diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 106e834388e1..39544a559a33 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13731,7 +13731,7 @@ packages: dev: false file:projects/arm-netapp.tgz: - resolution: {integrity: sha512-JuY85pR7uNmqpQRYf6M0GWE91ff4gCo9ogQOq7p4L3clH9H4xIMfM8RJR7+pUCmalg6V5wBSklwJPFWEka0iDw==, tarball: file:projects/arm-netapp.tgz} + resolution: {integrity: sha512-fLlv8y56IayUBD+7gyEH8Ego8aaiFhQSpKcJz9ZUgnVcoKKPovo6D8h9vAa3g6PxPRLml/ahXk+BCspdmMu5uA==, tarball: file:projects/arm-netapp.tgz} name: '@rush-temp/arm-netapp' version: 0.0.0 dependencies: @@ -13739,10 +13739,12 @@ packages: '@azure/identity': 3.4.1 '@microsoft/api-extractor': 7.38.5(@types/node@18.19.3) '@types/chai': 4.3.11 + '@types/mocha': 10.0.6 '@types/node': 18.19.3 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 rimraf: 5.0.5 @@ -16103,7 +16105,7 @@ packages: dev: false file:projects/communication-call-automation.tgz: - resolution: {integrity: sha512-FKPW5vU2WsVJMkdfZ5IxbcxDzNtzHPn9kKgePWgbzDE/uJxdOZXZG9VTzgPweJ8gNlgppHMcbLXRCMDsrhH/Hw==, tarball: file:projects/communication-call-automation.tgz} + resolution: {integrity: sha512-Uu1Q/G2ySL65PrMIYQF4EX/2GPmrPFyzXK9RbplZ0kR5dJhQrhNeDSGclEkwyFoXxS2BUiR/bZKmjej+9xC/Fw==, tarball: file:projects/communication-call-automation.tgz} name: '@rush-temp/communication-call-automation' version: 0.0.0 dependencies: @@ -16250,7 +16252,7 @@ packages: dev: false file:projects/communication-email.tgz: - resolution: {integrity: sha512-NuaGmhNTNl9+exQhHcX/xHhAB1dIyJ1eejSORDnC1VPLC+9KlGVbTkafNvlh7beBqbgjrFRzwicYkIwhZW2Y2A==, tarball: file:projects/communication-email.tgz} + resolution: {integrity: sha512-7+XicOkmzZimU6S+kOqbY29AFNai786TFQ4OcNax+kRxxVsaTu8NFEMfvNZL+PgRIlbcyQYU5/KsrRdKhNl9bg==, tarball: file:projects/communication-email.tgz} name: '@rush-temp/communication-email' version: 0.0.0 dependencies: @@ -16478,7 +16480,7 @@ packages: dev: false file:projects/communication-phone-numbers.tgz: - resolution: {integrity: sha512-E2L3evVu9vo9SVTON1ozq41juORw8e9vGnjIG73uLxflDhv80yAacAIajIZsvYMOCMRRWS4aOlfB7Ph/ePuTVQ==, tarball: file:projects/communication-phone-numbers.tgz} + resolution: {integrity: sha512-mHsSrhvInk2mTXZfgdow339HdZBxlEIuNKUKKhos2O59vDpPdWZ1ctkja6wccCYLab3VTRPobl8ZC4rm06VVKQ==, tarball: file:projects/communication-phone-numbers.tgz} name: '@rush-temp/communication-phone-numbers' version: 0.0.0 dependencies: @@ -16572,7 +16574,7 @@ packages: dev: false file:projects/communication-rooms.tgz: - resolution: {integrity: sha512-30NjuqlQLAQBGIBpOPDuFw0I+povzuwrS8uqVYcD3QkPZj1oKar187I3FsJf/Hct/DKrb8zgO2fYpcGP8WtKMA==, tarball: file:projects/communication-rooms.tgz} + resolution: {integrity: sha512-xCElsUhQUUazRCG41aPdBbz5WgeFd8G1bFNX+9Wc6iLOlMjOgmmqUpIYQ+F5XG8bW6qRDgrmj1sZK5MsJJ+mIQ==, tarball: file:projects/communication-rooms.tgz} name: '@rush-temp/communication-rooms' version: 0.0.0 dependencies: @@ -16656,7 +16658,7 @@ packages: dev: false file:projects/communication-sms.tgz: - resolution: {integrity: sha512-If8thN6fEW/+pzCVLKYKd3Ay1vEfjmKbPTqKNOuyispqJu2Qw3Bq1fHpc9i1ks3JZN2aQ2Iisq5UntdXcm/LRg==, tarball: file:projects/communication-sms.tgz} + resolution: {integrity: sha512-xM/+JwdTMQ+qY4zOn59ERBx1ygCF11ZdGuX5OjkEh6fCnu1Z2pSY+0qcwtryzOV7XddvMvQgIollmLIbUthvBw==, tarball: file:projects/communication-sms.tgz} name: '@rush-temp/communication-sms' version: 0.0.0 dependencies: @@ -16751,7 +16753,7 @@ packages: dev: false file:projects/communication-toll-free-verification.tgz: - resolution: {integrity: sha512-ap1OrQ//SaCRnwdy+a5aS6XJyAVJpePrjhv8aIZJsXvffbZji1hYjWepY+s/zGIsVN3rIWBT05QT3ewgii68gg==, tarball: file:projects/communication-toll-free-verification.tgz} + resolution: {integrity: sha512-Orh9bHnZUl3cKARGCqj8/liA4vTe7tzCjMMtVsiMDYuv239So9qvLj70XceDHbg+AMLnDbBOGfys2w1S7Sv8hQ==, tarball: file:projects/communication-toll-free-verification.tgz} name: '@rush-temp/communication-toll-free-verification' version: 0.0.0 dependencies: diff --git a/sdk/netapp/arm-netapp/CHANGELOG.md b/sdk/netapp/arm-netapp/CHANGELOG.md index d9c7e6209bd5..2aa9a356daaf 100644 --- a/sdk/netapp/arm-netapp/CHANGELOG.md +++ b/sdk/netapp/arm-netapp/CHANGELOG.md @@ -1,5 +1,124 @@ # Release History +## 20.0.0-beta.1 (2023-12-14) + +**Features** + + - Added operation group AccountBackups + - Added operation group BackupsUnderAccount + - Added operation group BackupsUnderBackupVault + - Added operation group BackupsUnderVolume + - Added operation group BackupVaults + - Added operation group NetAppResourceRegionInfos + - Added operation Accounts.beginMigrateEncryptionKey + - Added operation Accounts.beginMigrateEncryptionKeyAndWait + - Added operation Backups.beginCreate + - Added operation Backups.beginCreateAndWait + - Added operation Backups.beginDelete + - Added operation Backups.beginDeleteAndWait + - Added operation Backups.beginUpdate + - Added operation Backups.beginUpdateAndWait + - Added operation Backups.get + - Added operation Backups.getLatestStatus + - Added operation Backups.listByVault + - Added operation Volumes.beginSplitCloneFromParent + - Added operation Volumes.beginSplitCloneFromParentAndWait + - Added Interface AccountBackupsDeleteHeaders + - Added Interface AccountBackupsDeleteOptionalParams + - Added Interface AccountBackupsGetOptionalParams + - Added Interface AccountBackupsListByNetAppAccountOptionalParams + - Added Interface AccountsMigrateEncryptionKeyHeaders + - Added Interface AccountsMigrateEncryptionKeyOptionalParams + - Added Interface Backup + - Added Interface BackupPatch + - Added Interface BackupRestoreFiles + - Added Interface BackupsCreateOptionalParams + - Added Interface BackupsDeleteHeaders + - Added Interface BackupsDeleteOptionalParams + - Added Interface BackupsGetLatestStatusOptionalParams + - Added Interface BackupsGetOptionalParams + - Added Interface BackupsList + - Added Interface BackupsListByVaultNextOptionalParams + - Added Interface BackupsListByVaultOptionalParams + - Added Interface BackupsMigrationRequest + - Added Interface BackupStatus + - Added Interface BackupsUnderAccountMigrateBackupsHeaders + - Added Interface BackupsUnderAccountMigrateBackupsOptionalParams + - Added Interface BackupsUnderBackupVaultRestoreFilesHeaders + - Added Interface BackupsUnderBackupVaultRestoreFilesOptionalParams + - Added Interface BackupsUnderVolumeMigrateBackupsHeaders + - Added Interface BackupsUnderVolumeMigrateBackupsOptionalParams + - Added Interface BackupsUpdateHeaders + - Added Interface BackupsUpdateOptionalParams + - Added Interface BackupVault + - Added Interface BackupVaultPatch + - Added Interface BackupVaultsCreateOrUpdateOptionalParams + - Added Interface BackupVaultsDeleteHeaders + - Added Interface BackupVaultsDeleteOptionalParams + - Added Interface BackupVaultsGetOptionalParams + - Added Interface BackupVaultsList + - Added Interface BackupVaultsListByNetAppAccountNextOptionalParams + - Added Interface BackupVaultsListByNetAppAccountOptionalParams + - Added Interface BackupVaultsUpdateHeaders + - Added Interface BackupVaultsUpdateOptionalParams + - Added Interface EncryptionMigrationRequest + - Added Interface NetAppResourceRegionInfosGetOptionalParams + - Added Interface NetAppResourceRegionInfosListNextOptionalParams + - Added Interface NetAppResourceRegionInfosListOptionalParams + - Added Interface RegionInfoResource + - Added Interface RegionInfosList + - Added Interface RemotePath + - Added Interface VolumeBackupProperties + - Added Interface VolumesResetCifsPasswordHeaders + - Added Interface VolumesSplitCloneFromParentHeaders + - Added Interface VolumesSplitCloneFromParentOptionalParams + - Added Type Alias AccountBackupsDeleteResponse + - Added Type Alias AccountBackupsGetResponse + - Added Type Alias AccountBackupsListByNetAppAccountResponse + - Added Type Alias AccountsMigrateEncryptionKeyResponse + - Added Type Alias BackupsCreateResponse + - Added Type Alias BackupsDeleteResponse + - Added Type Alias BackupsGetLatestStatusResponse + - Added Type Alias BackupsGetResponse + - Added Type Alias BackupsListByVaultNextResponse + - Added Type Alias BackupsListByVaultResponse + - Added Type Alias BackupsUnderAccountMigrateBackupsResponse + - Added Type Alias BackupsUnderBackupVaultRestoreFilesResponse + - Added Type Alias BackupsUnderVolumeMigrateBackupsResponse + - Added Type Alias BackupsUpdateResponse + - Added Type Alias BackupType + - Added Type Alias BackupVaultsCreateOrUpdateResponse + - Added Type Alias BackupVaultsDeleteResponse + - Added Type Alias BackupVaultsGetResponse + - Added Type Alias BackupVaultsListByNetAppAccountNextResponse + - Added Type Alias BackupVaultsListByNetAppAccountResponse + - Added Type Alias BackupVaultsUpdateResponse + - Added Type Alias NetAppResourceRegionInfosGetResponse + - Added Type Alias NetAppResourceRegionInfosListNextResponse + - Added Type Alias NetAppResourceRegionInfosListResponse + - Added Type Alias VolumesResetCifsPasswordResponse + - Added Type Alias VolumesSplitCloneFromParentResponse + - Interface NetAppAccount has a new optional parameter isMultiAdEnabled + - Interface NetAppAccount has a new optional parameter nfsV4IDDomain + - Interface NetAppAccountPatch has a new optional parameter isMultiAdEnabled + - Interface NetAppAccountPatch has a new optional parameter nfsV4IDDomain + - Interface ReplicationObject has a new optional parameter remotePath + - Interface Volume has a new optional parameter inheritedSizeInBytes + - Interface VolumeGroupVolumeProperties has a new optional parameter inheritedSizeInBytes + - Interface VolumePatchPropertiesDataProtection has a new optional parameter backup + - Interface VolumePropertiesDataProtection has a new optional parameter backup + - Added Enum KnownBackupType + +**Breaking Changes** + + - Interface VolumeGroupMetaData no longer has parameter deploymentSpecId + - Type of parameter userAssignedIdentities of interface ManagedServiceIdentity is changed from { + [propertyName: string]: UserAssignedIdentity; + } to { + [propertyName: string]: UserAssignedIdentity | null; + } + + ## 19.0.0 (2023-09-25) **Features** diff --git a/sdk/netapp/arm-netapp/README.md b/sdk/netapp/arm-netapp/README.md index 0d9fb4d010e8..78ab29c62855 100644 --- a/sdk/netapp/arm-netapp/README.md +++ b/sdk/netapp/arm-netapp/README.md @@ -6,7 +6,7 @@ Microsoft NetApp Files Azure Resource Provider specification [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/netapp/arm-netapp) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-netapp) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-netapp) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-netapp?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/netapp/arm-netapp/_meta.json b/sdk/netapp/arm-netapp/_meta.json index 027da89887c8..f2d5bdacd65f 100644 --- a/sdk/netapp/arm-netapp/_meta.json +++ b/sdk/netapp/arm-netapp/_meta.json @@ -1,8 +1,8 @@ { - "commit": "06479e897f635086bd40e6ee879e94f4a803ddd9", + "commit": "e62b17a09302b9bacca3504135091d1a71eeaebf", "readme": "specification/netapp/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\netapp\\resource-manager\\readme.md --use=@autorest/typescript@6.0.9 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\netapp\\resource-manager\\readme.md --use=@autorest/typescript@6.0.13 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", - "use": "@autorest/typescript@6.0.9" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", + "use": "@autorest/typescript@6.0.13" } \ No newline at end of file diff --git a/sdk/netapp/arm-netapp/assets.json b/sdk/netapp/arm-netapp/assets.json index 7ed1397b66be..9b748930f005 100644 --- a/sdk/netapp/arm-netapp/assets.json +++ b/sdk/netapp/arm-netapp/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/netapp/arm-netapp", - "Tag": "js/netapp/arm-netapp_f1eacceda2" + "Tag": "js/netapp/arm-netapp_efdf6a61ca" } diff --git a/sdk/netapp/arm-netapp/package.json b/sdk/netapp/arm-netapp/package.json index f56462ad3c86..df7dfb71c4b5 100644 --- a/sdk/netapp/arm-netapp/package.json +++ b/sdk/netapp/arm-netapp/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for NetAppManagementClient.", - "version": "19.0.0", + "version": "20.0.0-beta.1", "engines": { "node": ">=18.0.0" }, @@ -34,15 +34,17 @@ "uglify-js": "^3.4.9", "rimraf": "^5.0.0", "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", "@azure/identity": "^3.3.0", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", "ts-node": "^10.0.0" }, "repository": { @@ -114,4 +116,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-netapp?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/netapp/arm-netapp/review/arm-netapp.api.md b/sdk/netapp/arm-netapp/review/arm-netapp.api.md index 4ee3e22b088d..82f63b7bf12f 100644 --- a/sdk/netapp/arm-netapp/review/arm-netapp.api.md +++ b/sdk/netapp/arm-netapp/review/arm-netapp.api.md @@ -10,6 +10,44 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; +// @public +export interface AccountBackups { + beginDelete(resourceGroupName: string, accountName: string, backupName: string, options?: AccountBackupsDeleteOptionalParams): Promise, AccountBackupsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, backupName: string, options?: AccountBackupsDeleteOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, backupName: string, options?: AccountBackupsGetOptionalParams): Promise; + listByNetAppAccount(resourceGroupName: string, accountName: string, options?: AccountBackupsListByNetAppAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AccountBackupsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface AccountBackupsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccountBackupsDeleteResponse = AccountBackupsDeleteHeaders; + +// @public +export interface AccountBackupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountBackupsGetResponse = Backup; + +// @public +export interface AccountBackupsListByNetAppAccountOptionalParams extends coreClient.OperationOptions { + includeOnlyBackupsFromDeletedVolumes?: string; +} + +// @public +export type AccountBackupsListByNetAppAccountResponse = BackupsList; + // @public export interface AccountEncryption { identity?: EncryptionIdentity; @@ -23,6 +61,8 @@ export interface Accounts { beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, body: NetAppAccount, options?: AccountsCreateOrUpdateOptionalParams): Promise; beginDelete(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise; + beginMigrateEncryptionKey(resourceGroupName: string, accountName: string, options?: AccountsMigrateEncryptionKeyOptionalParams): Promise, AccountsMigrateEncryptionKeyResponse>>; + beginMigrateEncryptionKeyAndWait(resourceGroupName: string, accountName: string, options?: AccountsMigrateEncryptionKeyOptionalParams): Promise; beginRenewCredentials(resourceGroupName: string, accountName: string, options?: AccountsRenewCredentialsOptionalParams): Promise, void>>; beginRenewCredentialsAndWait(resourceGroupName: string, accountName: string, options?: AccountsRenewCredentialsOptionalParams): Promise; beginUpdate(resourceGroupName: string, accountName: string, body: NetAppAccountPatch, options?: AccountsUpdateOptionalParams): Promise, AccountsUpdateResponse>>; @@ -82,6 +122,22 @@ export interface AccountsListOptionalParams extends coreClient.OperationOptions // @public export type AccountsListResponse = NetAppAccountList; +// @public +export interface AccountsMigrateEncryptionKeyHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface AccountsMigrateEncryptionKeyOptionalParams extends coreClient.OperationOptions { + body?: EncryptionMigrationRequest; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccountsMigrateEncryptionKeyResponse = AccountsMigrateEncryptionKeyHeaders; + // @public export interface AccountsRenewCredentialsOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -138,6 +194,26 @@ export interface AuthorizeRequest { // @public export type AvsDataStore = string; +// @public +export interface Backup extends ProxyResource { + readonly backupId?: string; + readonly backupPolicyResourceId?: string; + readonly backupType?: BackupType; + readonly creationDate?: Date; + readonly failureReason?: string; + label?: string; + readonly provisioningState?: string; + readonly size?: number; + snapshotName?: string; + useExistingSnapshot?: boolean; + volumeResourceId: string; +} + +// @public +export interface BackupPatch { + label?: string; +} + // @public export interface BackupPolicies { beginCreate(resourceGroupName: string, accountName: string, backupPolicyName: string, body: BackupPolicy, options?: BackupPoliciesCreateOptionalParams): Promise, BackupPoliciesCreateResponse>>; @@ -225,11 +301,65 @@ export interface BackupPolicyPatch { weeklyBackupsToKeep?: number; } +// @public +export interface BackupRestoreFiles { + destinationVolumeId: string; + fileList: string[]; + restoreFilePath?: string; +} + // @public export interface Backups { + beginCreate(resourceGroupName: string, accountName: string, backupVaultName: string, backupName: string, body: Backup, options?: BackupsCreateOptionalParams): Promise, BackupsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, accountName: string, backupVaultName: string, backupName: string, body: Backup, options?: BackupsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, backupVaultName: string, backupName: string, options?: BackupsDeleteOptionalParams): Promise, BackupsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, backupVaultName: string, backupName: string, options?: BackupsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, backupVaultName: string, backupName: string, options?: BackupsUpdateOptionalParams): Promise, BackupsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, backupVaultName: string, backupName: string, options?: BackupsUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, backupVaultName: string, backupName: string, options?: BackupsGetOptionalParams): Promise; + getLatestStatus(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: BackupsGetLatestStatusOptionalParams): Promise; getVolumeRestoreStatus(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: BackupsGetVolumeRestoreStatusOptionalParams): Promise; + listByVault(resourceGroupName: string, accountName: string, backupVaultName: string, options?: BackupsListByVaultOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BackupsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupsCreateResponse = Backup; + +// @public +export interface BackupsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface BackupsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupsDeleteResponse = BackupsDeleteHeaders; + +// @public +export interface BackupsGetLatestStatusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupsGetLatestStatusResponse = BackupStatus; + +// @public +export interface BackupsGetOptionalParams extends coreClient.OperationOptions { } +// @public +export type BackupsGetResponse = Backup; + // @public export interface BackupsGetVolumeRestoreStatusOptionalParams extends coreClient.OperationOptions { } @@ -237,6 +367,217 @@ export interface BackupsGetVolumeRestoreStatusOptionalParams extends coreClient. // @public export type BackupsGetVolumeRestoreStatusResponse = RestoreStatus; +// @public +export interface BackupsList { + nextLink?: string; + value?: Backup[]; +} + +// @public +export interface BackupsListByVaultNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupsListByVaultNextResponse = BackupsList; + +// @public +export interface BackupsListByVaultOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type BackupsListByVaultResponse = BackupsList; + +// @public +export interface BackupsMigrationRequest { + backupVaultId: string; +} + +// @public +export interface BackupStatus { + readonly errorMessage?: string; + readonly healthy?: boolean; + readonly lastTransferSize?: number; + readonly lastTransferType?: string; + readonly mirrorState?: MirrorState; + readonly relationshipStatus?: RelationshipStatus; + readonly totalTransferBytes?: number; + readonly transferProgressBytes?: number; + readonly unhealthyReason?: string; +} + +// @public +export interface BackupsUnderAccount { + beginMigrateBackups(resourceGroupName: string, accountName: string, body: BackupsMigrationRequest, options?: BackupsUnderAccountMigrateBackupsOptionalParams): Promise, BackupsUnderAccountMigrateBackupsResponse>>; + beginMigrateBackupsAndWait(resourceGroupName: string, accountName: string, body: BackupsMigrationRequest, options?: BackupsUnderAccountMigrateBackupsOptionalParams): Promise; +} + +// @public +export interface BackupsUnderAccountMigrateBackupsHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface BackupsUnderAccountMigrateBackupsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupsUnderAccountMigrateBackupsResponse = BackupsUnderAccountMigrateBackupsHeaders; + +// @public +export interface BackupsUnderBackupVault { + beginRestoreFiles(resourceGroupName: string, accountName: string, backupVaultName: string, backupName: string, body: BackupRestoreFiles, options?: BackupsUnderBackupVaultRestoreFilesOptionalParams): Promise, BackupsUnderBackupVaultRestoreFilesResponse>>; + beginRestoreFilesAndWait(resourceGroupName: string, accountName: string, backupVaultName: string, backupName: string, body: BackupRestoreFiles, options?: BackupsUnderBackupVaultRestoreFilesOptionalParams): Promise; +} + +// @public +export interface BackupsUnderBackupVaultRestoreFilesHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface BackupsUnderBackupVaultRestoreFilesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupsUnderBackupVaultRestoreFilesResponse = BackupsUnderBackupVaultRestoreFilesHeaders; + +// @public +export interface BackupsUnderVolume { + beginMigrateBackups(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, body: BackupsMigrationRequest, options?: BackupsUnderVolumeMigrateBackupsOptionalParams): Promise, BackupsUnderVolumeMigrateBackupsResponse>>; + beginMigrateBackupsAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, body: BackupsMigrationRequest, options?: BackupsUnderVolumeMigrateBackupsOptionalParams): Promise; +} + +// @public +export interface BackupsUnderVolumeMigrateBackupsHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface BackupsUnderVolumeMigrateBackupsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupsUnderVolumeMigrateBackupsResponse = BackupsUnderVolumeMigrateBackupsHeaders; + +// @public +export interface BackupsUpdateHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface BackupsUpdateOptionalParams extends coreClient.OperationOptions { + body?: BackupPatch; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupsUpdateResponse = Backup; + +// @public +export type BackupType = string; + +// @public +export interface BackupVault extends TrackedResource { + readonly provisioningState?: string; +} + +// @public +export interface BackupVaultPatch { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface BackupVaults { + beginCreateOrUpdate(resourceGroupName: string, accountName: string, backupVaultName: string, body: BackupVault, options?: BackupVaultsCreateOrUpdateOptionalParams): Promise, BackupVaultsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, backupVaultName: string, body: BackupVault, options?: BackupVaultsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, backupVaultName: string, options?: BackupVaultsDeleteOptionalParams): Promise, BackupVaultsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, backupVaultName: string, options?: BackupVaultsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, backupVaultName: string, body: BackupVaultPatch, options?: BackupVaultsUpdateOptionalParams): Promise, BackupVaultsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, backupVaultName: string, body: BackupVaultPatch, options?: BackupVaultsUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, backupVaultName: string, options?: BackupVaultsGetOptionalParams): Promise; + listByNetAppAccount(resourceGroupName: string, accountName: string, options?: BackupVaultsListByNetAppAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BackupVaultsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupVaultsCreateOrUpdateResponse = BackupVault; + +// @public +export interface BackupVaultsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface BackupVaultsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupVaultsDeleteResponse = BackupVaultsDeleteHeaders; + +// @public +export interface BackupVaultsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupVaultsGetResponse = BackupVault; + +// @public +export interface BackupVaultsList { + nextLink?: string; + value?: BackupVault[]; +} + +// @public +export interface BackupVaultsListByNetAppAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupVaultsListByNetAppAccountNextResponse = BackupVaultsList; + +// @public +export interface BackupVaultsListByNetAppAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupVaultsListByNetAppAccountResponse = BackupVaultsList; + +// @public +export interface BackupVaultsUpdateHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface BackupVaultsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupVaultsUpdateResponse = BackupVault; + // @public export interface BreakFileLocksRequest { clientIp?: string; @@ -341,6 +682,12 @@ export interface EncryptionIdentity { // @public export type EncryptionKeySource = string; +// @public +export interface EncryptionMigrationRequest { + privateEndpointId: string; + virtualNetworkId: string; +} + // @public export type EncryptionType = string; @@ -454,6 +801,12 @@ export enum KnownAvsDataStore { Enabled = "Enabled" } +// @public +export enum KnownBackupType { + Manual = "Manual", + Scheduled = "Scheduled" +} + // @public export enum KnownCheckNameResourceTypes { MicrosoftNetAppNetAppAccounts = "Microsoft.NetApp/netAppAccounts", @@ -675,7 +1028,7 @@ export interface ManagedServiceIdentity { readonly tenantId?: string; type: ManagedServiceIdentityType; userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentity; + [propertyName: string]: UserAssignedIdentity | null; }; } @@ -747,6 +1100,8 @@ export interface NetAppAccount extends TrackedResource { encryption?: AccountEncryption; readonly etag?: string; identity?: ManagedServiceIdentity; + readonly isMultiAdEnabled?: boolean; + nfsV4IDDomain?: string; readonly provisioningState?: string; } @@ -763,8 +1118,10 @@ export interface NetAppAccountPatch { encryption?: AccountEncryption; readonly id?: string; identity?: ManagedServiceIdentity; + readonly isMultiAdEnabled?: boolean; location?: string; readonly name?: string; + nfsV4IDDomain?: string; readonly provisioningState?: string; tags?: { [propertyName: string]: string; @@ -778,6 +1135,8 @@ export class NetAppManagementClient extends coreClient.ServiceClient { $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: NetAppManagementClientOptionalParams); // (undocumented) + accountBackups: AccountBackups; + // (undocumented) accounts: Accounts; // (undocumented) apiVersion: string; @@ -786,10 +1145,20 @@ export class NetAppManagementClient extends coreClient.ServiceClient { // (undocumented) backups: Backups; // (undocumented) + backupsUnderAccount: BackupsUnderAccount; + // (undocumented) + backupsUnderBackupVault: BackupsUnderBackupVault; + // (undocumented) + backupsUnderVolume: BackupsUnderVolume; + // (undocumented) + backupVaults: BackupVaults; + // (undocumented) netAppResource: NetAppResource; // (undocumented) netAppResourceQuotaLimits: NetAppResourceQuotaLimits; // (undocumented) + netAppResourceRegionInfos: NetAppResourceRegionInfos; + // (undocumented) operations: Operations; // (undocumented) pools: Pools; @@ -882,6 +1251,33 @@ export interface NetAppResourceQuotaLimitsListOptionalParams extends coreClient. // @public export type NetAppResourceQuotaLimitsListResponse = SubscriptionQuotaItemList; +// @public +export interface NetAppResourceRegionInfos { + get(location: string, options?: NetAppResourceRegionInfosGetOptionalParams): Promise; + list(location: string, options?: NetAppResourceRegionInfosListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface NetAppResourceRegionInfosGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetAppResourceRegionInfosGetResponse = RegionInfoResource; + +// @public +export interface NetAppResourceRegionInfosListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetAppResourceRegionInfosListNextResponse = RegionInfosList; + +// @public +export interface NetAppResourceRegionInfosListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetAppResourceRegionInfosListResponse = RegionInfosList; + // @public export interface NetAppResourceUpdateNetworkSiblingSetHeaders { // (undocumented) @@ -1060,6 +1456,18 @@ export interface RegionInfoAvailabilityZoneMappingsItem { isAvailable?: boolean; } +// @public +export interface RegionInfoResource extends ProxyResource { + availabilityZoneMappings?: RegionInfoAvailabilityZoneMappingsItem[]; + storageToNetworkProximity?: RegionStorageToNetworkProximity; +} + +// @public +export interface RegionInfosList { + nextLink?: string; + value?: RegionInfoResource[]; +} + // @public export type RegionStorageToNetworkProximity = string; @@ -1071,6 +1479,13 @@ export interface RelocateVolumeRequest { creationToken?: string; } +// @public +export interface RemotePath { + externalHostName: string; + serverName: string; + volumeName: string; +} + // @public export interface Replication { endpointType?: EndpointType; @@ -1082,6 +1497,7 @@ export interface Replication { // @public export interface ReplicationObject { endpointType?: EndpointType; + remotePath?: RemotePath; remoteVolumeRegion?: string; remoteVolumeResourceId: string; readonly replicationId?: string; @@ -1512,6 +1928,7 @@ export interface Volume extends TrackedResource { exportPolicy?: VolumePropertiesExportPolicy; readonly fileAccessLogs?: FileAccessLogs; readonly fileSystemId?: string; + readonly inheritedSizeInBytes?: number; isDefaultQuotaEnabled?: boolean; isLargeVolume?: boolean; isRestoring?: boolean; @@ -1548,6 +1965,14 @@ export interface Volume extends TrackedResource { zones?: string[]; } +// @public +export interface VolumeBackupProperties { + backupEnabled?: boolean; + backupPolicyId?: string; + backupVaultId?: string; + policyEnforced?: boolean; +} + // @public export interface VolumeBackups { backupsCount?: number; @@ -1585,7 +2010,6 @@ export interface VolumeGroupList { export interface VolumeGroupMetaData { applicationIdentifier?: string; applicationType?: ApplicationType; - deploymentSpecId?: string; globalPlacementRules?: PlacementKeyValuePairs[]; groupDescription?: string; readonly volumesCount?: number; @@ -1654,6 +2078,7 @@ export interface VolumeGroupVolumeProperties { readonly fileAccessLogs?: FileAccessLogs; readonly fileSystemId?: string; readonly id?: string; + readonly inheritedSizeInBytes?: number; isDefaultQuotaEnabled?: boolean; isLargeVolume?: boolean; isRestoring?: boolean; @@ -1729,6 +2154,7 @@ export interface VolumePatch { // @public export interface VolumePatchPropertiesDataProtection { + backup?: VolumeBackupProperties; snapshot?: VolumeSnapshotProperties; } @@ -1739,6 +2165,7 @@ export interface VolumePatchPropertiesExportPolicy { // @public export interface VolumePropertiesDataProtection { + backup?: VolumeBackupProperties; replication?: ReplicationObject; snapshot?: VolumeSnapshotProperties; volumeRelocation?: VolumeRelocationProperties; @@ -1862,14 +2289,16 @@ export interface Volumes { beginReInitializeReplicationAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesReInitializeReplicationOptionalParams): Promise; beginRelocate(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesRelocateOptionalParams): Promise, void>>; beginRelocateAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesRelocateOptionalParams): Promise; - beginResetCifsPassword(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesResetCifsPasswordOptionalParams): Promise, void>>; - beginResetCifsPasswordAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesResetCifsPasswordOptionalParams): Promise; + beginResetCifsPassword(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesResetCifsPasswordOptionalParams): Promise, VolumesResetCifsPasswordResponse>>; + beginResetCifsPasswordAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesResetCifsPasswordOptionalParams): Promise; beginResyncReplication(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesResyncReplicationOptionalParams): Promise, void>>; beginResyncReplicationAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesResyncReplicationOptionalParams): Promise; beginRevert(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, body: VolumeRevert, options?: VolumesRevertOptionalParams): Promise, void>>; beginRevertAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, body: VolumeRevert, options?: VolumesRevertOptionalParams): Promise; beginRevertRelocation(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesRevertRelocationOptionalParams): Promise, void>>; beginRevertRelocationAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesRevertRelocationOptionalParams): Promise; + beginSplitCloneFromParent(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesSplitCloneFromParentOptionalParams): Promise, VolumesSplitCloneFromParentResponse>>; + beginSplitCloneFromParentAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesSplitCloneFromParentOptionalParams): Promise; beginUpdate(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, body: VolumePatch, options?: VolumesUpdateOptionalParams): Promise, VolumesUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, body: VolumePatch, options?: VolumesUpdateOptionalParams): Promise; get(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; @@ -2027,12 +2456,21 @@ export interface VolumesReplicationStatusOptionalParams extends coreClient.Opera // @public export type VolumesReplicationStatusResponse = ReplicationStatus; +// @public +export interface VolumesResetCifsPasswordHeaders { + // (undocumented) + location?: string; +} + // @public export interface VolumesResetCifsPasswordOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type VolumesResetCifsPasswordResponse = VolumesResetCifsPasswordHeaders; + // @public export interface VolumesResyncReplicationOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -2051,6 +2489,21 @@ export interface VolumesRevertRelocationOptionalParams extends coreClient.Operat updateIntervalInMs?: number; } +// @public +export interface VolumesSplitCloneFromParentHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface VolumesSplitCloneFromParentOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VolumesSplitCloneFromParentResponse = VolumesSplitCloneFromParentHeaders; + // @public export type VolumeStorageToNetworkProximity = string; 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 000000000000..a70df34e81e9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountBackupsDeleteSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Backups_Account_Delete.json + */ +async function accountBackupsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = + process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountBackupsDelete(); +} + +main().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 000000000000..2410c0df94ab --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountBackupsGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Backups_Account_Get.json + */ +async function accountBackupsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountBackupsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountBackupsListByNetAppAccountSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountBackupsListByNetAppAccountSample.ts new file mode 100644 index 000000000000..b9f7624afc1f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountBackupsListByNetAppAccountSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Backups_Account_List.json + */ +async function accountBackupsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.listByNetAppAccount( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + accountBackupsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsCreateOrUpdateSample.ts index 4d013bfbb89a..e53609546155 100644 --- a/sdk/netapp/arm-netapp/samples-dev/accountsCreateOrUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/accountsCreateOrUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Accounts_CreateOrUpdate.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_CreateOrUpdate.json */ async function accountsCreateOrUpdate() { const subscriptionId = @@ -41,7 +41,7 @@ async function accountsCreateOrUpdate() { * 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/2023-05-01/examples/Accounts_CreateOrUpdateAD.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_CreateOrUpdateAD.json */ async function accountsCreateOrUpdateWithActiveDirectory() { const subscriptionId = @@ -53,7 +53,7 @@ async function accountsCreateOrUpdateWithActiveDirectory() { activeDirectories: [ { aesEncryption: true, - dns: "10.10.10.3, 10.10.10.4", + dns: "10.10.10.3", domain: "10.10.10.3", ldapOverTLS: false, ldapSigning: false, diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsDeleteSample.ts index 33d0741dc550..e520aff851ff 100644 --- a/sdk/netapp/arm-netapp/samples-dev/accountsDeleteSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/accountsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Accounts_Delete.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_Delete.json */ async function accountsDelete() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsGetSample.ts index 86ee73e4802f..22a8a1ab0873 100644 --- a/sdk/netapp/arm-netapp/samples-dev/accountsGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/accountsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Accounts_Get.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_Get.json */ async function accountsGet() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsListBySubscriptionSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsListBySubscriptionSample.ts index f691141d212b..1f292e0303b9 100644 --- a/sdk/netapp/arm-netapp/samples-dev/accountsListBySubscriptionSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/accountsListBySubscriptionSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Accounts_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_List.json */ async function accountsList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsListSample.ts index 1ce755109d7a..fc0b884f17c3 100644 --- a/sdk/netapp/arm-netapp/samples-dev/accountsListSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/accountsListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Accounts_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_List.json */ async function accountsList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsMigrateEncryptionKeySample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsMigrateEncryptionKeySample.ts new file mode 100644 index 000000000000..4975f091426e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/accountsMigrateEncryptionKeySample.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 { + EncryptionMigrationRequest, + AccountsMigrateEncryptionKeyOptionalParams, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from another account. + * + * @summary Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from another account. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_MigrateEncryptionKey.json + */ +async function accountsMigrateEncryptionKey() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body: EncryptionMigrationRequest = { + privateEndpointId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/privateEndpoints/privip1", + virtualNetworkId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/vnet1" + }; + const options: AccountsMigrateEncryptionKeyOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginMigrateEncryptionKeyAndWait( + resourceGroupName, + accountName, + options + ); + console.log(result); +} + +async function main() { + accountsMigrateEncryptionKey(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsRenewCredentialsSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsRenewCredentialsSample.ts index f9f37b1a6b65..4d0b3ca77014 100644 --- a/sdk/netapp/arm-netapp/samples-dev/accountsRenewCredentialsSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/accountsRenewCredentialsSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. * * @summary Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Accounts_RenewCredentials.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_RenewCredentials.json */ async function accountsRenewCredentials() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/accountsUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/accountsUpdateSample.ts index e8ac842fa374..f70d57a33678 100644 --- a/sdk/netapp/arm-netapp/samples-dev/accountsUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/accountsUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Accounts_Update.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_Update.json */ async function accountsUpdate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesCreateSample.ts index 3bbd7817334f..6b2316ba4533 100644 --- a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesCreateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesCreateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/BackupPolicies_Create.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Create.json */ async function backupPoliciesCreate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesDeleteSample.ts index e41ce0088796..ab6bae9205cc 100644 --- a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesDeleteSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Delete backup policy * * @summary Delete backup policy - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/BackupPolicies_Delete.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Delete.json */ async function backupsDelete() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesGetSample.ts index 078b4d62a688..53cc2fc4840c 100644 --- a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/BackupPolicies_Get.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Get.json */ async function backupsGet() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesListSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesListSample.ts index 5f57598adb0f..6c99bb47ce8e 100644 --- a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesListSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/BackupPolicies_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_List.json */ async function backupsList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesUpdateSample.ts index e187044ec1b2..7b8288681132 100644 --- a/sdk/netapp/arm-netapp/samples-dev/backupPoliciesUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/backupPoliciesUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/BackupPolicies_Update.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Update.json */ async function backupPoliciesUpdate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/backupVaultsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupVaultsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e741c2c215c6 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupVaultsCreateOrUpdateSample.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 { BackupVault, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update the specified Backup Vault in the NetApp account + * + * @summary Create or update the specified Backup Vault in the NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Create.json + */ +async function backupVaultCreateOrUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const body: BackupVault = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + backupVaultName, + body + ); + console.log(result); +} + +async function main() { + backupVaultCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupVaultsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupVaultsDeleteSample.ts new file mode 100644 index 000000000000..5918f68afc9d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupVaultsDeleteSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the specified Backup Vault + * + * @summary Delete the specified Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Delete.json + */ +async function backupVaultsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = + process.env["NETAPP_RESOURCE_GROUP"] || "resourceGroup"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.beginDeleteAndWait( + resourceGroupName, + accountName, + backupVaultName + ); + console.log(result); +} + +async function main() { + backupVaultsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupVaultsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupVaultsGetSample.ts new file mode 100644 index 000000000000..f12d1e74b43e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupVaultsGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the Backup Vault + * + * @summary Get the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Get.json + */ +async function backupVaultsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.get( + resourceGroupName, + accountName, + backupVaultName + ); + console.log(result); +} + +async function main() { + backupVaultsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupVaultsListByNetAppAccountSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupVaultsListByNetAppAccountSample.ts new file mode 100644 index 000000000000..26db2a521b97 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupVaultsListByNetAppAccountSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List and describe all Backup Vaults in the NetApp account. + * + * @summary List and describe all Backup Vaults in the NetApp account. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_List.json + */ +async function backupVaultsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupVaults.listByNetAppAccount( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + backupVaultsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupVaultsUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupVaultsUpdateSample.ts new file mode 100644 index 000000000000..90ad3a20022d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupVaultsUpdateSample.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 { BackupVaultPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch the specified NetApp Backup Vault + * + * @summary Patch the specified NetApp Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Update.json + */ +async function backupVaultsUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const body: BackupVaultPatch = { tags: { tag1: "Value1" } }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.beginUpdateAndWait( + resourceGroupName, + accountName, + backupVaultName, + body + ); + console.log(result); +} + +async function main() { + backupVaultsUpdate(); +} + +main().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 000000000000..11eb66c7c2b7 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsCreateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a backup under the Backup Vault + * + * @summary Create a backup under the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Create.json + */ +async function backupsUnderBackupVaultCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const body: Backup = { + label: "myLabel", + volumeResourceId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginCreateAndWait( + resourceGroupName, + accountName, + backupVaultName, + backupName, + body + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultCreate(); +} + +main().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 000000000000..fec3afd8d873 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsDeleteSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete a Backup under the Backup Vault + * + * @summary Delete a Backup under the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Delete.json + */ +async function backupsUnderBackupVaultDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = + process.env["NETAPP_RESOURCE_GROUP"] || "resourceGroup"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + resourceGroupName, + accountName, + backupVaultName, + backupName + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsGetLatestStatusSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsGetLatestStatusSample.ts new file mode 100644 index 000000000000..bd1cb2a56c89 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsGetLatestStatusSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the latest status of the backup for a volume + * + * @summary Get the latest status of the backup for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_LatestBackupStatus.json + */ +async function volumesBackupStatus() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.getLatestStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +async function main() { + volumesBackupStatus(); +} + +main().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 000000000000..98f4a3dd8d30 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the specified Backup under Backup Vault. + * + * @summary Get the specified Backup under Backup Vault. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Get.json + */ +async function backupsUnderBackupVaultGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.get( + resourceGroupName, + accountName, + backupVaultName, + backupName + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsGetVolumeRestoreStatusSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsGetVolumeRestoreStatusSample.ts index 3236bfc61f71..6d6ca819cdc8 100644 --- a/sdk/netapp/arm-netapp/samples-dev/backupsGetVolumeRestoreStatusSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/backupsGetVolumeRestoreStatusSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_RestoreStatus.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_RestoreStatus.json */ async function volumesRestoreStatus() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsListByVaultSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsListByVaultSample.ts new file mode 100644 index 000000000000..828c41fbc9af --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsListByVaultSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List all backups Under a Backup Vault + * + * @summary List all backups Under a Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_List.json + */ +async function backupsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByVault( + resourceGroupName, + accountName, + backupVaultName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + backupsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsUnderAccountMigrateBackupsSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsUnderAccountMigrateBackupsSample.ts new file mode 100644 index 000000000000..9bf1d05d2bf4 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsUnderAccountMigrateBackupsSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + BackupsMigrationRequest, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Migrate the backups under a NetApp account to backup vault + * + * @summary Migrate the backups under a NetApp account to backup vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderAccount_Migrate.json + */ +async function backupsUnderAccountMigrate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body: BackupsMigrationRequest = { + backupVaultId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupsUnderAccount.beginMigrateBackupsAndWait( + resourceGroupName, + accountName, + body + ); + console.log(result); +} + +async function main() { + backupsUnderAccountMigrate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsUnderBackupVaultRestoreFilesSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsUnderBackupVaultRestoreFilesSample.ts new file mode 100644 index 000000000000..d463fa78ae3d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsUnderBackupVaultRestoreFilesSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { BackupRestoreFiles, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restore the specified files from the specified backup to the active filesystem + * + * @summary Restore the specified files from the specified backup to the active filesystem + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_SingleFileRestore.json + */ +async function backupsSingleFileRestore() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const body: BackupRestoreFiles = { + destinationVolumeId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1", + fileList: ["/dir1/customer1.db", "/dir1/customer2.db"] + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupsUnderBackupVault.beginRestoreFilesAndWait( + resourceGroupName, + accountName, + backupVaultName, + backupName, + body + ); + console.log(result); +} + +async function main() { + backupsSingleFileRestore(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/backupsUnderVolumeMigrateBackupsSample.ts b/sdk/netapp/arm-netapp/samples-dev/backupsUnderVolumeMigrateBackupsSample.ts new file mode 100644 index 000000000000..ab1ce078a0b4 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsUnderVolumeMigrateBackupsSample.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 { + BackupsMigrationRequest, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Migrate the backups under volume to backup vault + * + * @summary Migrate the backups under volume to backup vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderVolume_Migrate.json + */ +async function backupsUnderVolumeMigrate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: BackupsMigrationRequest = { + backupVaultId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupsUnderVolume.beginMigrateBackupsAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +async function main() { + backupsUnderVolumeMigrate(); +} + +main().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 000000000000..07d90d61e774 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/backupsUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch a Backup under the Backup Vault + * + * @summary Patch a Backup under the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Update.json + */ +async function backupsUnderBackupVaultUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + 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, + backupVaultName, + backupName, + options + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckFilePathAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckFilePathAvailabilitySample.ts index 5954626a4465..63a0ea2906e4 100644 --- a/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckFilePathAvailabilitySample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckFilePathAvailabilitySample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/CheckFilePathAvailability.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/CheckFilePathAvailability.json */ async function checkFilePathAvailability() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckNameAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckNameAvailabilitySample.ts index cf33fb750a6d..3cc975b1d3f9 100644 --- a/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckNameAvailabilitySample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckNameAvailabilitySample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/CheckNameAvailability.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/CheckNameAvailability.json */ async function checkNameAvailability() { const subscriptionId = @@ -26,7 +26,7 @@ async function checkNameAvailability() { "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; const location = "eastus"; const name = "accName"; - const typeParam = "netAppAccount"; + const typeParam = "Microsoft.NetApp/netAppAccounts"; const resourceGroup = "myRG"; const credential = new DefaultAzureCredential(); const client = new NetAppManagementClient(credential, subscriptionId); diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckQuotaAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckQuotaAvailabilitySample.ts index 94279fa04f9e..3378adbd26b4 100644 --- a/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckQuotaAvailabilitySample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceCheckQuotaAvailabilitySample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/CheckQuotaAvailability.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/CheckQuotaAvailability.json */ async function checkQuotaAvailability() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQueryNetworkSiblingSetSample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQueryNetworkSiblingSetSample.ts index 5c4bba4b7061..bb58c0a33128 100644 --- a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQueryNetworkSiblingSetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQueryNetworkSiblingSetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get details of the specified network sibling set. * * @summary Get details of the specified network sibling set. - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/NetworkSiblingSet_Query.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Query.json */ async function networkSiblingSetQuery() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQueryRegionInfoSample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQueryRegionInfoSample.ts index 75432f6ab7bb..7c3cd7080e7d 100644 --- a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQueryRegionInfoSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQueryRegionInfoSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Provides storage to network proximity and logical zone mapping information. * * @summary Provides storage to network proximity and logical zone mapping information. - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/RegionInfo.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfo.json */ async function regionInfoQuery() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsGetSample.ts index bb254e301aad..8f0f34b8878d 100644 --- a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/QuotaLimits_Get.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/QuotaLimits_Get.json */ async function quotaLimits() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsListSample.ts index c194601ae95d..4a2b587d265e 100644 --- a/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsListSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceQuotaLimitsListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/QuotaLimits_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/QuotaLimits_List.json */ async function quotaLimits() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceRegionInfosGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceRegionInfosGetSample.ts new file mode 100644 index 000000000000..6ad0077bbeb3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceRegionInfosGetSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides storage to network proximity and logical zone mapping information. + * + * @summary Provides storage to network proximity and logical zone mapping information. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_Get.json + */ +async function regionInfosGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResourceRegionInfos.get(location); + console.log(result); +} + +async function main() { + regionInfosGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceRegionInfosListSample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceRegionInfosListSample.ts new file mode 100644 index 000000000000..0f001d6f3e8e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceRegionInfosListSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides region specific information. + * + * @summary Provides region specific information. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_List.json + */ +async function regionInfosList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "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.netAppResourceRegionInfos.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + regionInfosList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/netAppResourceUpdateNetworkSiblingSetSample.ts b/sdk/netapp/arm-netapp/samples-dev/netAppResourceUpdateNetworkSiblingSetSample.ts index 148ae9c04c99..993cb310901c 100644 --- a/sdk/netapp/arm-netapp/samples-dev/netAppResourceUpdateNetworkSiblingSetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/netAppResourceUpdateNetworkSiblingSetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Update the network features of the specified network sibling set. * * @summary Update the network features of the specified network sibling set. - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/NetworkSiblingSet_Update.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Update.json */ async function networkFeaturesUpdate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/operationsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/operationsListSample.ts index 334b22188ff4..b6889338df8c 100644 --- a/sdk/netapp/arm-netapp/samples-dev/operationsListSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/operationsListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/OperationList.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/OperationList.json */ async function operationList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsCreateOrUpdateSample.ts index 60fcdabcaa1f..5e35e7140231 100644 --- a/sdk/netapp/arm-netapp/samples-dev/poolsCreateOrUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/poolsCreateOrUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Pools_CreateOrUpdate.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_CreateOrUpdate.json */ async function poolsCreateOrUpdate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsDeleteSample.ts index e6cb91300b74..601a7a09b375 100644 --- a/sdk/netapp/arm-netapp/samples-dev/poolsDeleteSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/poolsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Pools_Delete.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_Delete.json */ async function poolsDelete() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsGetSample.ts index ce3e361a1e50..1d9e9e863d38 100644 --- a/sdk/netapp/arm-netapp/samples-dev/poolsGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/poolsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Pools_Get.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_Get.json */ async function poolsGet() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsListSample.ts index f49209600485..cc274cf7c4c8 100644 --- a/sdk/netapp/arm-netapp/samples-dev/poolsListSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/poolsListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Pools_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_List.json */ async function poolsList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/poolsUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/poolsUpdateSample.ts index c333305830a2..d8b99b70b4cb 100644 --- a/sdk/netapp/arm-netapp/samples-dev/poolsUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/poolsUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Pools_Update.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_Update.json */ async function poolsUpdate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesCreateSample.ts index 7a5b1dba57ad..c3bb40d7d4fd 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesCreateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesCreateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/SnapshotPolicies_Create.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Create.json */ async function snapshotPoliciesCreate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesDeleteSample.ts index a0dbe8a3a8dd..b070d8be07bf 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesDeleteSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Delete snapshot policy * * @summary Delete snapshot policy - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/SnapshotPolicies_Delete.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Delete.json */ async function snapshotPoliciesDelete() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesGetSample.ts index 301a9b79c983..e04c17f19010 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/SnapshotPolicies_Get.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Get.json */ async function snapshotPoliciesGet() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListSample.ts index d021f4cfe9e4..0fcd799a519d 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List snapshot policy * * @summary List snapshot policy - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/SnapshotPolicies_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_List.json */ async function snapshotPoliciesList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListVolumesSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListVolumesSample.ts index 4c51f3e86bd5..fef7aef70825 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListVolumesSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesListVolumesSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/SnapshotPolicies_ListVolumes.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_ListVolumes.json */ async function snapshotPoliciesListVolumes() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesUpdateSample.ts index 3605b9917084..149027a25a16 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotPoliciesUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/SnapshotPolicies_Update.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Update.json */ async function snapshotPoliciesUpdate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsCreateSample.ts index 61a67e8db4d3..a5ce922be485 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotsCreateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsCreateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Snapshots_Create.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Create.json */ async function snapshotsCreate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsDeleteSample.ts index 22aed2be43a1..e5fcdca7bfbb 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotsDeleteSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Delete snapshot * * @summary Delete snapshot - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Snapshots_Delete.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Delete.json */ async function snapshotsDelete() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsGetSample.ts index 2ed101c64a63..d022a1c4641e 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotsGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Snapshots_Get.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Get.json */ async function snapshotsGet() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsListSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsListSample.ts index 1f619512e4fb..3e6b274df61f 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotsListSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Snapshots_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_List.json */ async function snapshotsList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsRestoreFilesSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsRestoreFilesSample.ts index 93070d6a8169..cf8c6d188b99 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotsRestoreFilesSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsRestoreFilesSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * 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/2023-05-01/examples/Snapshots_SingleFileRestore.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_SingleFileRestore.json */ async function snapshotsSingleFileRestore() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/snapshotsUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/snapshotsUpdateSample.ts index f38fe415d72d..413c1e71fdf8 100644 --- a/sdk/netapp/arm-netapp/samples-dev/snapshotsUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/snapshotsUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Patch a snapshot * * @summary Patch a snapshot - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Snapshots_Update.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Update.json */ async function snapshotsUpdate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesCreateSample.ts index 008ef9db5709..bf067d8f406f 100644 --- a/sdk/netapp/arm-netapp/samples-dev/subvolumesCreateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesCreateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Subvolumes_Create.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Create.json */ async function subvolumesCreate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesDeleteSample.ts index d33128bf507f..7dd5570262e8 100644 --- a/sdk/netapp/arm-netapp/samples-dev/subvolumesDeleteSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Delete subvolume * * @summary Delete subvolume - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Subvolumes_Delete.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Delete.json */ async function subvolumesDelete() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesGetMetadataSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesGetMetadataSample.ts index b377365b2224..abadb46aa9c0 100644 --- a/sdk/netapp/arm-netapp/samples-dev/subvolumesGetMetadataSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesGetMetadataSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Subvolumes_Metadata.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Metadata.json */ async function subvolumesMetadata() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesGetSample.ts index 463e5a6f7080..a1c2a6cd64d5 100644 --- a/sdk/netapp/arm-netapp/samples-dev/subvolumesGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Subvolumes_Get.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Get.json */ async function subvolumesGet() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesListByVolumeSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesListByVolumeSample.ts index 75a1ce1e036d..bac5cfd473dd 100644 --- a/sdk/netapp/arm-netapp/samples-dev/subvolumesListByVolumeSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesListByVolumeSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Subvolumes_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_List.json */ async function subvolumesList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/subvolumesUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/subvolumesUpdateSample.ts index 08c3663f3197..b1ffe151c805 100644 --- a/sdk/netapp/arm-netapp/samples-dev/subvolumesUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/subvolumesUpdateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Patch a subvolume * * @summary Patch a subvolume - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Subvolumes_Update.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Update.json */ async function subvolumesUpdate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsCreateSample.ts index dee85d118c11..0f13621808dc 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsCreateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsCreateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/VolumeGroups_Create_Oracle.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Create_Oracle.json */ async function volumeGroupsCreateOracle() { const subscriptionId = @@ -460,7 +460,7 @@ async function volumeGroupsCreateOracle() { * 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/2023-05-01/examples/VolumeGroups_Create_SapHana.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Create_SapHana.json */ async function volumeGroupsCreateSapHana() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsDeleteSample.ts index 72d8a47e7997..e01302d73dcd 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsDeleteSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/VolumeGroups_Delete.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Delete.json */ async function volumeGroupsDelete() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsGetSample.ts index b105a170c87b..dc28f5ca1baf 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/VolumeGroups_Get_Oracle.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Get_Oracle.json */ async function volumeGroupsGetOracle() { const subscriptionId = @@ -41,7 +41,7 @@ async function volumeGroupsGetOracle() { * 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/2023-05-01/examples/VolumeGroups_Get_SapHana.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Get_SapHana.json */ async function volumeGroupsGetSapHana() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsListByNetAppAccountSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsListByNetAppAccountSample.ts index f86b3e66f004..c95287efcf06 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumeGroupsListByNetAppAccountSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumeGroupsListByNetAppAccountSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/VolumeGroups_List_Oracle.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_List_Oracle.json */ async function volumeGroupsListOracle() { const subscriptionId = @@ -42,7 +42,7 @@ async function volumeGroupsListOracle() { * 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/2023-05-01/examples/VolumeGroups_List_SapHana.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_List_SapHana.json */ async function volumeGroupsListSapHana() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesCreateSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesCreateSample.ts index fd7c4ec1651b..2635560f8c1f 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesCreateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesCreateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Create the specified quota rule within the given volume * * @summary Create the specified quota rule within the given volume - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/VolumeQuotaRules_Create.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Create.json */ async function volumeQuotaRulesCreate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesDeleteSample.ts index 201f66cb7a5d..3bd1d48a0aba 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesDeleteSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Delete quota rule * * @summary Delete quota rule - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/VolumeQuotaRules_Delete.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Delete.json */ async function volumeQuotaRulesDelete() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesGetSample.ts index f9a08f574a34..ae6fa041a5d7 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Get details of the specified quota rule * * @summary Get details of the specified quota rule - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/VolumeQuotaRules_Get.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Get.json */ async function volumeQuotaRulesGet() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesListByVolumeSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesListByVolumeSample.ts index c678f0f46e12..633491b0db13 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesListByVolumeSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesListByVolumeSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all quota rules associated with the volume * * @summary List all quota rules associated with the volume - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/VolumeQuotaRules_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_List.json */ async function volumeQuotaRulesList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesUpdateSample.ts index a5490d0b51c8..d73d0af1c03b 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumeQuotaRulesUpdateSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Patch a quota rule * * @summary Patch a quota rule - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/VolumeQuotaRules_Update.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Update.json */ async function volumeQuotaRulesUpdate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesAuthorizeReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesAuthorizeReplicationSample.ts index afdb586b8f39..34f5e7d6773b 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesAuthorizeReplicationSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesAuthorizeReplicationSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_AuthorizeReplication.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_AuthorizeReplication.json */ async function volumesAuthorizeReplication() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesBreakFileLocksSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesBreakFileLocksSample.ts index b18995c7a729..4968b24e20c5 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesBreakFileLocksSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesBreakFileLocksSample.ts @@ -22,7 +22,7 @@ dotenv.config(); * This sample demonstrates how to Break all the file locks on a volume * * @summary Break all the file locks on a volume - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_BreakFileLocks.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_BreakFileLocks.json */ async function volumesBreakFileLocks() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesBreakReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesBreakReplicationSample.ts index fce98c6cffb4..8e71b4fb4187 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesBreakReplicationSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesBreakReplicationSample.ts @@ -22,7 +22,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_BreakReplication.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_BreakReplication.json */ async function volumesBreakReplication() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesCreateOrUpdateSample.ts index 6f1e0e6f3a4a..b3eb6943dbbf 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesCreateOrUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesCreateOrUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_CreateOrUpdate.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_CreateOrUpdate.json */ async function volumesCreateOrUpdate() { const subscriptionId = @@ -30,10 +30,12 @@ async function volumesCreateOrUpdate() { 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(); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesDeleteReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesDeleteReplicationSample.ts index 7cac6bae5cb9..96063c59f5fd 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesDeleteReplicationSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesDeleteReplicationSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_DeleteReplication.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_DeleteReplication.json */ async function volumesDeleteReplication() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesDeleteSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesDeleteSample.ts index 3f2b6e5b3b47..75a4bce9ad86 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesDeleteSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_Delete.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Delete.json */ async function volumesDelete() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesFinalizeRelocationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesFinalizeRelocationSample.ts index a6eef130ddd4..084aad858a59 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesFinalizeRelocationSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesFinalizeRelocationSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Finalizes the relocation of the volume and cleans up the old volume. * * @summary Finalizes the relocation of the volume and cleans up the old volume. - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_FinalizeRelocation.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_FinalizeRelocation.json */ async function volumesFinalizeRelocation() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesGetSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesGetSample.ts index a48e1c5dc56b..9cd849ab90d0 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesGetSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_Get.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Get.json */ async function volumesGet() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesListGetGroupIdListForLdapUserSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesListGetGroupIdListForLdapUserSample.ts index 8aa9ee49096e..5bc7dd0c12f5 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesListGetGroupIdListForLdapUserSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesListGetGroupIdListForLdapUserSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Returns the list of group Ids for a specific LDAP User * * @summary Returns the list of group Ids for a specific LDAP User - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/GroupIdListForLDAPUser.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/GroupIdListForLDAPUser.json */ async function getGroupIdListForUser() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesListReplicationsSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesListReplicationsSample.ts index b707242657e4..25b4ea9e10d7 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesListReplicationsSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesListReplicationsSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to List all replications for a specified volume * * @summary List all replications for a specified volume - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_ListReplications.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ListReplications.json */ async function volumesListReplications() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesListSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesListSample.ts index 916c1b6d159e..1e6320a9ad05 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesListSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesListSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_List.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_List.json */ async function volumesList() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesPoolChangeSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesPoolChangeSample.ts index baf058a58f3f..e9bcd70a6317 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesPoolChangeSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesPoolChangeSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_PoolChange.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_PoolChange.json */ async function volumesAuthorizeReplication() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesPopulateAvailabilityZoneSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesPopulateAvailabilityZoneSample.ts index c1985a3c12fc..c363a99c4af3 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesPopulateAvailabilityZoneSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesPopulateAvailabilityZoneSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to This operation will populate availability zone information for a volume * * @summary This operation will populate availability zone information for a volume - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_PopulateAvailabilityZones.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_PopulateAvailabilityZones.json */ async function volumesPopulateAvailabilityZones() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesReInitializeReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesReInitializeReplicationSample.ts index 0784c89e7068..2b8e869cc66a 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesReInitializeReplicationSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesReInitializeReplicationSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_ReInitializeReplication.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReInitializeReplication.json */ async function volumesReInitializeReplication() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesReestablishReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesReestablishReplicationSample.ts index 7d6575cd7e9e..74f3243493aa 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesReestablishReplicationSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesReestablishReplicationSample.ts @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots * * @summary Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_ReestablishReplication.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReestablishReplication.json */ async function volumesReestablishReplication() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesRelocateSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesRelocateSample.ts index 334a090c4c3d..3c278a1211af 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesRelocateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesRelocateSample.ts @@ -22,7 +22,7 @@ dotenv.config(); * This sample demonstrates how to Relocates volume to a new stamp * * @summary Relocates volume to a new stamp - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_Relocate.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Relocate.json */ async function volumesRelocate() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesReplicationStatusSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesReplicationStatusSample.ts index 700945c9da1c..703a80c6a2cc 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesReplicationStatusSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesReplicationStatusSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_ReplicationStatus.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReplicationStatus.json */ async function volumesReplicationStatus() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesResetCifsPasswordSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesResetCifsPasswordSample.ts index e1b9ffd66ccb..bfdd4ad6ab8a 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesResetCifsPasswordSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesResetCifsPasswordSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Reset cifs password from volume * * @summary Reset cifs password from volume - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_ResetCifsPassword.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ResetCifsPassword.json */ async function volumesResetCifsPassword() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesResyncReplicationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesResyncReplicationSample.ts index 3fe10211d92d..819e72b259cc 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesResyncReplicationSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesResyncReplicationSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_ResyncReplication.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ResyncReplication.json */ async function volumesResyncReplication() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesRevertRelocationSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesRevertRelocationSample.ts index 6316da080d79..971c433827cb 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesRevertRelocationSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesRevertRelocationSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. * * @summary Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. - * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/Volumes_RevertRelocation.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_RevertRelocation.json */ async function volumesRevertRelocation() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesRevertSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesRevertSample.ts index e5bc335094f9..be658f3923d5 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesRevertSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesRevertSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_Revert.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Revert.json */ async function volumesRevert() { const subscriptionId = diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesSplitCloneFromParentSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesSplitCloneFromParentSample.ts new file mode 100644 index 000000000000..83a8764fe8f2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples-dev/volumesSplitCloneFromParentSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Split operation to convert clone volume to an independent volume. + * + * @summary Split operation to convert clone volume to an independent volume. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_SplitClone.json + */ +async function volumesSplitClone() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginSplitCloneFromParentAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +async function main() { + volumesSplitClone(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples-dev/volumesUpdateSample.ts b/sdk/netapp/arm-netapp/samples-dev/volumesUpdateSample.ts index e5a415d8cbb9..1b1facca9524 100644 --- a/sdk/netapp/arm-netapp/samples-dev/volumesUpdateSample.ts +++ b/sdk/netapp/arm-netapp/samples-dev/volumesUpdateSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * 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/2023-05-01/examples/Volumes_Update.json + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Update.json */ async function volumesUpdate() { const subscriptionId = @@ -28,7 +28,17 @@ async function volumesUpdate() { const accountName = "account1"; const poolName = "pool1"; const volumeName = "volume1"; - const body: VolumePatch = {}; + const body: VolumePatch = { + dataProtection: { + backup: { + backupEnabled: true, + backupVaultId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRP/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1", + policyEnforced: false + } + }, + location: "eastus" + }; const credential = new DefaultAzureCredential(); const client = new NetAppManagementClient(credential, subscriptionId); const result = await client.volumes.beginUpdateAndWait( diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/README.md b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/README.md new file mode 100644 index 000000000000..d2799d0c39f3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/README.md @@ -0,0 +1,242 @@ +# client library samples for JavaScript (Beta) + +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/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Backups_Account_Get.json | +| [accountBackupsListByNetAppAccountSample.js][accountbackupslistbynetappaccountsample] | List all Backups for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Accounts_CreateOrUpdate.json | +| [accountsDeleteSample.js][accountsdeletesample] | Delete the specified NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_Delete.json | +| [accountsGetSample.js][accountsgetsample] | Get the NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Accounts_List.json | +| [accountsMigrateEncryptionKeySample.js][accountsmigrateencryptionkeysample] | Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from another account. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_MigrateEncryptionKey.json | +| [accountsRenewCredentialsSample.js][accountsrenewcredentialssample] | Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_RenewCredentials.json | +| [accountsUpdateSample.js][accountsupdatesample] | Patch the specified NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_Update.json | +| [backupPoliciesCreateSample.js][backuppoliciescreatesample] | Create a backup policy for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Create.json | +| [backupPoliciesDeleteSample.js][backuppoliciesdeletesample] | Delete backup policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Delete.json | +| [backupPoliciesGetSample.js][backuppoliciesgetsample] | Get a particular backup Policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Get.json | +| [backupPoliciesListSample.js][backuppolicieslistsample] | List backup policies for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_List.json | +| [backupPoliciesUpdateSample.js][backuppoliciesupdatesample] | Patch a backup policy for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Update.json | +| [backupVaultsCreateOrUpdateSample.js][backupvaultscreateorupdatesample] | Create or update the specified Backup Vault in the NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Create.json | +| [backupVaultsDeleteSample.js][backupvaultsdeletesample] | Delete the specified Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Delete.json | +| [backupVaultsGetSample.js][backupvaultsgetsample] | Get the Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Get.json | +| [backupVaultsListByNetAppAccountSample.js][backupvaultslistbynetappaccountsample] | List and describe all Backup Vaults in the NetApp account. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_List.json | +| [backupVaultsUpdateSample.js][backupvaultsupdatesample] | Patch the specified NetApp Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Update.json | +| [backupsCreateSample.js][backupscreatesample] | Create a backup under the Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Create.json | +| [backupsDeleteSample.js][backupsdeletesample] | Delete a Backup under the Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Delete.json | +| [backupsGetLatestStatusSample.js][backupsgetlateststatussample] | Get the latest status of the backup for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_LatestBackupStatus.json | +| [backupsGetSample.js][backupsgetsample] | Get the specified Backup under Backup Vault. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Get.json | +| [backupsGetVolumeRestoreStatusSample.js][backupsgetvolumerestorestatussample] | Get the status of the restore for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_RestoreStatus.json | +| [backupsListByVaultSample.js][backupslistbyvaultsample] | List all backups Under a Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_List.json | +| [backupsUnderAccountMigrateBackupsSample.js][backupsunderaccountmigratebackupssample] | Migrate the backups under a NetApp account to backup vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderAccount_Migrate.json | +| [backupsUnderBackupVaultRestoreFilesSample.js][backupsunderbackupvaultrestorefilessample] | Restore the specified files from the specified backup to the active filesystem x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_SingleFileRestore.json | +| [backupsUnderVolumeMigrateBackupsSample.js][backupsundervolumemigratebackupssample] | Migrate the backups under volume to backup vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderVolume_Migrate.json | +| [backupsUpdateSample.js][backupsupdatesample] | Patch a Backup under the Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Update.json | +| [netAppResourceCheckFilePathAvailabilitySample.js][netappresourcecheckfilepathavailabilitysample] | Check if a file path is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/CheckFilePathAvailability.json | +| [netAppResourceCheckNameAvailabilitySample.js][netappresourcechecknameavailabilitysample] | Check if a resource name is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/CheckNameAvailability.json | +| [netAppResourceCheckQuotaAvailabilitySample.js][netappresourcecheckquotaavailabilitysample] | Check if a quota is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/CheckQuotaAvailability.json | +| [netAppResourceQueryNetworkSiblingSetSample.js][netappresourcequerynetworksiblingsetsample] | Get details of the specified network sibling set. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Query.json | +| [netAppResourceQueryRegionInfoSample.js][netappresourcequeryregioninfosample] | Provides storage to network proximity and logical zone mapping information. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfo.json | +| [netAppResourceQuotaLimitsGetSample.js][netappresourcequotalimitsgetsample] | Get the default and current subscription quota limit x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/QuotaLimits_List.json | +| [netAppResourceRegionInfosGetSample.js][netappresourceregioninfosgetsample] | Provides storage to network proximity and logical zone mapping information. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_Get.json | +| [netAppResourceRegionInfosListSample.js][netappresourceregioninfoslistsample] | Provides region specific information. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_List.json | +| [netAppResourceUpdateNetworkSiblingSetSample.js][netappresourceupdatenetworksiblingsetsample] | Update the network features of the specified network sibling set. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Update.json | +| [operationsListSample.js][operationslistsample] | Lists all of the available Microsoft.NetApp Rest API operations x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/OperationList.json | +| [poolsCreateOrUpdateSample.js][poolscreateorupdatesample] | Create or Update a capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_CreateOrUpdate.json | +| [poolsDeleteSample.js][poolsdeletesample] | Delete the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_Delete.json | +| [poolsGetSample.js][poolsgetsample] | Get details of the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Pools_List.json | +| [poolsUpdateSample.js][poolsupdatesample] | Patch the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_Update.json | +| [snapshotPoliciesCreateSample.js][snapshotpoliciescreatesample] | Create a snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Create.json | +| [snapshotPoliciesDeleteSample.js][snapshotpoliciesdeletesample] | Delete snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Delete.json | +| [snapshotPoliciesGetSample.js][snapshotpoliciesgetsample] | Get a snapshot Policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Get.json | +| [snapshotPoliciesListSample.js][snapshotpolicieslistsample] | List snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_List.json | +| [snapshotPoliciesListVolumesSample.js][snapshotpolicieslistvolumessample] | Get volumes associated with snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_ListVolumes.json | +| [snapshotPoliciesUpdateSample.js][snapshotpoliciesupdatesample] | Patch a snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Snapshots_Create.json | +| [snapshotsDeleteSample.js][snapshotsdeletesample] | Delete snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Delete.json | +| [snapshotsGetSample.js][snapshotsgetsample] | Get details of the specified snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Get.json | +| [snapshotsListSample.js][snapshotslistsample] | List all snapshots associated with the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Snapshots_SingleFileRestore.json | +| [snapshotsUpdateSample.js][snapshotsupdatesample] | Patch a snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Subvolumes_Create.json | +| [subvolumesDeleteSample.js][subvolumesdeletesample] | Delete subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Delete.json | +| [subvolumesGetMetadataSample.js][subvolumesgetmetadatasample] | Get details of the specified subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Subvolumes_List.json | +| [subvolumesUpdateSample.js][subvolumesupdatesample] | Patch a subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Update.json | +| [volumeGroupsCreateSample.js][volumegroupscreatesample] | Create a volume group along with specified volumes x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Create_Oracle.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/preview/2023-05-01-preview/examples/VolumeGroups_Delete.json | +| [volumeGroupsGetSample.js][volumegroupsgetsample] | Get details of the specified volume group x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Get_Oracle.json | +| [volumeGroupsListByNetAppAccountSample.js][volumegroupslistbynetappaccountsample] | List all volume groups for given account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_List_Oracle.json | +| [volumeQuotaRulesCreateSample.js][volumequotarulescreatesample] | Create the specified quota rule within the given volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Create.json | +| [volumeQuotaRulesDeleteSample.js][volumequotarulesdeletesample] | Delete quota rule x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Delete.json | +| [volumeQuotaRulesGetSample.js][volumequotarulesgetsample] | Get details of the specified quota rule x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Get.json | +| [volumeQuotaRulesListByVolumeSample.js][volumequotaruleslistbyvolumesample] | List all quota rules associated with the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_List.json | +| [volumeQuotaRulesUpdateSample.js][volumequotarulesupdatesample] | Patch a quota rule x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Update.json | +| [volumesAuthorizeReplicationSample.js][volumesauthorizereplicationsample] | Authorize the replication connection on the source volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_AuthorizeReplication.json | +| [volumesBreakFileLocksSample.js][volumesbreakfilelockssample] | Break all the file locks on a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_BreakFileLocks.json | +| [volumesBreakReplicationSample.js][volumesbreakreplicationsample] | Break the replication connection on the destination volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Volumes_DeleteReplication.json | +| [volumesDeleteSample.js][volumesdeletesample] | Delete the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Delete.json | +| [volumesFinalizeRelocationSample.js][volumesfinalizerelocationsample] | Finalizes the relocation of the volume and cleans up the old volume. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_FinalizeRelocation.json | +| [volumesGetSample.js][volumesgetsample] | Get the details of the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Get.json | +| [volumesListGetGroupIdListForLdapUserSample.js][volumeslistgetgroupidlistforldapusersample] | Returns the list of group Ids for a specific LDAP User x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/GroupIdListForLDAPUser.json | +| [volumesListReplicationsSample.js][volumeslistreplicationssample] | List all replications for a specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ListReplications.json | +| [volumesListSample.js][volumeslistsample] | List all volumes within the capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_List.json | +| [volumesPoolChangeSample.js][volumespoolchangesample] | Moves volume to another pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_PoolChange.json | +| [volumesPopulateAvailabilityZoneSample.js][volumespopulateavailabilityzonesample] | This operation will populate availability zone information for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_PopulateAvailabilityZones.json | +| [volumesReInitializeReplicationSample.js][volumesreinitializereplicationsample] | Re-Initializes the replication connection on the destination volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReInitializeReplication.json | +| [volumesReestablishReplicationSample.js][volumesreestablishreplicationsample] | Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReestablishReplication.json | +| [volumesRelocateSample.js][volumesrelocatesample] | Relocates volume to a new stamp x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Relocate.json | +| [volumesReplicationStatusSample.js][volumesreplicationstatussample] | Get the status of the replication x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReplicationStatus.json | +| [volumesResetCifsPasswordSample.js][volumesresetcifspasswordsample] | Reset cifs password from volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ResetCifsPassword.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/preview/2023-05-01-preview/examples/Volumes_ResyncReplication.json | +| [volumesRevertRelocationSample.js][volumesrevertrelocationsample] | Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_RevertRelocation.json | +| [volumesRevertSample.js][volumesrevertsample] | Revert a volume to the snapshot specified in the body x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Revert.json | +| [volumesSplitCloneFromParentSample.js][volumessplitclonefromparentsample] | Split operation to convert clone volume to an independent volume. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_SplitClone.json | +| [volumesUpdateSample.js][volumesupdatesample] | Patch the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Update.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node 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 NETAPP_SUBSCRIPTION_ID="" NETAPP_RESOURCE_GROUP="" 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/v20-beta/javascript/accountBackupsDeleteSample.js +[accountbackupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsGetSample.js +[accountbackupslistbynetappaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsListByNetAppAccountSample.js +[accountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsCreateOrUpdateSample.js +[accountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsDeleteSample.js +[accountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsGetSample.js +[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsListBySubscriptionSample.js +[accountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsListSample.js +[accountsmigrateencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsMigrateEncryptionKeySample.js +[accountsrenewcredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsRenewCredentialsSample.js +[accountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsUpdateSample.js +[backuppoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesCreateSample.js +[backuppoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesDeleteSample.js +[backuppoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesGetSample.js +[backuppolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesListSample.js +[backuppoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesUpdateSample.js +[backupvaultscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsCreateOrUpdateSample.js +[backupvaultsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsDeleteSample.js +[backupvaultsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsGetSample.js +[backupvaultslistbynetappaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsListByNetAppAccountSample.js +[backupvaultsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsUpdateSample.js +[backupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsCreateSample.js +[backupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsDeleteSample.js +[backupsgetlateststatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetLatestStatusSample.js +[backupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetSample.js +[backupsgetvolumerestorestatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetVolumeRestoreStatusSample.js +[backupslistbyvaultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsListByVaultSample.js +[backupsunderaccountmigratebackupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderAccountMigrateBackupsSample.js +[backupsunderbackupvaultrestorefilessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderBackupVaultRestoreFilesSample.js +[backupsundervolumemigratebackupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderVolumeMigrateBackupsSample.js +[backupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUpdateSample.js +[netappresourcecheckfilepathavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckFilePathAvailabilitySample.js +[netappresourcechecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckNameAvailabilitySample.js +[netappresourcecheckquotaavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckQuotaAvailabilitySample.js +[netappresourcequerynetworksiblingsetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQueryNetworkSiblingSetSample.js +[netappresourcequeryregioninfosample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQueryRegionInfoSample.js +[netappresourcequotalimitsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQuotaLimitsGetSample.js +[netappresourcequotalimitslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQuotaLimitsListSample.js +[netappresourceregioninfosgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceRegionInfosGetSample.js +[netappresourceregioninfoslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceRegionInfosListSample.js +[netappresourceupdatenetworksiblingsetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceUpdateNetworkSiblingSetSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/operationsListSample.js +[poolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsCreateOrUpdateSample.js +[poolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsDeleteSample.js +[poolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsGetSample.js +[poolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsListSample.js +[poolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsUpdateSample.js +[snapshotpoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesCreateSample.js +[snapshotpoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesDeleteSample.js +[snapshotpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesGetSample.js +[snapshotpolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesListSample.js +[snapshotpolicieslistvolumessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesListVolumesSample.js +[snapshotpoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesUpdateSample.js +[snapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsCreateSample.js +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsDeleteSample.js +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsGetSample.js +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsListSample.js +[snapshotsrestorefilessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsRestoreFilesSample.js +[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsUpdateSample.js +[subvolumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesCreateSample.js +[subvolumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesDeleteSample.js +[subvolumesgetmetadatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesGetMetadataSample.js +[subvolumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesGetSample.js +[subvolumeslistbyvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesListByVolumeSample.js +[subvolumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesUpdateSample.js +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsCreateSample.js +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsDeleteSample.js +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsGetSample.js +[volumegroupslistbynetappaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsListByNetAppAccountSample.js +[volumequotarulescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesCreateSample.js +[volumequotarulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesDeleteSample.js +[volumequotarulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesGetSample.js +[volumequotaruleslistbyvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesListByVolumeSample.js +[volumequotarulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesUpdateSample.js +[volumesauthorizereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesAuthorizeReplicationSample.js +[volumesbreakfilelockssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesBreakFileLocksSample.js +[volumesbreakreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesBreakReplicationSample.js +[volumescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesCreateOrUpdateSample.js +[volumesdeletereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesDeleteReplicationSample.js +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesDeleteSample.js +[volumesfinalizerelocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesFinalizeRelocationSample.js +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesGetSample.js +[volumeslistgetgroupidlistforldapusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListGetGroupIdListForLdapUserSample.js +[volumeslistreplicationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListReplicationsSample.js +[volumeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListSample.js +[volumespoolchangesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesPoolChangeSample.js +[volumespopulateavailabilityzonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesPopulateAvailabilityZoneSample.js +[volumesreinitializereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReInitializeReplicationSample.js +[volumesreestablishreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReestablishReplicationSample.js +[volumesrelocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRelocateSample.js +[volumesreplicationstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReplicationStatusSample.js +[volumesresetcifspasswordsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesResetCifsPasswordSample.js +[volumesresyncreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesResyncReplicationSample.js +[volumesrevertrelocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRevertRelocationSample.js +[volumesrevertsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRevertSample.js +[volumessplitclonefromparentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesSplitCloneFromParentSample.js +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/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/v20-beta/javascript/accountBackupsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsDeleteSample.js new file mode 100644 index 000000000000..89a970a1d13f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsDeleteSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Backups_Account_Delete.json + */ +async function accountBackupsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountBackupsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsGetSample.js new file mode 100644 index 000000000000..37af4530968f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsGetSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Backups_Account_Get.json + */ +async function accountBackupsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountBackupsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsListByNetAppAccountSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsListByNetAppAccountSample.js new file mode 100644 index 000000000000..0c20b31287a9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountBackupsListByNetAppAccountSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Backups_Account_List.json + */ +async function accountBackupsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.listByNetAppAccount( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + accountBackupsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsCreateOrUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsCreateOrUpdateSample.js new file mode 100644 index 000000000000..356f13b42725 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsCreateOrUpdateSample.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_CreateOrUpdate.json + */ +async function accountsCreateOrUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + body, + ); + console.log(result); +} + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_CreateOrUpdateAD.json + */ +async function accountsCreateOrUpdateWithActiveDirectory() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body = { + activeDirectories: [ + { + aesEncryption: true, + dns: "10.10.10.3", + 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); +} + +async function main() { + accountsCreateOrUpdate(); + accountsCreateOrUpdateWithActiveDirectory(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsDeleteSample.js new file mode 100644 index 000000000000..ecdde01f72a3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsDeleteSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_Delete.json + */ +async function accountsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsGetSample.js new file mode 100644 index 000000000000..8a89b17b00de --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsGetSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get the NetApp account + * + * @summary Get the NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_Get.json + */ +async function accountsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsListBySubscriptionSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsListBySubscriptionSample.js new file mode 100644 index 000000000000..7a22b22226bb --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsListBySubscriptionSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "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); +} + +async function main() { + accountsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsListSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsListSample.js new file mode 100644 index 000000000000..5d76755f998e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsListSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsMigrateEncryptionKeySample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsMigrateEncryptionKeySample.js new file mode 100644 index 000000000000..30623f11199c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsMigrateEncryptionKeySample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from another account. + * + * @summary Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from another account. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_MigrateEncryptionKey.json + */ +async function accountsMigrateEncryptionKey() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body = { + privateEndpointId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/privateEndpoints/privip1", + virtualNetworkId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/vnet1", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginMigrateEncryptionKeyAndWait( + resourceGroupName, + accountName, + options, + ); + console.log(result); +} + +async function main() { + accountsMigrateEncryptionKey(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsRenewCredentialsSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsRenewCredentialsSample.js new file mode 100644 index 000000000000..9920d251303f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsRenewCredentialsSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. + * + * @summary Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_RenewCredentials.json + */ +async function accountsRenewCredentials() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginRenewCredentialsAndWait(resourceGroupName, accountName); + console.log(result); +} + +async function main() { + accountsRenewCredentials(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsUpdateSample.js new file mode 100644 index 000000000000..baeeaa3cea92 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/accountsUpdateSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_Update.json + */ +async function accountsUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesCreateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesCreateSample.js new file mode 100644 index 000000000000..85a463d27424 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesCreateSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/BackupPolicies_Create.json + */ +async function backupPoliciesCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupPoliciesCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesDeleteSample.js new file mode 100644 index 000000000000..7aa13db568a5 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesDeleteSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete backup policy + * + * @summary Delete backup policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Delete.json + */ +async function backupsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesGetSample.js new file mode 100644 index 000000000000..d9a296d7eb39 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesGetSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/BackupPolicies_Get.json + */ +async function backupsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesListSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesListSample.js new file mode 100644 index 000000000000..ed30bdf6324c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesListSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/BackupPolicies_List.json + */ +async function backupsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesUpdateSample.js new file mode 100644 index 000000000000..0456013773f2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupPoliciesUpdateSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/BackupPolicies_Update.json + */ +async function backupPoliciesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupPoliciesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsCreateOrUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsCreateOrUpdateSample.js new file mode 100644 index 000000000000..98c3c5c92209 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsCreateOrUpdateSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create or update the specified Backup Vault in the NetApp account + * + * @summary Create or update the specified Backup Vault in the NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Create.json + */ +async function backupVaultCreateOrUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const body = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + backupVaultName, + body, + ); + console.log(result); +} + +async function main() { + backupVaultCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsDeleteSample.js new file mode 100644 index 000000000000..ab9d43c1ffe3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsDeleteSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the specified Backup Vault + * + * @summary Delete the specified Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Delete.json + */ +async function backupVaultsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "resourceGroup"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.beginDeleteAndWait( + resourceGroupName, + accountName, + backupVaultName, + ); + console.log(result); +} + +async function main() { + backupVaultsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsGetSample.js new file mode 100644 index 000000000000..76881e7ec716 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsGetSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get the Backup Vault + * + * @summary Get the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Get.json + */ +async function backupVaultsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.get(resourceGroupName, accountName, backupVaultName); + console.log(result); +} + +async function main() { + backupVaultsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsListByNetAppAccountSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsListByNetAppAccountSample.js new file mode 100644 index 000000000000..f01e7084898a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsListByNetAppAccountSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List and describe all Backup Vaults in the NetApp account. + * + * @summary List and describe all Backup Vaults in the NetApp account. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_List.json + */ +async function backupVaultsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupVaults.listByNetAppAccount(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + backupVaultsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsUpdateSample.js new file mode 100644 index 000000000000..5ffa172c1707 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupVaultsUpdateSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch the specified NetApp Backup Vault + * + * @summary Patch the specified NetApp Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Update.json + */ +async function backupVaultsUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const body = { tags: { tag1: "Value1" } }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.beginUpdateAndWait( + resourceGroupName, + accountName, + backupVaultName, + body, + ); + console.log(result); +} + +async function main() { + backupVaultsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsCreateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsCreateSample.js new file mode 100644 index 000000000000..698713a92a37 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsCreateSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a backup under the Backup Vault + * + * @summary Create a backup under the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Create.json + */ +async function backupsUnderBackupVaultCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const body = { + label: "myLabel", + volumeResourceId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginCreateAndWait( + resourceGroupName, + accountName, + backupVaultName, + backupName, + body, + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsDeleteSample.js new file mode 100644 index 000000000000..3fc6a3dcde72 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsDeleteSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete a Backup under the Backup Vault + * + * @summary Delete a Backup under the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Delete.json + */ +async function backupsUnderBackupVaultDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "resourceGroup"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + resourceGroupName, + accountName, + backupVaultName, + backupName, + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetLatestStatusSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetLatestStatusSample.js new file mode 100644 index 000000000000..db0e8f370868 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetLatestStatusSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get the latest status of the backup for a volume + * + * @summary Get the latest status of the backup for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_LatestBackupStatus.json + */ +async function volumesBackupStatus() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.getLatestStatus( + resourceGroupName, + accountName, + poolName, + volumeName, + ); + console.log(result); +} + +async function main() { + volumesBackupStatus(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetSample.js new file mode 100644 index 000000000000..06b73145fd62 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get the specified Backup under Backup Vault. + * + * @summary Get the specified Backup under Backup Vault. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Get.json + */ +async function backupsUnderBackupVaultGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.get( + resourceGroupName, + accountName, + backupVaultName, + backupName, + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetVolumeRestoreStatusSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetVolumeRestoreStatusSample.js new file mode 100644 index 000000000000..de1c5c081f96 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsGetVolumeRestoreStatusSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_RestoreStatus.json + */ +async function volumesRestoreStatus() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesRestoreStatus(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsListByVaultSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsListByVaultSample.js new file mode 100644 index 000000000000..39eb229f2216 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsListByVaultSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List all backups Under a Backup Vault + * + * @summary List all backups Under a Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_List.json + */ +async function backupsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByVault( + resourceGroupName, + accountName, + backupVaultName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + backupsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderAccountMigrateBackupsSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderAccountMigrateBackupsSample.js new file mode 100644 index 000000000000..84810072bc25 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderAccountMigrateBackupsSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Migrate the backups under a NetApp account to backup vault + * + * @summary Migrate the backups under a NetApp account to backup vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderAccount_Migrate.json + */ +async function backupsUnderAccountMigrate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body = { + backupVaultId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupsUnderAccount.beginMigrateBackupsAndWait( + resourceGroupName, + accountName, + body, + ); + console.log(result); +} + +async function main() { + backupsUnderAccountMigrate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderBackupVaultRestoreFilesSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderBackupVaultRestoreFilesSample.js new file mode 100644 index 000000000000..7769fe00412d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderBackupVaultRestoreFilesSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Restore the specified files from the specified backup to the active filesystem + * + * @summary Restore the specified files from the specified backup to the active filesystem + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_SingleFileRestore.json + */ +async function backupsSingleFileRestore() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const body = { + destinationVolumeId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1", + fileList: ["/dir1/customer1.db", "/dir1/customer2.db"], + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupsUnderBackupVault.beginRestoreFilesAndWait( + resourceGroupName, + accountName, + backupVaultName, + backupName, + body, + ); + console.log(result); +} + +async function main() { + backupsSingleFileRestore(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderVolumeMigrateBackupsSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderVolumeMigrateBackupsSample.js new file mode 100644 index 000000000000..1a58084b3140 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUnderVolumeMigrateBackupsSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Migrate the backups under volume to backup vault + * + * @summary Migrate the backups under volume to backup vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderVolume_Migrate.json + */ +async function backupsUnderVolumeMigrate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { + backupVaultId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupsUnderVolume.beginMigrateBackupsAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body, + ); + console.log(result); +} + +async function main() { + backupsUnderVolumeMigrate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUpdateSample.js new file mode 100644 index 000000000000..909295f2c60e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/backupsUpdateSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch a Backup under the Backup Vault + * + * @summary Patch a Backup under the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Update.json + */ +async function backupsUnderBackupVaultUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + 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, + backupVaultName, + backupName, + options, + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckFilePathAvailabilitySample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckFilePathAvailabilitySample.js new file mode 100644 index 000000000000..6cbe5c6f5794 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckFilePathAvailabilitySample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/CheckFilePathAvailability.json + */ +async function checkFilePathAvailability() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "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); +} + +async function main() { + checkFilePathAvailability(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckNameAvailabilitySample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckNameAvailabilitySample.js new file mode 100644 index 000000000000..23dc09b9f1cf --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckNameAvailabilitySample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/CheckNameAvailability.json + */ +async function checkNameAvailability() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "accName"; + const typeParam = "Microsoft.NetApp/netAppAccounts"; + 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); +} + +async function main() { + checkNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckQuotaAvailabilitySample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckQuotaAvailabilitySample.js new file mode 100644 index 000000000000..43c4dd46a7c7 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceCheckQuotaAvailabilitySample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/CheckQuotaAvailability.json + */ +async function checkQuotaAvailability() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "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); +} + +async function main() { + checkQuotaAvailability(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQueryNetworkSiblingSetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQueryNetworkSiblingSetSample.js new file mode 100644 index 000000000000..2740819707cc --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQueryNetworkSiblingSetSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get details of the specified network sibling set. + * + * @summary Get details of the specified network sibling set. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Query.json + */ +async function networkSiblingSetQuery() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const networkSiblingSetId = "9760acf5-4638-11e7-9bdb-020073ca3333"; + const subnetId = + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.queryNetworkSiblingSet( + location, + networkSiblingSetId, + subnetId, + ); + console.log(result); +} + +async function main() { + networkSiblingSetQuery(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQueryRegionInfoSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQueryRegionInfoSample.js new file mode 100644 index 000000000000..a11ab3d15397 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQueryRegionInfoSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Provides storage to network proximity and logical zone mapping information. + * + * @summary Provides storage to network proximity and logical zone mapping information. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfo.json + */ +async function regionInfoQuery() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.queryRegionInfo(location); + console.log(result); +} + +async function main() { + regionInfoQuery(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQuotaLimitsGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQuotaLimitsGetSample.js new file mode 100644 index 000000000000..5a93893cb1d2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQuotaLimitsGetSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/QuotaLimits_Get.json + */ +async function quotaLimits() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "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); +} + +async function main() { + quotaLimits(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQuotaLimitsListSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQuotaLimitsListSample.js new file mode 100644 index 000000000000..90f2f6af4f90 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceQuotaLimitsListSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/QuotaLimits_List.json + */ +async function quotaLimits() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "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); +} + +async function main() { + quotaLimits(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceRegionInfosGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceRegionInfosGetSample.js new file mode 100644 index 000000000000..52609dc4fdee --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceRegionInfosGetSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Provides storage to network proximity and logical zone mapping information. + * + * @summary Provides storage to network proximity and logical zone mapping information. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_Get.json + */ +async function regionInfosGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResourceRegionInfos.get(location); + console.log(result); +} + +async function main() { + regionInfosGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceRegionInfosListSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceRegionInfosListSample.js new file mode 100644 index 000000000000..bfe7b8ce6851 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceRegionInfosListSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Provides region specific information. + * + * @summary Provides region specific information. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_List.json + */ +async function regionInfosList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "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.netAppResourceRegionInfos.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + regionInfosList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceUpdateNetworkSiblingSetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceUpdateNetworkSiblingSetSample.js new file mode 100644 index 000000000000..7b029fb77cf7 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/netAppResourceUpdateNetworkSiblingSetSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update the network features of the specified network sibling set. + * + * @summary Update the network features of the specified network sibling set. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Update.json + */ +async function networkFeaturesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const networkSiblingSetId = "9760acf5-4638-11e7-9bdb-020073ca3333"; + const subnetId = + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"; + const networkSiblingSetStateId = "12345_44420.8001578125"; + const networkFeatures = "Standard"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.beginUpdateNetworkSiblingSetAndWait( + location, + networkSiblingSetId, + subnetId, + networkSiblingSetStateId, + networkFeatures, + ); + console.log(result); +} + +async function main() { + networkFeaturesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/operationsListSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/operationsListSample.js new file mode 100644 index 000000000000..6231e1533d32 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/operationsListSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/OperationList.json + */ +async function operationList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "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); +} + +async function main() { + operationList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/package.json b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/package.json new file mode 100644 index 000000000000..d486a39dc024 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-netapp-js-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript (Beta)", + "engines": { + "node": ">=18.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": "next", + "dotenv": "latest", + "@azure/identity": "^3.3.0" + } +} diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsCreateOrUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsCreateOrUpdateSample.js new file mode 100644 index 000000000000..c56b3da8899e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsCreateOrUpdateSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_CreateOrUpdate.json + */ +async function poolsCreateOrUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsDeleteSample.js new file mode 100644 index 000000000000..444a1607455a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsDeleteSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_Delete.json + */ +async function poolsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsGetSample.js new file mode 100644 index 000000000000..18bcd9b1491f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsGetSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_Get.json + */ +async function poolsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsListSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsListSample.js new file mode 100644 index 000000000000..301c223a32cf --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsListSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_List.json + */ +async function poolsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsUpdateSample.js new file mode 100644 index 000000000000..920c62380824 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/poolsUpdateSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_Update.json + */ +async function poolsUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/sample.env b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/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/v20-beta/javascript/snapshotPoliciesCreateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesCreateSample.js new file mode 100644 index 000000000000..8311ad8fa779 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesCreateSample.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a snapshot policy + * + * @summary Create a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Create.json + */ +async function snapshotPoliciesCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesDeleteSample.js new file mode 100644 index 000000000000..63b9597839e8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesDeleteSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete snapshot policy + * + * @summary Delete snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Delete.json + */ +async function snapshotPoliciesDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesGetSample.js new file mode 100644 index 000000000000..fa1b2c6605c5 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesGetSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a snapshot Policy + * + * @summary Get a snapshot Policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Get.json + */ +async function snapshotPoliciesGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesListSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesListSample.js new file mode 100644 index 000000000000..412f44c5a93e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesListSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List snapshot policy + * + * @summary List snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_List.json + */ +async function snapshotPoliciesList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesListVolumesSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesListVolumesSample.js new file mode 100644 index 000000000000..4aca38404189 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesListVolumesSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/SnapshotPolicies_ListVolumes.json + */ +async function snapshotPoliciesListVolumes() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesListVolumes(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesUpdateSample.js new file mode 100644 index 000000000000..41fe961945e5 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotPoliciesUpdateSample.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch a snapshot policy + * + * @summary Patch a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Update.json + */ +async function snapshotPoliciesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsCreateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsCreateSample.js new file mode 100644 index 000000000000..e798709886d9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsCreateSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Snapshots_Create.json + */ +async function snapshotsCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsDeleteSample.js new file mode 100644 index 000000000000..9cd94b20626c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsDeleteSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete snapshot + * + * @summary Delete snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Delete.json + */ +async function snapshotsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsGetSample.js new file mode 100644 index 000000000000..558e0806fd39 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsGetSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Snapshots_Get.json + */ +async function snapshotsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsListSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsListSample.js new file mode 100644 index 000000000000..bf5924217f55 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsListSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Snapshots_List.json + */ +async function snapshotsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsRestoreFilesSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsRestoreFilesSample.js new file mode 100644 index 000000000000..80bee2e7adc2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsRestoreFilesSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Snapshots_SingleFileRestore.json + */ +async function snapshotsSingleFileRestore() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsSingleFileRestore(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsUpdateSample.js new file mode 100644 index 000000000000..cb235762ce65 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/snapshotsUpdateSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch a snapshot + * + * @summary Patch a snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Update.json + */ +async function snapshotsUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesCreateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesCreateSample.js new file mode 100644 index 000000000000..5c72839966f8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesCreateSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Subvolumes_Create.json + */ +async function subvolumesCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesDeleteSample.js new file mode 100644 index 000000000000..572992a983d9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesDeleteSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete subvolume + * + * @summary Delete subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Delete.json + */ +async function subvolumesDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesGetMetadataSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesGetMetadataSample.js new file mode 100644 index 000000000000..3f78d8ea6417 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesGetMetadataSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Subvolumes_Metadata.json + */ +async function subvolumesMetadata() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesMetadata(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesGetSample.js new file mode 100644 index 000000000000..e14ac63912cd --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesGetSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Subvolumes_Get.json + */ +async function subvolumesGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesListByVolumeSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesListByVolumeSample.js new file mode 100644 index 000000000000..39d28210f126 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesListByVolumeSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Subvolumes_List.json + */ +async function subvolumesList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesUpdateSample.js new file mode 100644 index 000000000000..73090d59f1ed --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/subvolumesUpdateSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch a subvolume + * + * @summary Patch a subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Update.json + */ +async function subvolumesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsCreateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsCreateSample.js new file mode 100644 index 000000000000..dc6332842d9b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsCreateSample.js @@ -0,0 +1,669 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Create_Oracle.json + */ +async function volumeGroupsCreateOracle() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const body = { + groupMetaData: { + applicationIdentifier: "OR2", + applicationType: "ORACLE", + groupDescription: "Volume group", + }, + location: "westus", + volumes: [ + { + name: "test-ora-data1", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data1", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data1", + zones: ["1"], + }, + { + name: "test-ora-data2", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data2", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data2", + zones: ["1"], + }, + { + name: "test-ora-data3", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data3", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data3", + zones: ["1"], + }, + { + name: "test-ora-data4", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data4", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data4", + zones: ["1"], + }, + { + name: "test-ora-data5", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data5", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data5", + zones: ["1"], + }, + { + name: "test-ora-data6", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data6", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data6", + zones: ["1"], + }, + { + name: "test-ora-data7", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data7", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data7", + zones: ["1"], + }, + { + name: "test-ora-data8", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data8", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data8", + zones: ["1"], + }, + { + name: "test-ora-log", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-log", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-log", + zones: ["1"], + }, + { + name: "test-ora-log-mirror", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-log-mirror", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-log-mirror", + zones: ["1"], + }, + { + name: "test-ora-binary", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-binary", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-binary", + zones: ["1"], + }, + { + name: "test-ora-backup", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-backup", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-backup", + zones: ["1"], + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + accountName, + volumeGroupName, + body, + ); + console.log(result); +} + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Create_SapHana.json + */ +async function volumeGroupsCreateSapHana() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const body = { + groupMetaData: { + applicationIdentifier: "SH9", + applicationType: "SAP-HANA", + groupDescription: "Volume group", + }, + location: "westus", + volumes: [ + { + name: "test-data-mnt00001", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-data-mnt00001", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + 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: "test-log-mnt00001", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-log-mnt00001", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + 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: "test-shared", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-shared", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + 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", + }, + { + name: "test-data-backup", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-data-backup", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + 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-backup", + }, + { + name: "test-log-backup", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-log-backup", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true, + }, + ], + }, + protocolTypes: ["NFSv4.1"], + 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-backup", + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + accountName, + volumeGroupName, + body, + ); + console.log(result); +} + +async function main() { + volumeGroupsCreateOracle(); + volumeGroupsCreateSapHana(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsDeleteSample.js new file mode 100644 index 000000000000..b4a43324486f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsDeleteSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Delete.json + */ +async function volumeGroupsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumeGroupsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsGetSample.js new file mode 100644 index 000000000000..3f19fd13da57 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsGetSample.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Get_Oracle.json + */ +async function volumeGroupsGetOracle() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Get_SapHana.json + */ +async function volumeGroupsGetSapHana() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumeGroupsGetOracle(); + volumeGroupsGetSapHana(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsListByNetAppAccountSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsListByNetAppAccountSample.js new file mode 100644 index 000000000000..da6a5ae7ca02 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeGroupsListByNetAppAccountSample.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_List_Oracle.json + */ +async function volumeGroupsListOracle() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_List_SapHana.json + */ +async function volumeGroupsListSapHana() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumeGroupsListOracle(); + volumeGroupsListSapHana(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesCreateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesCreateSample.js new file mode 100644 index 000000000000..25b49fadb99a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesCreateSample.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create the specified quota rule within the given volume + * + * @summary Create the specified quota rule within the given volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Create.json + */ +async function volumeQuotaRulesCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const volumeQuotaRuleName = "rule-0004"; + const body = { + location: "westus", + quotaSizeInKiBs: 100005, + quotaTarget: "1821", + quotaType: "IndividualUserQuota", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeQuotaRules.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + volumeQuotaRuleName, + body, + ); + console.log(result); +} + +async function main() { + volumeQuotaRulesCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesDeleteSample.js new file mode 100644 index 000000000000..13b3edb3cc4e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesDeleteSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete quota rule + * + * @summary Delete quota rule + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Delete.json + */ +async function volumeQuotaRulesDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const volumeQuotaRuleName = "rule-0004"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeQuotaRules.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + volumeQuotaRuleName, + ); + console.log(result); +} + +async function main() { + volumeQuotaRulesDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesGetSample.js new file mode 100644 index 000000000000..f594c697b6d3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesGetSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get details of the specified quota rule + * + * @summary Get details of the specified quota rule + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Get.json + */ +async function volumeQuotaRulesGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const volumeQuotaRuleName = "rule-0004"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeQuotaRules.get( + resourceGroupName, + accountName, + poolName, + volumeName, + volumeQuotaRuleName, + ); + console.log(result); +} + +async function main() { + volumeQuotaRulesGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesListByVolumeSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesListByVolumeSample.js new file mode 100644 index 000000000000..d03646d3f293 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesListByVolumeSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List all quota rules associated with the volume + * + * @summary List all quota rules associated with the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_List.json + */ +async function volumeQuotaRulesList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumeQuotaRules.listByVolume( + resourceGroupName, + accountName, + poolName, + volumeName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + volumeQuotaRulesList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesUpdateSample.js new file mode 100644 index 000000000000..a5c45f0d79b9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumeQuotaRulesUpdateSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch a quota rule + * + * @summary Patch a quota rule + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Update.json + */ +async function volumeQuotaRulesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const volumeQuotaRuleName = "rule-0004"; + const body = { quotaSizeInKiBs: 100009 }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeQuotaRules.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + volumeQuotaRuleName, + body, + ); + console.log(result); +} + +async function main() { + volumeQuotaRulesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesAuthorizeReplicationSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesAuthorizeReplicationSample.js new file mode 100644 index 000000000000..9d0d273f0740 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesAuthorizeReplicationSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_AuthorizeReplication.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesAuthorizeReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesBreakFileLocksSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesBreakFileLocksSample.js new file mode 100644 index 000000000000..369613d5ee9d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesBreakFileLocksSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Break all the file locks on a volume + * + * @summary Break all the file locks on a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_BreakFileLocks.json + */ +async function volumesBreakFileLocks() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { + clientIp: "101.102.103.104", + confirmRunningDisruptiveOperation: true, + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginBreakFileLocksAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + options, + ); + console.log(result); +} + +async function main() { + volumesBreakFileLocks(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesBreakReplicationSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesBreakReplicationSample.js new file mode 100644 index 000000000000..8707ff772200 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesBreakReplicationSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_BreakReplication.json + */ +async function volumesBreakReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesBreakReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesCreateOrUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesCreateOrUpdateSample.js new file mode 100644 index 000000000000..a7bc02f7c935 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesCreateOrUpdateSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_CreateOrUpdate.json + */ +async function volumesCreateOrUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesDeleteReplicationSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesDeleteReplicationSample.js new file mode 100644 index 000000000000..866803190c31 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesDeleteReplicationSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_DeleteReplication.json + */ +async function volumesDeleteReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesDeleteReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesDeleteSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesDeleteSample.js new file mode 100644 index 000000000000..0ffaf51fcbd0 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesDeleteSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the specified volume + * + * @summary Delete the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Delete.json + */ +async function volumesDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesFinalizeRelocationSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesFinalizeRelocationSample.js new file mode 100644 index 000000000000..47a82676be0c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesFinalizeRelocationSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Finalizes the relocation of the volume and cleans up the old volume. + * + * @summary Finalizes the relocation of the volume and cleans up the old volume. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_FinalizeRelocation.json + */ +async function volumesFinalizeRelocation() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginFinalizeRelocationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + ); + console.log(result); +} + +async function main() { + volumesFinalizeRelocation(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesGetSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesGetSample.js new file mode 100644 index 000000000000..687c97f00cf2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesGetSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_Get.json + */ +async function volumesGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListGetGroupIdListForLdapUserSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListGetGroupIdListForLdapUserSample.js new file mode 100644 index 000000000000..8303cc313c84 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListGetGroupIdListForLdapUserSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Returns the list of group Ids for a specific LDAP User + * + * @summary Returns the list of group Ids for a specific LDAP User + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/GroupIdListForLDAPUser.json + */ +async function getGroupIdListForUser() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { username: "user1" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginListGetGroupIdListForLdapUserAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body, + ); + console.log(result); +} + +async function main() { + getGroupIdListForUser(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListReplicationsSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListReplicationsSample.js new file mode 100644 index 000000000000..5dd1cd534c70 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListReplicationsSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List all replications for a specified volume + * + * @summary List all replications for a specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ListReplications.json + */ +async function volumesListReplications() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.volumes.listReplications( + resourceGroupName, + accountName, + poolName, + volumeName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + volumesListReplications(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListSample.js new file mode 100644 index 000000000000..56bf8ed91300 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesListSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_List.json + */ +async function volumesList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesPoolChangeSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesPoolChangeSample.js new file mode 100644 index 000000000000..bf1ceb81466a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesPoolChangeSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_PoolChange.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesAuthorizeReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesPopulateAvailabilityZoneSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesPopulateAvailabilityZoneSample.js new file mode 100644 index 000000000000..fa7b0a268c67 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesPopulateAvailabilityZoneSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to This operation will populate availability zone information for a volume + * + * @summary This operation will populate availability zone information for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_PopulateAvailabilityZones.json + */ +async function volumesPopulateAvailabilityZones() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginPopulateAvailabilityZoneAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + ); + console.log(result); +} + +async function main() { + volumesPopulateAvailabilityZones(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReInitializeReplicationSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReInitializeReplicationSample.js new file mode 100644 index 000000000000..3026960b5a22 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReInitializeReplicationSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_ReInitializeReplication.json + */ +async function volumesReInitializeReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesReInitializeReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReestablishReplicationSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReestablishReplicationSample.js new file mode 100644 index 000000000000..1488e02af480 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReestablishReplicationSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots + * + * @summary Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReestablishReplication.json + */ +async function volumesReestablishReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { + sourceVolumeId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/mySourceRG/providers/Microsoft.NetApp/netAppAccounts/sourceAccount1/capacityPools/sourcePool1/volumes/sourceVolume1", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginReestablishReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body, + ); + console.log(result); +} + +async function main() { + volumesReestablishReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRelocateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRelocateSample.js new file mode 100644 index 000000000000..35c274ea533a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRelocateSample.js @@ -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. +const { NetAppManagementClient } = require("@azure/arm-netapp"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Relocates volume to a new stamp + * + * @summary Relocates volume to a new stamp + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Relocate.json + */ +async function volumesRelocate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = {}; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginRelocateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + options, + ); + console.log(result); +} + +async function main() { + volumesRelocate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReplicationStatusSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReplicationStatusSample.js new file mode 100644 index 000000000000..85e6eb16167e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesReplicationStatusSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_ReplicationStatus.json + */ +async function volumesReplicationStatus() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesReplicationStatus(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesResetCifsPasswordSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesResetCifsPasswordSample.js new file mode 100644 index 000000000000..4930682fc65a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesResetCifsPasswordSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Reset cifs password from volume + * + * @summary Reset cifs password from volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ResetCifsPassword.json + */ +async function volumesResetCifsPassword() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginResetCifsPasswordAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + ); + console.log(result); +} + +async function main() { + volumesResetCifsPassword(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesResyncReplicationSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesResyncReplicationSample.js new file mode 100644 index 000000000000..882f186a3062 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesResyncReplicationSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_ResyncReplication.json + */ +async function volumesResyncReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesResyncReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRevertRelocationSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRevertRelocationSample.js new file mode 100644 index 000000000000..59122df7035c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRevertRelocationSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. + * + * @summary Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_RevertRelocation.json + */ +async function volumesRevertRelocation() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginRevertRelocationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + ); + console.log(result); +} + +async function main() { + volumesRevertRelocation(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRevertSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRevertSample.js new file mode 100644 index 000000000000..0f1191416833 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesRevertSample.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"); +require("dotenv").config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_Revert.json + */ +async function volumesRevert() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesRevert(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesSplitCloneFromParentSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesSplitCloneFromParentSample.js new file mode 100644 index 000000000000..479163184261 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesSplitCloneFromParentSample.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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Split operation to convert clone volume to an independent volume. + * + * @summary Split operation to convert clone volume to an independent volume. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_SplitClone.json + */ +async function volumesSplitClone() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginSplitCloneFromParentAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + ); + console.log(result); +} + +async function main() { + volumesSplitClone(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesUpdateSample.js b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesUpdateSample.js new file mode 100644 index 000000000000..03af3792446a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/javascript/volumesUpdateSample.js @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch the specified volume + * + * @summary Patch the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Update.json + */ +async function volumesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body = { + dataProtection: { + backup: { + backupEnabled: true, + backupVaultId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRP/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1", + policyEnforced: false, + }, + }, + location: "eastus", + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body, + ); + console.log(result); +} + +async function main() { + volumesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/README.md b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/README.md new file mode 100644 index 000000000000..1cb7aed3c8dc --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/README.md @@ -0,0 +1,255 @@ +# client library samples for TypeScript (Beta) + +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/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Backups_Account_Get.json | +| [accountBackupsListByNetAppAccountSample.ts][accountbackupslistbynetappaccountsample] | List all Backups for a Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Accounts_CreateOrUpdate.json | +| [accountsDeleteSample.ts][accountsdeletesample] | Delete the specified NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_Delete.json | +| [accountsGetSample.ts][accountsgetsample] | Get the NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Accounts_List.json | +| [accountsMigrateEncryptionKeySample.ts][accountsmigrateencryptionkeysample] | Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from another account. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_MigrateEncryptionKey.json | +| [accountsRenewCredentialsSample.ts][accountsrenewcredentialssample] | Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_RenewCredentials.json | +| [accountsUpdateSample.ts][accountsupdatesample] | Patch the specified NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_Update.json | +| [backupPoliciesCreateSample.ts][backuppoliciescreatesample] | Create a backup policy for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Create.json | +| [backupPoliciesDeleteSample.ts][backuppoliciesdeletesample] | Delete backup policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Delete.json | +| [backupPoliciesGetSample.ts][backuppoliciesgetsample] | Get a particular backup Policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Get.json | +| [backupPoliciesListSample.ts][backuppolicieslistsample] | List backup policies for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_List.json | +| [backupPoliciesUpdateSample.ts][backuppoliciesupdatesample] | Patch a backup policy for Netapp Account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Update.json | +| [backupVaultsCreateOrUpdateSample.ts][backupvaultscreateorupdatesample] | Create or update the specified Backup Vault in the NetApp account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Create.json | +| [backupVaultsDeleteSample.ts][backupvaultsdeletesample] | Delete the specified Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Delete.json | +| [backupVaultsGetSample.ts][backupvaultsgetsample] | Get the Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Get.json | +| [backupVaultsListByNetAppAccountSample.ts][backupvaultslistbynetappaccountsample] | List and describe all Backup Vaults in the NetApp account. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_List.json | +| [backupVaultsUpdateSample.ts][backupvaultsupdatesample] | Patch the specified NetApp Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Update.json | +| [backupsCreateSample.ts][backupscreatesample] | Create a backup under the Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Create.json | +| [backupsDeleteSample.ts][backupsdeletesample] | Delete a Backup under the Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Delete.json | +| [backupsGetLatestStatusSample.ts][backupsgetlateststatussample] | Get the latest status of the backup for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_LatestBackupStatus.json | +| [backupsGetSample.ts][backupsgetsample] | Get the specified Backup under Backup Vault. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Get.json | +| [backupsGetVolumeRestoreStatusSample.ts][backupsgetvolumerestorestatussample] | Get the status of the restore for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_RestoreStatus.json | +| [backupsListByVaultSample.ts][backupslistbyvaultsample] | List all backups Under a Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_List.json | +| [backupsUnderAccountMigrateBackupsSample.ts][backupsunderaccountmigratebackupssample] | Migrate the backups under a NetApp account to backup vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderAccount_Migrate.json | +| [backupsUnderBackupVaultRestoreFilesSample.ts][backupsunderbackupvaultrestorefilessample] | Restore the specified files from the specified backup to the active filesystem x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_SingleFileRestore.json | +| [backupsUnderVolumeMigrateBackupsSample.ts][backupsundervolumemigratebackupssample] | Migrate the backups under volume to backup vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderVolume_Migrate.json | +| [backupsUpdateSample.ts][backupsupdatesample] | Patch a Backup under the Backup Vault x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Update.json | +| [netAppResourceCheckFilePathAvailabilitySample.ts][netappresourcecheckfilepathavailabilitysample] | Check if a file path is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/CheckFilePathAvailability.json | +| [netAppResourceCheckNameAvailabilitySample.ts][netappresourcechecknameavailabilitysample] | Check if a resource name is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/CheckNameAvailability.json | +| [netAppResourceCheckQuotaAvailabilitySample.ts][netappresourcecheckquotaavailabilitysample] | Check if a quota is available. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/CheckQuotaAvailability.json | +| [netAppResourceQueryNetworkSiblingSetSample.ts][netappresourcequerynetworksiblingsetsample] | Get details of the specified network sibling set. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Query.json | +| [netAppResourceQueryRegionInfoSample.ts][netappresourcequeryregioninfosample] | Provides storage to network proximity and logical zone mapping information. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfo.json | +| [netAppResourceQuotaLimitsGetSample.ts][netappresourcequotalimitsgetsample] | Get the default and current subscription quota limit x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/QuotaLimits_List.json | +| [netAppResourceRegionInfosGetSample.ts][netappresourceregioninfosgetsample] | Provides storage to network proximity and logical zone mapping information. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_Get.json | +| [netAppResourceRegionInfosListSample.ts][netappresourceregioninfoslistsample] | Provides region specific information. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_List.json | +| [netAppResourceUpdateNetworkSiblingSetSample.ts][netappresourceupdatenetworksiblingsetsample] | Update the network features of the specified network sibling set. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Update.json | +| [operationsListSample.ts][operationslistsample] | Lists all of the available Microsoft.NetApp Rest API operations x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/OperationList.json | +| [poolsCreateOrUpdateSample.ts][poolscreateorupdatesample] | Create or Update a capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_CreateOrUpdate.json | +| [poolsDeleteSample.ts][poolsdeletesample] | Delete the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_Delete.json | +| [poolsGetSample.ts][poolsgetsample] | Get details of the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Pools_List.json | +| [poolsUpdateSample.ts][poolsupdatesample] | Patch the specified capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Pools_Update.json | +| [snapshotPoliciesCreateSample.ts][snapshotpoliciescreatesample] | Create a snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Create.json | +| [snapshotPoliciesDeleteSample.ts][snapshotpoliciesdeletesample] | Delete snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Delete.json | +| [snapshotPoliciesGetSample.ts][snapshotpoliciesgetsample] | Get a snapshot Policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Get.json | +| [snapshotPoliciesListSample.ts][snapshotpolicieslistsample] | List snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_List.json | +| [snapshotPoliciesListVolumesSample.ts][snapshotpolicieslistvolumessample] | Get volumes associated with snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_ListVolumes.json | +| [snapshotPoliciesUpdateSample.ts][snapshotpoliciesupdatesample] | Patch a snapshot policy x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Snapshots_Create.json | +| [snapshotsDeleteSample.ts][snapshotsdeletesample] | Delete snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Delete.json | +| [snapshotsGetSample.ts][snapshotsgetsample] | Get details of the specified snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Get.json | +| [snapshotsListSample.ts][snapshotslistsample] | List all snapshots associated with the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Snapshots_SingleFileRestore.json | +| [snapshotsUpdateSample.ts][snapshotsupdatesample] | Patch a snapshot x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Subvolumes_Create.json | +| [subvolumesDeleteSample.ts][subvolumesdeletesample] | Delete subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Delete.json | +| [subvolumesGetMetadataSample.ts][subvolumesgetmetadatasample] | Get details of the specified subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Subvolumes_List.json | +| [subvolumesUpdateSample.ts][subvolumesupdatesample] | Patch a subvolume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Update.json | +| [volumeGroupsCreateSample.ts][volumegroupscreatesample] | Create a volume group along with specified volumes x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Create_Oracle.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/preview/2023-05-01-preview/examples/VolumeGroups_Delete.json | +| [volumeGroupsGetSample.ts][volumegroupsgetsample] | Get details of the specified volume group x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Get_Oracle.json | +| [volumeGroupsListByNetAppAccountSample.ts][volumegroupslistbynetappaccountsample] | List all volume groups for given account x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_List_Oracle.json | +| [volumeQuotaRulesCreateSample.ts][volumequotarulescreatesample] | Create the specified quota rule within the given volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Create.json | +| [volumeQuotaRulesDeleteSample.ts][volumequotarulesdeletesample] | Delete quota rule x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Delete.json | +| [volumeQuotaRulesGetSample.ts][volumequotarulesgetsample] | Get details of the specified quota rule x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Get.json | +| [volumeQuotaRulesListByVolumeSample.ts][volumequotaruleslistbyvolumesample] | List all quota rules associated with the volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_List.json | +| [volumeQuotaRulesUpdateSample.ts][volumequotarulesupdatesample] | Patch a quota rule x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Update.json | +| [volumesAuthorizeReplicationSample.ts][volumesauthorizereplicationsample] | Authorize the replication connection on the source volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_AuthorizeReplication.json | +| [volumesBreakFileLocksSample.ts][volumesbreakfilelockssample] | Break all the file locks on a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_BreakFileLocks.json | +| [volumesBreakReplicationSample.ts][volumesbreakreplicationsample] | Break the replication connection on the destination volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/preview/2023-05-01-preview/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/preview/2023-05-01-preview/examples/Volumes_DeleteReplication.json | +| [volumesDeleteSample.ts][volumesdeletesample] | Delete the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Delete.json | +| [volumesFinalizeRelocationSample.ts][volumesfinalizerelocationsample] | Finalizes the relocation of the volume and cleans up the old volume. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_FinalizeRelocation.json | +| [volumesGetSample.ts][volumesgetsample] | Get the details of the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Get.json | +| [volumesListGetGroupIdListForLdapUserSample.ts][volumeslistgetgroupidlistforldapusersample] | Returns the list of group Ids for a specific LDAP User x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/GroupIdListForLDAPUser.json | +| [volumesListReplicationsSample.ts][volumeslistreplicationssample] | List all replications for a specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ListReplications.json | +| [volumesListSample.ts][volumeslistsample] | List all volumes within the capacity pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_List.json | +| [volumesPoolChangeSample.ts][volumespoolchangesample] | Moves volume to another pool x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_PoolChange.json | +| [volumesPopulateAvailabilityZoneSample.ts][volumespopulateavailabilityzonesample] | This operation will populate availability zone information for a volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_PopulateAvailabilityZones.json | +| [volumesReInitializeReplicationSample.ts][volumesreinitializereplicationsample] | Re-Initializes the replication connection on the destination volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReInitializeReplication.json | +| [volumesReestablishReplicationSample.ts][volumesreestablishreplicationsample] | Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReestablishReplication.json | +| [volumesRelocateSample.ts][volumesrelocatesample] | Relocates volume to a new stamp x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Relocate.json | +| [volumesReplicationStatusSample.ts][volumesreplicationstatussample] | Get the status of the replication x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReplicationStatus.json | +| [volumesResetCifsPasswordSample.ts][volumesresetcifspasswordsample] | Reset cifs password from volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ResetCifsPassword.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/preview/2023-05-01-preview/examples/Volumes_ResyncReplication.json | +| [volumesRevertRelocationSample.ts][volumesrevertrelocationsample] | Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_RevertRelocation.json | +| [volumesRevertSample.ts][volumesrevertsample] | Revert a volume to the snapshot specified in the body x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Revert.json | +| [volumesSplitCloneFromParentSample.ts][volumessplitclonefromparentsample] | Split operation to convert clone volume to an independent volume. x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_SplitClone.json | +| [volumesUpdateSample.ts][volumesupdatesample] | Patch the specified volume x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Update.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/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 NETAPP_SUBSCRIPTION_ID="" NETAPP_RESOURCE_GROUP="" 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/v20-beta/typescript/src/accountBackupsDeleteSample.ts +[accountbackupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsGetSample.ts +[accountbackupslistbynetappaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsListByNetAppAccountSample.ts +[accountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsCreateOrUpdateSample.ts +[accountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsDeleteSample.ts +[accountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsGetSample.ts +[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsListBySubscriptionSample.ts +[accountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsListSample.ts +[accountsmigrateencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsMigrateEncryptionKeySample.ts +[accountsrenewcredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsRenewCredentialsSample.ts +[accountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsUpdateSample.ts +[backuppoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesCreateSample.ts +[backuppoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesDeleteSample.ts +[backuppoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesGetSample.ts +[backuppolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesListSample.ts +[backuppoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesUpdateSample.ts +[backupvaultscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsCreateOrUpdateSample.ts +[backupvaultsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsDeleteSample.ts +[backupvaultsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsGetSample.ts +[backupvaultslistbynetappaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsListByNetAppAccountSample.ts +[backupvaultsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsUpdateSample.ts +[backupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsCreateSample.ts +[backupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsDeleteSample.ts +[backupsgetlateststatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetLatestStatusSample.ts +[backupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetSample.ts +[backupsgetvolumerestorestatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetVolumeRestoreStatusSample.ts +[backupslistbyvaultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsListByVaultSample.ts +[backupsunderaccountmigratebackupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderAccountMigrateBackupsSample.ts +[backupsunderbackupvaultrestorefilessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderBackupVaultRestoreFilesSample.ts +[backupsundervolumemigratebackupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderVolumeMigrateBackupsSample.ts +[backupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUpdateSample.ts +[netappresourcecheckfilepathavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckFilePathAvailabilitySample.ts +[netappresourcechecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckNameAvailabilitySample.ts +[netappresourcecheckquotaavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckQuotaAvailabilitySample.ts +[netappresourcequerynetworksiblingsetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQueryNetworkSiblingSetSample.ts +[netappresourcequeryregioninfosample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQueryRegionInfoSample.ts +[netappresourcequotalimitsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQuotaLimitsGetSample.ts +[netappresourcequotalimitslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQuotaLimitsListSample.ts +[netappresourceregioninfosgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceRegionInfosGetSample.ts +[netappresourceregioninfoslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceRegionInfosListSample.ts +[netappresourceupdatenetworksiblingsetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceUpdateNetworkSiblingSetSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/operationsListSample.ts +[poolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsCreateOrUpdateSample.ts +[poolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsDeleteSample.ts +[poolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsGetSample.ts +[poolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsListSample.ts +[poolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsUpdateSample.ts +[snapshotpoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesCreateSample.ts +[snapshotpoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesDeleteSample.ts +[snapshotpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesGetSample.ts +[snapshotpolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesListSample.ts +[snapshotpolicieslistvolumessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesListVolumesSample.ts +[snapshotpoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesUpdateSample.ts +[snapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsCreateSample.ts +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsDeleteSample.ts +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsGetSample.ts +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsListSample.ts +[snapshotsrestorefilessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsRestoreFilesSample.ts +[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsUpdateSample.ts +[subvolumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesCreateSample.ts +[subvolumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesDeleteSample.ts +[subvolumesgetmetadatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesGetMetadataSample.ts +[subvolumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesGetSample.ts +[subvolumeslistbyvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesListByVolumeSample.ts +[subvolumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesUpdateSample.ts +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsCreateSample.ts +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsDeleteSample.ts +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsGetSample.ts +[volumegroupslistbynetappaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsListByNetAppAccountSample.ts +[volumequotarulescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesCreateSample.ts +[volumequotarulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesDeleteSample.ts +[volumequotarulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesGetSample.ts +[volumequotaruleslistbyvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesListByVolumeSample.ts +[volumequotarulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesUpdateSample.ts +[volumesauthorizereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesAuthorizeReplicationSample.ts +[volumesbreakfilelockssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesBreakFileLocksSample.ts +[volumesbreakreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesBreakReplicationSample.ts +[volumescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesCreateOrUpdateSample.ts +[volumesdeletereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesDeleteReplicationSample.ts +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesDeleteSample.ts +[volumesfinalizerelocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesFinalizeRelocationSample.ts +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesGetSample.ts +[volumeslistgetgroupidlistforldapusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListGetGroupIdListForLdapUserSample.ts +[volumeslistreplicationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListReplicationsSample.ts +[volumeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListSample.ts +[volumespoolchangesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesPoolChangeSample.ts +[volumespopulateavailabilityzonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesPopulateAvailabilityZoneSample.ts +[volumesreinitializereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReInitializeReplicationSample.ts +[volumesreestablishreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReestablishReplicationSample.ts +[volumesrelocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRelocateSample.ts +[volumesreplicationstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReplicationStatusSample.ts +[volumesresetcifspasswordsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesResetCifsPasswordSample.ts +[volumesresyncreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesResyncReplicationSample.ts +[volumesrevertrelocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRevertRelocationSample.ts +[volumesrevertsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRevertSample.ts +[volumessplitclonefromparentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesSplitCloneFromParentSample.ts +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/netapp/arm-netapp/samples/v20-beta/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/v20-beta/typescript/package.json b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/package.json new file mode 100644 index 000000000000..4a5bdfc1f29e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-netapp-ts-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript (Beta)", + "engines": { + "node": ">=18.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/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": "next", + "dotenv": "latest", + "@azure/identity": "^3.3.0" + }, + "devDependencies": { + "@types/node": "^18.0.0", + "typescript": "~5.2.0", + "rimraf": "latest" + } +} diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/sample.env b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/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/v20-beta/typescript/src/accountBackupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsDeleteSample.ts new file mode 100644 index 000000000000..a70df34e81e9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsDeleteSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Backups_Account_Delete.json + */ +async function accountBackupsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = + process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountBackupsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsGetSample.ts new file mode 100644 index 000000000000..2410c0df94ab --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Backups_Account_Get.json + */ +async function accountBackupsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountBackupsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsListByNetAppAccountSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsListByNetAppAccountSample.ts new file mode 100644 index 000000000000..b9f7624afc1f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountBackupsListByNetAppAccountSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Backups_Account_List.json + */ +async function accountBackupsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.listByNetAppAccount( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + accountBackupsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e53609546155 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsCreateOrUpdateSample.ts @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_CreateOrUpdate.json + */ +async function accountsCreateOrUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body: NetAppAccount = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + body + ); + console.log(result); +} + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_CreateOrUpdateAD.json + */ +async function accountsCreateOrUpdateWithActiveDirectory() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body: NetAppAccount = { + activeDirectories: [ + { + aesEncryption: true, + dns: "10.10.10.3", + 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); +} + +async function main() { + accountsCreateOrUpdate(); + accountsCreateOrUpdateWithActiveDirectory(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsDeleteSample.ts new file mode 100644 index 000000000000..e520aff851ff --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsDeleteSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_Delete.json + */ +async function accountsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsGetSample.ts new file mode 100644 index 000000000000..22a8a1ab0873 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsGetSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the NetApp account + * + * @summary Get the NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_Get.json + */ +async function accountsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsListBySubscriptionSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsListBySubscriptionSample.ts new file mode 100644 index 000000000000..1f292e0303b9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsListBySubscriptionSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "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); +} + +async function main() { + accountsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsListSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsListSample.ts new file mode 100644 index 000000000000..fc0b884f17c3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsListSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_List.json + */ +async function accountsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsMigrateEncryptionKeySample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsMigrateEncryptionKeySample.ts new file mode 100644 index 000000000000..4975f091426e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsMigrateEncryptionKeySample.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 { + EncryptionMigrationRequest, + AccountsMigrateEncryptionKeyOptionalParams, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from another account. + * + * @summary Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from another account. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_MigrateEncryptionKey.json + */ +async function accountsMigrateEncryptionKey() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body: EncryptionMigrationRequest = { + privateEndpointId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/privateEndpoints/privip1", + virtualNetworkId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/vnet1" + }; + const options: AccountsMigrateEncryptionKeyOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginMigrateEncryptionKeyAndWait( + resourceGroupName, + accountName, + options + ); + console.log(result); +} + +async function main() { + accountsMigrateEncryptionKey(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsRenewCredentialsSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsRenewCredentialsSample.ts new file mode 100644 index 000000000000..4d0b3ca77014 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsRenewCredentialsSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. + * + * @summary Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_RenewCredentials.json + */ +async function accountsRenewCredentials() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.accounts.beginRenewCredentialsAndWait( + resourceGroupName, + accountName + ); + console.log(result); +} + +async function main() { + accountsRenewCredentials(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsUpdateSample.ts new file mode 100644 index 000000000000..f70d57a33678 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/accountsUpdateSample.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 { NetAppAccountPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Accounts_Update.json + */ +async function accountsUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + accountsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesCreateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesCreateSample.ts new file mode 100644 index 000000000000..6b2316ba4533 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesCreateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/BackupPolicies_Create.json + */ +async function backupPoliciesCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupPoliciesCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesDeleteSample.ts new file mode 100644 index 000000000000..ab6bae9205cc --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesDeleteSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete backup policy + * + * @summary Delete backup policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupPolicies_Delete.json + */ +async function backupsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = + process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesGetSample.ts new file mode 100644 index 000000000000..53cc2fc4840c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/BackupPolicies_Get.json + */ +async function backupsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesListSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesListSample.ts new file mode 100644 index 000000000000..6c99bb47ce8e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesListSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/BackupPolicies_List.json + */ +async function backupsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesUpdateSample.ts new file mode 100644 index 000000000000..7b8288681132 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupPoliciesUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/BackupPolicies_Update.json + */ +async function backupPoliciesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + backupPoliciesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e741c2c215c6 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsCreateOrUpdateSample.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 { BackupVault, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update the specified Backup Vault in the NetApp account + * + * @summary Create or update the specified Backup Vault in the NetApp account + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Create.json + */ +async function backupVaultCreateOrUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const body: BackupVault = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.beginCreateOrUpdateAndWait( + resourceGroupName, + accountName, + backupVaultName, + body + ); + console.log(result); +} + +async function main() { + backupVaultCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsDeleteSample.ts new file mode 100644 index 000000000000..5918f68afc9d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsDeleteSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the specified Backup Vault + * + * @summary Delete the specified Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Delete.json + */ +async function backupVaultsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = + process.env["NETAPP_RESOURCE_GROUP"] || "resourceGroup"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.beginDeleteAndWait( + resourceGroupName, + accountName, + backupVaultName + ); + console.log(result); +} + +async function main() { + backupVaultsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsGetSample.ts new file mode 100644 index 000000000000..f12d1e74b43e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the Backup Vault + * + * @summary Get the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Get.json + */ +async function backupVaultsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.get( + resourceGroupName, + accountName, + backupVaultName + ); + console.log(result); +} + +async function main() { + backupVaultsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsListByNetAppAccountSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsListByNetAppAccountSample.ts new file mode 100644 index 000000000000..26db2a521b97 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsListByNetAppAccountSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List and describe all Backup Vaults in the NetApp account. + * + * @summary List and describe all Backup Vaults in the NetApp account. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_List.json + */ +async function backupVaultsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backupVaults.listByNetAppAccount( + resourceGroupName, + accountName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + backupVaultsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsUpdateSample.ts new file mode 100644 index 000000000000..90ad3a20022d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupVaultsUpdateSample.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 { BackupVaultPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch the specified NetApp Backup Vault + * + * @summary Patch the specified NetApp Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Update.json + */ +async function backupVaultsUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const body: BackupVaultPatch = { tags: { tag1: "Value1" } }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupVaults.beginUpdateAndWait( + resourceGroupName, + accountName, + backupVaultName, + body + ); + console.log(result); +} + +async function main() { + backupVaultsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsCreateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsCreateSample.ts new file mode 100644 index 000000000000..11eb66c7c2b7 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsCreateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a backup under the Backup Vault + * + * @summary Create a backup under the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Create.json + */ +async function backupsUnderBackupVaultCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const body: Backup = { + label: "myLabel", + volumeResourceId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginCreateAndWait( + resourceGroupName, + accountName, + backupVaultName, + backupName, + body + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsDeleteSample.ts new file mode 100644 index 000000000000..fec3afd8d873 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsDeleteSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete a Backup under the Backup Vault + * + * @summary Delete a Backup under the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Delete.json + */ +async function backupsUnderBackupVaultDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = + process.env["NETAPP_RESOURCE_GROUP"] || "resourceGroup"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.beginDeleteAndWait( + resourceGroupName, + accountName, + backupVaultName, + backupName + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetLatestStatusSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetLatestStatusSample.ts new file mode 100644 index 000000000000..bd1cb2a56c89 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetLatestStatusSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the latest status of the backup for a volume + * + * @summary Get the latest status of the backup for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_LatestBackupStatus.json + */ +async function volumesBackupStatus() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.getLatestStatus( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +async function main() { + volumesBackupStatus(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetSample.ts new file mode 100644 index 000000000000..98f4a3dd8d30 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the specified Backup under Backup Vault. + * + * @summary Get the specified Backup under Backup Vault. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Get.json + */ +async function backupsUnderBackupVaultGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backups.get( + resourceGroupName, + accountName, + backupVaultName, + backupName + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetVolumeRestoreStatusSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetVolumeRestoreStatusSample.ts new file mode 100644 index 000000000000..6d6ca819cdc8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsGetVolumeRestoreStatusSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_RestoreStatus.json + */ +async function volumesRestoreStatus() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesRestoreStatus(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsListByVaultSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsListByVaultSample.ts new file mode 100644 index 000000000000..828c41fbc9af --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsListByVaultSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List all backups Under a Backup Vault + * + * @summary List all backups Under a Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_List.json + */ +async function backupsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.backups.listByVault( + resourceGroupName, + accountName, + backupVaultName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + backupsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderAccountMigrateBackupsSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderAccountMigrateBackupsSample.ts new file mode 100644 index 000000000000..9bf1d05d2bf4 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderAccountMigrateBackupsSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + BackupsMigrationRequest, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Migrate the backups under a NetApp account to backup vault + * + * @summary Migrate the backups under a NetApp account to backup vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderAccount_Migrate.json + */ +async function backupsUnderAccountMigrate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const body: BackupsMigrationRequest = { + backupVaultId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupsUnderAccount.beginMigrateBackupsAndWait( + resourceGroupName, + accountName, + body + ); + console.log(result); +} + +async function main() { + backupsUnderAccountMigrate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderBackupVaultRestoreFilesSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderBackupVaultRestoreFilesSample.ts new file mode 100644 index 000000000000..d463fa78ae3d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderBackupVaultRestoreFilesSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { BackupRestoreFiles, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restore the specified files from the specified backup to the active filesystem + * + * @summary Restore the specified files from the specified backup to the active filesystem + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_SingleFileRestore.json + */ +async function backupsSingleFileRestore() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + const backupName = "backup1"; + const body: BackupRestoreFiles = { + destinationVolumeId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1", + fileList: ["/dir1/customer1.db", "/dir1/customer2.db"] + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupsUnderBackupVault.beginRestoreFilesAndWait( + resourceGroupName, + accountName, + backupVaultName, + backupName, + body + ); + console.log(result); +} + +async function main() { + backupsSingleFileRestore(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderVolumeMigrateBackupsSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderVolumeMigrateBackupsSample.ts new file mode 100644 index 000000000000..ab1ce078a0b4 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUnderVolumeMigrateBackupsSample.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 { + BackupsMigrationRequest, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Migrate the backups under volume to backup vault + * + * @summary Migrate the backups under volume to backup vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderVolume_Migrate.json + */ +async function backupsUnderVolumeMigrate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: BackupsMigrationRequest = { + backupVaultId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.backupsUnderVolume.beginMigrateBackupsAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +async function main() { + backupsUnderVolumeMigrate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUpdateSample.ts new file mode 100644 index 000000000000..07d90d61e774 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/backupsUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch a Backup under the Backup Vault + * + * @summary Patch a Backup under the Backup Vault + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_Update.json + */ +async function backupsUnderBackupVaultUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const backupVaultName = "backupVault1"; + 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, + backupVaultName, + backupName, + options + ); + console.log(result); +} + +async function main() { + backupsUnderBackupVaultUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckFilePathAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckFilePathAvailabilitySample.ts new file mode 100644 index 000000000000..63a0ea2906e4 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckFilePathAvailabilitySample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/CheckFilePathAvailability.json + */ +async function checkFilePathAvailability() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "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); +} + +async function main() { + checkFilePathAvailability(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckNameAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckNameAvailabilitySample.ts new file mode 100644 index 000000000000..3cc975b1d3f9 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckNameAvailabilitySample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/CheckNameAvailability.json + */ +async function checkNameAvailability() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const name = "accName"; + const typeParam = "Microsoft.NetApp/netAppAccounts"; + 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); +} + +async function main() { + checkNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckQuotaAvailabilitySample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckQuotaAvailabilitySample.ts new file mode 100644 index 000000000000..3378adbd26b4 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceCheckQuotaAvailabilitySample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/CheckQuotaAvailability.json + */ +async function checkQuotaAvailability() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "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); +} + +async function main() { + checkQuotaAvailability(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQueryNetworkSiblingSetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQueryNetworkSiblingSetSample.ts new file mode 100644 index 000000000000..bb58c0a33128 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQueryNetworkSiblingSetSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get details of the specified network sibling set. + * + * @summary Get details of the specified network sibling set. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Query.json + */ +async function networkSiblingSetQuery() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const networkSiblingSetId = "9760acf5-4638-11e7-9bdb-020073ca3333"; + const subnetId = + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.queryNetworkSiblingSet( + location, + networkSiblingSetId, + subnetId + ); + console.log(result); +} + +async function main() { + networkSiblingSetQuery(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQueryRegionInfoSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQueryRegionInfoSample.ts new file mode 100644 index 000000000000..7c3cd7080e7d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQueryRegionInfoSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides storage to network proximity and logical zone mapping information. + * + * @summary Provides storage to network proximity and logical zone mapping information. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfo.json + */ +async function regionInfoQuery() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.queryRegionInfo(location); + console.log(result); +} + +async function main() { + regionInfoQuery(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQuotaLimitsGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQuotaLimitsGetSample.ts new file mode 100644 index 000000000000..8f0f34b8878d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQuotaLimitsGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/QuotaLimits_Get.json + */ +async function quotaLimits() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "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); +} + +async function main() { + quotaLimits(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQuotaLimitsListSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQuotaLimitsListSample.ts new file mode 100644 index 000000000000..4a2b587d265e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceQuotaLimitsListSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/QuotaLimits_List.json + */ +async function quotaLimits() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "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); +} + +async function main() { + quotaLimits(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceRegionInfosGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceRegionInfosGetSample.ts new file mode 100644 index 000000000000..6ad0077bbeb3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceRegionInfosGetSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides storage to network proximity and logical zone mapping information. + * + * @summary Provides storage to network proximity and logical zone mapping information. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_Get.json + */ +async function regionInfosGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResourceRegionInfos.get(location); + console.log(result); +} + +async function main() { + regionInfosGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceRegionInfosListSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceRegionInfosListSample.ts new file mode 100644 index 000000000000..0f001d6f3e8e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceRegionInfosListSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides region specific information. + * + * @summary Provides region specific information. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_List.json + */ +async function regionInfosList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "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.netAppResourceRegionInfos.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + regionInfosList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceUpdateNetworkSiblingSetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceUpdateNetworkSiblingSetSample.ts new file mode 100644 index 000000000000..993cb310901c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/netAppResourceUpdateNetworkSiblingSetSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update the network features of the specified network sibling set. + * + * @summary Update the network features of the specified network sibling set. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Update.json + */ +async function networkFeaturesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const location = "eastus"; + const networkSiblingSetId = "9760acf5-4638-11e7-9bdb-020073ca3333"; + const subnetId = + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"; + const networkSiblingSetStateId = "12345_44420.8001578125"; + const networkFeatures = "Standard"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.netAppResource.beginUpdateNetworkSiblingSetAndWait( + location, + networkSiblingSetId, + subnetId, + networkSiblingSetStateId, + networkFeatures + ); + console.log(result); +} + +async function main() { + networkFeaturesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/operationsListSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..b6889338df8c --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/operationsListSample.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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/OperationList.json + */ +async function operationList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "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); +} + +async function main() { + operationList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..5e35e7140231 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsCreateOrUpdateSample.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 { CapacityPool, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_CreateOrUpdate.json + */ +async function poolsCreateOrUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsDeleteSample.ts new file mode 100644 index 000000000000..601a7a09b375 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsDeleteSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_Delete.json + */ +async function poolsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsGetSample.ts new file mode 100644 index 000000000000..1d9e9e863d38 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_Get.json + */ +async function poolsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsListSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsListSample.ts new file mode 100644 index 000000000000..cc274cf7c4c8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsListSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_List.json + */ +async function poolsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsUpdateSample.ts new file mode 100644 index 000000000000..d8b99b70b4cb --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/poolsUpdateSample.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 { CapacityPoolPatch, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Pools_Update.json + */ +async function poolsUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + poolsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesCreateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesCreateSample.ts new file mode 100644 index 000000000000..c3bb40d7d4fd --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesCreateSample.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a snapshot policy + * + * @summary Create a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Create.json + */ +async function snapshotPoliciesCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesDeleteSample.ts new file mode 100644 index 000000000000..b070d8be07bf --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesDeleteSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete snapshot policy + * + * @summary Delete snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Delete.json + */ +async function snapshotPoliciesDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = + process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesGetSample.ts new file mode 100644 index 000000000000..e04c17f19010 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a snapshot Policy + * + * @summary Get a snapshot Policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Get.json + */ +async function snapshotPoliciesGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesListSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesListSample.ts new file mode 100644 index 000000000000..0fcd799a519d --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesListSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List snapshot policy + * + * @summary List snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_List.json + */ +async function snapshotPoliciesList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesListVolumesSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesListVolumesSample.ts new file mode 100644 index 000000000000..fef7aef70825 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesListVolumesSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/SnapshotPolicies_ListVolumes.json + */ +async function snapshotPoliciesListVolumes() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesListVolumes(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesUpdateSample.ts new file mode 100644 index 000000000000..149027a25a16 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotPoliciesUpdateSample.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch a snapshot policy + * + * @summary Patch a snapshot policy + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/SnapshotPolicies_Update.json + */ +async function snapshotPoliciesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotPoliciesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsCreateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsCreateSample.ts new file mode 100644 index 000000000000..a5ce922be485 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsCreateSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Snapshots_Create.json + */ +async function snapshotsCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsDeleteSample.ts new file mode 100644 index 000000000000..e5fcdca7bfbb --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsDeleteSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete snapshot + * + * @summary Delete snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Delete.json + */ +async function snapshotsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsGetSample.ts new file mode 100644 index 000000000000..d022a1c4641e --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Snapshots_Get.json + */ +async function snapshotsGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsListSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsListSample.ts new file mode 100644 index 000000000000..3e6b274df61f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsListSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Snapshots_List.json + */ +async function snapshotsList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsRestoreFilesSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsRestoreFilesSample.ts new file mode 100644 index 000000000000..cf8c6d188b99 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsRestoreFilesSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Snapshots_SingleFileRestore.json + */ +async function snapshotsSingleFileRestore() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsSingleFileRestore(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsUpdateSample.ts new file mode 100644 index 000000000000..413c1e71fdf8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/snapshotsUpdateSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch a snapshot + * + * @summary Patch a snapshot + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Snapshots_Update.json + */ +async function snapshotsUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + snapshotsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesCreateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesCreateSample.ts new file mode 100644 index 000000000000..bf067d8f406f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesCreateSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Subvolumes_Create.json + */ +async function subvolumesCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesDeleteSample.ts new file mode 100644 index 000000000000..7dd5570262e8 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesDeleteSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete subvolume + * + * @summary Delete subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Delete.json + */ +async function subvolumesDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesGetMetadataSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesGetMetadataSample.ts new file mode 100644 index 000000000000..abadb46aa9c0 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesGetMetadataSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Subvolumes_Metadata.json + */ +async function subvolumesMetadata() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesMetadata(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesGetSample.ts new file mode 100644 index 000000000000..a1c2a6cd64d5 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Subvolumes_Get.json + */ +async function subvolumesGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesListByVolumeSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesListByVolumeSample.ts new file mode 100644 index 000000000000..bac5cfd473dd --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesListByVolumeSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Subvolumes_List.json + */ +async function subvolumesList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesUpdateSample.ts new file mode 100644 index 000000000000..b1ffe151c805 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/subvolumesUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch a subvolume + * + * @summary Patch a subvolume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Subvolumes_Update.json + */ +async function subvolumesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + subvolumesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsCreateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsCreateSample.ts new file mode 100644 index 000000000000..0f13621808dc --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsCreateSample.ts @@ -0,0 +1,673 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VolumeGroupDetails, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Create_Oracle.json + */ +async function volumeGroupsCreateOracle() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const body: VolumeGroupDetails = { + groupMetaData: { + applicationIdentifier: "OR2", + applicationType: "ORACLE", + groupDescription: "Volume group" + }, + location: "westus", + volumes: [ + { + name: "test-ora-data1", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data1", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data1", + zones: ["1"] + }, + { + name: "test-ora-data2", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data2", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data2", + zones: ["1"] + }, + { + name: "test-ora-data3", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data3", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data3", + zones: ["1"] + }, + { + name: "test-ora-data4", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data4", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data4", + zones: ["1"] + }, + { + name: "test-ora-data5", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data5", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data5", + zones: ["1"] + }, + { + name: "test-ora-data6", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data6", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data6", + zones: ["1"] + }, + { + name: "test-ora-data7", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data7", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data7", + zones: ["1"] + }, + { + name: "test-ora-data8", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-data8", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-data8", + zones: ["1"] + }, + { + name: "test-ora-log", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-log", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-log", + zones: ["1"] + }, + { + name: "test-ora-log-mirror", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-log-mirror", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-log-mirror", + zones: ["1"] + }, + { + name: "test-ora-binary", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-binary", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-binary", + zones: ["1"] + }, + { + name: "test-ora-backup", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-ora-backup", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + serviceLevel: "Premium", + subnetId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3", + throughputMibps: 10, + usageThreshold: 107374182400, + volumeSpecName: "ora-backup", + zones: ["1"] + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + accountName, + volumeGroupName, + body + ); + console.log(result); +} + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Create_SapHana.json + */ +async function volumeGroupsCreateSapHana() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const volumeGroupName = "group1"; + const body: VolumeGroupDetails = { + groupMetaData: { + applicationIdentifier: "SH9", + applicationType: "SAP-HANA", + groupDescription: "Volume group" + }, + location: "westus", + volumes: [ + { + name: "test-data-mnt00001", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-data-mnt00001", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + 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: "test-log-mnt00001", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-log-mnt00001", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + 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: "test-shared", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-shared", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + 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" + }, + { + name: "test-data-backup", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-data-backup", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + 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-backup" + }, + { + name: "test-log-backup", + capacityPoolResourceId: + "/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1", + creationToken: "test-log-backup", + exportPolicy: { + rules: [ + { + allowedClients: "0.0.0.0/0", + cifs: false, + hasRootAccess: true, + kerberos5ReadOnly: false, + kerberos5ReadWrite: false, + kerberos5IReadOnly: false, + kerberos5IReadWrite: false, + kerberos5PReadOnly: false, + kerberos5PReadWrite: false, + nfsv3: false, + nfsv41: true, + ruleIndex: 1, + unixReadOnly: true, + unixReadWrite: true + } + ] + }, + protocolTypes: ["NFSv4.1"], + 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-backup" + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + accountName, + volumeGroupName, + body + ); + console.log(result); +} + +async function main() { + volumeGroupsCreateOracle(); + volumeGroupsCreateSapHana(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsDeleteSample.ts new file mode 100644 index 000000000000..e01302d73dcd --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsDeleteSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Delete.json + */ +async function volumeGroupsDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumeGroupsDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsGetSample.ts new file mode 100644 index 000000000000..dc28f5ca1baf --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsGetSample.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Get_Oracle.json + */ +async function volumeGroupsGetOracle() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_Get_SapHana.json + */ +async function volumeGroupsGetSapHana() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumeGroupsGetOracle(); + volumeGroupsGetSapHana(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsListByNetAppAccountSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsListByNetAppAccountSample.ts new file mode 100644 index 000000000000..c95287efcf06 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeGroupsListByNetAppAccountSample.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_List_Oracle.json + */ +async function volumeGroupsListOracle() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +/** + * 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/preview/2023-05-01-preview/examples/VolumeGroups_List_SapHana.json + */ +async function volumeGroupsListSapHana() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumeGroupsListOracle(); + volumeGroupsListSapHana(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesCreateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesCreateSample.ts new file mode 100644 index 000000000000..2635560f8c1f --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesCreateSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { VolumeQuotaRule, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create the specified quota rule within the given volume + * + * @summary Create the specified quota rule within the given volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Create.json + */ +async function volumeQuotaRulesCreate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const volumeQuotaRuleName = "rule-0004"; + const body: VolumeQuotaRule = { + location: "westus", + quotaSizeInKiBs: 100005, + quotaTarget: "1821", + quotaType: "IndividualUserQuota" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeQuotaRules.beginCreateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + volumeQuotaRuleName, + body + ); + console.log(result); +} + +async function main() { + volumeQuotaRulesCreate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesDeleteSample.ts new file mode 100644 index 000000000000..3bd1d48a0aba --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesDeleteSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete quota rule + * + * @summary Delete quota rule + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Delete.json + */ +async function volumeQuotaRulesDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const volumeQuotaRuleName = "rule-0004"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeQuotaRules.beginDeleteAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + volumeQuotaRuleName + ); + console.log(result); +} + +async function main() { + volumeQuotaRulesDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesGetSample.ts new file mode 100644 index 000000000000..ae6fa041a5d7 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get details of the specified quota rule + * + * @summary Get details of the specified quota rule + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Get.json + */ +async function volumeQuotaRulesGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const volumeQuotaRuleName = "rule-0004"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeQuotaRules.get( + resourceGroupName, + accountName, + poolName, + volumeName, + volumeQuotaRuleName + ); + console.log(result); +} + +async function main() { + volumeQuotaRulesGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesListByVolumeSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesListByVolumeSample.ts new file mode 100644 index 000000000000..633491b0db13 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesListByVolumeSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List all quota rules associated with the volume + * + * @summary List all quota rules associated with the volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_List.json + */ +async function volumeQuotaRulesList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumeQuotaRules.listByVolume( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + volumeQuotaRulesList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesUpdateSample.ts new file mode 100644 index 000000000000..d73d0af1c03b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumeQuotaRulesUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + VolumeQuotaRulePatch, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch a quota rule + * + * @summary Patch a quota rule + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeQuotaRules_Update.json + */ +async function volumeQuotaRulesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "5275316f-a498-48d6-b324-2cbfdc4311b9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account-9957"; + const poolName = "pool-5210"; + const volumeName = "volume-6387"; + const volumeQuotaRuleName = "rule-0004"; + const body: VolumeQuotaRulePatch = { quotaSizeInKiBs: 100009 }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumeQuotaRules.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + volumeQuotaRuleName, + body + ); + console.log(result); +} + +async function main() { + volumeQuotaRulesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesAuthorizeReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesAuthorizeReplicationSample.ts new file mode 100644 index 000000000000..34f5e7d6773b --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesAuthorizeReplicationSample.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 { AuthorizeRequest, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_AuthorizeReplication.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesAuthorizeReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesBreakFileLocksSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesBreakFileLocksSample.ts new file mode 100644 index 000000000000..4968b24e20c5 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesBreakFileLocksSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + BreakFileLocksRequest, + VolumesBreakFileLocksOptionalParams, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Break all the file locks on a volume + * + * @summary Break all the file locks on a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_BreakFileLocks.json + */ +async function volumesBreakFileLocks() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: BreakFileLocksRequest = { + clientIp: "101.102.103.104", + confirmRunningDisruptiveOperation: true + }; + const options: VolumesBreakFileLocksOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginBreakFileLocksAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + options + ); + console.log(result); +} + +async function main() { + volumesBreakFileLocks(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesBreakReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesBreakReplicationSample.ts new file mode 100644 index 000000000000..8e71b4fb4187 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesBreakReplicationSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_BreakReplication.json + */ +async function volumesBreakReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesBreakReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesCreateOrUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..b3eb6943dbbf --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesCreateOrUpdateSample.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_CreateOrUpdate.json + */ +async function volumesCreateOrUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesDeleteReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesDeleteReplicationSample.ts new file mode 100644 index 000000000000..96063c59f5fd --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesDeleteReplicationSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_DeleteReplication.json + */ +async function volumesDeleteReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesDeleteReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesDeleteSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesDeleteSample.ts new file mode 100644 index 000000000000..75a4bce9ad86 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesDeleteSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the specified volume + * + * @summary Delete the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Delete.json + */ +async function volumesDelete() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesDelete(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesFinalizeRelocationSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesFinalizeRelocationSample.ts new file mode 100644 index 000000000000..084aad858a59 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesFinalizeRelocationSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Finalizes the relocation of the volume and cleans up the old volume. + * + * @summary Finalizes the relocation of the volume and cleans up the old volume. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_FinalizeRelocation.json + */ +async function volumesFinalizeRelocation() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginFinalizeRelocationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +async function main() { + volumesFinalizeRelocation(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesGetSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesGetSample.ts new file mode 100644 index 000000000000..9cd849ab90d0 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesGetSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_Get.json + */ +async function volumesGet() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesGet(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListGetGroupIdListForLdapUserSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListGetGroupIdListForLdapUserSample.ts new file mode 100644 index 000000000000..5bc7dd0c12f5 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListGetGroupIdListForLdapUserSample.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 { + GetGroupIdListForLdapUserRequest, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Returns the list of group Ids for a specific LDAP User + * + * @summary Returns the list of group Ids for a specific LDAP User + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/GroupIdListForLDAPUser.json + */ +async function getGroupIdListForUser() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: GetGroupIdListForLdapUserRequest = { username: "user1" }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginListGetGroupIdListForLdapUserAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +async function main() { + getGroupIdListForUser(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListReplicationsSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListReplicationsSample.ts new file mode 100644 index 000000000000..25b4ea9e10d7 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListReplicationsSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List all replications for a specified volume + * + * @summary List all replications for a specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ListReplications.json + */ +async function volumesListReplications() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.volumes.listReplications( + resourceGroupName, + accountName, + poolName, + volumeName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + volumesListReplications(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListSample.ts new file mode 100644 index 000000000000..1e6320a9ad05 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesListSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_List.json + */ +async function volumesList() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesList(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesPoolChangeSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesPoolChangeSample.ts new file mode 100644 index 000000000000..e9bcd70a6317 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesPoolChangeSample.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 { PoolChangeRequest, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_PoolChange.json + */ +async function volumesAuthorizeReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesAuthorizeReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesPopulateAvailabilityZoneSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesPopulateAvailabilityZoneSample.ts new file mode 100644 index 000000000000..c363a99c4af3 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesPopulateAvailabilityZoneSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to This operation will populate availability zone information for a volume + * + * @summary This operation will populate availability zone information for a volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_PopulateAvailabilityZones.json + */ +async function volumesPopulateAvailabilityZones() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginPopulateAvailabilityZoneAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +async function main() { + volumesPopulateAvailabilityZones(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReInitializeReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReInitializeReplicationSample.ts new file mode 100644 index 000000000000..2b8e869cc66a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReInitializeReplicationSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_ReInitializeReplication.json + */ +async function volumesReInitializeReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesReInitializeReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReestablishReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReestablishReplicationSample.ts new file mode 100644 index 000000000000..74f3243493aa --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReestablishReplicationSample.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 { + ReestablishReplicationRequest, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots + * + * @summary Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ReestablishReplication.json + */ +async function volumesReestablishReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: ReestablishReplicationRequest = { + sourceVolumeId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/mySourceRG/providers/Microsoft.NetApp/netAppAccounts/sourceAccount1/capacityPools/sourcePool1/volumes/sourceVolume1" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginReestablishReplicationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +async function main() { + volumesReestablishReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRelocateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRelocateSample.ts new file mode 100644 index 000000000000..3c278a1211af --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRelocateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + RelocateVolumeRequest, + VolumesRelocateOptionalParams, + NetAppManagementClient +} from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Relocates volume to a new stamp + * + * @summary Relocates volume to a new stamp + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Relocate.json + */ +async function volumesRelocate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: RelocateVolumeRequest = {}; + const options: VolumesRelocateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginRelocateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + options + ); + console.log(result); +} + +async function main() { + volumesRelocate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReplicationStatusSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReplicationStatusSample.ts new file mode 100644 index 000000000000..703a80c6a2cc --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesReplicationStatusSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_ReplicationStatus.json + */ +async function volumesReplicationStatus() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesReplicationStatus(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesResetCifsPasswordSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesResetCifsPasswordSample.ts new file mode 100644 index 000000000000..bfdd4ad6ab8a --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesResetCifsPasswordSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Reset cifs password from volume + * + * @summary Reset cifs password from volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_ResetCifsPassword.json + */ +async function volumesResetCifsPassword() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginResetCifsPasswordAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +async function main() { + volumesResetCifsPassword(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesResyncReplicationSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesResyncReplicationSample.ts new file mode 100644 index 000000000000..819e72b259cc --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesResyncReplicationSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_ResyncReplication.json + */ +async function volumesResyncReplication() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesResyncReplication(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRevertRelocationSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRevertRelocationSample.ts new file mode 100644 index 000000000000..971c433827cb --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRevertRelocationSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. + * + * @summary Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_RevertRelocation.json + */ +async function volumesRevertRelocation() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginRevertRelocationAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +async function main() { + volumesRevertRelocation(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRevertSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRevertSample.ts new file mode 100644 index 000000000000..be658f3923d5 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesRevertSample.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 { VolumeRevert, NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * 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/preview/2023-05-01-preview/examples/Volumes_Revert.json + */ +async function volumesRevert() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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); +} + +async function main() { + volumesRevert(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesSplitCloneFromParentSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesSplitCloneFromParentSample.ts new file mode 100644 index 000000000000..83a8764fe8f2 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesSplitCloneFromParentSample.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 { NetAppManagementClient } from "@azure/arm-netapp"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Split operation to convert clone volume to an independent volume. + * + * @summary Split operation to convert clone volume to an independent volume. + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_SplitClone.json + */ +async function volumesSplitClone() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "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.beginSplitCloneFromParentAndWait( + resourceGroupName, + accountName, + poolName, + volumeName + ); + console.log(result); +} + +async function main() { + volumesSplitClone(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesUpdateSample.ts b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesUpdateSample.ts new file mode 100644 index 000000000000..1b1facca9524 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/src/volumesUpdateSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch the specified volume + * + * @summary Patch the specified volume + * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_Update.json + */ +async function volumesUpdate() { + const subscriptionId = + process.env["NETAPP_SUBSCRIPTION_ID"] || + "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9"; + const resourceGroupName = process.env["NETAPP_RESOURCE_GROUP"] || "myRG"; + const accountName = "account1"; + const poolName = "pool1"; + const volumeName = "volume1"; + const body: VolumePatch = { + dataProtection: { + backup: { + backupEnabled: true, + backupVaultId: + "/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRP/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1", + policyEnforced: false + } + }, + location: "eastus" + }; + const credential = new DefaultAzureCredential(); + const client = new NetAppManagementClient(credential, subscriptionId); + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + accountName, + poolName, + volumeName, + body + ); + console.log(result); +} + +async function main() { + volumesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/netapp/arm-netapp/samples/v20-beta/typescript/tsconfig.json b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..e26ce2a6d8f7 --- /dev/null +++ b/sdk/netapp/arm-netapp/samples/v20-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/netapp/arm-netapp/src/models/index.ts b/sdk/netapp/arm-netapp/src/models/index.ts index 8a6ab71d1c19..a4e5526d38de 100644 --- a/sdk/netapp/arm-netapp/src/models/index.ts +++ b/sdk/netapp/arm-netapp/src/models/index.ts @@ -145,7 +145,7 @@ export interface SubscriptionQuotaItemList { /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; @@ -182,6 +182,14 @@ export interface SystemData { lastModifiedAt?: Date; } +/** List of regionInfo resources */ +export interface RegionInfosList { + /** A list of regionInfo resources */ + value?: RegionInfoResource[]; + /** URL to get the next set of results. */ + nextLink?: string; +} + /** Provides region specific information. */ export interface RegionInfo { /** Provides storage to network proximity information in the region. */ @@ -197,44 +205,6 @@ export interface RegionInfoAvailabilityZoneMappingsItem { isAvailable?: boolean; } -/** Network sibling set query. */ -export interface QueryNetworkSiblingSetRequest { - /** Network Sibling Set ID for a group of volumes sharing networking resources in a subnet. */ - networkSiblingSetId: string; - /** The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Example /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} */ - subnetId: string; -} - -/** Describes the contents of a network sibling set. */ -export interface NetworkSiblingSet { - /** Network Sibling Set ID for a group of volumes sharing networking resources in a subnet. */ - networkSiblingSetId?: string; - /** The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Example /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} */ - subnetId?: string; - /** Network sibling set state Id identifying the current state of the sibling set. */ - networkSiblingSetStateId?: string; - /** Network features available to the volume, or current state of update. */ - networkFeatures?: NetworkFeatures; - /** - * Gets the status of the NetworkSiblingSet at the time the operation was called. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: NetworkSiblingSetProvisioningState; - /** List of NIC information */ - nicInfoList?: NicInfo[]; -} - -/** NIC information and list of volumes for which the NIC has the primary mount ip address. */ -export interface NicInfo { - /** - * ipAddress - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly ipAddress?: string; - /** Volume resource Ids */ - volumeResourceIds?: string[]; -} - /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ export interface ErrorResponse { /** The error object. */ @@ -284,6 +254,44 @@ export interface ErrorAdditionalInfo { readonly info?: Record; } +/** Network sibling set query. */ +export interface QueryNetworkSiblingSetRequest { + /** Network Sibling Set ID for a group of volumes sharing networking resources in a subnet. */ + networkSiblingSetId: string; + /** The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Example /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} */ + subnetId: string; +} + +/** Describes the contents of a network sibling set. */ +export interface NetworkSiblingSet { + /** Network Sibling Set ID for a group of volumes sharing networking resources in a subnet. */ + networkSiblingSetId?: string; + /** The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Example /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} */ + subnetId?: string; + /** Network sibling set state Id identifying the current state of the sibling set. */ + networkSiblingSetStateId?: string; + /** Network features available to the volume, or current state of update. */ + networkFeatures?: NetworkFeatures; + /** + * Gets the status of the NetworkSiblingSet at the time the operation was called. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: NetworkSiblingSetProvisioningState; + /** List of NIC information */ + nicInfoList?: NicInfo[]; +} + +/** NIC information and list of volumes for which the NIC has the primary mount ip address. */ +export interface NicInfo { + /** + * ipAddress + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly ipAddress?: string; + /** Volume resource Ids */ + volumeResourceIds?: string[]; +} + /** Network sibling set update. */ export interface UpdateNetworkSiblingSetRequest { /** Network Sibling Set ID for a group of volumes sharing networking resources in a subnet. */ @@ -292,7 +300,7 @@ export interface UpdateNetworkSiblingSetRequest { subnetId: string; /** Network sibling set state Id identifying the current state of the sibling set. */ networkSiblingSetStateId: string; - /** Network features available to the volume, some such */ + /** Network features available to the volume */ networkFeatures: NetworkFeatures; } @@ -426,7 +434,9 @@ export interface ManagedServiceIdentity { /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ type: ManagedServiceIdentityType; /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ - userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity | null; + }; } /** User assigned identity properties */ @@ -480,6 +490,13 @@ export interface NetAppAccountPatch { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly disableShowmount?: boolean; + /** Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes. */ + nfsV4IDDomain?: string; + /** + * This will have true value only if account is Multiple AD enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isMultiAdEnabled?: boolean; } /** An error response from the service. */ @@ -496,6 +513,14 @@ export interface CloudErrorBody { message?: string; } +/** Encryption migration request */ +export interface EncryptionMigrationRequest { + /** Identifier for the virtual network */ + virtualNetworkId: string; + /** Identifier of the private endpoint to reach the Azure Key Vault */ + privateEndpointId: string; +} + /** List of capacity pool resources */ export interface CapacityPoolList { /** List of Capacity pools */ @@ -601,6 +626,8 @@ export interface MountTargetProperties { /** DataProtection type volumes include an object containing details of the replication */ export interface VolumePropertiesDataProtection { + /** Backup Properties */ + backup?: VolumeBackupProperties; /** Replication properties */ replication?: ReplicationObject; /** Snapshot properties. */ @@ -609,6 +636,18 @@ export interface VolumePropertiesDataProtection { volumeRelocation?: VolumeRelocationProperties; } +/** Volume Backup Properties */ +export interface VolumeBackupProperties { + /** Backup Policy Resource ID */ + backupPolicyId?: string; + /** Policy Enforced */ + policyEnforced?: boolean; + /** Backup Enabled */ + backupEnabled?: boolean; + /** Backup Vault Resource ID */ + backupVaultId?: string; +} + /** Replication properties */ export interface ReplicationObject { /** @@ -620,12 +659,24 @@ export interface ReplicationObject { endpointType?: EndpointType; /** Schedule */ replicationSchedule?: ReplicationSchedule; - /** The resource ID of the remote volume. */ + /** The resource ID of the remote volume. Required for cross region and cross zone replication */ remoteVolumeResourceId: string; + /** The full path to a volume that is to be migrated into ANF. Required for Migration volumes */ + remotePath?: RemotePath; /** The remote region for the other end of the Volume Replication. */ remoteVolumeRegion?: string; } +/** The full path to a volume that is to be migrated into ANF. Required for Migration volumes */ +export interface RemotePath { + /** The Path to a Ontap Host */ + externalHostName: string; + /** The name of a server on the Ontap Host */ + serverName: string; + /** The name of a volume on the server */ + volumeName: string; +} + /** Volume Snapshot Properties */ export interface VolumeSnapshotProperties { /** Snapshot Policy ResourceId */ @@ -717,6 +768,8 @@ export interface VolumePatchPropertiesExportPolicy { /** DataProtection type volumes include an object containing details of the replication */ export interface VolumePatchPropertiesDataProtection { + /** Backup Properties */ + backup?: VolumeBackupProperties; /** Snapshot properties. */ snapshot?: VolumeSnapshotProperties; } @@ -923,6 +976,55 @@ export interface SnapshotPolicyVolumeList { value?: Volume[]; } +/** Backup status */ +export interface BackupStatus { + /** + * Backup health status + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly healthy?: boolean; + /** + * Status of the backup mirror relationship + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly relationshipStatus?: RelationshipStatus; + /** + * The status of the backup + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly mirrorState?: MirrorState; + /** + * Reason for the unhealthy backup relationship + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly unhealthyReason?: string; + /** + * Displays error message if the backup is in an error state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorMessage?: string; + /** + * Displays the last transfer size + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastTransferSize?: number; + /** + * Displays the last transfer type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastTransferType?: string; + /** + * Displays the total bytes transferred + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalTransferBytes?: number; + /** + * Displays the total number of bytes transferred for the ongoing operation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly transferProgressBytes?: number; +} + /** Restore status */ export interface RestoreStatus { /** @@ -957,6 +1059,20 @@ export interface RestoreStatus { readonly totalTransferBytes?: number; } +/** List of Backups */ +export interface BackupsList { + /** A list of Backups */ + value?: Backup[]; + /** URL to get the next set of results. */ + nextLink?: string; +} + +/** Backup patch */ +export interface BackupPatch { + /** Label for backup */ + label?: string; +} + /** List of Backup Policies */ export interface BackupPoliciesList { /** A list of backup policies */ @@ -1091,8 +1207,6 @@ export interface VolumeGroupMetaData { applicationIdentifier?: string; /** Application specific placement rules for the volume group */ globalPlacementRules?: PlacementKeyValuePairs[]; - /** Application specific identifier of deployment rules for the volume group */ - deploymentSpecId?: string; /** * Number of volumes in volume group * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1198,7 +1312,7 @@ export interface VolumeGroupVolumeProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly mountTargets?: MountTargetProperties[]; - /** What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection */ + /** What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. For creating clone volume, set type to ShortTermClone */ volumeType?: string; /** DataProtection type volumes include an object containing details of the replication */ dataProtection?: VolumePropertiesDataProtection; @@ -1309,6 +1423,11 @@ export interface VolumeGroupVolumeProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly originatingResourceId?: string; + /** + * Space shared by short term clone volume with parent volume in bytes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly inheritedSizeInBytes?: number; } /** List of Subvolumes */ @@ -1366,6 +1485,36 @@ export interface SubvolumeModel { provisioningState?: string; } +/** List of Backup Vaults */ +export interface BackupVaultsList { + /** A list of Backup Vaults */ + value?: BackupVault[]; + /** URL to get the next set of results. */ + nextLink?: string; +} + +/** Backup Vault information */ +export interface BackupVaultPatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** Restore payload for Single File Backup Restore */ +export interface BackupRestoreFiles { + /** List of files to be restored */ + fileList: string[]; + /** Destination folder where the files will be restored. The path name should start with a forward slash. If it is omitted from request then restore is done at the root folder of the destination volume by default */ + restoreFilePath?: string; + /** Resource Id of the destination volume on which the files need to be restored */ + destinationVolumeId: string; +} + +/** Migrate Backups Request */ +export interface BackupsMigrationRequest { + /** The ResourceId of the Backup Vault */ + backupVaultId: string; +} + /** Identity for the resource. */ export interface ResourceIdentity { /** @@ -1482,6 +1631,14 @@ export interface SubscriptionQuotaItem extends ProxyResource { readonly default?: number; } +/** Information regarding regionInfo Item. */ +export interface RegionInfoResource extends ProxyResource { + /** Provides storage to network proximity information in the region. */ + storageToNetworkProximity?: RegionStorageToNetworkProximity; + /** Provides logical availability zone mappings for the subscription for a region. */ + availabilityZoneMappings?: RegionInfoAvailabilityZoneMappingsItem[]; +} + /** Snapshot of a Volume */ export interface Snapshot extends ProxyResource { /** Resource location */ @@ -1503,6 +1660,53 @@ export interface Snapshot extends ProxyResource { readonly provisioningState?: string; } +/** Backup under a Backup Vault */ +export interface Backup extends ProxyResource { + /** + * UUID v4 used to identify the Backup + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly backupId?: string; + /** + * The creation date of the backup + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creationDate?: Date; + /** + * Azure lifecycle management + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * Size of backup in bytes + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly size?: number; + /** Label for backup */ + label?: string; + /** + * Type of backup Manual or Scheduled + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly backupType?: BackupType; + /** + * Failure reason + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failureReason?: string; + /** ResourceId used to identify the Volume */ + volumeResourceId: string; + /** Manual backup an already existing snapshot. This will always be false for scheduled backups and true/false for manual backups */ + useExistingSnapshot?: boolean; + /** The name of the snapshot */ + snapshotName?: string; + /** + * ResourceId used to identify the backup policy + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly backupPolicyResourceId?: string; +} + /** Subvolume Information properties */ export interface SubvolumeInfo extends ProxyResource { /** Path to the subvolume */ @@ -1541,6 +1745,13 @@ export interface NetAppAccount extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly disableShowmount?: boolean; + /** Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes. */ + nfsV4IDDomain?: string; + /** + * This will have true value only if account is Multiple AD enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isMultiAdEnabled?: boolean; } /** Capacity pool resource */ @@ -1641,7 +1852,7 @@ export interface Volume extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly mountTargets?: MountTargetProperties[]; - /** What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection */ + /** What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. For creating clone volume, set type to ShortTermClone */ volumeType?: string; /** DataProtection type volumes include an object containing details of the replication */ dataProtection?: VolumePropertiesDataProtection; @@ -1752,6 +1963,11 @@ export interface Volume extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly originatingResourceId?: string; + /** + * Space shared by short term clone volume with parent volume in bytes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly inheritedSizeInBytes?: number; } /** Snapshot policy information */ @@ -1830,16 +2046,40 @@ export interface VolumeQuotaRule extends TrackedResource { quotaTarget?: string; } +/** Backup Vault information */ +export interface BackupVault extends TrackedResource { + /** + * Azure lifecycle management + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + /** Defines headers for NetAppResource_updateNetworkSiblingSet operation. */ export interface NetAppResourceUpdateNetworkSiblingSetHeaders { location?: string; } +/** Defines headers for Accounts_migrateEncryptionKey operation. */ +export interface AccountsMigrateEncryptionKeyHeaders { + location?: string; +} + /** Defines headers for Volumes_populateAvailabilityZone operation. */ export interface VolumesPopulateAvailabilityZoneHeaders { location?: string; } +/** Defines headers for Volumes_resetCifsPassword operation. */ +export interface VolumesResetCifsPasswordHeaders { + location?: string; +} + +/** Defines headers for Volumes_splitCloneFromParent operation. */ +export interface VolumesSplitCloneFromParentHeaders { + location?: string; +} + /** Defines headers for Volumes_breakFileLocks operation. */ export interface VolumesBreakFileLocksHeaders { location?: string; @@ -1850,6 +2090,46 @@ export interface VolumesListGetGroupIdListForLdapUserHeaders { location?: string; } +/** Defines headers for Backups_update operation. */ +export interface BackupsUpdateHeaders { + location?: string; +} + +/** Defines headers for Backups_delete operation. */ +export interface BackupsDeleteHeaders { + location?: string; +} + +/** Defines headers for AccountBackups_delete operation. */ +export interface AccountBackupsDeleteHeaders { + location?: string; +} + +/** Defines headers for BackupVaults_update operation. */ +export interface BackupVaultsUpdateHeaders { + location?: string; +} + +/** Defines headers for BackupVaults_delete operation. */ +export interface BackupVaultsDeleteHeaders { + location?: string; +} + +/** Defines headers for BackupsUnderBackupVault_restoreFiles operation. */ +export interface BackupsUnderBackupVaultRestoreFilesHeaders { + location?: string; +} + +/** Defines headers for BackupsUnderVolume_migrateBackups operation. */ +export interface BackupsUnderVolumeMigrateBackupsHeaders { + location?: string; +} + +/** Defines headers for BackupsUnderAccount_migrateBackups operation. */ +export interface BackupsUnderAccountMigrateBackupsHeaders { + location?: string; +} + /** Known values of {@link MetricAggregationType} that the service accepts. */ export enum KnownMetricAggregationType { /** Average */ @@ -2462,6 +2742,24 @@ export enum KnownMirrorState { */ export type MirrorState = string; +/** Known values of {@link BackupType} that the service accepts. */ +export enum KnownBackupType { + /** Manual backup */ + Manual = "Manual", + /** Scheduled backup */ + Scheduled = "Scheduled" +} + +/** + * Defines values for BackupType. \ + * {@link KnownBackupType} can be used interchangeably with BackupType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Manual**: Manual backup \ + * **Scheduled**: Scheduled backup + */ +export type BackupType = string; + /** Known values of {@link Type} that the service accepts. */ export enum KnownType { /** Default user quota */ @@ -2581,6 +2879,27 @@ export interface NetAppResourceQuotaLimitsGetOptionalParams /** Contains response data for the get operation. */ export type NetAppResourceQuotaLimitsGetResponse = SubscriptionQuotaItem; +/** Optional parameters. */ +export interface NetAppResourceRegionInfosListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type NetAppResourceRegionInfosListResponse = RegionInfosList; + +/** Optional parameters. */ +export interface NetAppResourceRegionInfosGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type NetAppResourceRegionInfosGetResponse = RegionInfoResource; + +/** Optional parameters. */ +export interface NetAppResourceRegionInfosListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type NetAppResourceRegionInfosListNextResponse = RegionInfosList; + /** Optional parameters. */ export interface AccountsListBySubscriptionOptionalParams extends coreClient.OperationOptions {} @@ -2644,6 +2963,20 @@ export interface AccountsRenewCredentialsOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface AccountsMigrateEncryptionKeyOptionalParams + extends coreClient.OperationOptions { + /** The required parameters to perform encryption migration. */ + body?: EncryptionMigrationRequest; + /** 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 migrateEncryptionKey operation. */ +export type AccountsMigrateEncryptionKeyResponse = AccountsMigrateEncryptionKeyHeaders; + /** Optional parameters. */ export interface AccountsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} @@ -2786,6 +3119,21 @@ export interface VolumesResetCifsPasswordOptionalParams resumeFrom?: string; } +/** Contains response data for the resetCifsPassword operation. */ +export type VolumesResetCifsPasswordResponse = VolumesResetCifsPasswordHeaders; + +/** Optional parameters. */ +export interface VolumesSplitCloneFromParentOptionalParams + 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 splitCloneFromParent operation. */ +export type VolumesSplitCloneFromParentResponse = VolumesSplitCloneFromParentHeaders; + /** Optional parameters. */ export interface VolumesBreakFileLocksOptionalParams extends coreClient.OperationOptions { @@ -3029,6 +3377,13 @@ export interface SnapshotPoliciesListVolumesOptionalParams /** Contains response data for the listVolumes operation. */ export type SnapshotPoliciesListVolumesResponse = SnapshotPolicyVolumeList; +/** Optional parameters. */ +export interface BackupsGetLatestStatusOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getLatestStatus operation. */ +export type BackupsGetLatestStatusResponse = BackupStatus; + /** Optional parameters. */ export interface BackupsGetVolumeRestoreStatusOptionalParams extends coreClient.OperationOptions {} @@ -3036,6 +3391,96 @@ export interface BackupsGetVolumeRestoreStatusOptionalParams /** Contains response data for the getVolumeRestoreStatus operation. */ export type BackupsGetVolumeRestoreStatusResponse = RestoreStatus; +/** Optional parameters. */ +export interface BackupsListByVaultOptionalParams + extends coreClient.OperationOptions { + /** An option to specify the VolumeResourceId. If present, then only returns the backups under the specified volume */ + filter?: string; +} + +/** Contains response data for the listByVault operation. */ +export type BackupsListByVaultResponse = BackupsList; + +/** Optional parameters. */ +export interface BackupsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BackupsGetResponse = Backup; + +/** Optional parameters. */ +export interface BackupsCreateOptionalParams + 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 BackupsCreateResponse = Backup; + +/** Optional parameters. */ +export interface BackupsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Backup object supplied in the body of the operation. */ + body?: BackupPatch; + /** 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 BackupsUpdateResponse = Backup; + +/** Optional parameters. */ +export interface BackupsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type BackupsDeleteResponse = BackupsDeleteHeaders; + +/** Optional parameters. */ +export interface BackupsListByVaultNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVaultNext operation. */ +export type BackupsListByVaultNextResponse = BackupsList; + +/** Optional parameters. */ +export interface AccountBackupsListByNetAppAccountOptionalParams + extends coreClient.OperationOptions { + /** An option to specify whether to return backups only from deleted volumes */ + includeOnlyBackupsFromDeletedVolumes?: string; +} + +/** Contains response data for the listByNetAppAccount operation. */ +export type AccountBackupsListByNetAppAccountResponse = BackupsList; + +/** Optional parameters. */ +export interface AccountBackupsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AccountBackupsGetResponse = Backup; + +/** Optional parameters. */ +export interface AccountBackupsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type AccountBackupsDeleteResponse = AccountBackupsDeleteHeaders; + /** Optional parameters. */ export interface BackupPoliciesListOptionalParams extends coreClient.OperationOptions {} @@ -3231,6 +3676,99 @@ export interface SubvolumesListByVolumeNextOptionalParams /** Contains response data for the listByVolumeNext operation. */ export type SubvolumesListByVolumeNextResponse = SubvolumesList; +/** Optional parameters. */ +export interface BackupVaultsListByNetAppAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByNetAppAccount operation. */ +export type BackupVaultsListByNetAppAccountResponse = BackupVaultsList; + +/** Optional parameters. */ +export interface BackupVaultsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BackupVaultsGetResponse = BackupVault; + +/** Optional parameters. */ +export interface BackupVaultsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type BackupVaultsCreateOrUpdateResponse = BackupVault; + +/** Optional parameters. */ +export interface BackupVaultsUpdateOptionalParams + 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 BackupVaultsUpdateResponse = BackupVault; + +/** Optional parameters. */ +export interface BackupVaultsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type BackupVaultsDeleteResponse = BackupVaultsDeleteHeaders; + +/** Optional parameters. */ +export interface BackupVaultsListByNetAppAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByNetAppAccountNext operation. */ +export type BackupVaultsListByNetAppAccountNextResponse = BackupVaultsList; + +/** Optional parameters. */ +export interface BackupsUnderBackupVaultRestoreFilesOptionalParams + 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 restoreFiles operation. */ +export type BackupsUnderBackupVaultRestoreFilesResponse = BackupsUnderBackupVaultRestoreFilesHeaders; + +/** Optional parameters. */ +export interface BackupsUnderVolumeMigrateBackupsOptionalParams + 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 migrateBackups operation. */ +export type BackupsUnderVolumeMigrateBackupsResponse = BackupsUnderVolumeMigrateBackupsHeaders; + +/** Optional parameters. */ +export interface BackupsUnderAccountMigrateBackupsOptionalParams + 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 migrateBackups operation. */ +export type BackupsUnderAccountMigrateBackupsResponse = BackupsUnderAccountMigrateBackupsHeaders; + /** 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 f15467f13ad9..ae8cee007552 100644 --- a/sdk/netapp/arm-netapp/src/models/mappers.ts +++ b/sdk/netapp/arm-netapp/src/models/mappers.ts @@ -506,6 +506,33 @@ export const SystemData: coreClient.CompositeMapper = { } }; +export const RegionInfosList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegionInfosList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RegionInfoResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const RegionInfo: coreClient.CompositeMapper = { type: { name: "Composite", @@ -554,6 +581,102 @@ export const RegionInfoAvailabilityZoneMappingsItem: coreClient.CompositeMapper } }; +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + export const QueryNetworkSiblingSetRequest: coreClient.CompositeMapper = { type: { name: "Composite", @@ -671,102 +794,6 @@ export const NicInfo: coreClient.CompositeMapper = { } }; -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - } -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String" - } - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - export const UpdateNetworkSiblingSetRequest: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1325,6 +1352,25 @@ export const NetAppAccountPatch: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + nfsV4IDDomain: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9.-]{0,253}[a-zA-Z0-9]$"), + MaxLength: 255 + }, + serializedName: "properties.nfsV4IDDomain", + nullable: true, + type: { + name: "String" + } + }, + isMultiAdEnabled: { + serializedName: "properties.isMultiAdEnabled", + readOnly: true, + nullable: true, + type: { + name: "Boolean" + } } } } @@ -1367,6 +1413,29 @@ export const CloudErrorBody: coreClient.CompositeMapper = { } }; +export const EncryptionMigrationRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EncryptionMigrationRequest", + modelProperties: { + virtualNetworkId: { + serializedName: "virtualNetworkId", + required: true, + type: { + name: "String" + } + }, + privateEndpointId: { + serializedName: "privateEndpointId", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const CapacityPoolList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1666,6 +1735,13 @@ export const VolumePropertiesDataProtection: coreClient.CompositeMapper = { name: "Composite", className: "VolumePropertiesDataProtection", modelProperties: { + backup: { + serializedName: "backup", + type: { + name: "Composite", + className: "VolumeBackupProperties" + } + }, replication: { serializedName: "replication", type: { @@ -1691,14 +1767,47 @@ export const VolumePropertiesDataProtection: coreClient.CompositeMapper = { } }; -export const ReplicationObject: coreClient.CompositeMapper = { +export const VolumeBackupProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ReplicationObject", + className: "VolumeBackupProperties", modelProperties: { - replicationId: { - serializedName: "replicationId", - readOnly: true, + backupPolicyId: { + serializedName: "backupPolicyId", + type: { + name: "String" + } + }, + policyEnforced: { + serializedName: "policyEnforced", + type: { + name: "Boolean" + } + }, + backupEnabled: { + serializedName: "backupEnabled", + type: { + name: "Boolean" + } + }, + backupVaultId: { + serializedName: "backupVaultId", + type: { + name: "String" + } + } + } + } +}; + +export const ReplicationObject: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReplicationObject", + modelProperties: { + replicationId: { + serializedName: "replicationId", + readOnly: true, type: { name: "String" } @@ -1722,6 +1831,13 @@ export const ReplicationObject: coreClient.CompositeMapper = { name: "String" } }, + remotePath: { + serializedName: "remotePath", + type: { + name: "Composite", + className: "RemotePath" + } + }, remoteVolumeRegion: { serializedName: "remoteVolumeRegion", type: { @@ -1732,6 +1848,36 @@ export const ReplicationObject: coreClient.CompositeMapper = { } }; +export const RemotePath: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemotePath", + modelProperties: { + externalHostName: { + serializedName: "externalHostName", + required: true, + type: { + name: "String" + } + }, + serverName: { + serializedName: "serverName", + required: true, + type: { + name: "String" + } + }, + volumeName: { + serializedName: "volumeName", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const VolumeSnapshotProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1972,6 +2118,13 @@ export const VolumePatchPropertiesDataProtection: coreClient.CompositeMapper = { name: "Composite", className: "VolumePatchPropertiesDataProtection", modelProperties: { + backup: { + serializedName: "backup", + type: { + name: "Composite", + className: "VolumeBackupProperties" + } + }, snapshot: { serializedName: "snapshot", type: { @@ -2555,6 +2708,78 @@ export const SnapshotPolicyVolumeList: coreClient.CompositeMapper = { } }; +export const BackupStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupStatus", + modelProperties: { + healthy: { + serializedName: "healthy", + readOnly: true, + type: { + name: "Boolean" + } + }, + relationshipStatus: { + serializedName: "relationshipStatus", + readOnly: true, + type: { + name: "String" + } + }, + mirrorState: { + serializedName: "mirrorState", + readOnly: true, + type: { + name: "String" + } + }, + unhealthyReason: { + serializedName: "unhealthyReason", + readOnly: true, + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + readOnly: true, + type: { + name: "String" + } + }, + lastTransferSize: { + serializedName: "lastTransferSize", + readOnly: true, + type: { + name: "Number" + } + }, + lastTransferType: { + serializedName: "lastTransferType", + readOnly: true, + type: { + name: "String" + } + }, + totalTransferBytes: { + serializedName: "totalTransferBytes", + readOnly: true, + type: { + name: "Number" + } + }, + transferProgressBytes: { + serializedName: "transferProgressBytes", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + export const RestoreStatus: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2606,6 +2831,48 @@ export const RestoreStatus: coreClient.CompositeMapper = { } }; +export const BackupsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupsList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Backup" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const BackupPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupPatch", + modelProperties: { + label: { + serializedName: "properties.label", + type: { + name: "String" + } + } + } + } +}; + export const BackupPoliciesList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2932,12 +3199,6 @@ export const VolumeGroupMetaData: coreClient.CompositeMapper = { } } }, - deploymentSpecId: { - serializedName: "deploymentSpecId", - type: { - name: "String" - } - }, volumesCount: { serializedName: "volumesCount", readOnly: true, @@ -3481,6 +3742,14 @@ export const VolumeGroupVolumeProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + inheritedSizeInBytes: { + serializedName: "properties.inheritedSizeInBytes", + readOnly: true, + nullable: true, + type: { + name: "Number" + } } } } @@ -3625,6 +3894,110 @@ export const SubvolumeModel: coreClient.CompositeMapper = { } }; +export const BackupVaultsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupVaultsList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BackupVault" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const BackupVaultPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupVaultPatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const BackupRestoreFiles: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupRestoreFiles", + modelProperties: { + fileList: { + constraints: { + MinItems: 1, + MaxItems: 8 + }, + serializedName: "fileList", + required: true, + type: { + name: "Sequence", + element: { + constraints: { + MaxLength: 1024, + MinLength: 1 + }, + type: { + name: "String" + } + } + } + }, + restoreFilePath: { + constraints: { + Pattern: new RegExp("^\\/.*$") + }, + serializedName: "restoreFilePath", + type: { + name: "String" + } + }, + destinationVolumeId: { + serializedName: "destinationVolumeId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const BackupsMigrationRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupsMigrationRequest", + modelProperties: { + backupVaultId: { + serializedName: "backupVaultId", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const ResourceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3881,7 +4254,35 @@ export const SubscriptionQuotaItem: coreClient.CompositeMapper = { } }; -export const Snapshot: coreClient.CompositeMapper = { +export const RegionInfoResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegionInfoResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + storageToNetworkProximity: { + serializedName: "properties.storageToNetworkProximity", + type: { + name: "String" + } + }, + availabilityZoneMappings: { + serializedName: "properties.availabilityZoneMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RegionInfoAvailabilityZoneMappingsItem" + } + } + } + } + } + } +}; + +export const Snapshot: coreClient.CompositeMapper = { type: { name: "Composite", className: "Snapshot", @@ -3926,6 +4327,98 @@ export const Snapshot: coreClient.CompositeMapper = { } }; +export const Backup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Backup", + modelProperties: { + ...ProxyResource.type.modelProperties, + backupId: { + constraints: { + Pattern: new RegExp( + "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + ), + MaxLength: 36, + MinLength: 36 + }, + serializedName: "properties.backupId", + readOnly: true, + type: { + name: "String" + } + }, + creationDate: { + serializedName: "properties.creationDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + size: { + serializedName: "properties.size", + readOnly: true, + type: { + name: "Number" + } + }, + label: { + serializedName: "properties.label", + type: { + name: "String" + } + }, + backupType: { + serializedName: "properties.backupType", + readOnly: true, + type: { + name: "String" + } + }, + failureReason: { + serializedName: "properties.failureReason", + readOnly: true, + type: { + name: "String" + } + }, + volumeResourceId: { + serializedName: "properties.volumeResourceId", + required: true, + type: { + name: "String" + } + }, + useExistingSnapshot: { + defaultValue: false, + serializedName: "properties.useExistingSnapshot", + type: { + name: "Boolean" + } + }, + snapshotName: { + serializedName: "properties.snapshotName", + type: { + name: "String" + } + }, + backupPolicyResourceId: { + serializedName: "properties.backupPolicyResourceId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const SubvolumeInfo: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4016,6 +4509,25 @@ export const NetAppAccount: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + nfsV4IDDomain: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9.-]{0,253}[a-zA-Z0-9]$"), + MaxLength: 255 + }, + serializedName: "properties.nfsV4IDDomain", + nullable: true, + type: { + name: "String" + } + }, + isMultiAdEnabled: { + serializedName: "properties.isMultiAdEnabled", + readOnly: true, + nullable: true, + type: { + name: "Boolean" + } } } } @@ -4561,6 +5073,14 @@ export const Volume: coreClient.CompositeMapper = { type: { name: "String" } + }, + inheritedSizeInBytes: { + serializedName: "properties.inheritedSizeInBytes", + readOnly: true, + nullable: true, + type: { + name: "Number" + } } } } @@ -4743,6 +5263,23 @@ export const VolumeQuotaRule: coreClient.CompositeMapper = { } }; +export const BackupVault: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupVault", + modelProperties: { + ...TrackedResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const NetAppResourceUpdateNetworkSiblingSetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4758,6 +5295,21 @@ export const NetAppResourceUpdateNetworkSiblingSetHeaders: coreClient.CompositeM } }; +export const AccountsMigrateEncryptionKeyHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountsMigrateEncryptionKeyHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const VolumesPopulateAvailabilityZoneHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4773,6 +5325,36 @@ export const VolumesPopulateAvailabilityZoneHeaders: coreClient.CompositeMapper } }; +export const VolumesResetCifsPasswordHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesResetCifsPasswordHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VolumesSplitCloneFromParentHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesSplitCloneFromParentHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const VolumesBreakFileLocksHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4802,3 +5384,123 @@ export const VolumesListGetGroupIdListForLdapUserHeaders: coreClient.CompositeMa } } }; + +export const BackupsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BackupsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AccountBackupsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountBackupsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BackupVaultsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupVaultsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BackupVaultsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupVaultsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BackupsUnderBackupVaultRestoreFilesHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupsUnderBackupVaultRestoreFilesHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BackupsUnderVolumeMigrateBackupsHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupsUnderVolumeMigrateBackupsHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BackupsUnderAccountMigrateBackupsHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupsUnderAccountMigrateBackupsHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/netapp/arm-netapp/src/models/parameters.ts b/sdk/netapp/arm-netapp/src/models/parameters.ts index 70f8a06d6f4a..a29ceee75306 100644 --- a/sdk/netapp/arm-netapp/src/models/parameters.ts +++ b/sdk/netapp/arm-netapp/src/models/parameters.ts @@ -19,6 +19,7 @@ import { UpdateNetworkSiblingSetRequest as UpdateNetworkSiblingSetRequestMapper, NetAppAccount as NetAppAccountMapper, NetAppAccountPatch as NetAppAccountPatchMapper, + EncryptionMigrationRequest as EncryptionMigrationRequestMapper, CapacityPool as CapacityPoolMapper, CapacityPoolPatch as CapacityPoolPatchMapper, Volume as VolumeMapper, @@ -35,13 +36,19 @@ import { SnapshotRestoreFiles as SnapshotRestoreFilesMapper, SnapshotPolicy as SnapshotPolicyMapper, SnapshotPolicyPatch as SnapshotPolicyPatchMapper, + Backup as BackupMapper, + BackupPatch as BackupPatchMapper, BackupPolicy as BackupPolicyMapper, BackupPolicyPatch as BackupPolicyPatchMapper, VolumeQuotaRule as VolumeQuotaRuleMapper, VolumeQuotaRulePatch as VolumeQuotaRulePatchMapper, VolumeGroupDetails as VolumeGroupDetailsMapper, SubvolumeInfo as SubvolumeInfoMapper, - SubvolumePatchRequest as SubvolumePatchRequestMapper + SubvolumePatchRequest as SubvolumePatchRequestMapper, + BackupVault as BackupVaultMapper, + BackupVaultPatch as BackupVaultPatchMapper, + BackupRestoreFiles as BackupRestoreFilesMapper, + BackupsMigrationRequest as BackupsMigrationRequestMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -71,7 +78,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-05-01", + defaultValue: "2023-05-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -110,13 +117,10 @@ export const resourceGroup: OperationParameter = { export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { - constraints: { - MinLength: 1 - }, serializedName: "subscriptionId", required: true, type: { - name: "String" + name: "Uuid" } } }; @@ -201,6 +205,18 @@ export const quotaLimitName: OperationURLParameter = { } }; +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { @@ -240,16 +256,9 @@ export const body6: OperationParameter = { mapper: NetAppAccountPatchMapper }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true +export const body7: OperationParameter = { + parameterPath: ["options", "body"], + mapper: EncryptionMigrationRequestMapper }; export const poolName: OperationURLParameter = { @@ -268,12 +277,12 @@ export const poolName: OperationURLParameter = { } }; -export const body7: OperationParameter = { +export const body8: OperationParameter = { parameterPath: "body", mapper: CapacityPoolMapper }; -export const body8: OperationParameter = { +export const body9: OperationParameter = { parameterPath: "body", mapper: CapacityPoolPatchMapper }; @@ -294,12 +303,12 @@ export const volumeName: OperationURLParameter = { } }; -export const body9: OperationParameter = { +export const body10: OperationParameter = { parameterPath: "body", mapper: VolumeMapper }; -export const body10: OperationParameter = { +export const body11: OperationParameter = { parameterPath: "body", mapper: VolumePatchMapper }; @@ -314,42 +323,42 @@ export const forceDelete: OperationQueryParameter = { } }; -export const body11: OperationParameter = { +export const body12: OperationParameter = { parameterPath: "body", mapper: VolumeRevertMapper }; -export const body12: OperationParameter = { +export const body13: OperationParameter = { parameterPath: ["options", "body"], mapper: BreakFileLocksRequestMapper }; -export const body13: OperationParameter = { +export const body14: OperationParameter = { parameterPath: "body", mapper: GetGroupIdListForLdapUserRequestMapper }; -export const body14: OperationParameter = { +export const body15: OperationParameter = { parameterPath: ["options", "body"], mapper: BreakReplicationRequestMapper }; -export const body15: OperationParameter = { +export const body16: OperationParameter = { parameterPath: "body", mapper: ReestablishReplicationRequestMapper }; -export const body16: OperationParameter = { +export const body17: OperationParameter = { parameterPath: "body", mapper: AuthorizeRequestMapper }; -export const body17: OperationParameter = { +export const body18: OperationParameter = { parameterPath: "body", mapper: PoolChangeRequestMapper }; -export const body18: OperationParameter = { +export const body19: OperationParameter = { parameterPath: ["options", "body"], mapper: RelocateVolumeRequestMapper }; @@ -365,12 +374,12 @@ export const snapshotName: OperationURLParameter = { } }; -export const body19: OperationParameter = { +export const body20: OperationParameter = { parameterPath: "body", mapper: SnapshotMapper }; -export const body20: OperationParameter = { +export const body21: OperationParameter = { parameterPath: "body", mapper: { serializedName: "body", @@ -382,7 +391,7 @@ export const body20: OperationParameter = { } }; -export const body21: OperationParameter = { +export const body22: OperationParameter = { parameterPath: "body", mapper: SnapshotRestoreFilesMapper }; @@ -398,16 +407,74 @@ export const snapshotPolicyName: OperationURLParameter = { } }; -export const body22: OperationParameter = { +export const body23: OperationParameter = { parameterPath: "body", mapper: SnapshotPolicyMapper }; -export const body23: OperationParameter = { +export const body24: OperationParameter = { parameterPath: "body", mapper: SnapshotPolicyPatchMapper }; +export const backupVaultName: OperationURLParameter = { + parameterPath: "backupVaultName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$") + }, + serializedName: "backupVaultName", + required: true, + type: { + name: "String" + } + } +}; + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; + +export const backupName: OperationURLParameter = { + parameterPath: "backupName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,255}$") + }, + serializedName: "backupName", + required: true, + type: { + name: "String" + } + } +}; + +export const body25: OperationParameter = { + parameterPath: "body", + mapper: BackupMapper +}; + +export const body26: OperationParameter = { + parameterPath: ["options", "body"], + mapper: BackupPatchMapper +}; + +export const includeOnlyBackupsFromDeletedVolumes: OperationQueryParameter = { + parameterPath: ["options", "includeOnlyBackupsFromDeletedVolumes"], + mapper: { + serializedName: "includeOnlyBackupsFromDeletedVolumes", + type: { + name: "String" + } + } +}; + export const backupPolicyName: OperationURLParameter = { parameterPath: "backupPolicyName", mapper: { @@ -419,12 +486,12 @@ export const backupPolicyName: OperationURLParameter = { } }; -export const body24: OperationParameter = { +export const body27: OperationParameter = { parameterPath: "body", mapper: BackupPolicyMapper }; -export const body25: OperationParameter = { +export const body28: OperationParameter = { parameterPath: "body", mapper: BackupPolicyPatchMapper }; @@ -440,12 +507,12 @@ export const volumeQuotaRuleName: OperationURLParameter = { } }; -export const body26: OperationParameter = { +export const body29: OperationParameter = { parameterPath: "body", mapper: VolumeQuotaRuleMapper }; -export const body27: OperationParameter = { +export const body30: OperationParameter = { parameterPath: "body", mapper: VolumeQuotaRulePatchMapper }; @@ -466,7 +533,7 @@ export const volumeGroupName: OperationURLParameter = { } }; -export const body28: OperationParameter = { +export const body31: OperationParameter = { parameterPath: "body", mapper: VolumeGroupDetailsMapper }; @@ -487,12 +554,32 @@ export const subvolumeName: OperationURLParameter = { } }; -export const body29: OperationParameter = { +export const body32: OperationParameter = { parameterPath: "body", mapper: SubvolumeInfoMapper }; -export const body30: OperationParameter = { +export const body33: OperationParameter = { parameterPath: "body", mapper: SubvolumePatchRequestMapper }; + +export const body34: OperationParameter = { + parameterPath: "body", + mapper: BackupVaultMapper +}; + +export const body35: OperationParameter = { + parameterPath: "body", + mapper: BackupVaultPatchMapper +}; + +export const body36: OperationParameter = { + parameterPath: "body", + mapper: BackupRestoreFilesMapper +}; + +export const body37: OperationParameter = { + parameterPath: "body", + mapper: BackupsMigrationRequestMapper +}; diff --git a/sdk/netapp/arm-netapp/src/netAppManagementClient.ts b/sdk/netapp/arm-netapp/src/netAppManagementClient.ts index 5aa3b09b35fa..a860c397362a 100644 --- a/sdk/netapp/arm-netapp/src/netAppManagementClient.ts +++ b/sdk/netapp/arm-netapp/src/netAppManagementClient.ts @@ -18,31 +18,43 @@ import { OperationsImpl, NetAppResourceImpl, NetAppResourceQuotaLimitsImpl, + NetAppResourceRegionInfosImpl, AccountsImpl, PoolsImpl, VolumesImpl, SnapshotsImpl, SnapshotPoliciesImpl, BackupsImpl, + AccountBackupsImpl, BackupPoliciesImpl, VolumeQuotaRulesImpl, VolumeGroupsImpl, - SubvolumesImpl + SubvolumesImpl, + BackupVaultsImpl, + BackupsUnderBackupVaultImpl, + BackupsUnderVolumeImpl, + BackupsUnderAccountImpl } from "./operations"; import { Operations, NetAppResource, NetAppResourceQuotaLimits, + NetAppResourceRegionInfos, Accounts, Pools, Volumes, Snapshots, SnapshotPolicies, Backups, + AccountBackups, BackupPolicies, VolumeQuotaRules, VolumeGroups, - Subvolumes + Subvolumes, + BackupVaults, + BackupsUnderBackupVault, + BackupsUnderVolume, + BackupsUnderAccount } from "./operationsInterfaces"; import { NetAppManagementClientOptionalParams } from "./models"; @@ -54,7 +66,7 @@ export class NetAppManagementClient extends coreClient.ServiceClient { /** * Initializes a new instance of the NetAppManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( @@ -78,7 +90,7 @@ export class NetAppManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-netapp/19.0.0`; + const packageDetails = `azsdk-js-arm-netapp/20.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -131,20 +143,26 @@ export class NetAppManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-05-01"; + this.apiVersion = options.apiVersion || "2023-05-01-preview"; this.operations = new OperationsImpl(this); this.netAppResource = new NetAppResourceImpl(this); this.netAppResourceQuotaLimits = new NetAppResourceQuotaLimitsImpl(this); + this.netAppResourceRegionInfos = new NetAppResourceRegionInfosImpl(this); this.accounts = new AccountsImpl(this); this.pools = new PoolsImpl(this); this.volumes = new VolumesImpl(this); this.snapshots = new SnapshotsImpl(this); this.snapshotPolicies = new SnapshotPoliciesImpl(this); this.backups = new BackupsImpl(this); + this.accountBackups = new AccountBackupsImpl(this); this.backupPolicies = new BackupPoliciesImpl(this); this.volumeQuotaRules = new VolumeQuotaRulesImpl(this); this.volumeGroups = new VolumeGroupsImpl(this); this.subvolumes = new SubvolumesImpl(this); + this.backupVaults = new BackupVaultsImpl(this); + this.backupsUnderBackupVault = new BackupsUnderBackupVaultImpl(this); + this.backupsUnderVolume = new BackupsUnderVolumeImpl(this); + this.backupsUnderAccount = new BackupsUnderAccountImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -179,14 +197,20 @@ export class NetAppManagementClient extends coreClient.ServiceClient { operations: Operations; netAppResource: NetAppResource; netAppResourceQuotaLimits: NetAppResourceQuotaLimits; + netAppResourceRegionInfos: NetAppResourceRegionInfos; accounts: Accounts; pools: Pools; volumes: Volumes; snapshots: Snapshots; snapshotPolicies: SnapshotPolicies; backups: Backups; + accountBackups: AccountBackups; backupPolicies: BackupPolicies; volumeQuotaRules: VolumeQuotaRules; volumeGroups: VolumeGroups; subvolumes: Subvolumes; + backupVaults: BackupVaults; + backupsUnderBackupVault: BackupsUnderBackupVault; + backupsUnderVolume: BackupsUnderVolume; + backupsUnderAccount: BackupsUnderAccount; } diff --git a/sdk/netapp/arm-netapp/src/operations/accountBackups.ts b/sdk/netapp/arm-netapp/src/operations/accountBackups.ts new file mode 100644 index 000000000000..51f44bb6ae60 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operations/accountBackups.ts @@ -0,0 +1,324 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { AccountBackups } 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 { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Backup, + AccountBackupsListByNetAppAccountOptionalParams, + AccountBackupsListByNetAppAccountResponse, + AccountBackupsGetOptionalParams, + AccountBackupsGetResponse, + AccountBackupsDeleteOptionalParams, + AccountBackupsDeleteResponse +} from "../models"; + +/// +/** Class containing AccountBackups operations. */ +export class AccountBackupsImpl implements AccountBackups { + private readonly client: NetAppManagementClient; + + /** + * Initialize a new instance of the class AccountBackups class. + * @param client Reference to the service client + */ + constructor(client: NetAppManagementClient) { + this.client = client; + } + + /** + * List all Backups for a Netapp Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + public listByNetAppAccount( + resourceGroupName: string, + accountName: string, + options?: AccountBackupsListByNetAppAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByNetAppAccountPagingAll( + resourceGroupName, + accountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByNetAppAccountPagingPage( + resourceGroupName, + accountName, + options, + settings + ); + } + }; + } + + private async *listByNetAppAccountPagingPage( + resourceGroupName: string, + accountName: string, + options?: AccountBackupsListByNetAppAccountOptionalParams, + _settings?: PageSettings + ): AsyncIterableIterator { + let result: AccountBackupsListByNetAppAccountResponse; + result = await this._listByNetAppAccount( + resourceGroupName, + accountName, + options + ); + yield result.value || []; + } + + private async *listByNetAppAccountPagingAll( + resourceGroupName: string, + accountName: string, + options?: AccountBackupsListByNetAppAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByNetAppAccountPagingPage( + resourceGroupName, + accountName, + options + )) { + yield* page; + } + } + + /** + * List all Backups for a Netapp Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + private _listByNetAppAccount( + resourceGroupName: string, + accountName: string, + options?: AccountBackupsListByNetAppAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listByNetAppAccountOperationSpec + ); + } + + /** + * Gets the specified backup for a Netapp Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + backupName: string, + options?: AccountBackupsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, backupName, options }, + getOperationSpec + ); + } + + /** + * Delete the specified Backup for a Netapp Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + backupName: string, + options?: AccountBackupsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccountBackupsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, backupName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + AccountBackupsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Delete the specified Backup for a Netapp Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + backupName: string, + options?: AccountBackupsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + backupName, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByNetAppAccountOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.includeOnlyBackupsFromDeletedVolumes + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Backup + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.AccountBackupsDeleteHeaders + }, + 201: { + headersMapper: Mappers.AccountBackupsDeleteHeaders + }, + 202: { + headersMapper: Mappers.AccountBackupsDeleteHeaders + }, + 204: { + headersMapper: Mappers.AccountBackupsDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/netapp/arm-netapp/src/operations/accounts.ts b/sdk/netapp/arm-netapp/src/operations/accounts.ts index 05e875ec9c8e..2835df533976 100644 --- a/sdk/netapp/arm-netapp/src/operations/accounts.ts +++ b/sdk/netapp/arm-netapp/src/operations/accounts.ts @@ -36,6 +36,8 @@ import { AccountsUpdateOptionalParams, AccountsUpdateResponse, AccountsRenewCredentialsOptionalParams, + AccountsMigrateEncryptionKeyOptionalParams, + AccountsMigrateEncryptionKeyResponse, AccountsListBySubscriptionNextResponse, AccountsListNextResponse } from "../models"; @@ -576,6 +578,101 @@ export class AccountsImpl implements Accounts { return poller.pollUntilDone(); } + /** + * Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure + * Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from + * another account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + async beginMigrateEncryptionKey( + resourceGroupName: string, + accountName: string, + options?: AccountsMigrateEncryptionKeyOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccountsMigrateEncryptionKeyResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, options }, + spec: migrateEncryptionKeyOperationSpec + }); + const poller = await createHttpPoller< + AccountsMigrateEncryptionKeyResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure + * Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from + * another account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + async beginMigrateEncryptionKeyAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsMigrateEncryptionKeyOptionalParams + ): Promise { + const poller = await this.beginMigrateEncryptionKey( + resourceGroupName, + accountName, + options + ); + return poller.pollUntilDone(); + } + /** * ListBySubscriptionNext * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. @@ -757,6 +854,39 @@ const renewCredentialsOperationSpec: coreClient.OperationSpec = { ], serializer }; +const migrateEncryptionKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/migrateEncryption", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.AccountsMigrateEncryptionKeyHeaders + }, + 201: { + headersMapper: Mappers.AccountsMigrateEncryptionKeyHeaders + }, + 202: { + headersMapper: Mappers.AccountsMigrateEncryptionKeyHeaders + }, + 204: { + headersMapper: Mappers.AccountsMigrateEncryptionKeyHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", @@ -786,8 +916,8 @@ const listNextOperationSpec: coreClient.OperationSpec = { urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink + Parameters.nextLink, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts b/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts index 022827097f80..54ca7befbc1b 100644 --- a/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts +++ b/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts @@ -492,7 +492,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body24, + requestBody: Parameters.body27, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -524,7 +524,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body25, + requestBody: Parameters.body28, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/netapp/arm-netapp/src/operations/backupVaults.ts b/sdk/netapp/arm-netapp/src/operations/backupVaults.ts new file mode 100644 index 000000000000..84e178f89414 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operations/backupVaults.ts @@ -0,0 +1,657 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { BackupVaults } 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 { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + BackupVault, + BackupVaultsListByNetAppAccountNextOptionalParams, + BackupVaultsListByNetAppAccountOptionalParams, + BackupVaultsListByNetAppAccountResponse, + BackupVaultsGetOptionalParams, + BackupVaultsGetResponse, + BackupVaultsCreateOrUpdateOptionalParams, + BackupVaultsCreateOrUpdateResponse, + BackupVaultPatch, + BackupVaultsUpdateOptionalParams, + BackupVaultsUpdateResponse, + BackupVaultsDeleteOptionalParams, + BackupVaultsDeleteResponse, + BackupVaultsListByNetAppAccountNextResponse +} from "../models"; + +/// +/** Class containing BackupVaults operations. */ +export class BackupVaultsImpl implements BackupVaults { + private readonly client: NetAppManagementClient; + + /** + * Initialize a new instance of the class BackupVaults class. + * @param client Reference to the service client + */ + constructor(client: NetAppManagementClient) { + this.client = client; + } + + /** + * List and describe all Backup Vaults in the NetApp account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + public listByNetAppAccount( + resourceGroupName: string, + accountName: string, + options?: BackupVaultsListByNetAppAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByNetAppAccountPagingAll( + resourceGroupName, + accountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByNetAppAccountPagingPage( + resourceGroupName, + accountName, + options, + settings + ); + } + }; + } + + private async *listByNetAppAccountPagingPage( + resourceGroupName: string, + accountName: string, + options?: BackupVaultsListByNetAppAccountOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: BackupVaultsListByNetAppAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByNetAppAccount( + resourceGroupName, + accountName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByNetAppAccountNext( + resourceGroupName, + accountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByNetAppAccountPagingAll( + resourceGroupName: string, + accountName: string, + options?: BackupVaultsListByNetAppAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByNetAppAccountPagingPage( + resourceGroupName, + accountName, + options + )) { + yield* page; + } + } + + /** + * List and describe all Backup Vaults in the NetApp account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + private _listByNetAppAccount( + resourceGroupName: string, + accountName: string, + options?: BackupVaultsListByNetAppAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listByNetAppAccountOperationSpec + ); + } + + /** + * Get the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupVaultsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, backupVaultName, options }, + getOperationSpec + ); + } + + /** + * Create or update the specified Backup Vault in the NetApp account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param body BackupVault object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + body: BackupVault, + options?: BackupVaultsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupVaultsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, backupVaultName, body, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + BackupVaultsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create or update the specified Backup Vault in the NetApp account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param body BackupVault object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + body: BackupVault, + options?: BackupVaultsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + accountName, + backupVaultName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Patch the specified NetApp Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param body Backup Vault object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + body: BackupVaultPatch, + options?: BackupVaultsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupVaultsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, backupVaultName, body, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + BackupVaultsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Patch the specified NetApp Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param body Backup Vault object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + body: BackupVaultPatch, + options?: BackupVaultsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + backupVaultName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete the specified Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupVaultsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupVaultsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, backupVaultName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + BackupVaultsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Delete the specified Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupVaultsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + backupVaultName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByNetAppAccountNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param nextLink The nextLink from the previous successful call to the ListByNetAppAccount method. + * @param options The options parameters. + */ + private _listByNetAppAccountNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: BackupVaultsListByNetAppAccountNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listByNetAppAccountNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByNetAppAccountOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupVaultsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupVault + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BackupVault + }, + 201: { + bodyMapper: Mappers.BackupVault + }, + 202: { + bodyMapper: Mappers.BackupVault + }, + 204: { + bodyMapper: Mappers.BackupVault + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body34, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.BackupVault + }, + 201: { + bodyMapper: Mappers.BackupVault + }, + 202: { + bodyMapper: Mappers.BackupVault + }, + 204: { + bodyMapper: Mappers.BackupVault + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body35, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.BackupVaultsDeleteHeaders + }, + 201: { + headersMapper: Mappers.BackupVaultsDeleteHeaders + }, + 202: { + headersMapper: Mappers.BackupVaultsDeleteHeaders + }, + 204: { + headersMapper: Mappers.BackupVaultsDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByNetAppAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupVaultsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/netapp/arm-netapp/src/operations/backups.ts b/sdk/netapp/arm-netapp/src/operations/backups.ts index 8e5bb823e171..f47ed8a1d63a 100644 --- a/sdk/netapp/arm-netapp/src/operations/backups.ts +++ b/sdk/netapp/arm-netapp/src/operations/backups.ts @@ -6,16 +6,40 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Backups } 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 { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Backup, + BackupsListByVaultNextOptionalParams, + BackupsListByVaultOptionalParams, + BackupsListByVaultResponse, + BackupsGetLatestStatusOptionalParams, + BackupsGetLatestStatusResponse, BackupsGetVolumeRestoreStatusOptionalParams, - BackupsGetVolumeRestoreStatusResponse + BackupsGetVolumeRestoreStatusResponse, + BackupsGetOptionalParams, + BackupsGetResponse, + BackupsCreateOptionalParams, + BackupsCreateResponse, + BackupsUpdateOptionalParams, + BackupsUpdateResponse, + BackupsDeleteOptionalParams, + BackupsDeleteResponse, + BackupsListByVaultNextResponse } from "../models"; +/// /** Class containing Backups operations. */ export class BackupsImpl implements Backups { private readonly client: NetAppManagementClient; @@ -28,6 +52,120 @@ export class BackupsImpl implements Backups { this.client = client; } + /** + * List all backups Under a Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param options The options parameters. + */ + public listByVault( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupsListByVaultOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByVaultPagingAll( + resourceGroupName, + accountName, + backupVaultName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByVaultPagingPage( + resourceGroupName, + accountName, + backupVaultName, + options, + settings + ); + } + }; + } + + private async *listByVaultPagingPage( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupsListByVaultOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: BackupsListByVaultResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByVault( + resourceGroupName, + accountName, + backupVaultName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByVaultNext( + resourceGroupName, + accountName, + backupVaultName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByVaultPagingAll( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupsListByVaultOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByVaultPagingPage( + resourceGroupName, + accountName, + backupVaultName, + options + )) { + yield* page; + } + } + + /** + * Get the latest status of the backup for a volume + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + getLatestStatus( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: BackupsGetLatestStatusOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, poolName, volumeName, options }, + getLatestStatusOperationSpec + ); + } + /** * Get the status of the restore for a volume * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -48,10 +186,422 @@ export class BackupsImpl implements Backups { getVolumeRestoreStatusOperationSpec ); } + + /** + * List all backups Under a Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param options The options parameters. + */ + private _listByVault( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupsListByVaultOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, backupVaultName, options }, + listByVaultOperationSpec + ); + } + + /** + * Get the specified Backup under Backup Vault. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, backupVaultName, backupName, options }, + getOperationSpec + ); + } + + /** + * Create a backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + body: Backup, + options?: BackupsCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + backupVaultName, + backupName, + body, + options + }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + BackupsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create a backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + body: Backup, + options?: BackupsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + accountName, + backupVaultName, + backupName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Patch a Backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + backupVaultName, + backupName, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + BackupsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Patch a Backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + backupVaultName, + backupName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete a Backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + backupVaultName, + backupName, + options + }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + BackupsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Delete a Backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + backupVaultName, + backupName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByVaultNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param nextLink The nextLink from the previous successful call to the ListByVault method. + * @param options The options parameters. + */ + private _listByVaultNext( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + nextLink: string, + options?: BackupsListByVaultNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, backupVaultName, nextLink, options }, + listByVaultNextOperationSpec + ); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const getLatestStatusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/latestBackupStatus/current", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupStatus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept], + serializer +}; const getVolumeRestoreStatusOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/restoreStatus", @@ -74,3 +624,175 @@ const getVolumeRestoreStatusOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listByVaultOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Backup + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName, + Parameters.backupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Backup + }, + 201: { + bodyMapper: Mappers.Backup + }, + 202: { + bodyMapper: Mappers.Backup + }, + 204: { + bodyMapper: Mappers.Backup + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body25, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName, + Parameters.backupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Backup + }, + 201: { + bodyMapper: Mappers.Backup + }, + 202: { + bodyMapper: Mappers.Backup + }, + 204: { + bodyMapper: Mappers.Backup + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body26, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName, + Parameters.backupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.BackupsDeleteHeaders + }, + 201: { + headersMapper: Mappers.BackupsDeleteHeaders + }, + 202: { + headersMapper: Mappers.BackupsDeleteHeaders + }, + 204: { + headersMapper: Mappers.BackupsDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName, + Parameters.backupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVaultNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/netapp/arm-netapp/src/operations/backupsUnderAccount.ts b/sdk/netapp/arm-netapp/src/operations/backupsUnderAccount.ts new file mode 100644 index 000000000000..526ec4637d66 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operations/backupsUnderAccount.ts @@ -0,0 +1,169 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { BackupsUnderAccount } 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 { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + BackupsMigrationRequest, + BackupsUnderAccountMigrateBackupsOptionalParams, + BackupsUnderAccountMigrateBackupsResponse +} from "../models"; + +/** Class containing BackupsUnderAccount operations. */ +export class BackupsUnderAccountImpl implements BackupsUnderAccount { + private readonly client: NetAppManagementClient; + + /** + * Initialize a new instance of the class BackupsUnderAccount class. + * @param client Reference to the service client + */ + constructor(client: NetAppManagementClient) { + this.client = client; + } + + /** + * Migrate the backups under a NetApp account to backup vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param body Migrate backups under an account payload supplied in the body of the operation. + * @param options The options parameters. + */ + async beginMigrateBackups( + resourceGroupName: string, + accountName: string, + body: BackupsMigrationRequest, + options?: BackupsUnderAccountMigrateBackupsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsUnderAccountMigrateBackupsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, body, options }, + spec: migrateBackupsOperationSpec + }); + const poller = await createHttpPoller< + BackupsUnderAccountMigrateBackupsResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Migrate the backups under a NetApp account to backup vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param body Migrate backups under an account payload supplied in the body of the operation. + * @param options The options parameters. + */ + async beginMigrateBackupsAndWait( + resourceGroupName: string, + accountName: string, + body: BackupsMigrationRequest, + options?: BackupsUnderAccountMigrateBackupsOptionalParams + ): Promise { + const poller = await this.beginMigrateBackups( + resourceGroupName, + accountName, + body, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const migrateBackupsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/migrateBackups", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BackupsUnderAccountMigrateBackupsHeaders + }, + 201: { + headersMapper: Mappers.BackupsUnderAccountMigrateBackupsHeaders + }, + 202: { + headersMapper: Mappers.BackupsUnderAccountMigrateBackupsHeaders + }, + 204: { + headersMapper: Mappers.BackupsUnderAccountMigrateBackupsHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body37, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/netapp/arm-netapp/src/operations/backupsUnderBackupVault.ts b/sdk/netapp/arm-netapp/src/operations/backupsUnderBackupVault.ts new file mode 100644 index 000000000000..5a72ba838517 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operations/backupsUnderBackupVault.ts @@ -0,0 +1,188 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { BackupsUnderBackupVault } 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 { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + BackupRestoreFiles, + BackupsUnderBackupVaultRestoreFilesOptionalParams, + BackupsUnderBackupVaultRestoreFilesResponse +} from "../models"; + +/** Class containing BackupsUnderBackupVault operations. */ +export class BackupsUnderBackupVaultImpl implements BackupsUnderBackupVault { + private readonly client: NetAppManagementClient; + + /** + * Initialize a new instance of the class BackupsUnderBackupVault class. + * @param client Reference to the service client + */ + constructor(client: NetAppManagementClient) { + this.client = client; + } + + /** + * Restore the specified files from the specified backup to the active filesystem + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param body Restore payload supplied in the body of the operation. + * @param options The options parameters. + */ + async beginRestoreFiles( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + body: BackupRestoreFiles, + options?: BackupsUnderBackupVaultRestoreFilesOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsUnderBackupVaultRestoreFilesResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + backupVaultName, + backupName, + body, + options + }, + spec: restoreFilesOperationSpec + }); + const poller = await createHttpPoller< + BackupsUnderBackupVaultRestoreFilesResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Restore the specified files from the specified backup to the active filesystem + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param body Restore payload supplied in the body of the operation. + * @param options The options parameters. + */ + async beginRestoreFilesAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + body: BackupRestoreFiles, + options?: BackupsUnderBackupVaultRestoreFilesOptionalParams + ): Promise { + const poller = await this.beginRestoreFiles( + resourceGroupName, + accountName, + backupVaultName, + backupName, + body, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const restoreFilesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}/restoreFiles", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BackupsUnderBackupVaultRestoreFilesHeaders + }, + 201: { + headersMapper: Mappers.BackupsUnderBackupVaultRestoreFilesHeaders + }, + 202: { + headersMapper: Mappers.BackupsUnderBackupVaultRestoreFilesHeaders + }, + 204: { + headersMapper: Mappers.BackupsUnderBackupVaultRestoreFilesHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body36, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.backupVaultName, + Parameters.backupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/netapp/arm-netapp/src/operations/backupsUnderVolume.ts b/sdk/netapp/arm-netapp/src/operations/backupsUnderVolume.ts new file mode 100644 index 000000000000..977c95387438 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operations/backupsUnderVolume.ts @@ -0,0 +1,188 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { BackupsUnderVolume } 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 { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + BackupsMigrationRequest, + BackupsUnderVolumeMigrateBackupsOptionalParams, + BackupsUnderVolumeMigrateBackupsResponse +} from "../models"; + +/** Class containing BackupsUnderVolume operations. */ +export class BackupsUnderVolumeImpl implements BackupsUnderVolume { + private readonly client: NetAppManagementClient; + + /** + * Initialize a new instance of the class BackupsUnderVolume class. + * @param client Reference to the service client + */ + constructor(client: NetAppManagementClient) { + this.client = client; + } + + /** + * Migrate the backups under volume to backup vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Migrate backups under volume payload supplied in the body of the operation. + * @param options The options parameters. + */ + async beginMigrateBackups( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + body: BackupsMigrationRequest, + options?: BackupsUnderVolumeMigrateBackupsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsUnderVolumeMigrateBackupsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + poolName, + volumeName, + body, + options + }, + spec: migrateBackupsOperationSpec + }); + const poller = await createHttpPoller< + BackupsUnderVolumeMigrateBackupsResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Migrate the backups under volume to backup vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Migrate backups under volume payload supplied in the body of the operation. + * @param options The options parameters. + */ + async beginMigrateBackupsAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + body: BackupsMigrationRequest, + options?: BackupsUnderVolumeMigrateBackupsOptionalParams + ): Promise { + const poller = await this.beginMigrateBackups( + resourceGroupName, + accountName, + poolName, + volumeName, + body, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const migrateBackupsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/migrateBackups", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BackupsUnderVolumeMigrateBackupsHeaders + }, + 201: { + headersMapper: Mappers.BackupsUnderVolumeMigrateBackupsHeaders + }, + 202: { + headersMapper: Mappers.BackupsUnderVolumeMigrateBackupsHeaders + }, + 204: { + headersMapper: Mappers.BackupsUnderVolumeMigrateBackupsHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body37, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/netapp/arm-netapp/src/operations/index.ts b/sdk/netapp/arm-netapp/src/operations/index.ts index 3452b163b6da..85ac01dc9a6e 100644 --- a/sdk/netapp/arm-netapp/src/operations/index.ts +++ b/sdk/netapp/arm-netapp/src/operations/index.ts @@ -9,13 +9,19 @@ export * from "./operations"; export * from "./netAppResource"; export * from "./netAppResourceQuotaLimits"; +export * from "./netAppResourceRegionInfos"; export * from "./accounts"; export * from "./pools"; export * from "./volumes"; export * from "./snapshots"; export * from "./snapshotPolicies"; export * from "./backups"; +export * from "./accountBackups"; export * from "./backupPolicies"; export * from "./volumeQuotaRules"; export * from "./volumeGroups"; export * from "./subvolumes"; +export * from "./backupVaults"; +export * from "./backupsUnderBackupVault"; +export * from "./backupsUnderVolume"; +export * from "./backupsUnderAccount"; diff --git a/sdk/netapp/arm-netapp/src/operations/netAppResource.ts b/sdk/netapp/arm-netapp/src/operations/netAppResource.ts index 0d1269707fc3..2f7f08795a07 100644 --- a/sdk/netapp/arm-netapp/src/operations/netAppResource.ts +++ b/sdk/netapp/arm-netapp/src/operations/netAppResource.ts @@ -49,7 +49,7 @@ export class NetAppResourceImpl implements NetAppResource { /** * Check if a resource name is available. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param name Resource name to verify. * @param typeParam Resource type used for verification. * @param resourceGroup Resource group name. @@ -70,7 +70,7 @@ export class NetAppResourceImpl implements NetAppResource { /** * Check if a file path is available. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param name File path to verify. * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation * Microsoft.NetApp/volumes @@ -90,7 +90,7 @@ export class NetAppResourceImpl implements NetAppResource { /** * Check if a quota is available. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param name Name of the resource to verify. * @param typeParam Resource type used for verification. * @param resourceGroup Resource group name. @@ -111,7 +111,7 @@ export class NetAppResourceImpl implements NetAppResource { /** * Provides storage to network proximity and logical zone mapping information. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param options The options parameters. */ queryRegionInfo( @@ -126,7 +126,7 @@ export class NetAppResourceImpl implements NetAppResource { /** * Get details of the specified network sibling set. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param networkSiblingSetId Network Sibling Set ID for a group of volumes sharing networking * resources in a subnet. * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation @@ -148,7 +148,7 @@ export class NetAppResourceImpl implements NetAppResource { /** * Update the network features of the specified network sibling set. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param networkSiblingSetId Network Sibling Set ID for a group of volumes sharing networking * resources in a subnet. * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation @@ -156,7 +156,7 @@ export class NetAppResourceImpl implements NetAppResource { * /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} * @param networkSiblingSetStateId Network sibling set state Id identifying the current state of the * sibling set. - * @param networkFeatures Network features available to the volume, some such + * @param networkFeatures Network features available to the volume * @param options The options parameters. */ async beginUpdateNetworkSiblingSet( @@ -237,7 +237,7 @@ export class NetAppResourceImpl implements NetAppResource { /** * Update the network features of the specified network sibling set. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param networkSiblingSetId Network Sibling Set ID for a group of volumes sharing networking * resources in a subnet. * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation @@ -245,7 +245,7 @@ export class NetAppResourceImpl implements NetAppResource { * /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} * @param networkSiblingSetStateId Network sibling set state Id identifying the current state of the * sibling set. - * @param networkFeatures Network features available to the volume, some such + * @param networkFeatures Network features available to the volume * @param options The options parameters. */ async beginUpdateNetworkSiblingSetAndWait( diff --git a/sdk/netapp/arm-netapp/src/operations/netAppResourceQuotaLimits.ts b/sdk/netapp/arm-netapp/src/operations/netAppResourceQuotaLimits.ts index a4ce74b1b1d7..e727476ef69d 100644 --- a/sdk/netapp/arm-netapp/src/operations/netAppResourceQuotaLimits.ts +++ b/sdk/netapp/arm-netapp/src/operations/netAppResourceQuotaLimits.ts @@ -36,7 +36,7 @@ export class NetAppResourceQuotaLimitsImpl /** * Get the default and current limits for quotas - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param options The options parameters. */ public list( @@ -81,7 +81,7 @@ export class NetAppResourceQuotaLimitsImpl /** * Get the default and current limits for quotas - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param options The options parameters. */ private _list( @@ -96,7 +96,7 @@ export class NetAppResourceQuotaLimitsImpl /** * Get the default and current subscription quota limit - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param quotaLimitName The name of the Quota Limit * @param options The options parameters. */ diff --git a/sdk/netapp/arm-netapp/src/operations/netAppResourceRegionInfos.ts b/sdk/netapp/arm-netapp/src/operations/netAppResourceRegionInfos.ts new file mode 100644 index 000000000000..e761953bccc0 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operations/netAppResourceRegionInfos.ts @@ -0,0 +1,209 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { NetAppResourceRegionInfos } 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 { + RegionInfoResource, + NetAppResourceRegionInfosListNextOptionalParams, + NetAppResourceRegionInfosListOptionalParams, + NetAppResourceRegionInfosListResponse, + NetAppResourceRegionInfosGetOptionalParams, + NetAppResourceRegionInfosGetResponse, + NetAppResourceRegionInfosListNextResponse +} from "../models"; + +/// +/** Class containing NetAppResourceRegionInfos operations. */ +export class NetAppResourceRegionInfosImpl + implements NetAppResourceRegionInfos { + private readonly client: NetAppManagementClient; + + /** + * Initialize a new instance of the class NetAppResourceRegionInfos class. + * @param client Reference to the service client + */ + constructor(client: NetAppManagementClient) { + this.client = client; + } + + /** + * Provides region specific information. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + public list( + location: string, + options?: NetAppResourceRegionInfosListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(location, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(location, options, settings); + } + }; + } + + private async *listPagingPage( + location: string, + options?: NetAppResourceRegionInfosListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: NetAppResourceRegionInfosListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(location, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + location: string, + options?: NetAppResourceRegionInfosListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(location, options)) { + yield* page; + } + } + + /** + * Provides region specific information. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + private _list( + location: string, + options?: NetAppResourceRegionInfosListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listOperationSpec + ); + } + + /** + * Provides storage to network proximity and logical zone mapping information. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + get( + location: string, + options?: NetAppResourceRegionInfosGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param location The name of the Azure region. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + location: string, + nextLink: string, + options?: NetAppResourceRegionInfosListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfos", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RegionInfosList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfos/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RegionInfoResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RegionInfosList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/netapp/arm-netapp/src/operations/pools.ts b/sdk/netapp/arm-netapp/src/operations/pools.ts index e8ca4ae2cbe4..f474039b7493 100644 --- a/sdk/netapp/arm-netapp/src/operations/pools.ts +++ b/sdk/netapp/arm-netapp/src/operations/pools.ts @@ -529,7 +529,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body7, + requestBody: Parameters.body8, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -561,7 +561,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body8, + requestBody: Parameters.body9, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -601,9 +601,9 @@ const listNextOperationSpec: coreClient.OperationSpec = { urlParameters: [ Parameters.$host, Parameters.subscriptionId, + Parameters.nextLink, Parameters.resourceGroupName, - Parameters.accountName, - Parameters.nextLink + Parameters.accountName ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/netapp/arm-netapp/src/operations/snapshotPolicies.ts b/sdk/netapp/arm-netapp/src/operations/snapshotPolicies.ts index 0d37dec2e158..2b2ca74dd838 100644 --- a/sdk/netapp/arm-netapp/src/operations/snapshotPolicies.ts +++ b/sdk/netapp/arm-netapp/src/operations/snapshotPolicies.ts @@ -433,7 +433,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body22, + requestBody: Parameters.body23, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -465,7 +465,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body23, + requestBody: Parameters.body24, 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 b9f511957073..a3c94dea49e7 100644 --- a/sdk/netapp/arm-netapp/src/operations/snapshots.ts +++ b/sdk/netapp/arm-netapp/src/operations/snapshots.ts @@ -700,7 +700,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body19, + requestBody: Parameters.body20, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -734,7 +734,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body20, + requestBody: Parameters.body21, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -771,7 +771,7 @@ const restoreFilesOperationSpec: coreClient.OperationSpec = { "/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.body21, + requestBody: Parameters.body22, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/netapp/arm-netapp/src/operations/subvolumes.ts b/sdk/netapp/arm-netapp/src/operations/subvolumes.ts index c446eef73b2e..ec5c0ba72c67 100644 --- a/sdk/netapp/arm-netapp/src/operations/subvolumes.ts +++ b/sdk/netapp/arm-netapp/src/operations/subvolumes.ts @@ -756,7 +756,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body29, + requestBody: Parameters.body32, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -790,7 +790,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body30, + requestBody: Parameters.body33, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -866,9 +866,9 @@ const listByVolumeNextOperationSpec: coreClient.OperationSpec = { urlParameters: [ Parameters.$host, Parameters.subscriptionId, + Parameters.nextLink, Parameters.resourceGroupName, Parameters.accountName, - Parameters.nextLink, Parameters.poolName, Parameters.volumeName ], diff --git a/sdk/netapp/arm-netapp/src/operations/volumeGroups.ts b/sdk/netapp/arm-netapp/src/operations/volumeGroups.ts index 373390e30cd5..68a88ec41859 100644 --- a/sdk/netapp/arm-netapp/src/operations/volumeGroups.ts +++ b/sdk/netapp/arm-netapp/src/operations/volumeGroups.ts @@ -395,7 +395,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body28, + requestBody: Parameters.body31, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/netapp/arm-netapp/src/operations/volumeQuotaRules.ts b/sdk/netapp/arm-netapp/src/operations/volumeQuotaRules.ts index 9bea00ee605c..c09dcef9a150 100644 --- a/sdk/netapp/arm-netapp/src/operations/volumeQuotaRules.ts +++ b/sdk/netapp/arm-netapp/src/operations/volumeQuotaRules.ts @@ -588,7 +588,7 @@ const createOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body26, + requestBody: Parameters.body29, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -622,7 +622,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body27, + requestBody: Parameters.body30, 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 4d2884ae3d8c..ecb1ca29cafc 100644 --- a/sdk/netapp/arm-netapp/src/operations/volumes.ts +++ b/sdk/netapp/arm-netapp/src/operations/volumes.ts @@ -40,6 +40,9 @@ import { VolumeRevert, VolumesRevertOptionalParams, VolumesResetCifsPasswordOptionalParams, + VolumesResetCifsPasswordResponse, + VolumesSplitCloneFromParentOptionalParams, + VolumesSplitCloneFromParentResponse, VolumesBreakFileLocksOptionalParams, GetGroupIdListForLdapUserRequest, VolumesListGetGroupIdListForLdapUserOptionalParams, @@ -829,11 +832,16 @@ export class VolumesImpl implements Volumes { poolName: string, volumeName: string, options?: VolumesResetCifsPasswordOptionalParams - ): Promise, void>> { + ): Promise< + SimplePollerLike< + OperationState, + VolumesResetCifsPasswordResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -874,7 +882,10 @@ export class VolumesImpl implements Volumes { args: { resourceGroupName, accountName, poolName, volumeName, options }, spec: resetCifsPasswordOperationSpec }); - const poller = await createHttpPoller>(lro, { + const poller = await createHttpPoller< + VolumesResetCifsPasswordResponse, + OperationState + >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); @@ -896,7 +907,7 @@ export class VolumesImpl implements Volumes { poolName: string, volumeName: string, options?: VolumesResetCifsPasswordOptionalParams - ): Promise { + ): Promise { const poller = await this.beginResetCifsPassword( resourceGroupName, accountName, @@ -907,6 +918,107 @@ export class VolumesImpl implements Volumes { return poller.pollUntilDone(); } + /** + * Split operation to convert clone volume to an independent volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + async beginSplitCloneFromParent( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: VolumesSplitCloneFromParentOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VolumesSplitCloneFromParentResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, poolName, volumeName, options }, + spec: splitCloneFromParentOperationSpec + }); + const poller = await createHttpPoller< + VolumesSplitCloneFromParentResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Split operation to convert clone volume to an independent volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + async beginSplitCloneFromParentAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: VolumesSplitCloneFromParentOptionalParams + ): Promise { + const poller = await this.beginSplitCloneFromParent( + resourceGroupName, + accountName, + poolName, + volumeName, + options + ); + return poller.pollUntilDone(); + } + /** * Break all the file locks on a volume * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -2212,7 +2324,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { }, default: {} }, - requestBody: Parameters.body9, + requestBody: Parameters.body10, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2247,7 +2359,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.body10, + requestBody: Parameters.body11, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2315,7 +2427,7 @@ const revertOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, - requestBody: Parameters.body11, + requestBody: Parameters.body12, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2333,7 +2445,53 @@ const resetCifsPasswordOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resetCifsPassword", httpMethod: "POST", - responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, + responses: { + 200: { + headersMapper: Mappers.VolumesResetCifsPasswordHeaders + }, + 201: { + headersMapper: Mappers.VolumesResetCifsPasswordHeaders + }, + 202: { + headersMapper: Mappers.VolumesResetCifsPasswordHeaders + }, + 204: { + headersMapper: Mappers.VolumesResetCifsPasswordHeaders + }, + default: {} + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + serializer +}; +const splitCloneFromParentOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/splitCloneFromParent", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.VolumesSplitCloneFromParentHeaders + }, + 201: { + headersMapper: Mappers.VolumesSplitCloneFromParentHeaders + }, + 202: { + headersMapper: Mappers.VolumesSplitCloneFromParentHeaders + }, + 204: { + headersMapper: Mappers.VolumesSplitCloneFromParentHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2343,6 +2501,7 @@ const resetCifsPasswordOperationSpec: coreClient.OperationSpec = { Parameters.poolName, Parameters.volumeName ], + headerParameters: [Parameters.accept], serializer }; const breakFileLocksOperationSpec: coreClient.OperationSpec = { @@ -2350,7 +2509,7 @@ const breakFileLocksOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakFileLocks", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, - requestBody: Parameters.body12, + requestBody: Parameters.body13, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2385,7 +2544,7 @@ const listGetGroupIdListForLdapUserOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.body13, + requestBody: Parameters.body14, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2404,7 +2563,7 @@ const breakReplicationOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, - requestBody: Parameters.body14, + requestBody: Parameters.body15, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2423,7 +2582,7 @@ const reestablishReplicationOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reestablishReplication", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, - requestBody: Parameters.body15, + requestBody: Parameters.body16, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2518,7 +2677,7 @@ const authorizeReplicationOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, - requestBody: Parameters.body16, + requestBody: Parameters.body17, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2553,7 +2712,7 @@ const poolChangeOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, - requestBody: Parameters.body17, + requestBody: Parameters.body18, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2572,7 +2731,7 @@ const relocateOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/relocate", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, - requestBody: Parameters.body18, + requestBody: Parameters.body19, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -2630,9 +2789,9 @@ const listNextOperationSpec: coreClient.OperationSpec = { urlParameters: [ Parameters.$host, Parameters.subscriptionId, + Parameters.nextLink, Parameters.resourceGroupName, Parameters.accountName, - Parameters.nextLink, Parameters.poolName ], headerParameters: [Parameters.accept], diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/accountBackups.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/accountBackups.ts new file mode 100644 index 000000000000..76a9abaa9f43 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/accountBackups.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Backup, + AccountBackupsListByNetAppAccountOptionalParams, + AccountBackupsGetOptionalParams, + AccountBackupsGetResponse, + AccountBackupsDeleteOptionalParams, + AccountBackupsDeleteResponse +} from "../models"; + +/// +/** Interface representing a AccountBackups. */ +export interface AccountBackups { + /** + * List all Backups for a Netapp Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + listByNetAppAccount( + resourceGroupName: string, + accountName: string, + options?: AccountBackupsListByNetAppAccountOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the specified backup for a Netapp Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + backupName: string, + options?: AccountBackupsGetOptionalParams + ): Promise; + /** + * Delete the specified Backup for a Netapp Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + backupName: string, + options?: AccountBackupsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccountBackupsDeleteResponse + > + >; + /** + * Delete the specified Backup for a Netapp Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + backupName: string, + options?: AccountBackupsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/accounts.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/accounts.ts index a6474857b7d9..e41cfb16a561 100644 --- a/sdk/netapp/arm-netapp/src/operationsInterfaces/accounts.ts +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/accounts.ts @@ -20,7 +20,9 @@ import { NetAppAccountPatch, AccountsUpdateOptionalParams, AccountsUpdateResponse, - AccountsRenewCredentialsOptionalParams + AccountsRenewCredentialsOptionalParams, + AccountsMigrateEncryptionKeyOptionalParams, + AccountsMigrateEncryptionKeyResponse } from "../models"; /// @@ -163,4 +165,35 @@ export interface Accounts { accountName: string, options?: AccountsRenewCredentialsOptionalParams ): Promise; + /** + * Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure + * Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from + * another account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + beginMigrateEncryptionKey( + resourceGroupName: string, + accountName: string, + options?: AccountsMigrateEncryptionKeyOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccountsMigrateEncryptionKeyResponse + > + >; + /** + * Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure + * Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from + * another account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + beginMigrateEncryptionKeyAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsMigrateEncryptionKeyOptionalParams + ): Promise; } diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/backupVaults.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/backupVaults.ts new file mode 100644 index 000000000000..49a3ab8e7a23 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/backupVaults.ts @@ -0,0 +1,153 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + BackupVault, + BackupVaultsListByNetAppAccountOptionalParams, + BackupVaultsGetOptionalParams, + BackupVaultsGetResponse, + BackupVaultsCreateOrUpdateOptionalParams, + BackupVaultsCreateOrUpdateResponse, + BackupVaultPatch, + BackupVaultsUpdateOptionalParams, + BackupVaultsUpdateResponse, + BackupVaultsDeleteOptionalParams, + BackupVaultsDeleteResponse +} from "../models"; + +/// +/** Interface representing a BackupVaults. */ +export interface BackupVaults { + /** + * List and describe all Backup Vaults in the NetApp account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param options The options parameters. + */ + listByNetAppAccount( + resourceGroupName: string, + accountName: string, + options?: BackupVaultsListByNetAppAccountOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupVaultsGetOptionalParams + ): Promise; + /** + * Create or update the specified Backup Vault in the NetApp account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param body BackupVault object supplied in the body of the operation. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + body: BackupVault, + options?: BackupVaultsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupVaultsCreateOrUpdateResponse + > + >; + /** + * Create or update the specified Backup Vault in the NetApp account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param body BackupVault object supplied in the body of the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + body: BackupVault, + options?: BackupVaultsCreateOrUpdateOptionalParams + ): Promise; + /** + * Patch the specified NetApp Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param body Backup Vault object supplied in the body of the operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + body: BackupVaultPatch, + options?: BackupVaultsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupVaultsUpdateResponse + > + >; + /** + * Patch the specified NetApp Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param body Backup Vault object supplied in the body of the operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + body: BackupVaultPatch, + options?: BackupVaultsUpdateOptionalParams + ): Promise; + /** + * Delete the specified Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupVaultsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupVaultsDeleteResponse + > + >; + /** + * Delete the specified Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupVaultsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/backups.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/backups.ts index e7ad406ae6ea..e799d65beac9 100644 --- a/sdk/netapp/arm-netapp/src/operationsInterfaces/backups.ts +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/backups.ts @@ -6,13 +6,56 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { + Backup, + BackupsListByVaultOptionalParams, + BackupsGetLatestStatusOptionalParams, + BackupsGetLatestStatusResponse, BackupsGetVolumeRestoreStatusOptionalParams, - BackupsGetVolumeRestoreStatusResponse + BackupsGetVolumeRestoreStatusResponse, + BackupsGetOptionalParams, + BackupsGetResponse, + BackupsCreateOptionalParams, + BackupsCreateResponse, + BackupsUpdateOptionalParams, + BackupsUpdateResponse, + BackupsDeleteOptionalParams, + BackupsDeleteResponse } from "../models"; +/// /** Interface representing a Backups. */ export interface Backups { + /** + * List all backups Under a Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param options The options parameters. + */ + listByVault( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + options?: BackupsListByVaultOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the latest status of the backup for a volume + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + getLatestStatus( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: BackupsGetLatestStatusOptionalParams + ): Promise; /** * Get the status of the restore for a volume * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -28,4 +71,128 @@ export interface Backups { volumeName: string, options?: BackupsGetVolumeRestoreStatusOptionalParams ): Promise; + /** + * Get the specified Backup under Backup Vault. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsGetOptionalParams + ): Promise; + /** + * Create a backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + body: Backup, + options?: BackupsCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsCreateResponse + > + >; + /** + * Create a backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + body: Backup, + options?: BackupsCreateOptionalParams + ): Promise; + /** + * Patch a Backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsUpdateResponse + > + >; + /** + * Patch a Backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsUpdateOptionalParams + ): Promise; + /** + * Delete a Backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsDeleteResponse + > + >; + /** + * Delete a Backup under the Backup Vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + options?: BackupsDeleteOptionalParams + ): Promise; } diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/backupsUnderAccount.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/backupsUnderAccount.ts new file mode 100644 index 000000000000..a33aad6436c9 --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/backupsUnderAccount.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + BackupsMigrationRequest, + BackupsUnderAccountMigrateBackupsOptionalParams, + BackupsUnderAccountMigrateBackupsResponse +} from "../models"; + +/** Interface representing a BackupsUnderAccount. */ +export interface BackupsUnderAccount { + /** + * Migrate the backups under a NetApp account to backup vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param body Migrate backups under an account payload supplied in the body of the operation. + * @param options The options parameters. + */ + beginMigrateBackups( + resourceGroupName: string, + accountName: string, + body: BackupsMigrationRequest, + options?: BackupsUnderAccountMigrateBackupsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsUnderAccountMigrateBackupsResponse + > + >; + /** + * Migrate the backups under a NetApp account to backup vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param body Migrate backups under an account payload supplied in the body of the operation. + * @param options The options parameters. + */ + beginMigrateBackupsAndWait( + resourceGroupName: string, + accountName: string, + body: BackupsMigrationRequest, + options?: BackupsUnderAccountMigrateBackupsOptionalParams + ): Promise; +} diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/backupsUnderBackupVault.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/backupsUnderBackupVault.ts new file mode 100644 index 000000000000..493f452dccdb --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/backupsUnderBackupVault.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + BackupRestoreFiles, + BackupsUnderBackupVaultRestoreFilesOptionalParams, + BackupsUnderBackupVaultRestoreFilesResponse +} from "../models"; + +/** Interface representing a BackupsUnderBackupVault. */ +export interface BackupsUnderBackupVault { + /** + * Restore the specified files from the specified backup to the active filesystem + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param body Restore payload supplied in the body of the operation. + * @param options The options parameters. + */ + beginRestoreFiles( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + body: BackupRestoreFiles, + options?: BackupsUnderBackupVaultRestoreFilesOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsUnderBackupVaultRestoreFilesResponse + > + >; + /** + * Restore the specified files from the specified backup to the active filesystem + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param backupVaultName The name of the Backup Vault + * @param backupName The name of the backup + * @param body Restore payload supplied in the body of the operation. + * @param options The options parameters. + */ + beginRestoreFilesAndWait( + resourceGroupName: string, + accountName: string, + backupVaultName: string, + backupName: string, + body: BackupRestoreFiles, + options?: BackupsUnderBackupVaultRestoreFilesOptionalParams + ): Promise; +} diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/backupsUnderVolume.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/backupsUnderVolume.ts new file mode 100644 index 000000000000..48375bd2d2bb --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/backupsUnderVolume.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + BackupsMigrationRequest, + BackupsUnderVolumeMigrateBackupsOptionalParams, + BackupsUnderVolumeMigrateBackupsResponse +} from "../models"; + +/** Interface representing a BackupsUnderVolume. */ +export interface BackupsUnderVolume { + /** + * Migrate the backups under volume to backup vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Migrate backups under volume payload supplied in the body of the operation. + * @param options The options parameters. + */ + beginMigrateBackups( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + body: BackupsMigrationRequest, + options?: BackupsUnderVolumeMigrateBackupsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupsUnderVolumeMigrateBackupsResponse + > + >; + /** + * Migrate the backups under volume to backup vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Migrate backups under volume payload supplied in the body of the operation. + * @param options The options parameters. + */ + beginMigrateBackupsAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + body: BackupsMigrationRequest, + options?: BackupsUnderVolumeMigrateBackupsOptionalParams + ): Promise; +} diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/index.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/index.ts index 3452b163b6da..85ac01dc9a6e 100644 --- a/sdk/netapp/arm-netapp/src/operationsInterfaces/index.ts +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/index.ts @@ -9,13 +9,19 @@ export * from "./operations"; export * from "./netAppResource"; export * from "./netAppResourceQuotaLimits"; +export * from "./netAppResourceRegionInfos"; export * from "./accounts"; export * from "./pools"; export * from "./volumes"; export * from "./snapshots"; export * from "./snapshotPolicies"; export * from "./backups"; +export * from "./accountBackups"; export * from "./backupPolicies"; export * from "./volumeQuotaRules"; export * from "./volumeGroups"; export * from "./subvolumes"; +export * from "./backupVaults"; +export * from "./backupsUnderBackupVault"; +export * from "./backupsUnderVolume"; +export * from "./backupsUnderAccount"; diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResource.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResource.ts index e266fa8c7d2c..ef0ae7423b66 100644 --- a/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResource.ts +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResource.ts @@ -29,7 +29,7 @@ import { export interface NetAppResource { /** * Check if a resource name is available. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param name Resource name to verify. * @param typeParam Resource type used for verification. * @param resourceGroup Resource group name. @@ -44,7 +44,7 @@ export interface NetAppResource { ): Promise; /** * Check if a file path is available. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param name File path to verify. * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation * Microsoft.NetApp/volumes @@ -58,7 +58,7 @@ export interface NetAppResource { ): Promise; /** * Check if a quota is available. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param name Name of the resource to verify. * @param typeParam Resource type used for verification. * @param resourceGroup Resource group name. @@ -73,7 +73,7 @@ export interface NetAppResource { ): Promise; /** * Provides storage to network proximity and logical zone mapping information. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param options The options parameters. */ queryRegionInfo( @@ -82,7 +82,7 @@ export interface NetAppResource { ): Promise; /** * Get details of the specified network sibling set. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param networkSiblingSetId Network Sibling Set ID for a group of volumes sharing networking * resources in a subnet. * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation @@ -98,7 +98,7 @@ export interface NetAppResource { ): Promise; /** * Update the network features of the specified network sibling set. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param networkSiblingSetId Network Sibling Set ID for a group of volumes sharing networking * resources in a subnet. * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation @@ -106,7 +106,7 @@ export interface NetAppResource { * /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} * @param networkSiblingSetStateId Network sibling set state Id identifying the current state of the * sibling set. - * @param networkFeatures Network features available to the volume, some such + * @param networkFeatures Network features available to the volume * @param options The options parameters. */ beginUpdateNetworkSiblingSet( @@ -124,7 +124,7 @@ export interface NetAppResource { >; /** * Update the network features of the specified network sibling set. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param networkSiblingSetId Network Sibling Set ID for a group of volumes sharing networking * resources in a subnet. * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation @@ -132,7 +132,7 @@ export interface NetAppResource { * /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} * @param networkSiblingSetStateId Network sibling set state Id identifying the current state of the * sibling set. - * @param networkFeatures Network features available to the volume, some such + * @param networkFeatures Network features available to the volume * @param options The options parameters. */ beginUpdateNetworkSiblingSetAndWait( diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResourceQuotaLimits.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResourceQuotaLimits.ts index 222b68c2c8e5..bea88fbc025c 100644 --- a/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResourceQuotaLimits.ts +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResourceQuotaLimits.ts @@ -19,7 +19,7 @@ import { export interface NetAppResourceQuotaLimits { /** * Get the default and current limits for quotas - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param options The options parameters. */ list( @@ -28,7 +28,7 @@ export interface NetAppResourceQuotaLimits { ): PagedAsyncIterableIterator; /** * Get the default and current subscription quota limit - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param quotaLimitName The name of the Quota Limit * @param options The options parameters. */ diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResourceRegionInfos.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResourceRegionInfos.ts new file mode 100644 index 000000000000..8b96f828710a --- /dev/null +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/netAppResourceRegionInfos.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. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RegionInfoResource, + NetAppResourceRegionInfosListOptionalParams, + NetAppResourceRegionInfosGetOptionalParams, + NetAppResourceRegionInfosGetResponse +} from "../models"; + +/// +/** Interface representing a NetAppResourceRegionInfos. */ +export interface NetAppResourceRegionInfos { + /** + * Provides region specific information. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + list( + location: string, + options?: NetAppResourceRegionInfosListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Provides storage to network proximity and logical zone mapping information. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + get( + location: string, + options?: NetAppResourceRegionInfosGetOptionalParams + ): Promise; +} diff --git a/sdk/netapp/arm-netapp/src/operationsInterfaces/volumes.ts b/sdk/netapp/arm-netapp/src/operationsInterfaces/volumes.ts index 804a09b4dd8a..ef8cff8d1323 100644 --- a/sdk/netapp/arm-netapp/src/operationsInterfaces/volumes.ts +++ b/sdk/netapp/arm-netapp/src/operationsInterfaces/volumes.ts @@ -26,6 +26,9 @@ import { VolumeRevert, VolumesRevertOptionalParams, VolumesResetCifsPasswordOptionalParams, + VolumesResetCifsPasswordResponse, + VolumesSplitCloneFromParentOptionalParams, + VolumesSplitCloneFromParentResponse, VolumesBreakFileLocksOptionalParams, GetGroupIdListForLdapUserRequest, VolumesListGetGroupIdListForLdapUserOptionalParams, @@ -284,7 +287,12 @@ export interface Volumes { poolName: string, volumeName: string, options?: VolumesResetCifsPasswordOptionalParams - ): Promise, void>>; + ): Promise< + SimplePollerLike< + OperationState, + VolumesResetCifsPasswordResponse + > + >; /** * Reset cifs password from volume * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -299,7 +307,42 @@ export interface Volumes { poolName: string, volumeName: string, options?: VolumesResetCifsPasswordOptionalParams - ): Promise; + ): Promise; + /** + * Split operation to convert clone volume to an independent volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + beginSplitCloneFromParent( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: VolumesSplitCloneFromParentOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VolumesSplitCloneFromParentResponse + > + >; + /** + * Split operation to convert clone volume to an independent volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + beginSplitCloneFromParentAndWait( + resourceGroupName: string, + accountName: string, + poolName: string, + volumeName: string, + options?: VolumesSplitCloneFromParentOptionalParams + ): Promise; /** * Break all the file locks on a volume * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/netapp/arm-netapp/test/netapp_examples.spec.ts b/sdk/netapp/arm-netapp/test/netapp_examples.spec.ts index b3cb4c562c23..d986a3bf3bf4 100644 --- a/sdk/netapp/arm-netapp/test/netapp_examples.spec.ts +++ b/sdk/netapp/arm-netapp/test/netapp_examples.spec.ts @@ -22,7 +22,7 @@ const replaceableVariables: Record = { AZURE_CLIENT_ID: "azure_client_id", AZURE_CLIENT_SECRET: "azure_client_secret", AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" + SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888" }; const recorderOptions: RecorderStartOptions = { @@ -62,7 +62,21 @@ describe("netapp test", () => { resourceGroup, accountName, { - location: location + location: location, + activeDirectories: [ + { + aesEncryption: true, + dns: "10.10.10.3", + domain: "10.10.10.3", + ldapOverTLS: false, + ldapSigning: false, + organizationalUnit: "OU=Engineering", + password: "ad_password", + site: "SiteName", + smbServerName: "SMBServer", + username: "ad_user_name", + }, + ], }, testPollingOptions ); @@ -90,4 +104,17 @@ describe("netapp test", () => { } assert.equal(resArray.length, 0); }); + + it("netAppResource checkNameAvailability test", async function () { + const name = "accName"; + const typeParam = "Microsoft.NetApp/netAppAccounts"; + const resourceGroup = "myRG"; + const result = await client.netAppResource.checkNameAvailability( + location, + name, + typeParam, + resourceGroup + ); + console.log(result); + }); })