diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 52c46ba0381..fa1c499df30 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -11412,27 +11412,28 @@ packages: dev: false file:projects/arm-netapp.tgz: - resolution: {integrity: sha512-ovCe7gK7PTpM+0vh0odxrCi8yCeEAS3DHjkyeG9VryTXs3PlWdAjdxCR1L+Je0veUslcb2DIxv4B6dekCPCFvg==, tarball: file:projects/arm-netapp.tgz} + resolution: {integrity: sha512-BxqmyPJTZGmcXiuya10kSyUifo4nWfNo6MiuleBAIEzMHzb4/9hXmv7h/n4y8AAE7lRRGDWrYGJaIBZyjb2gyw==, tarball: file:projects/arm-netapp.tgz} name: '@rush-temp/arm-netapp' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 - '@rollup/plugin-json': 4.1.0_rollup@1.32.1 - '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 - '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 + '@rollup/plugin-json': 4.1.0_rollup@2.67.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.67.1 + '@rollup/plugin-node-resolve': 13.1.3_rollup@2.67.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 1.32.1 - rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + rollup: 2.67.1 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.67.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.1 transitivePeerDependencies: + - '@types/node' - debug - encoding - supports-color diff --git a/sdk/netapp/arm-netapp/CHANGELOG.md b/sdk/netapp/arm-netapp/CHANGELOG.md index 30281727f44..74c43f78040 100644 --- a/sdk/netapp/arm-netapp/CHANGELOG.md +++ b/sdk/netapp/arm-netapp/CHANGELOG.md @@ -1,5 +1,48 @@ # Release History +## 15.1.0 (2022-03-02) + +**Features** + + - Added operation group Subvolumes + - Added operation Snapshots.beginRestoreFiles + - Added operation Snapshots.beginRestoreFilesAndWait + - Added Interface LdapSearchScopeOpt + - Added Interface SnapshotRestoreFiles + - Added Interface SnapshotsRestoreFilesOptionalParams + - Added Interface SubvolumeModel + - Added Interface SubvolumePatchRequest + - Added Interface SubvolumesCreateOptionalParams + - Added Interface SubvolumesDeleteOptionalParams + - Added Interface SubvolumesGetMetadataOptionalParams + - Added Interface SubvolumesGetOptionalParams + - Added Interface SubvolumesList + - Added Interface SubvolumesListByVolumeNextOptionalParams + - Added Interface SubvolumesListByVolumeOptionalParams + - Added Interface SubvolumesUpdateOptionalParams + - Added Type Alias EnableSubvolumes + - Added Type Alias SubvolumeInfo + - Added Type Alias SubvolumesCreateResponse + - Added Type Alias SubvolumesGetMetadataResponse + - Added Type Alias SubvolumesGetResponse + - Added Type Alias SubvolumesListByVolumeNextResponse + - Added Type Alias SubvolumesListByVolumeResponse + - Added Type Alias SubvolumesUpdateResponse + - Interface ActiveDirectory has a new optional parameter ldapSearchScope + - Interface BackupPolicy has a new optional parameter systemData + - Interface CapacityPool has a new optional parameter systemData + - Interface SnapshotPolicy has a new optional parameter systemData + - Interface Volume has a new optional parameter enableSubvolumes + - Interface Volume has a new optional parameter maximumNumberOfFiles + - Interface Volume has a new optional parameter systemData + - Interface VolumeGroupVolumeProperties has a new optional parameter enableSubvolumes + - Interface VolumeGroupVolumeProperties has a new optional parameter maximumNumberOfFiles + - Interface VolumePatch has a new optional parameter unixPermissions + - Interface VolumesDeleteOptionalParams has a new optional parameter forceDelete + - Class NetAppManagementClient has a new parameter subvolumes + - Added Enum KnownEnableSubvolumes + + ## 15.0.0 (2022-01-20) The package of @azure/arm-netapp is using our next generation design principles since version 15.0.0, which contains breaking changes. diff --git a/sdk/netapp/arm-netapp/README.md b/sdk/netapp/arm-netapp/README.md index 2d9c2f1ee4e..7cd680ea18e 100644 --- a/sdk/netapp/arm-netapp/README.md +++ b/sdk/netapp/arm-netapp/README.md @@ -16,6 +16,8 @@ Microsoft NetApp Files Azure Resource Provider specification - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + ### Prerequisites - An [Azure subscription][azure_sub]. @@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { NetAppManagementClient } = require("@azure/arm-netapp"); const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new NetAppManagementClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new NetAppManagementClient(credential, subscriptionId); ``` diff --git a/sdk/netapp/arm-netapp/_meta.json b/sdk/netapp/arm-netapp/_meta.json index c7e717a2903..65edcc8c123 100644 --- a/sdk/netapp/arm-netapp/_meta.json +++ b/sdk/netapp/arm-netapp/_meta.json @@ -1,7 +1,7 @@ { - "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "commit": "4042a47cff72c950d35dd72149895b044ed79713", "readme": "specification/netapp/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/netapp/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\netapp\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.16 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" + "use": "@autorest/typescript@6.0.0-beta.16" } \ No newline at end of file diff --git a/sdk/netapp/arm-netapp/api-extractor.json b/sdk/netapp/arm-netapp/api-extractor.json index 0f53b33ec84..c14c2d9f00d 100644 --- a/sdk/netapp/arm-netapp/api-extractor.json +++ b/sdk/netapp/arm-netapp/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-netapp.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/netapp/arm-netapp/package.json b/sdk/netapp/arm-netapp/package.json index 67f849d48a1..24e5bcadb25 100644 --- a/sdk/netapp/arm-netapp/package.json +++ b/sdk/netapp/arm-netapp/package.json @@ -3,8 +3,10 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for NetAppManagementClient.", - "version": "15.0.0", - "engines": { "node": ">=12.0.0" }, + "version": "15.1.0", + "engines": { + "node": ">=12.0.0" + }, "dependencies": { "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", @@ -14,20 +16,26 @@ "@azure/core-rest-pipeline": "^1.1.0", "tslib": "^2.2.0" }, - "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], "license": "MIT", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", "types": "./types/arm-netapp.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", - "@rollup/plugin-commonjs": "11.0.2", - "@rollup/plugin-json": "^4.0.0", - "@rollup/plugin-multi-entry": "^3.0.0", - "@rollup/plugin-node-resolve": "^8.0.0", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^1.0.4", - "rollup": "^1.16.3", - "rollup-plugin-sourcemaps": "^0.4.2", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", @@ -41,7 +49,9 @@ "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, "files": [ "dist/**/*.js", "dist/**/*.js.map", @@ -90,8 +100,19 @@ "sideEffects": false, "//metadata": { "constantPaths": [ - { "path": "src/NetAppManagementClient.ts", "prefix": "packageDetails" } + { + "path": "src/netAppManagementClient.ts", + "prefix": "packageDetails" + } ] }, - "autoPublish": true + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-netapp?view=azure-node-preview" + } } diff --git a/sdk/netapp/arm-netapp/review/arm-netapp.api.md b/sdk/netapp/arm-netapp/review/arm-netapp.api.md index 70cb8f73718..c780220e666 100644 --- a/sdk/netapp/arm-netapp/review/arm-netapp.api.md +++ b/sdk/netapp/arm-netapp/review/arm-netapp.api.md @@ -128,6 +128,7 @@ export interface ActiveDirectory { encryptDCConnections?: boolean; kdcIP?: string; ldapOverTLS?: boolean; + ldapSearchScope?: LdapSearchScopeOpt; ldapSigning?: boolean; organizationalUnit?: string; password?: string; @@ -253,6 +254,7 @@ export interface BackupPolicy { monthlyBackupsToKeep?: number; readonly name?: string; readonly provisioningState?: string; + readonly systemData?: SystemData; tags?: { [propertyName: string]: string; }; @@ -405,6 +407,7 @@ export interface CapacityPool { qosType?: QosType; serviceLevel: ServiceLevel; size: number; + readonly systemData?: SystemData; tags?: { [propertyName: string]: string; }; @@ -476,6 +479,9 @@ export interface Dimension { name?: string; } +// @public +export type EnableSubvolumes = string; + // @public export type EncryptionType = string; @@ -588,6 +594,12 @@ export enum KnownCreatedByType { User = "User" } +// @public +export enum KnownEnableSubvolumes { + Disabled = "Disabled", + Enabled = "Enabled" +} + // @public export enum KnownEncryptionType { Double = "Double", @@ -679,6 +691,13 @@ export enum KnownVolumeStorageToNetworkProximity { T2 = "T2" } +// @public +export interface LdapSearchScopeOpt { + groupDN?: string; + groupMembershipFilter?: string; + userDN?: string; +} + // @public export interface LogSpecification { displayName?: string; @@ -809,6 +828,8 @@ export class NetAppManagementClient extends coreClient.ServiceClient { // (undocumented) subscriptionId: string; // (undocumented) + subvolumes: Subvolumes; + // (undocumented) vaults: Vaults; // (undocumented) volumeGroups: VolumeGroups; @@ -1137,6 +1158,7 @@ export interface SnapshotPolicy { monthlySchedule?: MonthlySchedule; readonly name?: string; readonly provisioningState?: string; + readonly systemData?: SystemData; tags?: { [propertyName: string]: string; }; @@ -1183,12 +1205,20 @@ export interface SnapshotPolicyVolumeList { value?: Volume[]; } +// @public +export interface SnapshotRestoreFiles { + destinationPath?: string; + filePaths: string[]; +} + // @public export interface Snapshots { beginCreate(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, snapshotName: string, body: Snapshot, options?: SnapshotsCreateOptionalParams): Promise, SnapshotsCreateResponse>>; beginCreateAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, snapshotName: string, body: Snapshot, options?: SnapshotsCreateOptionalParams): Promise; beginDelete(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, snapshotName: string, options?: SnapshotsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, snapshotName: string, options?: SnapshotsDeleteOptionalParams): Promise; + beginRestoreFiles(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, snapshotName: string, body: SnapshotRestoreFiles, options?: SnapshotsRestoreFilesOptionalParams): Promise, void>>; + beginRestoreFilesAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, snapshotName: string, body: SnapshotRestoreFiles, options?: SnapshotsRestoreFilesOptionalParams): Promise; beginUpdate(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, snapshotName: string, body: Record, options?: SnapshotsUpdateOptionalParams): Promise, SnapshotsUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, snapshotName: string, body: Record, options?: SnapshotsUpdateOptionalParams): Promise; get(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, snapshotName: string, options?: SnapshotsGetOptionalParams): Promise; @@ -1229,6 +1259,12 @@ export interface SnapshotsListOptionalParams extends coreClient.OperationOptions // @public export type SnapshotsListResponse = SnapshotsList; +// @public +export interface SnapshotsRestoreFilesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + // @public export interface SnapshotsUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -1250,6 +1286,112 @@ export interface SubscriptionQuotaItemList { value?: SubscriptionQuotaItem[]; } +// @public +export type SubvolumeInfo = ProxyResource & { + readonly systemData?: SystemData; + path?: string; + size?: number; + parentPath?: string; + readonly provisioningState?: string; +}; + +// @public +export interface SubvolumeModel { + accessedTimeStamp?: Date; + bytesUsed?: number; + changedTimeStamp?: Date; + creationTimeStamp?: Date; + readonly id?: string; + modifiedTimeStamp?: Date; + readonly name?: string; + parentPath?: string; + path?: string; + permissions?: string; + provisioningState?: string; + size?: number; + readonly type?: string; +} + +// @public +export interface SubvolumePatchRequest { + path?: string; + size?: number; +} + +// @public +export interface Subvolumes { + beginCreate(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, subvolumeName: string, body: SubvolumeInfo, options?: SubvolumesCreateOptionalParams): Promise, SubvolumesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, subvolumeName: string, body: SubvolumeInfo, options?: SubvolumesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, subvolumeName: string, options?: SubvolumesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, subvolumeName: string, options?: SubvolumesDeleteOptionalParams): Promise; + beginGetMetadata(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, subvolumeName: string, options?: SubvolumesGetMetadataOptionalParams): Promise, SubvolumesGetMetadataResponse>>; + beginGetMetadataAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, subvolumeName: string, options?: SubvolumesGetMetadataOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, subvolumeName: string, body: SubvolumePatchRequest, options?: SubvolumesUpdateOptionalParams): Promise, SubvolumesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, subvolumeName: string, body: SubvolumePatchRequest, options?: SubvolumesUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, subvolumeName: string, options?: SubvolumesGetOptionalParams): Promise; + listByVolume(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: SubvolumesListByVolumeOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SubvolumesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SubvolumesCreateResponse = SubvolumeInfo; + +// @public +export interface SubvolumesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SubvolumesGetMetadataOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SubvolumesGetMetadataResponse = SubvolumeModel; + +// @public +export interface SubvolumesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubvolumesGetResponse = SubvolumeInfo; + +// @public +export interface SubvolumesList { + nextLink?: string; + value?: SubvolumeInfo[]; +} + +// @public +export interface SubvolumesListByVolumeNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubvolumesListByVolumeNextResponse = SubvolumesList; + +// @public +export interface SubvolumesListByVolumeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubvolumesListByVolumeResponse = SubvolumesList; + +// @public +export interface SubvolumesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SubvolumesUpdateResponse = SubvolumeInfo; + // @public export interface SystemData { createdAt?: Date; @@ -1299,6 +1441,7 @@ export interface Volume { dataProtection?: VolumePropertiesDataProtection; defaultGroupQuotaInKiBs?: number; defaultUserQuotaInKiBs?: number; + enableSubvolumes?: EnableSubvolumes; encryptionKeySource?: string; readonly etag?: string; exportPolicy?: VolumePropertiesExportPolicy; @@ -1309,6 +1452,7 @@ export interface Volume { kerberosEnabled?: boolean; ldapEnabled?: boolean; location: string; + readonly maximumNumberOfFiles?: number; readonly mountTargets?: MountTargetProperties[]; readonly name?: string; networkFeatures?: NetworkFeatures; @@ -1325,6 +1469,7 @@ export interface Volume { snapshotId?: string; readonly storageToNetworkProximity?: VolumeStorageToNetworkProximity; subnetId: string; + readonly systemData?: SystemData; readonly t2Network?: string; tags?: { [propertyName: string]: string; @@ -1447,6 +1592,7 @@ export interface VolumeGroupVolumeProperties { dataProtection?: VolumePropertiesDataProtection; defaultGroupQuotaInKiBs?: number; defaultUserQuotaInKiBs?: number; + enableSubvolumes?: EnableSubvolumes; encryptionKeySource?: string; exportPolicy?: VolumePropertiesExportPolicy; readonly fileSystemId?: string; @@ -1455,6 +1601,7 @@ export interface VolumeGroupVolumeProperties { isRestoring?: boolean; kerberosEnabled?: boolean; ldapEnabled?: boolean; + readonly maximumNumberOfFiles?: number; readonly mountTargets?: MountTargetProperties[]; name?: string; networkFeatures?: NetworkFeatures; @@ -1506,6 +1653,7 @@ export interface VolumePatch { }; throughputMibps?: number; readonly type?: string; + unixPermissions?: string; usageThreshold?: number; } @@ -1588,6 +1736,7 @@ export type VolumesCreateOrUpdateResponse = Volume; // @public export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { + forceDelete?: boolean; resumeFrom?: string; updateIntervalInMs?: number; } diff --git a/sdk/netapp/arm-netapp/rollup.config.js b/sdk/netapp/arm-netapp/rollup.config.js index 9be1955eb7f..3f89d7309da 100644 --- a/sdk/netapp/arm-netapp/rollup.config.js +++ b/sdk/netapp/arm-netapp/rollup.config.js @@ -14,62 +14,14 @@ import json from "@rollup/plugin-json"; import nodeBuiltins from "builtin-modules"; -/** - * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. - * - * NOTE: this manual configuration is only needed because OpenTelemetry uses an - * __exportStar downleveled helper function to declare its exports which confuses - * rollup's automatic discovery mechanism. - * - * @returns an object reference that can be `...`'d into your cjs() configuration. - */ -export function openTelemetryCommonJs() { - const namedExports = {}; - - for (const key of [ - "@opentelemetry/api", - "@azure/core-tracing/node_modules/@opentelemetry/api" - ]) { - namedExports[key] = [ - "SpanKind", - "TraceFlags", - "getSpan", - "setSpan", - "SpanStatusCode", - "getSpanContext", - "setSpanContext" - ]; - } - - const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; - - for (const version of releasedOpenTelemetryVersions) { - namedExports[ - // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. - `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` - ] = [ - "SpanKind", - "TraceFlags", - "getSpan", - "setSpan", - "StatusCode", - "CanonicalCode", - "getSpanContext", - "setSpanContext" - ]; - } - - return namedExports; -} - // #region Warning Handler /** - * A function that can determine whether a rollupwarning should be ignored. If + * A function that can determine whether a rollup warning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEvalWarnings(warning) { +function ignoreNiseSinonEval(warning) { return ( warning.code === "EVAL" && warning.id && @@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) { ); } -function ignoreChaiCircularDependencyWarnings(warning) { +function ignoreChaiCircularDependency(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ - ignoreChaiCircularDependencyWarnings, - ignoreNiseSinonEvalWarnings -]; +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; /** * Construct a warning handler for the shared rollup configuration @@ -122,22 +71,7 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs({ - namedExports: { - // Chai's strange internal architecture makes it impossible to statically - // analyze its exports. - chai: [ - "version", - "use", - "util", - "config", - "expect", - "should", - "assert" - ], - ...openTelemetryCommonJs() - } - }), + cjs(), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -173,7 +107,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve(), cjs()] + plugins: [sourcemaps(), nodeResolve()] }; const config = [baseConfig]; diff --git a/sdk/netapp/arm-netapp/sample.env b/sdk/netapp/arm-netapp/sample.env new file mode 100644 index 00000000000..672847a3fea --- /dev/null +++ b/sdk/netapp/arm-netapp/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/netapp/arm-netapp/samples-dev/accountBackupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountBackupsDeleteSample.ts new file mode 100644 index 00000000000..ade0915bfa8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountBackupsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified Backup for a Netapp Account + * + * @summary Delete the specified Backup for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Delete.json + */ +async function accountBackupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const backupName = "backupName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accountBackups.beginDeleteAndWait( + resourceGroupName, + accountName, + backupName + ); + console.log(result); +} + +accountBackupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountBackupsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountBackupsGetSample.ts new file mode 100644 index 00000000000..cb04ebc9536 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountBackupsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified backup for a Netapp Account + * + * @summary Gets the specified backup for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Get.json + */ +async function accountBackupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accountBackups.get( + resourceGroupName, + accountName, + backupName + ); + console.log(result); +} + +accountBackupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountBackupsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountBackupsListSample.ts new file mode 100644 index 00000000000..0de933b21a4 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountBackupsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all Backups for a Netapp Account + * + * @summary List all Backups for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_List.json + */ +async function accountBackupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accountBackups.list( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +accountBackupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..492fd13f8fd --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountsCreateOrUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppAccount, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the specified NetApp account within the resource group + * + * @summary Create or update the specified NetApp account within the resource group + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_CreateOrUpdate.json + */ +async function accountsCreateOrUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const body: NetAppAccount = { + activeDirectories: [ + { + aesEncryption: true, + dns: "10.10.10.3, 10.10.10.4", + domain: "10.10.10.3", + ldapOverTLS: false, + ldapSigning: false, + organizationalUnit: "OU=Engineering", + password: "ad_password", + site: "SiteName", + smbServerName: "SMBServer", + username: "ad_user_name" + } + ], + location: "eastus" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + body + ); + console.log(result); +} + +accountsCreateOrUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsDeleteSample.ts new file mode 100644 index 00000000000..bc02d40cc0c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified NetApp account + * + * @summary Delete the specified NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Delete.json + */ +async function accountsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginDeleteAndWait( + resourceGroupName, + accountName + ); + console.log(result); +} + +accountsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsGetSample.ts new file mode 100644 index 00000000000..ab510a28413 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountsGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the NetApp account + * + * @summary Get the NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Get.json + */ +async function accountsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.get(resourceGroupName, accountName); + console.log(result); +} + +accountsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsListBySubscriptionSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsListBySubscriptionSample.ts new file mode 100644 index 00000000000..9cd32a60f51 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountsListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List and describe all NetApp accounts in the subscription. + * + * @summary List and describe all NetApp accounts in the subscription. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accounts.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +accountsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsListSample.ts new file mode 100644 index 00000000000..df45422c6a2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountsListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List and describe all NetApp accounts in the resource group. + * + * @summary List and describe all NetApp accounts in the resource group. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accounts.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +accountsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsUpdateSample.ts new file mode 100644 index 00000000000..69cd421a38e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountsUpdateSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppAccountPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch the specified NetApp account + * + * @summary Patch the specified NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Update.json + */ +async function accountsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const body: NetAppAccountPatch = { tags: { tag1: "Value1" } }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginUpdateAndWait( + resourceGroupName, + accountName, + body + ); + console.log(result); +} + +accountsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesCreateSample.ts new file mode 100644 index 00000000000..deb09e8463f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesCreateSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BackupPolicy, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a backup policy for Netapp Account + * + * @summary Create a backup policy for Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Create.json + */ +async function backupPoliciesCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupPolicyName = "backupPolicyName"; + const body: BackupPolicy = { + dailyBackupsToKeep: 10, + enabled: true, + location: "westus", + monthlyBackupsToKeep: 10, + weeklyBackupsToKeep: 10 + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginCreateAndWait( + resourceGroupName, + accountName, + backupPolicyName, + body + ); + console.log(result); +} + +backupPoliciesCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesDeleteSample.ts new file mode 100644 index 00000000000..cecd6d5b36f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete backup policy + * + * @summary Delete backup policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Delete.json + */ +async function backupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const backupPolicyName = "backupPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginDeleteAndWait( + resourceGroupName, + accountName, + backupPolicyName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesGetSample.ts new file mode 100644 index 00000000000..74f4a375c8b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a particular backup Policy + * + * @summary Get a particular backup Policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Get.json + */ +async function backupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupPolicyName = "backupPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.get( + resourceGroupName, + accountName, + backupPolicyName + ); + console.log(result); +} + +backupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesListSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesListSample.ts new file mode 100644 index 00000000000..bf403875a9d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List backup policies for Netapp Account + * + * @summary List backup policies for Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_List.json + */ +async function backupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupPolicies.list( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesUpdateSample.ts new file mode 100644 index 00000000000..8d4751df899 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BackupPolicyPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a backup policy for Netapp Account + * + * @summary Patch a backup policy for Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Update.json + */ +async function backupPoliciesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupPolicyName = "backupPolicyName"; + const body: BackupPolicyPatch = { + dailyBackupsToKeep: 5, + enabled: false, + location: "westus", + monthlyBackupsToKeep: 10, + weeklyBackupsToKeep: 10 + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginUpdateAndWait( + resourceGroupName, + accountName, + backupPolicyName, + body + ); + console.log(result); +} + +backupPoliciesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsCreateSample.ts new file mode 100644 index 00000000000..6d7c76952e6 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsCreateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Backup, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a backup for the volume + * + * @summary Create a backup for the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Create.json + */ +async function backupsCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const backupName = "backup1"; + const body: Backup = { label: "myLabel", location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + body + ); + console.log(result); +} + +backupsCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsDeleteSample.ts new file mode 100644 index 00000000000..180bec36f3e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a backup of the volume + * + * @summary Delete a backup of the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Delete.json + */ +async function backupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const poolName = "poolName"; + const volumeName = "volumeName"; + const backupName = "backupName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsGetSample.ts new file mode 100644 index 00000000000..350f1317f17 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified backup of the volume + * + * @summary Gets the specified backup of the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Get.json + */ +async function backupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.get( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName + ); + console.log(result); +} + +backupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsGetStatusSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsGetStatusSample.ts new file mode 100644 index 00000000000..5818f123a4d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsGetStatusSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the status of the backup for a volume + * + * @summary Get the status of the backup for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BackupStatus.json + */ +async function volumesBackupStatus() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.getStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesBackupStatus().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsGetVolumeRestoreStatusSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsGetVolumeRestoreStatusSample.ts new file mode 100644 index 00000000000..80061ed240a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsGetVolumeRestoreStatusSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the status of the restore for a volume + * + * @summary Get the status of the restore for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_RestoreStatus.json + */ +async function volumesRestoreStatus() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.getVolumeRestoreStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesRestoreStatus().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsListSample.ts new file mode 100644 index 00000000000..a77feb3050f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsListSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all backups for a volume + * + * @summary List all backups for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_List.json + */ +async function backupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.list( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsUpdateSample.ts new file mode 100644 index 00000000000..ac0200b1f8e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsUpdateSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BackupPatch, + BackupsUpdateOptionalParams, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a backup for the volume + * + * @summary Patch a backup for the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Update.json + */ +async function backupsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const backupName = "backup1"; + const body: BackupPatch = {}; + const options: BackupsUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + options + ); + console.log(result); +} + +backupsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckFilePathAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckFilePathAvailabilitySample.ts new file mode 100644 index 00000000000..cebbf675958 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckFilePathAvailabilitySample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if a file path is available. + * + * @summary Check if a file path is available. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckFilePathAvailability.json + */ +async function checkFilePathAvailability() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "my-exact-filepth"; + const subnetId = + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.checkFilePathAvailability( + location, + name, + subnetId + ); + console.log(result); +} + +checkFilePathAvailability().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckNameAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckNameAvailabilitySample.ts new file mode 100644 index 00000000000..299577eb582 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckNameAvailabilitySample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if a resource name is available. + * + * @summary Check if a resource name is available. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckNameAvailability.json + */ +async function checkNameAvailability() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "accName"; + const typeParam = "netAppAccount"; + const resourceGroup = "myRG"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.checkNameAvailability( + location, + name, + typeParam, + resourceGroup + ); + console.log(result); +} + +checkNameAvailability().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckQuotaAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckQuotaAvailabilitySample.ts new file mode 100644 index 00000000000..c8f7fe20739 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckQuotaAvailabilitySample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if a quota is available. + * + * @summary Check if a quota is available. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckQuotaAvailability.json + */ +async function checkQuotaAvailability() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "resource1"; + const typeParam = "Microsoft.NetApp/netAppAccounts"; + const resourceGroup = "myRG"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.checkQuotaAvailability( + location, + name, + typeParam, + resourceGroup + ); + console.log(result); +} + +checkQuotaAvailability().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsGetSample.ts new file mode 100644 index 00000000000..aa314b0a533 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the default and current subscription quota limit + * + * @summary Get the default and current subscription quota limit + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_Get.json + */ +async function quotaLimits() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const quotaLimitName = "totalCoolAccessVolumesPerSubscription"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResourceQuotaLimits.get( + location, + quotaLimitName + ); + console.log(result); +} + +quotaLimits().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsListSample.ts new file mode 100644 index 00000000000..3701ad55d48 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the default and current limits for quotas + * + * @summary Get the default and current limits for quotas + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_List.json + */ +async function quotaLimits() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.netAppResourceQuotaLimits.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +quotaLimits().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/operationsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/operationsListSample.ts new file mode 100644 index 00000000000..5d613c9da70 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/operationsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available Microsoft.NetApp Rest API operations + * + * @summary Lists all of the available Microsoft.NetApp Rest API operations + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/OperationList.json + */ +async function operationList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..1e23d676d66 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/poolsCreateOrUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CapacityPool, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or Update a capacity pool + * + * @summary Create or Update a capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_CreateOrUpdate.json + */ +async function poolsCreateOrUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const body: CapacityPool = { + location: "eastus", + qosType: "Auto", + serviceLevel: "Premium", + size: 4398046511104 + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + poolName, + body + ); + console.log(result); +} + +poolsCreateOrUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsDeleteSample.ts new file mode 100644 index 00000000000..37da793c595 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/poolsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified capacity pool + * + * @summary Delete the specified capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Delete.json + */ +async function poolsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName + ); + console.log(result); +} + +poolsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsGetSample.ts new file mode 100644 index 00000000000..84b81f4126f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/poolsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get details of the specified capacity pool + * + * @summary Get details of the specified capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Get.json + */ +async function poolsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.get( + resourceGroupName, + accountName, + poolName + ); + console.log(result); +} + +poolsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsListSample.ts new file mode 100644 index 00000000000..b2af48052db --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/poolsListSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all capacity pools in the NetApp Account + * + * @summary List all capacity pools in the NetApp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_List.json + */ +async function poolsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.pools.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +poolsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsUpdateSample.ts new file mode 100644 index 00000000000..bc13e727314 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/poolsUpdateSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CapacityPoolPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch the specified capacity pool + * + * @summary Patch the specified capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Update.json + */ +async function poolsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const body: CapacityPoolPatch = {}; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + body + ); + console.log(result); +} + +poolsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesCreateSample.ts new file mode 100644 index 00000000000..4187767835c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesCreateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SnapshotPolicy, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a snapshot policy + * + * @summary Create a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Create.json + */ +async function snapshotPoliciesCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const body: SnapshotPolicy = { + dailySchedule: { hour: 14, minute: 30, snapshotsToKeep: 4 }, + enabled: true, + hourlySchedule: { minute: 50, snapshotsToKeep: 2 }, + location: "eastus", + monthlySchedule: { + daysOfMonth: "10,11,12", + hour: 14, + minute: 15, + snapshotsToKeep: 5 + }, + weeklySchedule: { + day: "Wednesday", + hour: 14, + minute: 45, + snapshotsToKeep: 3 + } + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.create( + resourceGroupName, + accountName, + snapshotPolicyName, + body + ); + console.log(result); +} + +snapshotPoliciesCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesDeleteSample.ts new file mode 100644 index 00000000000..dc736d9164c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete snapshot policy + * + * @summary Delete snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Delete.json + */ +async function snapshotPoliciesDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const snapshotPolicyName = "snapshotPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.beginDeleteAndWait( + resourceGroupName, + accountName, + snapshotPolicyName + ); + console.log(result); +} + +snapshotPoliciesDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesGetSample.ts new file mode 100644 index 00000000000..2f26aea8d5b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a snapshot Policy + * + * @summary Get a snapshot Policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Get.json + */ +async function snapshotPoliciesGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.get( + resourceGroupName, + accountName, + snapshotPolicyName + ); + console.log(result); +} + +snapshotPoliciesGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListSample.ts new file mode 100644 index 00000000000..52de5d38f4c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List snapshot policy + * + * @summary List snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_List.json + */ +async function snapshotPoliciesList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshotPolicies.list( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +snapshotPoliciesList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListVolumesSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListVolumesSample.ts new file mode 100644 index 00000000000..11338d33ad1 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListVolumesSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get volumes associated with snapshot policy + * + * @summary Get volumes associated with snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_ListVolumes.json + */ +async function snapshotPoliciesListVolumes() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.listVolumes( + resourceGroupName, + accountName, + snapshotPolicyName + ); + console.log(result); +} + +snapshotPoliciesListVolumes().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesUpdateSample.ts new file mode 100644 index 00000000000..d6a769ffeea --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesUpdateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SnapshotPolicyPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a snapshot policy + * + * @summary Patch a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Update.json + */ +async function snapshotPoliciesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const body: SnapshotPolicyPatch = { + dailySchedule: { hour: 14, minute: 30, snapshotsToKeep: 4 }, + enabled: true, + hourlySchedule: { minute: 50, snapshotsToKeep: 2 }, + location: "eastus", + monthlySchedule: { + daysOfMonth: "10,11,12", + hour: 14, + minute: 15, + snapshotsToKeep: 5 + }, + weeklySchedule: { + day: "Wednesday", + hour: 14, + minute: 45, + snapshotsToKeep: 3 + } + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.beginUpdateAndWait( + resourceGroupName, + accountName, + snapshotPolicyName, + body + ); + console.log(result); +} + +snapshotPoliciesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsCreateSample.ts new file mode 100644 index 00000000000..ca56d39a96f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsCreateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Snapshot, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the specified snapshot within the given volume + * + * @summary Create the specified snapshot within the given volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Create.json + */ +async function snapshotsCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const body: Snapshot = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body + ); + console.log(result); +} + +snapshotsCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsDeleteSample.ts new file mode 100644 index 00000000000..c97ab7e34da --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete snapshot + * + * @summary Delete snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Delete.json + */ +async function snapshotsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName + ); + console.log(result); +} + +snapshotsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsGetSample.ts new file mode 100644 index 00000000000..7e26fb921de --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get details of the specified snapshot + * + * @summary Get details of the specified snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Get.json + */ +async function snapshotsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.get( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName + ); + console.log(result); +} + +snapshotsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsListSample.ts new file mode 100644 index 00000000000..5b010d589fa --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsListSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all snapshots associated with the volume + * + * @summary List all snapshots associated with the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_List.json + */ +async function snapshotsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +snapshotsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsRestoreFilesSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsRestoreFilesSample.ts new file mode 100644 index 00000000000..222bb538ee8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsRestoreFilesSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SnapshotRestoreFiles, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restore the specified files from the specified snapshot to the active filesystem + * + * @summary Restore the specified files from the specified snapshot to the active filesystem + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_SingleFileRestore.json + */ +async function snapshotsSingleFileRestore() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const body: SnapshotRestoreFiles = { + filePaths: ["/dir1/customer1.db", "/dir1/customer2.db"] + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginRestoreFilesAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body + ); + console.log(result); +} + +snapshotsSingleFileRestore().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsUpdateSample.ts new file mode 100644 index 00000000000..0cb13a13356 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsUpdateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a snapshot + * + * @summary Patch a snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Update.json + */ +async function snapshotsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const body: Record = {}; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body + ); + console.log(result); +} + +snapshotsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesCreateSample.ts new file mode 100644 index 00000000000..66df11da065 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesCreateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SubvolumeInfo, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * + * @summary Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Create.json + */ +async function subvolumesCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const body: SubvolumeInfo = { path: "/subvolumePath" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body + ); + console.log(result); +} + +subvolumesCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesDeleteSample.ts new file mode 100644 index 00000000000..25d8d2dc001 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete subvolume + * + * @summary Delete subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Delete.json + */ +async function subvolumesDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName + ); + console.log(result); +} + +subvolumesDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesGetMetadataSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesGetMetadataSample.ts new file mode 100644 index 00000000000..78176f2c836 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesGetMetadataSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get details of the specified subvolume + * + * @summary Get details of the specified subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Metadata.json + */ +async function subvolumesMetadata() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginGetMetadataAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName + ); + console.log(result); +} + +subvolumesMetadata().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesGetSample.ts new file mode 100644 index 00000000000..2ea509b6517 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns the path associated with the subvolumeName provided + * + * @summary Returns the path associated with the subvolumeName provided + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Get.json + */ +async function subvolumesGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.get( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName + ); + console.log(result); +} + +subvolumesGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesListByVolumeSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesListByVolumeSample.ts new file mode 100644 index 00000000000..c40453530b3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesListByVolumeSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns a list of the subvolumes in the volume + * + * @summary Returns a list of the subvolumes in the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_List.json + */ +async function subvolumesList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.subvolumes.listByVolume( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +subvolumesList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesUpdateSample.ts new file mode 100644 index 00000000000..07fb4a87a71 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SubvolumePatchRequest, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a subvolume + * + * @summary Patch a subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Update.json + */ +async function subvolumesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const body: SubvolumePatchRequest = { path: "/subvolumePath" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body + ); + console.log(result); +} + +subvolumesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/vaultsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/vaultsListSample.ts new file mode 100644 index 00000000000..ec9c8fa0ac6 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/vaultsListSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List vaults for a Netapp Account + * + * @summary List vaults for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Vaults_List.json + */ +async function vaultsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.vaults.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +vaultsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsCreateSample.ts new file mode 100644 index 00000000000..aa57f4dfcb1 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsCreateSample.ts @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VolumeGroupDetails, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a volume group along with specified volumes + * + * @summary Create a volume group along with specified volumes + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Create.json + */ +async function volumeGroupsCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const body: VolumeGroupDetails = { + groupMetaData: { + applicationIdentifier: "DEV", + applicationType: "SAP-HANA", + deploymentSpecId: "fb04dbeb-005d-2703-197e-6208dfadb5d9", + groupDescription: "Volume group" + }, + location: "westus", + volumes: [ + { + name: "testVol1", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "testVol1", + proximityPlacementGroup: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "data" + }, + { + name: "testVol2", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "testVol2", + proximityPlacementGroup: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "log" + }, + { + name: "testVol3", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "testVol3", + proximityPlacementGroup: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "shared" + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + accountName, + volumeGroupName, + body + ); + console.log(result); +} + +volumeGroupsCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsDeleteSample.ts new file mode 100644 index 00000000000..89f7318e401 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified volume group only if there are no volumes under volume group. + * + * @summary Delete the specified volume group only if there are no volumes under volume group. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Delete.json + */ +async function volumeGroupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginDeleteAndWait( + resourceGroupName, + accountName, + volumeGroupName + ); + console.log(result); +} + +volumeGroupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsGetSample.ts new file mode 100644 index 00000000000..c7688d0c89f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get details of the specified volume group + * + * @summary Get details of the specified volume group + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Get.json + */ +async function volumeGroupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.get( + resourceGroupName, + accountName, + volumeGroupName + ); + console.log(result); +} + +volumeGroupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsListByNetAppAccountSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsListByNetAppAccountSample.ts new file mode 100644 index 00000000000..3233cabf077 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsListByNetAppAccountSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all volume groups for given account + * + * @summary List all volume groups for given account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_List.json + */ +async function volumeGroupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumeGroups.listByNetAppAccount( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeGroupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesAuthorizeReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesAuthorizeReplicationSample.ts new file mode 100644 index 00000000000..305c92f296d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesAuthorizeReplicationSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizeRequest, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Authorize the replication connection on the source volume + * + * @summary Authorize the replication connection on the source volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_AuthorizeReplication.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: AuthorizeRequest = { + remoteVolumeResourceId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRemoteRG/providers/Microsoft.NetApp/netAppAccounts/remoteAccount1/capacityPools/remotePool1/volumes/remoteVolume1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginAuthorizeReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesAuthorizeReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesBreakReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesBreakReplicationSample.ts new file mode 100644 index 00000000000..2780e2abd42 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesBreakReplicationSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BreakReplicationRequest, + VolumesBreakReplicationOptionalParams, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Break the replication connection on the destination volume + * + * @summary Break the replication connection on the destination volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BreakReplication.json + */ +async function volumesBreakReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: BreakReplicationRequest = { forceBreakReplication: false }; + const options: VolumesBreakReplicationOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginBreakReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + options + ); + console.log(result); +} + +volumesBreakReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesCreateOrUpdateSample.ts new file mode 100644 index 00000000000..4d817bdd1c2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Volume, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the specified volume within the capacity pool + * + * @summary Create or update the specified volume within the capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_CreateOrUpdate.json + */ +async function volumesCreateOrUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: Volume = { + creationToken: "my-unique-file-path", + encryptionKeySource: "Microsoft.KeyVault", + location: "eastus", + serviceLevel: "Premium", + subnetId: + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 128, + usageThreshold: 107374182400 + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesCreateOrUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesDeleteReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesDeleteReplicationSample.ts new file mode 100644 index 00000000000..b39f7541e4c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesDeleteReplicationSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the replication connection on the destination volume, and send release to the source replication + * + * @summary Delete the replication connection on the destination volume, and send release to the source replication + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_DeleteReplication.json + */ +async function volumesDeleteReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginDeleteReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesDeleteReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesDeleteSample.ts new file mode 100644 index 00000000000..37603993b87 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified volume + * + * @summary Delete the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Delete.json + */ +async function volumesDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesGetSample.ts new file mode 100644 index 00000000000..124f95d9a69 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the details of the specified volume + * + * @summary Get the details of the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Get.json + */ +async function volumesGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.get( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesListSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesListSample.ts new file mode 100644 index 00000000000..be1aaef2568 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all volumes within the capacity pool + * + * @summary List all volumes within the capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_List.json + */ +async function volumesList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.list( + resourceGroupName, + accountName, + poolName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesPoolChangeSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesPoolChangeSample.ts new file mode 100644 index 00000000000..1c1e2f8d2b9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesPoolChangeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PoolChangeRequest, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Moves volume to another pool + * + * @summary Moves volume to another pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_PoolChange.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: PoolChangeRequest = { + newPoolResourceId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginPoolChangeAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesAuthorizeReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesReInitializeReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesReInitializeReplicationSample.ts new file mode 100644 index 00000000000..10c6b937f9c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesReInitializeReplicationSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Re-Initializes the replication connection on the destination volume + * + * @summary Re-Initializes the replication connection on the destination volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReInitializeReplication.json + */ +async function volumesReInitializeReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginReInitializeReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesReInitializeReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesReplicationStatusSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesReplicationStatusSample.ts new file mode 100644 index 00000000000..0ce3629fedb --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesReplicationStatusSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the status of the replication + * + * @summary Get the status of the replication + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReplicationStatus.json + */ +async function volumesReplicationStatus() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.replicationStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesReplicationStatus().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesResyncReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesResyncReplicationSample.ts new file mode 100644 index 00000000000..28d336c6006 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesResyncReplicationSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @summary Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ResyncReplication.json + */ +async function volumesResyncReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginResyncReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesResyncReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesRevertSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesRevertSample.ts new file mode 100644 index 00000000000..e9db73e561e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesRevertSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VolumeRevert, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Revert a volume to the snapshot specified in the body + * + * @summary Revert a volume to the snapshot specified in the body + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Revert.json + */ +async function volumesRevert() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: VolumeRevert = { + snapshotId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginRevertAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesRevert().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesUpdateSample.ts new file mode 100644 index 00000000000..43631a23ad3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesUpdateSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VolumePatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch the specified volume + * + * @summary Patch the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Update.json + */ +async function volumesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: VolumePatch = {}; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/README.md b/sdk/netapp/arm-netapp/samples/v15/javascript/README.md new file mode 100644 index 00000000000..658abf1ac0b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/README.md @@ -0,0 +1,184 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accountBackupsDeleteSample.js][accountbackupsdeletesample] | Delete the specified Backup for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Delete.json | +| [accountBackupsGetSample.js][accountbackupsgetsample] | Gets the specified backup for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Get.json | +| [accountBackupsListSample.js][accountbackupslistsample] | List all Backups for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_List.json | +| [accountsCreateOrUpdateSample.js][accountscreateorupdatesample] | Create or update the specified NetApp account within the resource group x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_CreateOrUpdate.json | +| [accountsDeleteSample.js][accountsdeletesample] | Delete the specified NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Delete.json | +| [accountsGetSample.js][accountsgetsample] | Get the NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Get.json | +| [accountsListBySubscriptionSample.js][accountslistbysubscriptionsample] | List and describe all NetApp accounts in the subscription. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json | +| [accountsListSample.js][accountslistsample] | List and describe all NetApp accounts in the resource group. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json | +| [accountsUpdateSample.js][accountsupdatesample] | Patch the specified NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Update.json | +| [backupPoliciesCreateSample.js][backuppoliciescreatesample] | Create a backup policy for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Create.json | +| [backupPoliciesDeleteSample.js][backuppoliciesdeletesample] | Delete backup policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Delete.json | +| [backupPoliciesGetSample.js][backuppoliciesgetsample] | Get a particular backup Policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Get.json | +| [backupPoliciesListSample.js][backuppolicieslistsample] | List backup policies for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_List.json | +| [backupPoliciesUpdateSample.js][backuppoliciesupdatesample] | Patch a backup policy for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Update.json | +| [backupsCreateSample.js][backupscreatesample] | Create a backup for the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Create.json | +| [backupsDeleteSample.js][backupsdeletesample] | Delete a backup of the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Delete.json | +| [backupsGetSample.js][backupsgetsample] | Gets the specified backup of the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Get.json | +| [backupsGetStatusSample.js][backupsgetstatussample] | Get the status of the backup for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BackupStatus.json | +| [backupsGetVolumeRestoreStatusSample.js][backupsgetvolumerestorestatussample] | Get the status of the restore for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_RestoreStatus.json | +| [backupsListSample.js][backupslistsample] | List all backups for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_List.json | +| [backupsUpdateSample.js][backupsupdatesample] | Patch a backup for the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Update.json | +| [netAppResourceCheckFilePathAvailabilitySample.js][netappresourcecheckfilepathavailabilitysample] | Check if a file path is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckFilePathAvailability.json | +| [netAppResourceCheckNameAvailabilitySample.js][netappresourcechecknameavailabilitysample] | Check if a resource name is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckNameAvailability.json | +| [netAppResourceCheckQuotaAvailabilitySample.js][netappresourcecheckquotaavailabilitysample] | Check if a quota is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckQuotaAvailability.json | +| [netAppResourceQuotaLimitsGetSample.js][netappresourcequotalimitsgetsample] | Get the default and current subscription quota limit x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_Get.json | +| [netAppResourceQuotaLimitsListSample.js][netappresourcequotalimitslistsample] | Get the default and current limits for quotas x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_List.json | +| [operationsListSample.js][operationslistsample] | Lists all of the available Microsoft.NetApp Rest API operations x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/OperationList.json | +| [poolsCreateOrUpdateSample.js][poolscreateorupdatesample] | Create or Update a capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_CreateOrUpdate.json | +| [poolsDeleteSample.js][poolsdeletesample] | Delete the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Delete.json | +| [poolsGetSample.js][poolsgetsample] | Get details of the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Get.json | +| [poolsListSample.js][poolslistsample] | List all capacity pools in the NetApp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_List.json | +| [poolsUpdateSample.js][poolsupdatesample] | Patch the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Update.json | +| [snapshotPoliciesCreateSample.js][snapshotpoliciescreatesample] | Create a snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Create.json | +| [snapshotPoliciesDeleteSample.js][snapshotpoliciesdeletesample] | Delete snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Delete.json | +| [snapshotPoliciesGetSample.js][snapshotpoliciesgetsample] | Get a snapshot Policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Get.json | +| [snapshotPoliciesListSample.js][snapshotpolicieslistsample] | List snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_List.json | +| [snapshotPoliciesListVolumesSample.js][snapshotpolicieslistvolumessample] | Get volumes associated with snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_ListVolumes.json | +| [snapshotPoliciesUpdateSample.js][snapshotpoliciesupdatesample] | Patch a snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Update.json | +| [snapshotsCreateSample.js][snapshotscreatesample] | Create the specified snapshot within the given volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Create.json | +| [snapshotsDeleteSample.js][snapshotsdeletesample] | Delete snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Delete.json | +| [snapshotsGetSample.js][snapshotsgetsample] | Get details of the specified snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Get.json | +| [snapshotsListSample.js][snapshotslistsample] | List all snapshots associated with the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_List.json | +| [snapshotsRestoreFilesSample.js][snapshotsrestorefilessample] | Restore the specified files from the specified snapshot to the active filesystem x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_SingleFileRestore.json | +| [snapshotsUpdateSample.js][snapshotsupdatesample] | Patch a snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Update.json | +| [subvolumesCreateSample.js][subvolumescreatesample] | Creates a subvolume in the path or clones the subvolume mentioned in the parentPath x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Create.json | +| [subvolumesDeleteSample.js][subvolumesdeletesample] | Delete subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Delete.json | +| [subvolumesGetMetadataSample.js][subvolumesgetmetadatasample] | Get details of the specified subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Metadata.json | +| [subvolumesGetSample.js][subvolumesgetsample] | Returns the path associated with the subvolumeName provided x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Get.json | +| [subvolumesListByVolumeSample.js][subvolumeslistbyvolumesample] | Returns a list of the subvolumes in the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_List.json | +| [subvolumesUpdateSample.js][subvolumesupdatesample] | Patch a subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Update.json | +| [vaultsListSample.js][vaultslistsample] | List vaults for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Vaults_List.json | +| [volumeGroupsCreateSample.js][volumegroupscreatesample] | Create a volume group along with specified volumes x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Create.json | +| [volumeGroupsDeleteSample.js][volumegroupsdeletesample] | Delete the specified volume group only if there are no volumes under volume group. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Delete.json | +| [volumeGroupsGetSample.js][volumegroupsgetsample] | Get details of the specified volume group x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Get.json | +| [volumeGroupsListByNetAppAccountSample.js][volumegroupslistbynetappaccountsample] | List all volume groups for given account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_List.json | +| [volumesAuthorizeReplicationSample.js][volumesauthorizereplicationsample] | Authorize the replication connection on the source volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_AuthorizeReplication.json | +| [volumesBreakReplicationSample.js][volumesbreakreplicationsample] | Break the replication connection on the destination volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BreakReplication.json | +| [volumesCreateOrUpdateSample.js][volumescreateorupdatesample] | Create or update the specified volume within the capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_CreateOrUpdate.json | +| [volumesDeleteReplicationSample.js][volumesdeletereplicationsample] | Delete the replication connection on the destination volume, and send release to the source replication x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_DeleteReplication.json | +| [volumesDeleteSample.js][volumesdeletesample] | Delete the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Delete.json | +| [volumesGetSample.js][volumesgetsample] | Get the details of the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Get.json | +| [volumesListSample.js][volumeslistsample] | List all volumes within the capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_List.json | +| [volumesPoolChangeSample.js][volumespoolchangesample] | Moves volume to another pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_PoolChange.json | +| [volumesReInitializeReplicationSample.js][volumesreinitializereplicationsample] | Re-Initializes the replication connection on the destination volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReInitializeReplication.json | +| [volumesReplicationStatusSample.js][volumesreplicationstatussample] | Get the status of the replication x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReplicationStatus.json | +| [volumesResyncReplicationSample.js][volumesresyncreplicationsample] | Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ResyncReplication.json | +| [volumesRevertSample.js][volumesrevertsample] | Revert a volume to the snapshot specified in the body x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Revert.json | +| [volumesUpdateSample.js][volumesupdatesample] | Patch the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Update.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node accountBackupsDeleteSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node accountBackupsDeleteSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accountbackupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsDeleteSample.js +[accountbackupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsGetSample.js +[accountbackupslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsListSample.js +[accountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/accountsCreateOrUpdateSample.js +[accountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/accountsDeleteSample.js +[accountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/accountsGetSample.js +[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/accountsListBySubscriptionSample.js +[accountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/accountsListSample.js +[accountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/accountsUpdateSample.js +[backuppoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesCreateSample.js +[backuppoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesDeleteSample.js +[backuppoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesGetSample.js +[backuppolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesListSample.js +[backuppoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesUpdateSample.js +[backupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupsCreateSample.js +[backupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupsDeleteSample.js +[backupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetSample.js +[backupsgetstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetStatusSample.js +[backupsgetvolumerestorestatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetVolumeRestoreStatusSample.js +[backupslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupsListSample.js +[backupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/backupsUpdateSample.js +[netappresourcecheckfilepathavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckFilePathAvailabilitySample.js +[netappresourcechecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckNameAvailabilitySample.js +[netappresourcecheckquotaavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckQuotaAvailabilitySample.js +[netappresourcequotalimitsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceQuotaLimitsGetSample.js +[netappresourcequotalimitslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceQuotaLimitsListSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/operationsListSample.js +[poolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/poolsCreateOrUpdateSample.js +[poolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/poolsDeleteSample.js +[poolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/poolsGetSample.js +[poolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/poolsListSample.js +[poolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/poolsUpdateSample.js +[snapshotpoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesCreateSample.js +[snapshotpoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesDeleteSample.js +[snapshotpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesGetSample.js +[snapshotpolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesListSample.js +[snapshotpolicieslistvolumessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesListVolumesSample.js +[snapshotpoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesUpdateSample.js +[snapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsCreateSample.js +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsDeleteSample.js +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsGetSample.js +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsListSample.js +[snapshotsrestorefilessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsRestoreFilesSample.js +[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsUpdateSample.js +[subvolumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesCreateSample.js +[subvolumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesDeleteSample.js +[subvolumesgetmetadatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesGetMetadataSample.js +[subvolumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesGetSample.js +[subvolumeslistbyvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesListByVolumeSample.js +[subvolumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesUpdateSample.js +[vaultslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/vaultsListSample.js +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsCreateSample.js +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsDeleteSample.js +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsGetSample.js +[volumegroupslistbynetappaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsListByNetAppAccountSample.js +[volumesauthorizereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesAuthorizeReplicationSample.js +[volumesbreakreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesBreakReplicationSample.js +[volumescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesCreateOrUpdateSample.js +[volumesdeletereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesDeleteReplicationSample.js +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesDeleteSample.js +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesGetSample.js +[volumeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesListSample.js +[volumespoolchangesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesPoolChangeSample.js +[volumesreinitializereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesReInitializeReplicationSample.js +[volumesreplicationstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesReplicationStatusSample.js +[volumesresyncreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesResyncReplicationSample.js +[volumesrevertsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesRevertSample.js +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/javascript/volumesUpdateSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-netapp?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/netapp/arm-netapp/README.md diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsDeleteSample.js new file mode 100644 index 00000000000..f1ecb9142c3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the specified Backup for a Netapp Account + * + * @summary Delete the specified Backup for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Delete.json + */ +async function accountBackupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const backupName = "backupName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accountBackups.beginDeleteAndWait( + resourceGroupName, + accountName, + backupName + ); + console.log(result); +} + +accountBackupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsGetSample.js new file mode 100644 index 00000000000..e880a2aab73 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified backup for a Netapp Account + * + * @summary Gets the specified backup for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Get.json + */ +async function accountBackupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accountBackups.get(resourceGroupName, accountName, backupName); + console.log(result); +} + +accountBackupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsListSample.js new file mode 100644 index 00000000000..b2f5dc5494a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/accountBackupsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all Backups for a Netapp Account + * + * @summary List all Backups for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_List.json + */ +async function accountBackupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accountBackups.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +accountBackupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/accountsCreateOrUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsCreateOrUpdateSample.js new file mode 100644 index 00000000000..a6660fab711 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsCreateOrUpdateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update the specified NetApp account within the resource group + * + * @summary Create or update the specified NetApp account within the resource group + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_CreateOrUpdate.json + */ +async function accountsCreateOrUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const body = { + activeDirectories: [ + { + aesEncryption: true, + dns: "10.10.10.3, 10.10.10.4", + domain: "10.10.10.3", + ldapOverTLS: false, + ldapSigning: false, + organizationalUnit: "OU=Engineering", + password: "ad_password", + site: "SiteName", + smbServerName: "SMBServer", + username: "ad_user_name", + }, + ], + location: "eastus", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + body + ); + console.log(result); +} + +accountsCreateOrUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/accountsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsDeleteSample.js new file mode 100644 index 00000000000..ba3127fd1da --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the specified NetApp account + * + * @summary Delete the specified NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Delete.json + */ +async function accountsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginDeleteAndWait(resourceGroupName, accountName); + console.log(result); +} + +accountsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/accountsGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsGetSample.js new file mode 100644 index 00000000000..cb53db8d511 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the NetApp account + * + * @summary Get the NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Get.json + */ +async function accountsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.get(resourceGroupName, accountName); + console.log(result); +} + +accountsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/accountsListBySubscriptionSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsListBySubscriptionSample.js new file mode 100644 index 00000000000..a0b1689ad1f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsListBySubscriptionSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List and describe all NetApp accounts in the subscription. + * + * @summary List and describe all NetApp accounts in the subscription. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accounts.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +accountsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/accountsListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsListSample.js new file mode 100644 index 00000000000..9ca05b75929 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List and describe all NetApp accounts in the resource group. + * + * @summary List and describe all NetApp accounts in the resource group. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accounts.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +accountsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/accountsUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsUpdateSample.js new file mode 100644 index 00000000000..e59243fb2f2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/accountsUpdateSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patch the specified NetApp account + * + * @summary Patch the specified NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Update.json + */ +async function accountsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const body = { tags: { tag1: "Value1" } }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginUpdateAndWait(resourceGroupName, accountName, body); + console.log(result); +} + +accountsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesCreateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesCreateSample.js new file mode 100644 index 00000000000..2af63078cff --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesCreateSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a backup policy for Netapp Account + * + * @summary Create a backup policy for Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Create.json + */ +async function backupPoliciesCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupPolicyName = "backupPolicyName"; + const body = { + dailyBackupsToKeep: 10, + enabled: true, + location: "westus", + monthlyBackupsToKeep: 10, + weeklyBackupsToKeep: 10, + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginCreateAndWait( + resourceGroupName, + accountName, + backupPolicyName, + body + ); + console.log(result); +} + +backupPoliciesCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesDeleteSample.js new file mode 100644 index 00000000000..c5b854541db --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete backup policy + * + * @summary Delete backup policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Delete.json + */ +async function backupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const backupPolicyName = "backupPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginDeleteAndWait( + resourceGroupName, + accountName, + backupPolicyName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesGetSample.js new file mode 100644 index 00000000000..47776198f23 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a particular backup Policy + * + * @summary Get a particular backup Policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Get.json + */ +async function backupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupPolicyName = "backupPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.get(resourceGroupName, accountName, backupPolicyName); + console.log(result); +} + +backupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesListSample.js new file mode 100644 index 00000000000..d72c71a1880 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List backup policies for Netapp Account + * + * @summary List backup policies for Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_List.json + */ +async function backupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupPolicies.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +backupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesUpdateSample.js new file mode 100644 index 00000000000..1d86e6af262 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupPoliciesUpdateSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patch a backup policy for Netapp Account + * + * @summary Patch a backup policy for Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Update.json + */ +async function backupPoliciesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupPolicyName = "backupPolicyName"; + const body = { + dailyBackupsToKeep: 5, + enabled: false, + location: "westus", + monthlyBackupsToKeep: 10, + weeklyBackupsToKeep: 10, + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginUpdateAndWait( + resourceGroupName, + accountName, + backupPolicyName, + body + ); + console.log(result); +} + +backupPoliciesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupsCreateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsCreateSample.js new file mode 100644 index 00000000000..f03397e036b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsCreateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a backup for the volume + * + * @summary Create a backup for the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Create.json + */ +async function backupsCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const backupName = "backup1"; + const body = { label: "myLabel", location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + body + ); + console.log(result); +} + +backupsCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsDeleteSample.js new file mode 100644 index 00000000000..96ee5e79b5e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsDeleteSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a backup of the volume + * + * @summary Delete a backup of the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Delete.json + */ +async function backupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const poolName = "poolName"; + const volumeName = "volumeName"; + const backupName = "backupName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetSample.js new file mode 100644 index 00000000000..b0380fa0fcd --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified backup of the volume + * + * @summary Gets the specified backup of the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Get.json + */ +async function backupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.get( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName + ); + console.log(result); +} + +backupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetStatusSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetStatusSample.js new file mode 100644 index 00000000000..d600805c242 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetStatusSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the status of the backup for a volume + * + * @summary Get the status of the backup for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BackupStatus.json + */ +async function volumesBackupStatus() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.getStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesBackupStatus().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetVolumeRestoreStatusSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetVolumeRestoreStatusSample.js new file mode 100644 index 00000000000..633237e230c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsGetVolumeRestoreStatusSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the status of the restore for a volume + * + * @summary Get the status of the restore for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_RestoreStatus.json + */ +async function volumesRestoreStatus() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.getVolumeRestoreStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesRestoreStatus().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupsListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsListSample.js new file mode 100644 index 00000000000..6b919707c04 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsListSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all backups for a volume + * + * @summary List all backups for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_List.json + */ +async function backupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.list( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/backupsUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsUpdateSample.js new file mode 100644 index 00000000000..4bc448a4b74 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/backupsUpdateSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patch a backup for the volume + * + * @summary Patch a backup for the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Update.json + */ +async function backupsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const backupName = "backup1"; + const body = {}; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + options + ); + console.log(result); +} + +backupsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckFilePathAvailabilitySample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckFilePathAvailabilitySample.js new file mode 100644 index 00000000000..6c5a64b77b3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckFilePathAvailabilitySample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check if a file path is available. + * + * @summary Check if a file path is available. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckFilePathAvailability.json + */ +async function checkFilePathAvailability() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "my-exact-filepth"; + const subnetId = + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.checkFilePathAvailability(location, name, subnetId); + console.log(result); +} + +checkFilePathAvailability().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckNameAvailabilitySample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckNameAvailabilitySample.js new file mode 100644 index 00000000000..30c16fbc71f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckNameAvailabilitySample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check if a resource name is available. + * + * @summary Check if a resource name is available. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckNameAvailability.json + */ +async function checkNameAvailability() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "accName"; + const typeParam = "netAppAccount"; + const resourceGroup = "myRG"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.checkNameAvailability( + location, + name, + typeParam, + resourceGroup + ); + console.log(result); +} + +checkNameAvailability().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckQuotaAvailabilitySample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckQuotaAvailabilitySample.js new file mode 100644 index 00000000000..2e1778bce01 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceCheckQuotaAvailabilitySample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check if a quota is available. + * + * @summary Check if a quota is available. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckQuotaAvailability.json + */ +async function checkQuotaAvailability() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "resource1"; + const typeParam = "Microsoft.NetApp/netAppAccounts"; + const resourceGroup = "myRG"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.checkQuotaAvailability( + location, + name, + typeParam, + resourceGroup + ); + console.log(result); +} + +checkQuotaAvailability().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceQuotaLimitsGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceQuotaLimitsGetSample.js new file mode 100644 index 00000000000..703d73076f7 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceQuotaLimitsGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the default and current subscription quota limit + * + * @summary Get the default and current subscription quota limit + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_Get.json + */ +async function quotaLimits() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const quotaLimitName = "totalCoolAccessVolumesPerSubscription"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResourceQuotaLimits.get(location, quotaLimitName); + console.log(result); +} + +quotaLimits().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceQuotaLimitsListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceQuotaLimitsListSample.js new file mode 100644 index 00000000000..ae728d5aae2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/netAppResourceQuotaLimitsListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the default and current limits for quotas + * + * @summary Get the default and current limits for quotas + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_List.json + */ +async function quotaLimits() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.netAppResourceQuotaLimits.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +quotaLimits().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/operationsListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/operationsListSample.js new file mode 100644 index 00000000000..af2876d540e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/operationsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the available Microsoft.NetApp Rest API operations + * + * @summary Lists all of the available Microsoft.NetApp Rest API operations + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/OperationList.json + */ +async function operationList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/package.json b/sdk/netapp/arm-netapp/samples/v15/javascript/package.json new file mode 100644 index 00000000000..9d7f043a500 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "azure-arm-netapp-samples-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/netapp/arm-netapp" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/netapp/arm-netapp", + "dependencies": { + "@azure/arm-netapp": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/poolsCreateOrUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsCreateOrUpdateSample.js new file mode 100644 index 00000000000..670a01305fb --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsCreateOrUpdateSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or Update a capacity pool + * + * @summary Create or Update a capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_CreateOrUpdate.json + */ +async function poolsCreateOrUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const body = { + location: "eastus", + qosType: "Auto", + serviceLevel: "Premium", + size: 4398046511104, + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + poolName, + body + ); + console.log(result); +} + +poolsCreateOrUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/poolsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsDeleteSample.js new file mode 100644 index 00000000000..d5599bcf149 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsDeleteSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the specified capacity pool + * + * @summary Delete the specified capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Delete.json + */ +async function poolsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.beginDeleteAndWait(resourceGroupName, accountName, poolName); + console.log(result); +} + +poolsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/poolsGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsGetSample.js new file mode 100644 index 00000000000..2ae5da6c0fd --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get details of the specified capacity pool + * + * @summary Get details of the specified capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Get.json + */ +async function poolsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.get(resourceGroupName, accountName, poolName); + console.log(result); +} + +poolsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/poolsListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsListSample.js new file mode 100644 index 00000000000..8e59f29950c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all capacity pools in the NetApp Account + * + * @summary List all capacity pools in the NetApp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_List.json + */ +async function poolsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.pools.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +poolsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/poolsUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsUpdateSample.js new file mode 100644 index 00000000000..db2601f976c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/poolsUpdateSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patch the specified capacity pool + * + * @summary Patch the specified capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Update.json + */ +async function poolsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const body = {}; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + body + ); + console.log(result); +} + +poolsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/sample.env b/sdk/netapp/arm-netapp/samples/v15/javascript/sample.env new file mode 100644 index 00000000000..672847a3fea --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesCreateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesCreateSample.js new file mode 100644 index 00000000000..b1972a961f8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesCreateSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a snapshot policy + * + * @summary Create a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Create.json + */ +async function snapshotPoliciesCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const body = { + dailySchedule: { hour: 14, minute: 30, snapshotsToKeep: 4 }, + enabled: true, + hourlySchedule: { minute: 50, snapshotsToKeep: 2 }, + location: "eastus", + monthlySchedule: { + daysOfMonth: "10,11,12", + hour: 14, + minute: 15, + snapshotsToKeep: 5, + }, + weeklySchedule: { + day: "Wednesday", + hour: 14, + minute: 45, + snapshotsToKeep: 3, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.create( + resourceGroupName, + accountName, + snapshotPolicyName, + body + ); + console.log(result); +} + +snapshotPoliciesCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesDeleteSample.js new file mode 100644 index 00000000000..977c0c34f17 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete snapshot policy + * + * @summary Delete snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Delete.json + */ +async function snapshotPoliciesDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const snapshotPolicyName = "snapshotPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.beginDeleteAndWait( + resourceGroupName, + accountName, + snapshotPolicyName + ); + console.log(result); +} + +snapshotPoliciesDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesGetSample.js new file mode 100644 index 00000000000..af73a899b40 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a snapshot Policy + * + * @summary Get a snapshot Policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Get.json + */ +async function snapshotPoliciesGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.get( + resourceGroupName, + accountName, + snapshotPolicyName + ); + console.log(result); +} + +snapshotPoliciesGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesListSample.js new file mode 100644 index 00000000000..8856d909092 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List snapshot policy + * + * @summary List snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_List.json + */ +async function snapshotPoliciesList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshotPolicies.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +snapshotPoliciesList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesListVolumesSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesListVolumesSample.js new file mode 100644 index 00000000000..b5ceadf3604 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesListVolumesSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get volumes associated with snapshot policy + * + * @summary Get volumes associated with snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_ListVolumes.json + */ +async function snapshotPoliciesListVolumes() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.listVolumes( + resourceGroupName, + accountName, + snapshotPolicyName + ); + console.log(result); +} + +snapshotPoliciesListVolumes().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesUpdateSample.js new file mode 100644 index 00000000000..4f7740135ee --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotPoliciesUpdateSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patch a snapshot policy + * + * @summary Patch a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Update.json + */ +async function snapshotPoliciesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const body = { + dailySchedule: { hour: 14, minute: 30, snapshotsToKeep: 4 }, + enabled: true, + hourlySchedule: { minute: 50, snapshotsToKeep: 2 }, + location: "eastus", + monthlySchedule: { + daysOfMonth: "10,11,12", + hour: 14, + minute: 15, + snapshotsToKeep: 5, + }, + weeklySchedule: { + day: "Wednesday", + hour: 14, + minute: 45, + snapshotsToKeep: 3, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.beginUpdateAndWait( + resourceGroupName, + accountName, + snapshotPolicyName, + body + ); + console.log(result); +} + +snapshotPoliciesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsCreateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsCreateSample.js new file mode 100644 index 00000000000..61f7a535ca9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsCreateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the specified snapshot within the given volume + * + * @summary Create the specified snapshot within the given volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Create.json + */ +async function snapshotsCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const body = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body + ); + console.log(result); +} + +snapshotsCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsDeleteSample.js new file mode 100644 index 00000000000..a79252af9bb --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsDeleteSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete snapshot + * + * @summary Delete snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Delete.json + */ +async function snapshotsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName + ); + console.log(result); +} + +snapshotsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsGetSample.js new file mode 100644 index 00000000000..6c7d3f9cf11 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsGetSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get details of the specified snapshot + * + * @summary Get details of the specified snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Get.json + */ +async function snapshotsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.get( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName + ); + console.log(result); +} + +snapshotsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsListSample.js new file mode 100644 index 00000000000..9e1d43bee7f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsListSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all snapshots associated with the volume + * + * @summary List all snapshots associated with the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_List.json + */ +async function snapshotsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +snapshotsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsRestoreFilesSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsRestoreFilesSample.js new file mode 100644 index 00000000000..9bfe4d3dab8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsRestoreFilesSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Restore the specified files from the specified snapshot to the active filesystem + * + * @summary Restore the specified files from the specified snapshot to the active filesystem + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_SingleFileRestore.json + */ +async function snapshotsSingleFileRestore() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const body = { + filePaths: ["/dir1/customer1.db", "/dir1/customer2.db"], + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginRestoreFilesAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body + ); + console.log(result); +} + +snapshotsSingleFileRestore().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsUpdateSample.js new file mode 100644 index 00000000000..66205d77855 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/snapshotsUpdateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patch a snapshot + * + * @summary Patch a snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Update.json + */ +async function snapshotsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const body = {}; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body + ); + console.log(result); +} + +snapshotsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesCreateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesCreateSample.js new file mode 100644 index 00000000000..2864104faff --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesCreateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * + * @summary Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Create.json + */ +async function subvolumesCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const body = { path: "/subvolumePath" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body + ); + console.log(result); +} + +subvolumesCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesDeleteSample.js new file mode 100644 index 00000000000..a1236772107 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesDeleteSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete subvolume + * + * @summary Delete subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Delete.json + */ +async function subvolumesDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName + ); + console.log(result); +} + +subvolumesDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesGetMetadataSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesGetMetadataSample.js new file mode 100644 index 00000000000..050d3104913 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesGetMetadataSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get details of the specified subvolume + * + * @summary Get details of the specified subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Metadata.json + */ +async function subvolumesMetadata() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginGetMetadataAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName + ); + console.log(result); +} + +subvolumesMetadata().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesGetSample.js new file mode 100644 index 00000000000..226d78056bc --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesGetSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns the path associated with the subvolumeName provided + * + * @summary Returns the path associated with the subvolumeName provided + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Get.json + */ +async function subvolumesGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.get( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName + ); + console.log(result); +} + +subvolumesGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesListByVolumeSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesListByVolumeSample.js new file mode 100644 index 00000000000..76e04d71d67 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesListByVolumeSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns a list of the subvolumes in the volume + * + * @summary Returns a list of the subvolumes in the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_List.json + */ +async function subvolumesList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.subvolumes.listByVolume( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +subvolumesList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesUpdateSample.js new file mode 100644 index 00000000000..97c5cf3e742 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/subvolumesUpdateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patch a subvolume + * + * @summary Patch a subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Update.json + */ +async function subvolumesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const body = { path: "/subvolumePath" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body + ); + console.log(result); +} + +subvolumesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/vaultsListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/vaultsListSample.js new file mode 100644 index 00000000000..52e9df8d06c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/vaultsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List vaults for a Netapp Account + * + * @summary List vaults for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Vaults_List.json + */ +async function vaultsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.vaults.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +vaultsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsCreateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsCreateSample.js new file mode 100644 index 00000000000..6e66a36dcf8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsCreateSample.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a volume group along with specified volumes + * + * @summary Create a volume group along with specified volumes + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Create.json + */ +async function volumeGroupsCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const body = { + groupMetaData: { + applicationIdentifier: "DEV", + applicationType: "SAP-HANA", + deploymentSpecId: "fb04dbeb-005d-2703-197e-6208dfadb5d9", + groupDescription: "Volume group", + }, + location: "westus", + volumes: [ + { + name: "testVol1", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "testVol1", + proximityPlacementGroup: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "data", + }, + { + name: "testVol2", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "testVol2", + proximityPlacementGroup: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "log", + }, + { + name: "testVol3", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "testVol3", + proximityPlacementGroup: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "shared", + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + accountName, + volumeGroupName, + body + ); + console.log(result); +} + +volumeGroupsCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsDeleteSample.js new file mode 100644 index 00000000000..b200725bdab --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the specified volume group only if there are no volumes under volume group. + * + * @summary Delete the specified volume group only if there are no volumes under volume group. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Delete.json + */ +async function volumeGroupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginDeleteAndWait( + resourceGroupName, + accountName, + volumeGroupName + ); + console.log(result); +} + +volumeGroupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsGetSample.js new file mode 100644 index 00000000000..0fbc45edb1b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get details of the specified volume group + * + * @summary Get details of the specified volume group + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Get.json + */ +async function volumeGroupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.get(resourceGroupName, accountName, volumeGroupName); + console.log(result); +} + +volumeGroupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsListByNetAppAccountSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsListByNetAppAccountSample.js new file mode 100644 index 00000000000..c99391dcb51 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumeGroupsListByNetAppAccountSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all volume groups for given account + * + * @summary List all volume groups for given account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_List.json + */ +async function volumeGroupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumeGroups.listByNetAppAccount(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +volumeGroupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesAuthorizeReplicationSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesAuthorizeReplicationSample.js new file mode 100644 index 00000000000..0a09cd40edc --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesAuthorizeReplicationSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Authorize the replication connection on the source volume + * + * @summary Authorize the replication connection on the source volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_AuthorizeReplication.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { + remoteVolumeResourceId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRemoteRG/providers/Microsoft.NetApp/netAppAccounts/remoteAccount1/capacityPools/remotePool1/volumes/remoteVolume1", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginAuthorizeReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesAuthorizeReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesBreakReplicationSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesBreakReplicationSample.js new file mode 100644 index 00000000000..dbc166342ee --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesBreakReplicationSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Break the replication connection on the destination volume + * + * @summary Break the replication connection on the destination volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BreakReplication.json + */ +async function volumesBreakReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { forceBreakReplication: false }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginBreakReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + options + ); + console.log(result); +} + +volumesBreakReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesCreateOrUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesCreateOrUpdateSample.js new file mode 100644 index 00000000000..114bb786f27 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesCreateOrUpdateSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update the specified volume within the capacity pool + * + * @summary Create or update the specified volume within the capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_CreateOrUpdate.json + */ +async function volumesCreateOrUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { + creationToken: "my-unique-file-path", + encryptionKeySource: "Microsoft.KeyVault", + location: "eastus", + serviceLevel: "Premium", + subnetId: + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 128, + usageThreshold: 107374182400, + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesCreateOrUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesDeleteReplicationSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesDeleteReplicationSample.js new file mode 100644 index 00000000000..8551c569400 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesDeleteReplicationSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the replication connection on the destination volume, and send release to the source replication + * + * @summary Delete the replication connection on the destination volume, and send release to the source replication + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_DeleteReplication.json + */ +async function volumesDeleteReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginDeleteReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesDeleteReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesDeleteSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesDeleteSample.js new file mode 100644 index 00000000000..5bd11d80f9a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesDeleteSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the specified volume + * + * @summary Delete the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Delete.json + */ +async function volumesDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesGetSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesGetSample.js new file mode 100644 index 00000000000..06bee98386b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesGetSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the details of the specified volume + * + * @summary Get the details of the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Get.json + */ +async function volumesGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.get(resourceGroupName, accountName, poolName, volumeName); + console.log(result); +} + +volumesGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesListSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesListSample.js new file mode 100644 index 00000000000..0651cb30b39 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesListSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all volumes within the capacity pool + * + * @summary List all volumes within the capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_List.json + */ +async function volumesList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.list(resourceGroupName, accountName, poolName)) { + resArray.push(item); + } + console.log(resArray); +} + +volumesList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesPoolChangeSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesPoolChangeSample.js new file mode 100644 index 00000000000..39dda0b2f26 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesPoolChangeSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Moves volume to another pool + * + * @summary Moves volume to another pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_PoolChange.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { + newPoolResourceId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginPoolChangeAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesAuthorizeReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesReInitializeReplicationSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesReInitializeReplicationSample.js new file mode 100644 index 00000000000..072e51787f6 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesReInitializeReplicationSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Re-Initializes the replication connection on the destination volume + * + * @summary Re-Initializes the replication connection on the destination volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReInitializeReplication.json + */ +async function volumesReInitializeReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginReInitializeReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesReInitializeReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesReplicationStatusSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesReplicationStatusSample.js new file mode 100644 index 00000000000..d3741d6c43d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesReplicationStatusSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the status of the replication + * + * @summary Get the status of the replication + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReplicationStatus.json + */ +async function volumesReplicationStatus() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.replicationStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesReplicationStatus().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesResyncReplicationSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesResyncReplicationSample.js new file mode 100644 index 00000000000..1b561d0ea8f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesResyncReplicationSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @summary Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ResyncReplication.json + */ +async function volumesResyncReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginResyncReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesResyncReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesRevertSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesRevertSample.js new file mode 100644 index 00000000000..3932aa6e27d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesRevertSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Revert a volume to the snapshot specified in the body + * + * @summary Revert a volume to the snapshot specified in the body + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Revert.json + */ +async function volumesRevert() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { + snapshotId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginRevertAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesRevert().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/javascript/volumesUpdateSample.js b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesUpdateSample.js new file mode 100644 index 00000000000..5fa4a5be3f0 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/javascript/volumesUpdateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patch the specified volume + * + * @summary Patch the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Update.json + */ +async function volumesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = {}; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/README.md b/sdk/netapp/arm-netapp/samples/v15/typescript/README.md new file mode 100644 index 00000000000..56876dc679c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/README.md @@ -0,0 +1,197 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accountBackupsDeleteSample.ts][accountbackupsdeletesample] | Delete the specified Backup for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Delete.json | +| [accountBackupsGetSample.ts][accountbackupsgetsample] | Gets the specified backup for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Get.json | +| [accountBackupsListSample.ts][accountbackupslistsample] | List all Backups for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_List.json | +| [accountsCreateOrUpdateSample.ts][accountscreateorupdatesample] | Create or update the specified NetApp account within the resource group x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_CreateOrUpdate.json | +| [accountsDeleteSample.ts][accountsdeletesample] | Delete the specified NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Delete.json | +| [accountsGetSample.ts][accountsgetsample] | Get the NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Get.json | +| [accountsListBySubscriptionSample.ts][accountslistbysubscriptionsample] | List and describe all NetApp accounts in the subscription. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json | +| [accountsListSample.ts][accountslistsample] | List and describe all NetApp accounts in the resource group. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json | +| [accountsUpdateSample.ts][accountsupdatesample] | Patch the specified NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Update.json | +| [backupPoliciesCreateSample.ts][backuppoliciescreatesample] | Create a backup policy for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Create.json | +| [backupPoliciesDeleteSample.ts][backuppoliciesdeletesample] | Delete backup policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Delete.json | +| [backupPoliciesGetSample.ts][backuppoliciesgetsample] | Get a particular backup Policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Get.json | +| [backupPoliciesListSample.ts][backuppolicieslistsample] | List backup policies for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_List.json | +| [backupPoliciesUpdateSample.ts][backuppoliciesupdatesample] | Patch a backup policy for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Update.json | +| [backupsCreateSample.ts][backupscreatesample] | Create a backup for the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Create.json | +| [backupsDeleteSample.ts][backupsdeletesample] | Delete a backup of the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Delete.json | +| [backupsGetSample.ts][backupsgetsample] | Gets the specified backup of the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Get.json | +| [backupsGetStatusSample.ts][backupsgetstatussample] | Get the status of the backup for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BackupStatus.json | +| [backupsGetVolumeRestoreStatusSample.ts][backupsgetvolumerestorestatussample] | Get the status of the restore for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_RestoreStatus.json | +| [backupsListSample.ts][backupslistsample] | List all backups for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_List.json | +| [backupsUpdateSample.ts][backupsupdatesample] | Patch a backup for the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Update.json | +| [netAppResourceCheckFilePathAvailabilitySample.ts][netappresourcecheckfilepathavailabilitysample] | Check if a file path is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckFilePathAvailability.json | +| [netAppResourceCheckNameAvailabilitySample.ts][netappresourcechecknameavailabilitysample] | Check if a resource name is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckNameAvailability.json | +| [netAppResourceCheckQuotaAvailabilitySample.ts][netappresourcecheckquotaavailabilitysample] | Check if a quota is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckQuotaAvailability.json | +| [netAppResourceQuotaLimitsGetSample.ts][netappresourcequotalimitsgetsample] | Get the default and current subscription quota limit x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_Get.json | +| [netAppResourceQuotaLimitsListSample.ts][netappresourcequotalimitslistsample] | Get the default and current limits for quotas x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_List.json | +| [operationsListSample.ts][operationslistsample] | Lists all of the available Microsoft.NetApp Rest API operations x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/OperationList.json | +| [poolsCreateOrUpdateSample.ts][poolscreateorupdatesample] | Create or Update a capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_CreateOrUpdate.json | +| [poolsDeleteSample.ts][poolsdeletesample] | Delete the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Delete.json | +| [poolsGetSample.ts][poolsgetsample] | Get details of the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Get.json | +| [poolsListSample.ts][poolslistsample] | List all capacity pools in the NetApp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_List.json | +| [poolsUpdateSample.ts][poolsupdatesample] | Patch the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Update.json | +| [snapshotPoliciesCreateSample.ts][snapshotpoliciescreatesample] | Create a snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Create.json | +| [snapshotPoliciesDeleteSample.ts][snapshotpoliciesdeletesample] | Delete snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Delete.json | +| [snapshotPoliciesGetSample.ts][snapshotpoliciesgetsample] | Get a snapshot Policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Get.json | +| [snapshotPoliciesListSample.ts][snapshotpolicieslistsample] | List snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_List.json | +| [snapshotPoliciesListVolumesSample.ts][snapshotpolicieslistvolumessample] | Get volumes associated with snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_ListVolumes.json | +| [snapshotPoliciesUpdateSample.ts][snapshotpoliciesupdatesample] | Patch a snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Update.json | +| [snapshotsCreateSample.ts][snapshotscreatesample] | Create the specified snapshot within the given volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Create.json | +| [snapshotsDeleteSample.ts][snapshotsdeletesample] | Delete snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Delete.json | +| [snapshotsGetSample.ts][snapshotsgetsample] | Get details of the specified snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Get.json | +| [snapshotsListSample.ts][snapshotslistsample] | List all snapshots associated with the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_List.json | +| [snapshotsRestoreFilesSample.ts][snapshotsrestorefilessample] | Restore the specified files from the specified snapshot to the active filesystem x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_SingleFileRestore.json | +| [snapshotsUpdateSample.ts][snapshotsupdatesample] | Patch a snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Update.json | +| [subvolumesCreateSample.ts][subvolumescreatesample] | Creates a subvolume in the path or clones the subvolume mentioned in the parentPath x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Create.json | +| [subvolumesDeleteSample.ts][subvolumesdeletesample] | Delete subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Delete.json | +| [subvolumesGetMetadataSample.ts][subvolumesgetmetadatasample] | Get details of the specified subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Metadata.json | +| [subvolumesGetSample.ts][subvolumesgetsample] | Returns the path associated with the subvolumeName provided x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Get.json | +| [subvolumesListByVolumeSample.ts][subvolumeslistbyvolumesample] | Returns a list of the subvolumes in the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_List.json | +| [subvolumesUpdateSample.ts][subvolumesupdatesample] | Patch a subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Update.json | +| [vaultsListSample.ts][vaultslistsample] | List vaults for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Vaults_List.json | +| [volumeGroupsCreateSample.ts][volumegroupscreatesample] | Create a volume group along with specified volumes x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Create.json | +| [volumeGroupsDeleteSample.ts][volumegroupsdeletesample] | Delete the specified volume group only if there are no volumes under volume group. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Delete.json | +| [volumeGroupsGetSample.ts][volumegroupsgetsample] | Get details of the specified volume group x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Get.json | +| [volumeGroupsListByNetAppAccountSample.ts][volumegroupslistbynetappaccountsample] | List all volume groups for given account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_List.json | +| [volumesAuthorizeReplicationSample.ts][volumesauthorizereplicationsample] | Authorize the replication connection on the source volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_AuthorizeReplication.json | +| [volumesBreakReplicationSample.ts][volumesbreakreplicationsample] | Break the replication connection on the destination volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BreakReplication.json | +| [volumesCreateOrUpdateSample.ts][volumescreateorupdatesample] | Create or update the specified volume within the capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_CreateOrUpdate.json | +| [volumesDeleteReplicationSample.ts][volumesdeletereplicationsample] | Delete the replication connection on the destination volume, and send release to the source replication x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_DeleteReplication.json | +| [volumesDeleteSample.ts][volumesdeletesample] | Delete the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Delete.json | +| [volumesGetSample.ts][volumesgetsample] | Get the details of the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Get.json | +| [volumesListSample.ts][volumeslistsample] | List all volumes within the capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_List.json | +| [volumesPoolChangeSample.ts][volumespoolchangesample] | Moves volume to another pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_PoolChange.json | +| [volumesReInitializeReplicationSample.ts][volumesreinitializereplicationsample] | Re-Initializes the replication connection on the destination volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReInitializeReplication.json | +| [volumesReplicationStatusSample.ts][volumesreplicationstatussample] | Get the status of the replication x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReplicationStatus.json | +| [volumesResyncReplicationSample.ts][volumesresyncreplicationsample] | Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ResyncReplication.json | +| [volumesRevertSample.ts][volumesrevertsample] | Revert a volume to the snapshot specified in the body x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Revert.json | +| [volumesUpdateSample.ts][volumesupdatesample] | Patch the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Update.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/accountBackupsDeleteSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/accountBackupsDeleteSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accountbackupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsDeleteSample.ts +[accountbackupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsGetSample.ts +[accountbackupslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsListSample.ts +[accountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsCreateOrUpdateSample.ts +[accountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsDeleteSample.ts +[accountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsGetSample.ts +[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsListBySubscriptionSample.ts +[accountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsListSample.ts +[accountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsUpdateSample.ts +[backuppoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesCreateSample.ts +[backuppoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesDeleteSample.ts +[backuppoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesGetSample.ts +[backuppolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesListSample.ts +[backuppoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesUpdateSample.ts +[backupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsCreateSample.ts +[backupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsDeleteSample.ts +[backupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetSample.ts +[backupsgetstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetStatusSample.ts +[backupsgetvolumerestorestatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetVolumeRestoreStatusSample.ts +[backupslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsListSample.ts +[backupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsUpdateSample.ts +[netappresourcecheckfilepathavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckFilePathAvailabilitySample.ts +[netappresourcechecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckNameAvailabilitySample.ts +[netappresourcecheckquotaavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckQuotaAvailabilitySample.ts +[netappresourcequotalimitsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceQuotaLimitsGetSample.ts +[netappresourcequotalimitslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceQuotaLimitsListSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/operationsListSample.ts +[poolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsCreateOrUpdateSample.ts +[poolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsDeleteSample.ts +[poolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsGetSample.ts +[poolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsListSample.ts +[poolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsUpdateSample.ts +[snapshotpoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesCreateSample.ts +[snapshotpoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesDeleteSample.ts +[snapshotpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesGetSample.ts +[snapshotpolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesListSample.ts +[snapshotpolicieslistvolumessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesListVolumesSample.ts +[snapshotpoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesUpdateSample.ts +[snapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsCreateSample.ts +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsDeleteSample.ts +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsGetSample.ts +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsListSample.ts +[snapshotsrestorefilessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsRestoreFilesSample.ts +[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsUpdateSample.ts +[subvolumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesCreateSample.ts +[subvolumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesDeleteSample.ts +[subvolumesgetmetadatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesGetMetadataSample.ts +[subvolumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesGetSample.ts +[subvolumeslistbyvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesListByVolumeSample.ts +[subvolumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesUpdateSample.ts +[vaultslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/vaultsListSample.ts +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsCreateSample.ts +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsDeleteSample.ts +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsGetSample.ts +[volumegroupslistbynetappaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsListByNetAppAccountSample.ts +[volumesauthorizereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesAuthorizeReplicationSample.ts +[volumesbreakreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesBreakReplicationSample.ts +[volumescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesCreateOrUpdateSample.ts +[volumesdeletereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesDeleteReplicationSample.ts +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesDeleteSample.ts +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesGetSample.ts +[volumeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesListSample.ts +[volumespoolchangesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesPoolChangeSample.ts +[volumesreinitializereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesReInitializeReplicationSample.ts +[volumesreplicationstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesReplicationStatusSample.ts +[volumesresyncreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesResyncReplicationSample.ts +[volumesrevertsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesRevertSample.ts +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesUpdateSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-netapp?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/netapp/arm-netapp/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/package.json b/sdk/netapp/arm-netapp/samples/v15/typescript/package.json new file mode 100644 index 00000000000..e3e25c16b7a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "azure-arm-netapp-samples-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/netapp/arm-netapp" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/netapp/arm-netapp", + "dependencies": { + "@azure/arm-netapp": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/sample.env b/sdk/netapp/arm-netapp/samples/v15/typescript/sample.env new file mode 100644 index 00000000000..672847a3fea --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsDeleteSample.ts new file mode 100644 index 00000000000..ade0915bfa8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified Backup for a Netapp Account + * + * @summary Delete the specified Backup for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Delete.json + */ +async function accountBackupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const backupName = "backupName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accountBackups.beginDeleteAndWait( + resourceGroupName, + accountName, + backupName + ); + console.log(result); +} + +accountBackupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsGetSample.ts new file mode 100644 index 00000000000..cb04ebc9536 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified backup for a Netapp Account + * + * @summary Gets the specified backup for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_Get.json + */ +async function accountBackupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accountBackups.get( + resourceGroupName, + accountName, + backupName + ); + console.log(result); +} + +accountBackupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsListSample.ts new file mode 100644 index 00000000000..0de933b21a4 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountBackupsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all Backups for a Netapp Account + * + * @summary List all Backups for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Account_List.json + */ +async function accountBackupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accountBackups.list( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +accountBackupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..492fd13f8fd --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsCreateOrUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppAccount, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the specified NetApp account within the resource group + * + * @summary Create or update the specified NetApp account within the resource group + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_CreateOrUpdate.json + */ +async function accountsCreateOrUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const body: NetAppAccount = { + activeDirectories: [ + { + aesEncryption: true, + dns: "10.10.10.3, 10.10.10.4", + domain: "10.10.10.3", + ldapOverTLS: false, + ldapSigning: false, + organizationalUnit: "OU=Engineering", + password: "ad_password", + site: "SiteName", + smbServerName: "SMBServer", + username: "ad_user_name" + } + ], + location: "eastus" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + body + ); + console.log(result); +} + +accountsCreateOrUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsDeleteSample.ts new file mode 100644 index 00000000000..bc02d40cc0c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified NetApp account + * + * @summary Delete the specified NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Delete.json + */ +async function accountsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginDeleteAndWait( + resourceGroupName, + accountName + ); + console.log(result); +} + +accountsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsGetSample.ts new file mode 100644 index 00000000000..ab510a28413 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the NetApp account + * + * @summary Get the NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Get.json + */ +async function accountsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.get(resourceGroupName, accountName); + console.log(result); +} + +accountsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsListBySubscriptionSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsListBySubscriptionSample.ts new file mode 100644 index 00000000000..9cd32a60f51 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List and describe all NetApp accounts in the subscription. + * + * @summary List and describe all NetApp accounts in the subscription. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accounts.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +accountsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsListSample.ts new file mode 100644 index 00000000000..df45422c6a2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List and describe all NetApp accounts in the resource group. + * + * @summary List and describe all NetApp accounts in the resource group. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accounts.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +accountsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsUpdateSample.ts new file mode 100644 index 00000000000..69cd421a38e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/accountsUpdateSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppAccountPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch the specified NetApp account + * + * @summary Patch the specified NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Accounts_Update.json + */ +async function accountsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const body: NetAppAccountPatch = { tags: { tag1: "Value1" } }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginUpdateAndWait( + resourceGroupName, + accountName, + body + ); + console.log(result); +} + +accountsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesCreateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesCreateSample.ts new file mode 100644 index 00000000000..deb09e8463f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesCreateSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BackupPolicy, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a backup policy for Netapp Account + * + * @summary Create a backup policy for Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Create.json + */ +async function backupPoliciesCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupPolicyName = "backupPolicyName"; + const body: BackupPolicy = { + dailyBackupsToKeep: 10, + enabled: true, + location: "westus", + monthlyBackupsToKeep: 10, + weeklyBackupsToKeep: 10 + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginCreateAndWait( + resourceGroupName, + accountName, + backupPolicyName, + body + ); + console.log(result); +} + +backupPoliciesCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesDeleteSample.ts new file mode 100644 index 00000000000..cecd6d5b36f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete backup policy + * + * @summary Delete backup policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Delete.json + */ +async function backupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const backupPolicyName = "backupPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginDeleteAndWait( + resourceGroupName, + accountName, + backupPolicyName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesGetSample.ts new file mode 100644 index 00000000000..74f4a375c8b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a particular backup Policy + * + * @summary Get a particular backup Policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Get.json + */ +async function backupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupPolicyName = "backupPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.get( + resourceGroupName, + accountName, + backupPolicyName + ); + console.log(result); +} + +backupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesListSample.ts new file mode 100644 index 00000000000..bf403875a9d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List backup policies for Netapp Account + * + * @summary List backup policies for Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_List.json + */ +async function backupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupPolicies.list( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesUpdateSample.ts new file mode 100644 index 00000000000..8d4751df899 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupPoliciesUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BackupPolicyPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a backup policy for Netapp Account + * + * @summary Patch a backup policy for Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/BackupPolicies_Update.json + */ +async function backupPoliciesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const backupPolicyName = "backupPolicyName"; + const body: BackupPolicyPatch = { + dailyBackupsToKeep: 5, + enabled: false, + location: "westus", + monthlyBackupsToKeep: 10, + weeklyBackupsToKeep: 10 + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupPolicies.beginUpdateAndWait( + resourceGroupName, + accountName, + backupPolicyName, + body + ); + console.log(result); +} + +backupPoliciesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsCreateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsCreateSample.ts new file mode 100644 index 00000000000..6d7c76952e6 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsCreateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Backup, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a backup for the volume + * + * @summary Create a backup for the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Create.json + */ +async function backupsCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const backupName = "backup1"; + const body: Backup = { label: "myLabel", location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + body + ); + console.log(result); +} + +backupsCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsDeleteSample.ts new file mode 100644 index 00000000000..180bec36f3e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a backup of the volume + * + * @summary Delete a backup of the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Delete.json + */ +async function backupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const poolName = "poolName"; + const volumeName = "volumeName"; + const backupName = "backupName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName + ); + console.log(result); +} + +backupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetSample.ts new file mode 100644 index 00000000000..350f1317f17 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified backup of the volume + * + * @summary Gets the specified backup of the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Get.json + */ +async function backupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.get( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName + ); + console.log(result); +} + +backupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetStatusSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetStatusSample.ts new file mode 100644 index 00000000000..5818f123a4d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetStatusSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the status of the backup for a volume + * + * @summary Get the status of the backup for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BackupStatus.json + */ +async function volumesBackupStatus() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.getStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesBackupStatus().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetVolumeRestoreStatusSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetVolumeRestoreStatusSample.ts new file mode 100644 index 00000000000..80061ed240a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsGetVolumeRestoreStatusSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the status of the restore for a volume + * + * @summary Get the status of the restore for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_RestoreStatus.json + */ +async function volumesRestoreStatus() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.getVolumeRestoreStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesRestoreStatus().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsListSample.ts new file mode 100644 index 00000000000..a77feb3050f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsListSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all backups for a volume + * + * @summary List all backups for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_List.json + */ +async function backupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.list( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +backupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsUpdateSample.ts new file mode 100644 index 00000000000..ac0200b1f8e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/backupsUpdateSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BackupPatch, + BackupsUpdateOptionalParams, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a backup for the volume + * + * @summary Patch a backup for the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Backups_Update.json + */ +async function backupsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const backupName = "backup1"; + const body: BackupPatch = {}; + const options: BackupsUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + options + ); + console.log(result); +} + +backupsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckFilePathAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckFilePathAvailabilitySample.ts new file mode 100644 index 00000000000..cebbf675958 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckFilePathAvailabilitySample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if a file path is available. + * + * @summary Check if a file path is available. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckFilePathAvailability.json + */ +async function checkFilePathAvailability() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "my-exact-filepth"; + const subnetId = + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.checkFilePathAvailability( + location, + name, + subnetId + ); + console.log(result); +} + +checkFilePathAvailability().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckNameAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckNameAvailabilitySample.ts new file mode 100644 index 00000000000..299577eb582 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckNameAvailabilitySample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if a resource name is available. + * + * @summary Check if a resource name is available. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckNameAvailability.json + */ +async function checkNameAvailability() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "accName"; + const typeParam = "netAppAccount"; + const resourceGroup = "myRG"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.checkNameAvailability( + location, + name, + typeParam, + resourceGroup + ); + console.log(result); +} + +checkNameAvailability().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckQuotaAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckQuotaAvailabilitySample.ts new file mode 100644 index 00000000000..c8f7fe20739 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceCheckQuotaAvailabilitySample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if a quota is available. + * + * @summary Check if a quota is available. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/CheckQuotaAvailability.json + */ +async function checkQuotaAvailability() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "resource1"; + const typeParam = "Microsoft.NetApp/netAppAccounts"; + const resourceGroup = "myRG"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.checkQuotaAvailability( + location, + name, + typeParam, + resourceGroup + ); + console.log(result); +} + +checkQuotaAvailability().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceQuotaLimitsGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceQuotaLimitsGetSample.ts new file mode 100644 index 00000000000..aa314b0a533 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceQuotaLimitsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the default and current subscription quota limit + * + * @summary Get the default and current subscription quota limit + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_Get.json + */ +async function quotaLimits() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const quotaLimitName = "totalCoolAccessVolumesPerSubscription"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResourceQuotaLimits.get( + location, + quotaLimitName + ); + console.log(result); +} + +quotaLimits().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceQuotaLimitsListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceQuotaLimitsListSample.ts new file mode 100644 index 00000000000..3701ad55d48 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/netAppResourceQuotaLimitsListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the default and current limits for quotas + * + * @summary Get the default and current limits for quotas + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/QuotaLimits_List.json + */ +async function quotaLimits() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.netAppResourceQuotaLimits.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +quotaLimits().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/operationsListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/operationsListSample.ts new file mode 100644 index 00000000000..5d613c9da70 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/operationsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available Microsoft.NetApp Rest API operations + * + * @summary Lists all of the available Microsoft.NetApp Rest API operations + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/OperationList.json + */ +async function operationList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsCreateOrUpdateSample.ts new file mode 100644 index 00000000000..1e23d676d66 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsCreateOrUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CapacityPool, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or Update a capacity pool + * + * @summary Create or Update a capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_CreateOrUpdate.json + */ +async function poolsCreateOrUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const body: CapacityPool = { + location: "eastus", + qosType: "Auto", + serviceLevel: "Premium", + size: 4398046511104 + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + poolName, + body + ); + console.log(result); +} + +poolsCreateOrUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsDeleteSample.ts new file mode 100644 index 00000000000..37da793c595 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified capacity pool + * + * @summary Delete the specified capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Delete.json + */ +async function poolsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName + ); + console.log(result); +} + +poolsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsGetSample.ts new file mode 100644 index 00000000000..84b81f4126f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get details of the specified capacity pool + * + * @summary Get details of the specified capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Get.json + */ +async function poolsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.get( + resourceGroupName, + accountName, + poolName + ); + console.log(result); +} + +poolsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsListSample.ts new file mode 100644 index 00000000000..b2af48052db --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsListSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all capacity pools in the NetApp Account + * + * @summary List all capacity pools in the NetApp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_List.json + */ +async function poolsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.pools.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +poolsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsUpdateSample.ts new file mode 100644 index 00000000000..bc13e727314 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/poolsUpdateSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CapacityPoolPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch the specified capacity pool + * + * @summary Patch the specified capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Pools_Update.json + */ +async function poolsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const body: CapacityPoolPatch = {}; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.pools.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + body + ); + console.log(result); +} + +poolsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesCreateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesCreateSample.ts new file mode 100644 index 00000000000..4187767835c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesCreateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SnapshotPolicy, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a snapshot policy + * + * @summary Create a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Create.json + */ +async function snapshotPoliciesCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const body: SnapshotPolicy = { + dailySchedule: { hour: 14, minute: 30, snapshotsToKeep: 4 }, + enabled: true, + hourlySchedule: { minute: 50, snapshotsToKeep: 2 }, + location: "eastus", + monthlySchedule: { + daysOfMonth: "10,11,12", + hour: 14, + minute: 15, + snapshotsToKeep: 5 + }, + weeklySchedule: { + day: "Wednesday", + hour: 14, + minute: 45, + snapshotsToKeep: 3 + } + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.create( + resourceGroupName, + accountName, + snapshotPolicyName, + body + ); + console.log(result); +} + +snapshotPoliciesCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesDeleteSample.ts new file mode 100644 index 00000000000..dc736d9164c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete snapshot policy + * + * @summary Delete snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Delete.json + */ +async function snapshotPoliciesDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "resourceGroup"; + const accountName = "accountName"; + const snapshotPolicyName = "snapshotPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.beginDeleteAndWait( + resourceGroupName, + accountName, + snapshotPolicyName + ); + console.log(result); +} + +snapshotPoliciesDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesGetSample.ts new file mode 100644 index 00000000000..2f26aea8d5b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a snapshot Policy + * + * @summary Get a snapshot Policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Get.json + */ +async function snapshotPoliciesGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.get( + resourceGroupName, + accountName, + snapshotPolicyName + ); + console.log(result); +} + +snapshotPoliciesGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesListSample.ts new file mode 100644 index 00000000000..52de5d38f4c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List snapshot policy + * + * @summary List snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_List.json + */ +async function snapshotPoliciesList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshotPolicies.list( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +snapshotPoliciesList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesListVolumesSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesListVolumesSample.ts new file mode 100644 index 00000000000..11338d33ad1 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesListVolumesSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get volumes associated with snapshot policy + * + * @summary Get volumes associated with snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_ListVolumes.json + */ +async function snapshotPoliciesListVolumes() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.listVolumes( + resourceGroupName, + accountName, + snapshotPolicyName + ); + console.log(result); +} + +snapshotPoliciesListVolumes().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesUpdateSample.ts new file mode 100644 index 00000000000..d6a769ffeea --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotPoliciesUpdateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SnapshotPolicyPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a snapshot policy + * + * @summary Patch a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/SnapshotPolicies_Update.json + */ +async function snapshotPoliciesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const snapshotPolicyName = "snapshotPolicyName"; + const body: SnapshotPolicyPatch = { + dailySchedule: { hour: 14, minute: 30, snapshotsToKeep: 4 }, + enabled: true, + hourlySchedule: { minute: 50, snapshotsToKeep: 2 }, + location: "eastus", + monthlySchedule: { + daysOfMonth: "10,11,12", + hour: 14, + minute: 15, + snapshotsToKeep: 5 + }, + weeklySchedule: { + day: "Wednesday", + hour: 14, + minute: 45, + snapshotsToKeep: 3 + } + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshotPolicies.beginUpdateAndWait( + resourceGroupName, + accountName, + snapshotPolicyName, + body + ); + console.log(result); +} + +snapshotPoliciesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsCreateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsCreateSample.ts new file mode 100644 index 00000000000..ca56d39a96f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsCreateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Snapshot, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the specified snapshot within the given volume + * + * @summary Create the specified snapshot within the given volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Create.json + */ +async function snapshotsCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const body: Snapshot = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body + ); + console.log(result); +} + +snapshotsCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsDeleteSample.ts new file mode 100644 index 00000000000..c97ab7e34da --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete snapshot + * + * @summary Delete snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Delete.json + */ +async function snapshotsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName + ); + console.log(result); +} + +snapshotsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsGetSample.ts new file mode 100644 index 00000000000..7e26fb921de --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get details of the specified snapshot + * + * @summary Get details of the specified snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Get.json + */ +async function snapshotsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.get( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName + ); + console.log(result); +} + +snapshotsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsListSample.ts new file mode 100644 index 00000000000..5b010d589fa --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsListSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all snapshots associated with the volume + * + * @summary List all snapshots associated with the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_List.json + */ +async function snapshotsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +snapshotsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsRestoreFilesSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsRestoreFilesSample.ts new file mode 100644 index 00000000000..222bb538ee8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsRestoreFilesSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SnapshotRestoreFiles, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restore the specified files from the specified snapshot to the active filesystem + * + * @summary Restore the specified files from the specified snapshot to the active filesystem + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_SingleFileRestore.json + */ +async function snapshotsSingleFileRestore() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const body: SnapshotRestoreFiles = { + filePaths: ["/dir1/customer1.db", "/dir1/customer2.db"] + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginRestoreFilesAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body + ); + console.log(result); +} + +snapshotsSingleFileRestore().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsUpdateSample.ts new file mode 100644 index 00000000000..0cb13a13356 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/snapshotsUpdateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a snapshot + * + * @summary Patch a snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Snapshots_Update.json + */ +async function snapshotsUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const snapshotName = "snapshot1"; + const body: Record = {}; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body + ); + console.log(result); +} + +snapshotsUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesCreateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesCreateSample.ts new file mode 100644 index 00000000000..66df11da065 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesCreateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SubvolumeInfo, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * + * @summary Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Create.json + */ +async function subvolumesCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const body: SubvolumeInfo = { path: "/subvolumePath" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body + ); + console.log(result); +} + +subvolumesCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesDeleteSample.ts new file mode 100644 index 00000000000..25d8d2dc001 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete subvolume + * + * @summary Delete subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Delete.json + */ +async function subvolumesDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName + ); + console.log(result); +} + +subvolumesDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesGetMetadataSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesGetMetadataSample.ts new file mode 100644 index 00000000000..78176f2c836 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesGetMetadataSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get details of the specified subvolume + * + * @summary Get details of the specified subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Metadata.json + */ +async function subvolumesMetadata() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginGetMetadataAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName + ); + console.log(result); +} + +subvolumesMetadata().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesGetSample.ts new file mode 100644 index 00000000000..2ea509b6517 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns the path associated with the subvolumeName provided + * + * @summary Returns the path associated with the subvolumeName provided + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Get.json + */ +async function subvolumesGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.get( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName + ); + console.log(result); +} + +subvolumesGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesListByVolumeSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesListByVolumeSample.ts new file mode 100644 index 00000000000..c40453530b3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesListByVolumeSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns a list of the subvolumes in the volume + * + * @summary Returns a list of the subvolumes in the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_List.json + */ +async function subvolumesList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.subvolumes.listByVolume( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +subvolumesList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesUpdateSample.ts new file mode 100644 index 00000000000..07fb4a87a71 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/subvolumesUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SubvolumePatchRequest, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch a subvolume + * + * @summary Patch a subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Subvolumes_Update.json + */ +async function subvolumesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const subvolumeName = "subvolume1"; + const body: SubvolumePatchRequest = { path: "/subvolumePath" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.subvolumes.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body + ); + console.log(result); +} + +subvolumesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/vaultsListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/vaultsListSample.ts new file mode 100644 index 00000000000..ec9c8fa0ac6 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/vaultsListSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List vaults for a Netapp Account + * + * @summary List vaults for a Netapp Account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Vaults_List.json + */ +async function vaultsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.vaults.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +vaultsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsCreateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsCreateSample.ts new file mode 100644 index 00000000000..aa57f4dfcb1 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsCreateSample.ts @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VolumeGroupDetails, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a volume group along with specified volumes + * + * @summary Create a volume group along with specified volumes + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Create.json + */ +async function volumeGroupsCreate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const body: VolumeGroupDetails = { + groupMetaData: { + applicationIdentifier: "DEV", + applicationType: "SAP-HANA", + deploymentSpecId: "fb04dbeb-005d-2703-197e-6208dfadb5d9", + groupDescription: "Volume group" + }, + location: "westus", + volumes: [ + { + name: "testVol1", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "testVol1", + proximityPlacementGroup: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "data" + }, + { + name: "testVol2", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "testVol2", + proximityPlacementGroup: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "log" + }, + { + name: "testVol3", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "testVol3", + proximityPlacementGroup: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg", + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "shared" + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + accountName, + volumeGroupName, + body + ); + console.log(result); +} + +volumeGroupsCreate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsDeleteSample.ts new file mode 100644 index 00000000000..89f7318e401 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified volume group only if there are no volumes under volume group. + * + * @summary Delete the specified volume group only if there are no volumes under volume group. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Delete.json + */ +async function volumeGroupsDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginDeleteAndWait( + resourceGroupName, + accountName, + volumeGroupName + ); + console.log(result); +} + +volumeGroupsDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsGetSample.ts new file mode 100644 index 00000000000..c7688d0c89f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get details of the specified volume group + * + * @summary Get details of the specified volume group + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_Get.json + */ +async function volumeGroupsGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.get( + resourceGroupName, + accountName, + volumeGroupName + ); + console.log(result); +} + +volumeGroupsGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsListByNetAppAccountSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsListByNetAppAccountSample.ts new file mode 100644 index 00000000000..3233cabf077 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumeGroupsListByNetAppAccountSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all volume groups for given account + * + * @summary List all volume groups for given account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/VolumeGroups_List.json + */ +async function volumeGroupsList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumeGroups.listByNetAppAccount( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumeGroupsList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesAuthorizeReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesAuthorizeReplicationSample.ts new file mode 100644 index 00000000000..305c92f296d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesAuthorizeReplicationSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizeRequest, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Authorize the replication connection on the source volume + * + * @summary Authorize the replication connection on the source volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_AuthorizeReplication.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: AuthorizeRequest = { + remoteVolumeResourceId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRemoteRG/providers/Microsoft.NetApp/netAppAccounts/remoteAccount1/capacityPools/remotePool1/volumes/remoteVolume1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginAuthorizeReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesAuthorizeReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesBreakReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesBreakReplicationSample.ts new file mode 100644 index 00000000000..2780e2abd42 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesBreakReplicationSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BreakReplicationRequest, + VolumesBreakReplicationOptionalParams, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Break the replication connection on the destination volume + * + * @summary Break the replication connection on the destination volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_BreakReplication.json + */ +async function volumesBreakReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: BreakReplicationRequest = { forceBreakReplication: false }; + const options: VolumesBreakReplicationOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginBreakReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + options + ); + console.log(result); +} + +volumesBreakReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesCreateOrUpdateSample.ts new file mode 100644 index 00000000000..4d817bdd1c2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Volume, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the specified volume within the capacity pool + * + * @summary Create or update the specified volume within the capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_CreateOrUpdate.json + */ +async function volumesCreateOrUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: Volume = { + creationToken: "my-unique-file-path", + encryptionKeySource: "Microsoft.KeyVault", + location: "eastus", + serviceLevel: "Premium", + subnetId: + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 128, + usageThreshold: 107374182400 + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesCreateOrUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesDeleteReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesDeleteReplicationSample.ts new file mode 100644 index 00000000000..b39f7541e4c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesDeleteReplicationSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the replication connection on the destination volume, and send release to the source replication + * + * @summary Delete the replication connection on the destination volume, and send release to the source replication + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_DeleteReplication.json + */ +async function volumesDeleteReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginDeleteReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesDeleteReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesDeleteSample.ts new file mode 100644 index 00000000000..37603993b87 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the specified volume + * + * @summary Delete the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Delete.json + */ +async function volumesDelete() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesDelete().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesGetSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesGetSample.ts new file mode 100644 index 00000000000..124f95d9a69 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the details of the specified volume + * + * @summary Get the details of the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Get.json + */ +async function volumesGet() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.get( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesGet().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesListSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesListSample.ts new file mode 100644 index 00000000000..be1aaef2568 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all volumes within the capacity pool + * + * @summary List all volumes within the capacity pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_List.json + */ +async function volumesList() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.list( + resourceGroupName, + accountName, + poolName + )) { + resArray.push(item); + } + console.log(resArray); +} + +volumesList().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesPoolChangeSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesPoolChangeSample.ts new file mode 100644 index 00000000000..1c1e2f8d2b9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesPoolChangeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PoolChangeRequest, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Moves volume to another pool + * + * @summary Moves volume to another pool + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_PoolChange.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: PoolChangeRequest = { + newPoolResourceId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginPoolChangeAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesAuthorizeReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesReInitializeReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesReInitializeReplicationSample.ts new file mode 100644 index 00000000000..10c6b937f9c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesReInitializeReplicationSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Re-Initializes the replication connection on the destination volume + * + * @summary Re-Initializes the replication connection on the destination volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReInitializeReplication.json + */ +async function volumesReInitializeReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginReInitializeReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesReInitializeReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesReplicationStatusSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesReplicationStatusSample.ts new file mode 100644 index 00000000000..0ce3629fedb --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesReplicationStatusSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the status of the replication + * + * @summary Get the status of the replication + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ReplicationStatus.json + */ +async function volumesReplicationStatus() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.replicationStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesReplicationStatus().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesResyncReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesResyncReplicationSample.ts new file mode 100644 index 00000000000..28d336c6006 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesResyncReplicationSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @summary Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_ResyncReplication.json + */ +async function volumesResyncReplication() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginResyncReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +volumesResyncReplication().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesRevertSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesRevertSample.ts new file mode 100644 index 00000000000..e9db73e561e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesRevertSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VolumeRevert, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Revert a volume to the snapshot specified in the body + * + * @summary Revert a volume to the snapshot specified in the body + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Revert.json + */ +async function volumesRevert() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: VolumeRevert = { + snapshotId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginRevertAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesRevert().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesUpdateSample.ts new file mode 100644 index 00000000000..43631a23ad3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/src/volumesUpdateSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VolumePatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patch the specified volume + * + * @summary Patch the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2021-10-01/examples/Volumes_Update.json + */ +async function volumesUpdate() { + const subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: VolumePatch = {}; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +volumesUpdate().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v15/typescript/tsconfig.json b/sdk/netapp/arm-netapp/samples/v15/typescript/tsconfig.json new file mode 100644 index 00000000000..416c2dd82e0 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v15/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/netapp/arm-netapp/src/models/index.ts b/sdk/netapp/arm-netapp/src/models/index.ts index 7c71e6ebbce..2d7d17e641a 100644 --- a/sdk/netapp/arm-netapp/src/models/index.ts +++ b/sdk/netapp/arm-netapp/src/models/index.ts @@ -277,6 +277,18 @@ export interface ActiveDirectory { allowLocalNfsUsersWithLdap?: boolean; /** If enabled, Traffic between the SMB server to Domain Controller (DC) will be encrypted. */ encryptDCConnections?: boolean; + /** LDAP Search scope options */ + ldapSearchScope?: LdapSearchScopeOpt; +} + +/** LDAP search scope */ +export interface LdapSearchScopeOpt { + /** This specifies the user DN, which overrides the base DN for user lookups. */ + userDN?: string; + /** This specifies the group DN, which overrides the base DN for group lookups. */ + groupDN?: string; + /** This specifies the custom LDAP search filter to be used when looking up group membership from LDAP server. */ + groupMembershipFilter?: string; } /** Encryption settings */ @@ -365,12 +377,17 @@ export interface CapacityPool { readonly type?: string; /** Resource tags */ tags?: { [propertyName: string]: string }; + /** + * The system meta data relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; /** * UUID v4 used to identify the Pool * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly poolId?: string; - /** Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). */ + /** Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104). */ size: number; /** The service level of the file system */ serviceLevel: ServiceLevel; @@ -418,7 +435,7 @@ export interface CapacityPoolPatch { readonly type?: string; /** Resource tags */ tags?: { [propertyName: string]: string }; - /** Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). */ + /** Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104). */ size?: number; /** The qos type of the pool */ qosType?: QosType; @@ -458,6 +475,11 @@ export interface Volume { readonly type?: string; /** Resource tags */ tags?: { [propertyName: string]: string }; + /** + * The system meta data relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; /** * Unique FileSystem Identifier. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -547,6 +569,11 @@ export interface Volume { defaultUserQuotaInKiBs?: number; /** Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. */ defaultGroupQuotaInKiBs?: number; + /** + * Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maximumNumberOfFiles?: number; /** * Volume Group Name * NOTE: This property will not be serialized. It can only be populated by the server. @@ -565,6 +592,8 @@ export interface Volume { volumeSpecName?: string; /** Application specific placement rules for the particular volume */ placementRules?: PlacementKeyValuePairs[]; + /** Flag indicating whether subvolume operations are enabled on the volume */ + enableSubvolumes?: EnableSubvolumes; } /** Set of export policy rules */ @@ -712,6 +741,8 @@ export interface VolumePatch { defaultUserQuotaInKiBs?: number; /** Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. */ defaultGroupQuotaInKiBs?: number; + /** UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. */ + unixPermissions?: string; } /** Set of export policy rules */ @@ -808,6 +839,14 @@ export interface Snapshot { readonly provisioningState?: string; } +/** Restore payload for Single File Snapshot Restore */ +export interface SnapshotRestoreFiles { + /** List of files to be restored */ + filePaths: string[]; + /** Destination folder where the files will be restored */ + destinationPath?: string; +} + /** List of Snapshot Policies */ export interface SnapshotPoliciesList { /** A list of snapshot policies */ @@ -840,6 +879,11 @@ export interface SnapshotPolicy { readonly type?: string; /** Resource tags */ tags?: { [propertyName: string]: string }; + /** + * The system meta data relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; /** Schedule for hourly snapshots */ hourlySchedule?: HourlySchedule; /** Schedule for daily snapshots */ @@ -1172,6 +1216,11 @@ export interface BackupPolicy { readonly type?: string; /** Resource tags */ tags?: { [propertyName: string]: string }; + /** + * The system meta data relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; /** * Backup Policy Resource ID * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1484,6 +1533,11 @@ export interface VolumeGroupVolumeProperties { defaultUserQuotaInKiBs?: number; /** Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. */ defaultGroupQuotaInKiBs?: number; + /** + * Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maximumNumberOfFiles?: number; /** * Volume Group Name * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1502,6 +1556,63 @@ export interface VolumeGroupVolumeProperties { volumeSpecName?: string; /** Application specific placement rules for the particular volume */ placementRules?: PlacementKeyValuePairs[]; + /** Flag indicating whether subvolume operations are enabled on the volume */ + enableSubvolumes?: EnableSubvolumes; +} + +/** List of Subvolumes */ +export interface SubvolumesList { + /** A list of Subvolumes */ + value?: SubvolumeInfo[]; + /** URL to get the next set of results. */ + nextLink?: string; +} + +/** Subvolume Patch Request properties */ +export interface SubvolumePatchRequest { + /** Truncate subvolume to the provided size in bytes */ + size?: number; + /** path to the subvolume */ + path?: string; +} + +/** Result of the post subvolume and action is to get metadata of the subvolume. */ +export interface SubvolumeModel { + /** + * Resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Resource name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Resource type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Path to the subvolume */ + path?: string; + /** Path to the parent subvolume */ + parentPath?: string; + /** Size of subvolume */ + size?: number; + /** Bytes used */ + bytesUsed?: number; + /** Permissions of the subvolume */ + permissions?: string; + /** Creation time and date */ + creationTimeStamp?: Date; + /** Most recent access time and date */ + accessedTimeStamp?: Date; + /** Most recent modification time and date */ + modifiedTimeStamp?: Date; + /** Most recent change time and date */ + changedTimeStamp?: Date; + /** Azure lifecycle management */ + provisioningState?: string; } /** Identity for the resource. */ @@ -1668,6 +1779,26 @@ export type SubscriptionQuotaItem = ProxyResource & { readonly default?: number; }; +/** Subvolume Information properties */ +export type SubvolumeInfo = ProxyResource & { + /** + * The system meta data relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Path to the subvolume */ + path?: string; + /** Truncate subvolume to the provided size in bytes */ + size?: number; + /** parent path to the subvolume */ + parentPath?: string; + /** + * Azure lifecycle management + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + /** Known values of {@link MetricAggregationType} that the service accepts. */ export enum KnownMetricAggregationType { Average = "Average" @@ -1968,6 +2099,24 @@ export enum KnownAvsDataStore { */ export type AvsDataStore = string; +/** Known values of {@link EnableSubvolumes} that the service accepts. */ +export enum KnownEnableSubvolumes { + /** subvolumes are enabled */ + Enabled = "Enabled", + /** subvolumes are not enabled */ + Disabled = "Disabled" +} + +/** + * Defines values for EnableSubvolumes. \ + * {@link KnownEnableSubvolumes} can be used interchangeably with EnableSubvolumes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled**: subvolumes are enabled \ + * **Disabled**: subvolumes are not enabled + */ +export type EnableSubvolumes = string; + /** Known values of {@link RelationshipStatus} that the service accepts. */ export enum KnownRelationshipStatus { Idle = "Idle", @@ -2234,6 +2383,8 @@ export type VolumesUpdateResponse = Volume; /** Optional parameters. */ export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { + /** An option to force delete the volume. Will cleanup resources connected to the particular volume */ + forceDelete?: boolean; /** 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. */ @@ -2366,6 +2517,15 @@ export interface SnapshotsDeleteOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface SnapshotsRestoreFilesOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + /** Optional parameters. */ export interface SnapshotPoliciesListOptionalParams extends coreClient.OperationOptions {} @@ -2588,6 +2748,72 @@ export interface VolumeGroupsDeleteOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface SubvolumesListByVolumeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVolume operation. */ +export type SubvolumesListByVolumeResponse = SubvolumesList; + +/** Optional parameters. */ +export interface SubvolumesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SubvolumesGetResponse = SubvolumeInfo; + +/** Optional parameters. */ +export interface SubvolumesCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type SubvolumesCreateResponse = SubvolumeInfo; + +/** Optional parameters. */ +export interface SubvolumesUpdateOptionalParams + 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 SubvolumesUpdateResponse = SubvolumeInfo; + +/** Optional parameters. */ +export interface SubvolumesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface SubvolumesGetMetadataOptionalParams + 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 getMetadata operation. */ +export type SubvolumesGetMetadataResponse = SubvolumeModel; + +/** Optional parameters. */ +export interface SubvolumesListByVolumeNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVolumeNext operation. */ +export type SubvolumesListByVolumeNextResponse = SubvolumesList; + /** Optional parameters. */ export interface NetAppManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/netapp/arm-netapp/src/models/mappers.ts b/sdk/netapp/arm-netapp/src/models/mappers.ts index f722fc43fd3..0616182ef74 100644 --- a/sdk/netapp/arm-netapp/src/models/mappers.ts +++ b/sdk/netapp/arm-netapp/src/models/mappers.ts @@ -789,6 +789,49 @@ export const ActiveDirectory: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + ldapSearchScope: { + serializedName: "ldapSearchScope", + type: { + name: "Composite", + className: "LdapSearchScopeOpt" + } + } + } + } +}; + +export const LdapSearchScopeOpt: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LdapSearchScopeOpt", + modelProperties: { + userDN: { + constraints: { + MaxLength: 255 + }, + serializedName: "userDN", + type: { + name: "String" + } + }, + groupDN: { + constraints: { + MaxLength: 255 + }, + serializedName: "groupDN", + type: { + name: "String" + } + }, + groupMembershipFilter: { + constraints: { + MaxLength: 255 + }, + serializedName: "groupMembershipFilter", + type: { + name: "String" + } } } } @@ -989,6 +1032,13 @@ export const CapacityPool: coreClient.CompositeMapper = { value: { type: { name: "String" } } } }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, poolId: { constraints: { Pattern: new RegExp( @@ -1004,10 +1054,7 @@ export const CapacityPool: coreClient.CompositeMapper = { } }, size: { - constraints: { - InclusiveMaximum: 549755813888000, - InclusiveMinimum: 4398046511104 - }, + defaultValue: 4398046511104, serializedName: "properties.size", required: true, type: { @@ -1109,10 +1156,6 @@ export const CapacityPoolPatch: coreClient.CompositeMapper = { }, size: { defaultValue: 4398046511104, - constraints: { - InclusiveMaximum: 549755813888000, - InclusiveMinimum: 4398046511104 - }, serializedName: "properties.size", type: { name: "Number" @@ -1202,6 +1245,13 @@ export const Volume: coreClient.CompositeMapper = { value: { type: { name: "String" } } } }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, fileSystemId: { constraints: { Pattern: new RegExp( @@ -1494,6 +1544,13 @@ export const Volume: coreClient.CompositeMapper = { name: "Number" } }, + maximumNumberOfFiles: { + serializedName: "properties.maximumNumberOfFiles", + readOnly: true, + type: { + name: "Number" + } + }, volumeGroupName: { serializedName: "properties.volumeGroupName", readOnly: true, @@ -1537,6 +1594,13 @@ export const Volume: coreClient.CompositeMapper = { } } } + }, + enableSubvolumes: { + defaultValue: "Disabled", + serializedName: "properties.enableSubvolumes", + type: { + name: "String" + } } } } @@ -1959,6 +2023,17 @@ export const VolumePatch: coreClient.CompositeMapper = { type: { name: "Number" } + }, + unixPermissions: { + constraints: { + MaxLength: 4, + MinLength: 4 + }, + serializedName: "properties.unixPermissions", + nullable: true, + type: { + name: "String" + } } } } @@ -2194,6 +2269,41 @@ export const Snapshot: coreClient.CompositeMapper = { } }; +export const SnapshotRestoreFiles: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotRestoreFiles", + modelProperties: { + filePaths: { + constraints: { + MinItems: 1, + MaxItems: 10 + }, + serializedName: "filePaths", + required: true, + type: { + name: "Sequence", + element: { + constraints: { + MaxLength: 1024, + MinLength: 1 + }, + type: { + name: "String" + } + } + } + }, + destinationPath: { + serializedName: "destinationPath", + type: { + name: "String" + } + } + } + } +}; + export const SnapshotPoliciesList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2262,6 +2372,13 @@ export const SnapshotPolicy: coreClient.CompositeMapper = { value: { type: { name: "String" } } } }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, hourlySchedule: { serializedName: "properties.hourlySchedule", type: { @@ -2946,6 +3063,13 @@ export const BackupPolicy: coreClient.CompositeMapper = { value: { type: { name: "String" } } } }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, backupPolicyId: { serializedName: "properties.backupPolicyId", readOnly: true, @@ -3723,6 +3847,13 @@ export const VolumeGroupVolumeProperties: coreClient.CompositeMapper = { name: "Number" } }, + maximumNumberOfFiles: { + serializedName: "properties.maximumNumberOfFiles", + readOnly: true, + type: { + name: "Number" + } + }, volumeGroupName: { serializedName: "properties.volumeGroupName", readOnly: true, @@ -3766,6 +3897,152 @@ export const VolumeGroupVolumeProperties: coreClient.CompositeMapper = { } } } + }, + enableSubvolumes: { + defaultValue: "Disabled", + serializedName: "properties.enableSubvolumes", + type: { + name: "String" + } + } + } + } +}; + +export const SubvolumesList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubvolumesList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubvolumeInfo" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SubvolumePatchRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubvolumePatchRequest", + modelProperties: { + size: { + serializedName: "properties.size", + nullable: true, + type: { + name: "Number" + } + }, + path: { + serializedName: "properties.path", + type: { + name: "String" + } + } + } + } +}; + +export const SubvolumeModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubvolumeModel", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + path: { + serializedName: "properties.path", + type: { + name: "String" + } + }, + parentPath: { + serializedName: "properties.parentPath", + type: { + name: "String" + } + }, + size: { + serializedName: "properties.size", + type: { + name: "Number" + } + }, + bytesUsed: { + serializedName: "properties.bytesUsed", + type: { + name: "Number" + } + }, + permissions: { + serializedName: "properties.permissions", + type: { + name: "String" + } + }, + creationTimeStamp: { + serializedName: "properties.creationTimeStamp", + type: { + name: "DateTime" + } + }, + accessedTimeStamp: { + serializedName: "properties.accessedTimeStamp", + type: { + name: "DateTime" + } + }, + modifiedTimeStamp: { + serializedName: "properties.modifiedTimeStamp", + type: { + name: "DateTime" + } + }, + changedTimeStamp: { + serializedName: "properties.changedTimeStamp", + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } } } } @@ -4110,3 +4387,47 @@ export const SubscriptionQuotaItem: coreClient.CompositeMapper = { } } }; + +export const SubvolumeInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubvolumeInfo", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + path: { + serializedName: "properties.path", + type: { + name: "String" + } + }, + size: { + serializedName: "properties.size", + nullable: true, + type: { + name: "Number" + } + }, + parentPath: { + serializedName: "properties.parentPath", + nullable: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/netapp/arm-netapp/src/models/parameters.ts b/sdk/netapp/arm-netapp/src/models/parameters.ts index 4a5b9b1b405..c56539b9424 100644 --- a/sdk/netapp/arm-netapp/src/models/parameters.ts +++ b/sdk/netapp/arm-netapp/src/models/parameters.ts @@ -26,13 +26,16 @@ import { AuthorizeRequest as AuthorizeRequestMapper, PoolChangeRequest as PoolChangeRequestMapper, Snapshot as SnapshotMapper, + SnapshotRestoreFiles as SnapshotRestoreFilesMapper, SnapshotPolicy as SnapshotPolicyMapper, SnapshotPolicyPatch as SnapshotPolicyPatchMapper, Backup as BackupMapper, BackupPatch as BackupPatchMapper, BackupPolicy as BackupPolicyMapper, BackupPolicyPatch as BackupPolicyPatchMapper, - VolumeGroupDetails as VolumeGroupDetailsMapper + VolumeGroupDetails as VolumeGroupDetailsMapper, + SubvolumeInfo as SubvolumeInfoMapper, + SubvolumePatchRequest as SubvolumePatchRequestMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -62,7 +65,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-08-01", + defaultValue: "2021-10-01", isConstant: true, serializedName: "api-version", type: { @@ -257,6 +260,16 @@ export const body8: OperationParameter = { mapper: VolumePatchMapper }; +export const forceDelete: OperationQueryParameter = { + parameterPath: ["options", "forceDelete"], + mapper: { + serializedName: "forceDelete", + type: { + name: "Boolean" + } + } +}; + export const body9: OperationParameter = { parameterPath: "body", mapper: VolumeRevertMapper @@ -305,6 +318,11 @@ export const body14: OperationParameter = { } }; +export const body15: OperationParameter = { + parameterPath: "body", + mapper: SnapshotRestoreFilesMapper +}; + export const snapshotPolicyName: OperationURLParameter = { parameterPath: "snapshotPolicyName", mapper: { @@ -316,12 +334,12 @@ export const snapshotPolicyName: OperationURLParameter = { } }; -export const body15: OperationParameter = { +export const body16: OperationParameter = { parameterPath: "body", mapper: SnapshotPolicyMapper }; -export const body16: OperationParameter = { +export const body17: OperationParameter = { parameterPath: "body", mapper: SnapshotPolicyPatchMapper }; @@ -337,12 +355,12 @@ export const backupName: OperationURLParameter = { } }; -export const body17: OperationParameter = { +export const body18: OperationParameter = { parameterPath: "body", mapper: BackupMapper }; -export const body18: OperationParameter = { +export const body19: OperationParameter = { parameterPath: ["options", "body"], mapper: BackupPatchMapper }; @@ -358,12 +376,12 @@ export const backupPolicyName: OperationURLParameter = { } }; -export const body19: OperationParameter = { +export const body20: OperationParameter = { parameterPath: "body", mapper: BackupPolicyMapper }; -export const body20: OperationParameter = { +export const body21: OperationParameter = { parameterPath: "body", mapper: BackupPolicyPatchMapper }; @@ -384,7 +402,33 @@ export const volumeGroupName: OperationURLParameter = { } }; -export const body21: OperationParameter = { +export const body22: OperationParameter = { parameterPath: "body", mapper: VolumeGroupDetailsMapper }; + +export const subvolumeName: OperationURLParameter = { + parameterPath: "subvolumeName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"), + MaxLength: 64, + MinLength: 1 + }, + serializedName: "subvolumeName", + required: true, + type: { + name: "String" + } + } +}; + +export const body23: OperationParameter = { + parameterPath: "body", + mapper: SubvolumeInfoMapper +}; + +export const body24: OperationParameter = { + parameterPath: "body", + mapper: SubvolumePatchRequestMapper +}; diff --git a/sdk/netapp/arm-netapp/src/netAppManagementClient.ts b/sdk/netapp/arm-netapp/src/netAppManagementClient.ts index 52b8477db46..68430b97ffd 100644 --- a/sdk/netapp/arm-netapp/src/netAppManagementClient.ts +++ b/sdk/netapp/arm-netapp/src/netAppManagementClient.ts @@ -21,7 +21,8 @@ import { AccountBackupsImpl, BackupPoliciesImpl, VaultsImpl, - VolumeGroupsImpl + VolumeGroupsImpl, + SubvolumesImpl } from "./operations"; import { Operations, @@ -36,7 +37,8 @@ import { AccountBackups, BackupPolicies, Vaults, - VolumeGroups + VolumeGroups, + Subvolumes } from "./operationsInterfaces"; import { NetAppManagementClientOptionalParams } from "./models"; @@ -73,7 +75,7 @@ export class NetAppManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-netapp/15.0.0`; + const packageDetails = `azsdk-js-arm-netapp/15.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -96,7 +98,7 @@ export class NetAppManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-08-01"; + this.apiVersion = options.apiVersion || "2021-10-01"; this.operations = new OperationsImpl(this); this.netAppResource = new NetAppResourceImpl(this); this.netAppResourceQuotaLimits = new NetAppResourceQuotaLimitsImpl(this); @@ -110,6 +112,7 @@ export class NetAppManagementClient extends coreClient.ServiceClient { this.backupPolicies = new BackupPoliciesImpl(this); this.vaults = new VaultsImpl(this); this.volumeGroups = new VolumeGroupsImpl(this); + this.subvolumes = new SubvolumesImpl(this); } operations: Operations; @@ -125,4 +128,5 @@ export class NetAppManagementClient extends coreClient.ServiceClient { backupPolicies: BackupPolicies; vaults: Vaults; volumeGroups: VolumeGroups; + subvolumes: Subvolumes; } diff --git a/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts b/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts index fa08e649539..e61cf620d53 100644 --- a/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts +++ b/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts @@ -466,7 +466,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body19, + requestBody: Parameters.body20, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -498,7 +498,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body20, + requestBody: Parameters.body21, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/netapp/arm-netapp/src/operations/backups.ts b/sdk/netapp/arm-netapp/src/operations/backups.ts index 3c8ff14640b..97a5aa3f7e9 100644 --- a/sdk/netapp/arm-netapp/src/operations/backups.ts +++ b/sdk/netapp/arm-netapp/src/operations/backups.ts @@ -643,7 +643,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body17, + requestBody: Parameters.body18, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -677,7 +677,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body18, + requestBody: Parameters.body19, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/netapp/arm-netapp/src/operations/index.ts b/sdk/netapp/arm-netapp/src/operations/index.ts index f7bd6727d8c..cec2cd1de8a 100644 --- a/sdk/netapp/arm-netapp/src/operations/index.ts +++ b/sdk/netapp/arm-netapp/src/operations/index.ts @@ -19,3 +19,4 @@ export * from "./accountBackups"; export * from "./backupPolicies"; export * from "./vaults"; export * from "./volumeGroups"; +export * from "./subvolumes"; diff --git a/sdk/netapp/arm-netapp/src/operations/snapshotPolicies.ts b/sdk/netapp/arm-netapp/src/operations/snapshotPolicies.ts index fc2b1d058bd..7deab79459f 100644 --- a/sdk/netapp/arm-netapp/src/operations/snapshotPolicies.ts +++ b/sdk/netapp/arm-netapp/src/operations/snapshotPolicies.ts @@ -406,7 +406,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body15, + requestBody: Parameters.body16, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -438,7 +438,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body16, + requestBody: Parameters.body17, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/netapp/arm-netapp/src/operations/snapshots.ts b/sdk/netapp/arm-netapp/src/operations/snapshots.ts index e3848b734a4..efda5346ae0 100644 --- a/sdk/netapp/arm-netapp/src/operations/snapshots.ts +++ b/sdk/netapp/arm-netapp/src/operations/snapshots.ts @@ -24,7 +24,9 @@ import { SnapshotsCreateResponse, SnapshotsUpdateOptionalParams, SnapshotsUpdateResponse, - SnapshotsDeleteOptionalParams + SnapshotsDeleteOptionalParams, + SnapshotRestoreFiles, + SnapshotsRestoreFilesOptionalParams } from "../models"; /// @@ -497,6 +499,114 @@ export class SnapshotsImpl implements Snapshots { ); return poller.pollUntilDone(); } + + /** + * Restore the specified files from the specified snapshot to the active filesystem + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the snapshot + * @param body Restore payload supplied in the body of the operation. + * @param options The options parameters. + */ + async beginRestoreFiles( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + snapshotName: string, + body: SnapshotRestoreFiles, + options?: SnapshotsRestoreFilesOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body, + options + }, + restoreFilesOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Restore the specified files from the specified snapshot to the active filesystem + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the snapshot + * @param body Restore payload supplied in the body of the operation. + * @param options The options parameters. + */ + async beginRestoreFilesAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + snapshotName: string, + body: SnapshotRestoreFiles, + options?: SnapshotsRestoreFilesOptionalParams + ): Promise { + const poller = await this.beginRestoreFiles( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + body, + options + ); + return poller.pollUntilDone(); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -631,3 +741,23 @@ const deleteOperationSpec: coreClient.OperationSpec = { ], serializer }; +const restoreFilesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles", + httpMethod: "POST", + responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, + requestBody: Parameters.body15, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName, + Parameters.snapshotName + ], + headerParameters: [Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/netapp/arm-netapp/src/operations/subvolumes.ts b/sdk/netapp/arm-netapp/src/operations/subvolumes.ts new file mode 100644 index 00000000000..35f94501346 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operations/subvolumes.ts @@ -0,0 +1,843 @@ +/* + * 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 { Subvolumes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetAppManagementClient } from "../netAppManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SubvolumeInfo, + SubvolumesListByVolumeNextOptionalParams, + SubvolumesListByVolumeOptionalParams, + SubvolumesListByVolumeResponse, + SubvolumesGetOptionalParams, + SubvolumesGetResponse, + SubvolumesCreateOptionalParams, + SubvolumesCreateResponse, + SubvolumePatchRequest, + SubvolumesUpdateOptionalParams, + SubvolumesUpdateResponse, + SubvolumesDeleteOptionalParams, + SubvolumesGetMetadataOptionalParams, + SubvolumesGetMetadataResponse, + SubvolumesListByVolumeNextResponse +} from "../models"; + +/// +/** Class containing Subvolumes operations. */ +export class SubvolumesImpl implements Subvolumes { + private readonly client: NetAppManagementClient; + + /** + * Initialize a new instance of the class Subvolumes class. + * @param client Reference to the service client + */ + constructor(client: NetAppManagementClient) { + this.client = client; + } + + /** + * Returns a list of the subvolumes in the volume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param options The options parameters. + */ + public listByVolume( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: SubvolumesListByVolumeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByVolumePagingAll( + resourceGroupName, + accountName, + poolName, + volumeName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByVolumePagingPage( + resourceGroupName, + accountName, + poolName, + volumeName, + options + ); + } + }; + } + + private async *listByVolumePagingPage( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: SubvolumesListByVolumeOptionalParams + ): AsyncIterableIterator { + let result = await this._listByVolume( + resourceGroupName, + accountName, + poolName, + volumeName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByVolumeNext( + resourceGroupName, + accountName, + poolName, + volumeName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByVolumePagingAll( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: SubvolumesListByVolumeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByVolumePagingPage( + resourceGroupName, + accountName, + poolName, + volumeName, + options + )) { + yield* page; + } + } + + /** + * Returns a list of the subvolumes in the volume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param options The options parameters. + */ + private _listByVolume( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: SubvolumesListByVolumeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, poolName, volumeName, options }, + listByVolumeOperationSpec + ); + } + + /** + * Returns the path associated with the subvolumeName provided + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + options + }, + getOperationSpec + ); + } + + /** + * Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param body Subvolume object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + body: SubvolumeInfo, + options?: SubvolumesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SubvolumesCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body, + options + }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param body Subvolume object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + body: SubvolumeInfo, + options?: SubvolumesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Patch a subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param body Subvolume object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + body: SubvolumePatchRequest, + options?: SubvolumesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SubvolumesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body, + options + }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Patch a subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param body Subvolume object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + body: SubvolumePatchRequest, + options?: SubvolumesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + options + }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Delete subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get details of the specified subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + async beginGetMetadata( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesGetMetadataOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SubvolumesGetMetadataResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + options + }, + getMetadataOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Get details of the specified subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + async beginGetMetadataAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesGetMetadataOptionalParams + ): Promise { + const poller = await this.beginGetMetadata( + resourceGroupName, + accountName, + poolName, + volumeName, + subvolumeName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByVolumeNext + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param nextLink The nextLink from the previous successful call to the ListByVolume method. + * @param options The options parameters. + */ + private _listByVolumeNext( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + nextLink: string, + options?: SubvolumesListByVolumeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + poolName, + volumeName, + nextLink, + options + }, + listByVolumeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByVolumeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SubvolumesList + }, + default: {} + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SubvolumeInfo + }, + default: {} + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName, + Parameters.subvolumeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.SubvolumeInfo + }, + 201: { + bodyMapper: Mappers.SubvolumeInfo + }, + 202: { + bodyMapper: Mappers.SubvolumeInfo + }, + 204: { + bodyMapper: Mappers.SubvolumeInfo + }, + default: {} + }, + requestBody: Parameters.body23, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName, + Parameters.subvolumeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.SubvolumeInfo + }, + 201: { + bodyMapper: Mappers.SubvolumeInfo + }, + 202: { + bodyMapper: Mappers.SubvolumeInfo + }, + 204: { + bodyMapper: Mappers.SubvolumeInfo + }, + default: {} + }, + requestBody: Parameters.body24, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName, + Parameters.subvolumeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName, + Parameters.subvolumeName + ], + serializer +}; +const getMetadataOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SubvolumeModel + }, + 201: { + bodyMapper: Mappers.SubvolumeModel + }, + 202: { + bodyMapper: Mappers.SubvolumeModel + }, + 204: { + bodyMapper: Mappers.SubvolumeModel + }, + default: {} + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName, + Parameters.subvolumeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVolumeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SubvolumesList + }, + default: {} + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.nextLink, + Parameters.poolName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/netapp/arm-netapp/src/operations/volumeGroups.ts b/sdk/netapp/arm-netapp/src/operations/volumeGroups.ts index 05ddd2287ad..223227815f6 100644 --- a/sdk/netapp/arm-netapp/src/operations/volumeGroups.ts +++ b/sdk/netapp/arm-netapp/src/operations/volumeGroups.ts @@ -378,7 +378,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body21, + requestBody: Parameters.body22, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/netapp/arm-netapp/src/operations/volumes.ts b/sdk/netapp/arm-netapp/src/operations/volumes.ts index 9869c054324..c5f79c3d846 100644 --- a/sdk/netapp/arm-netapp/src/operations/volumes.ts +++ b/sdk/netapp/arm-netapp/src/operations/volumes.ts @@ -1282,7 +1282,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", httpMethod: "DELETE", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion, Parameters.forceDelete], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/index.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/index.ts index f7bd6727d8c..cec2cd1de8a 100644 --- a/sdk/netapp/arm-netapp/src/operationsInterfaces/index.ts +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/index.ts @@ -19,3 +19,4 @@ export * from "./accountBackups"; export * from "./backupPolicies"; export * from "./vaults"; export * from "./volumeGroups"; +export * from "./subvolumes"; diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/snapshots.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/snapshots.ts index ae359c2df85..636da031483 100644 --- a/sdk/netapp/arm-netapp/src/operationsInterfaces/snapshots.ts +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/snapshots.ts @@ -17,7 +17,9 @@ import { SnapshotsCreateResponse, SnapshotsUpdateOptionalParams, SnapshotsUpdateResponse, - SnapshotsDeleteOptionalParams + SnapshotsDeleteOptionalParams, + SnapshotRestoreFiles, + SnapshotsRestoreFilesOptionalParams } from "../models"; /// @@ -175,4 +177,42 @@ export interface Snapshots { snapshotName: string, options?: SnapshotsDeleteOptionalParams ): Promise; + /** + * Restore the specified files from the specified snapshot to the active filesystem + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the snapshot + * @param body Restore payload supplied in the body of the operation. + * @param options The options parameters. + */ + beginRestoreFiles( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + snapshotName: string, + body: SnapshotRestoreFiles, + options?: SnapshotsRestoreFilesOptionalParams + ): Promise, void>>; + /** + * Restore the specified files from the specified snapshot to the active filesystem + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the snapshot + * @param body Restore payload supplied in the body of the operation. + * @param options The options parameters. + */ + beginRestoreFilesAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + snapshotName: string, + body: SnapshotRestoreFiles, + options?: SnapshotsRestoreFilesOptionalParams + ): Promise; } diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/subvolumes.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/subvolumes.ts new file mode 100644 index 00000000000..eeaa6fdc978 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/subvolumes.ts @@ -0,0 +1,220 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + SubvolumeInfo, + SubvolumesListByVolumeOptionalParams, + SubvolumesGetOptionalParams, + SubvolumesGetResponse, + SubvolumesCreateOptionalParams, + SubvolumesCreateResponse, + SubvolumePatchRequest, + SubvolumesUpdateOptionalParams, + SubvolumesUpdateResponse, + SubvolumesDeleteOptionalParams, + SubvolumesGetMetadataOptionalParams, + SubvolumesGetMetadataResponse +} from "../models"; + +/// +/** Interface representing a Subvolumes. */ +export interface Subvolumes { + /** + * Returns a list of the subvolumes in the volume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param options The options parameters. + */ + listByVolume( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: SubvolumesListByVolumeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the path associated with the subvolumeName provided + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesGetOptionalParams + ): Promise; + /** + * Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param body Subvolume object supplied in the body of the operation. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + body: SubvolumeInfo, + options?: SubvolumesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SubvolumesCreateResponse + > + >; + /** + * Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param body Subvolume object supplied in the body of the operation. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + body: SubvolumeInfo, + options?: SubvolumesCreateOptionalParams + ): Promise; + /** + * Patch a subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param body Subvolume object supplied in the body of the operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + body: SubvolumePatchRequest, + options?: SubvolumesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SubvolumesUpdateResponse + > + >; + /** + * Patch a subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param body Subvolume object supplied in the body of the operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + body: SubvolumePatchRequest, + options?: SubvolumesUpdateOptionalParams + ): Promise; + /** + * Delete subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesDeleteOptionalParams + ): Promise, void>>; + /** + * Delete subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesDeleteOptionalParams + ): Promise; + /** + * Get details of the specified subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + beginGetMetadata( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesGetMetadataOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SubvolumesGetMetadataResponse + > + >; + /** + * Get details of the specified subvolume + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param subvolumeName The name of the subvolume. + * @param options The options parameters. + */ + beginGetMetadataAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + subvolumeName: string, + options?: SubvolumesGetMetadataOptionalParams + ): Promise; +} diff --git a/sdk/netapp/arm-netapp/tsconfig.json b/sdk/netapp/arm-netapp/tsconfig.json index 6e325119411..1772b582234 100644 --- a/sdk/netapp/arm-netapp/tsconfig.json +++ b/sdk/netapp/arm-netapp/tsconfig.json @@ -9,11 +9,25 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true + "importHelpers": true, + "paths": { + "@azure/arm-netapp": [ + "./src/index" + ] + } }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/netapp/ci.mgmt.yml b/sdk/netapp/ci.mgmt.yml index 87badf170ce..4cbaa28ee94 100644 --- a/sdk/netapp/ci.mgmt.yml +++ b/sdk/netapp/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -9,7 +9,7 @@ trigger: paths: include: - sdk/netapp/ci.mgmt.yml - - sdk/netapp/arm-netapp/ + - sdk/netapp/arm-netapp pr: branches: include: @@ -22,12 +22,11 @@ pr: paths: include: - sdk/netapp/ci.mgmt.yml - - sdk/netapp/arm-netapp/ - + - sdk/netapp/arm-netapp extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: netapp Artifacts: - name: azure-arm-netapp - safeName: azurearmnetapp \ No newline at end of file + safeName: azurearmnetapp