From 1d3dbf409363c6ec6b87cd42d749ba32835d96b0 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 30 Oct 2025 05:21:08 +0000 Subject: [PATCH 1/8] Configurations: 'specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/tspconfig.yaml', API Version: 2025-09-01, SDK Release Type: stable, and CommitSHA: 'c86c7e36fb15171a9967d9fdc47784f2e4202ca6' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5515645 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- pnpm-lock.yaml | 41 +- sdk/elasticsans/arm-elasticsan/CHANGELOG.md | 73 + sdk/elasticsans/arm-elasticsan/README.md | 18 +- sdk/elasticsans/arm-elasticsan/_meta.json | 8 - .../arm-elasticsan/api-extractor.json | 4 +- .../arm-elasticsan/eslint.config.mjs | 14 + sdk/elasticsans/arm-elasticsan/metadata.json | 115 + sdk/elasticsans/arm-elasticsan/package.json | 348 ++- ...arm-elasticsan-api-elasticSans-node.api.md | 59 + .../review/arm-elasticsan-api-node.api.md | 28 + .../arm-elasticsan-api-operations-node.api.md | 19 + ...api-privateEndpointConnections-node.api.md | 44 + ...icsan-api-privateLinkResources-node.api.md | 19 + .../arm-elasticsan-api-skus-node.api.md | 20 + ...rm-elasticsan-api-volumeGroups-node.api.md | 52 + ...elasticsan-api-volumeSnapshots-node.api.md | 45 + .../arm-elasticsan-api-volumes-node.api.md | 70 + .../review/arm-elasticsan-models-node.api.md | 530 +++++ .../review/arm-elasticsan-node.api.md | 533 ++--- .../samples-dev/elasticSansCreateSample.ts | 58 +- .../samples-dev/elasticSansDeleteSample.ts | 44 +- .../samples-dev/elasticSansGetSample.ts | 42 +- .../elasticSansListByResourceGroupSample.ts | 40 +- .../elasticSansListBySubscriptionSample.ts | 28 +- .../samples-dev/elasticSansUpdateSample.ts | 52 +- .../samples-dev/operationsListSample.ts | 30 +- .../privateEndpointConnectionsCreateSample.ts | 81 +- .../privateEndpointConnectionsDeleteSample.ts | 52 +- .../privateEndpointConnectionsGetSample.ts | 46 +- .../privateEndpointConnectionsListSample.ts | 42 +- ...vateLinkResourcesListByElasticSanSample.ts | 40 +- .../samples-dev/restoreVolumeSample.ts | 64 - .../samples-dev/skusListSample.ts | 35 +- .../samples-dev/volumeGroupsCreateSample.ts | 98 +- .../samples-dev/volumeGroupsDeleteSample.ts | 48 +- .../samples-dev/volumeGroupsGetSample.ts | 46 +- .../volumeGroupsListByElasticSanSample.ts | 55 +- .../samples-dev/volumeGroupsUpdateSample.ts | 98 +- .../volumeSnapshotsCreateSample.ts | 90 +- .../volumeSnapshotsDeleteSample.ts | 58 +- .../samples-dev/volumeSnapshotsGetSample.ts | 52 +- .../volumeSnapshotsListByVolumeGroupSample.ts | 55 +- .../samples-dev/volumesCreateSample.ts | 74 +- .../samples-dev/volumesDeleteSample.ts | 74 +- .../samples-dev/volumesGetSample.ts | 52 +- .../volumesListByVolumeGroupSample.ts | 61 +- .../samples-dev/volumesPreBackupSample.ts | 32 +- .../samples-dev/volumesPreRestoreSample.ts | 40 +- .../samples-dev/volumesUpdateSample.ts | 72 +- .../samples/v1-beta/javascript/README.md | 108 - .../javascript/elasticSansCreateSample.js | 87 - .../javascript/elasticSansDeleteSample.js | 52 - .../javascript/elasticSansGetSample.js | 52 - .../elasticSansListByResourceGroupSample.js | 56 - .../javascript/elasticSansUpdateSample.js | 77 - .../javascript/operationsListSample.js | 56 - .../samples/v1-beta/javascript/package.json | 32 - .../privateEndpointConnectionsCreateSample.js | 78 - .../privateEndpointConnectionsDeleteSample.js | 62 - .../privateEndpointConnectionsGetSample.js | 62 - .../privateEndpointConnectionsListSample.js | 64 - ...vateLinkResourcesListByElasticSanSample.js | 58 - .../v1-beta/javascript/restoreVolumeSample.js | 66 - .../v1-beta/javascript/skusListSample.js | 56 - .../javascript/volumeGroupsCreateSample.js | 88 - .../javascript/volumeGroupsDeleteSample.js | 62 - .../javascript/volumeGroupsGetSample.js | 54 - .../volumeGroupsListByElasticSanSample.js | 74 - .../javascript/volumeGroupsUpdateSample.js | 88 - .../javascript/volumeSnapshotsCreateSample.js | 84 - .../javascript/volumeSnapshotsDeleteSample.js | 66 - .../javascript/volumeSnapshotsGetSample.js | 66 - .../volumeSnapshotsListByVolumeGroupSample.js | 71 - .../v1-beta/javascript/volumesCreateSample.js | 76 - .../v1-beta/javascript/volumesDeleteSample.js | 78 - .../v1-beta/javascript/volumesGetSample.js | 66 - .../volumesListByVolumeGroupSample.js | 78 - .../javascript/volumesPreBackupSample.js | 42 - .../javascript/volumesPreRestoreSample.js | 46 - .../v1-beta/javascript/volumesUpdateSample.js | 75 - .../samples/v1-beta/typescript/README.md | 121 -- .../samples/v1-beta/typescript/package.json | 41 - .../typescript/src/elasticSansCreateSample.ts | 91 - .../typescript/src/elasticSansDeleteSample.ts | 62 - .../typescript/src/elasticSansGetSample.ts | 62 - .../elasticSansListByResourceGroupSample.ts | 64 - .../typescript/src/elasticSansUpdateSample.ts | 81 - .../typescript/src/operationsListSample.ts | 58 - .../privateEndpointConnectionsCreateSample.ts | 85 - .../privateEndpointConnectionsDeleteSample.ts | 66 - .../privateEndpointConnectionsGetSample.ts | 66 - .../privateEndpointConnectionsListSample.ts | 68 - ...vateLinkResourcesListByElasticSanSample.ts | 62 - .../typescript/src/restoreVolumeSample.ts | 70 - .../v1-beta/typescript/src/skusListSample.ts | 61 - .../src/volumeGroupsCreateSample.ts | 94 - .../src/volumeGroupsDeleteSample.ts | 66 - .../typescript/src/volumeGroupsGetSample.ts | 66 - .../src/volumeGroupsListByElasticSanSample.ts | 81 - .../src/volumeGroupsUpdateSample.ts | 94 - .../src/volumeSnapshotsCreateSample.ts | 88 - .../src/volumeSnapshotsDeleteSample.ts | 70 - .../src/volumeSnapshotsGetSample.ts | 70 - .../volumeSnapshotsListByVolumeGroupSample.ts | 78 - .../typescript/src/volumesCreateSample.ts | 80 - .../typescript/src/volumesDeleteSample.ts | 85 - .../typescript/src/volumesGetSample.ts | 70 - .../src/volumesListByVolumeGroupSample.ts | 85 - .../typescript/src/volumesPreBackupSample.ts | 44 - .../typescript/src/volumesPreRestoreSample.ts | 48 - .../typescript/src/volumesUpdateSample.ts | 79 - .../samples/v1/javascript/README.md | 102 - .../v1/javascript/elasticSansCreateSample.js | 79 - .../v1/javascript/elasticSansDeleteSample.js | 52 - .../v1/javascript/elasticSansGetSample.js | 52 - .../elasticSansListByResourceGroupSample.js | 56 - .../elasticSansListBySubscriptionSample.js | 54 - .../v1/javascript/elasticSansUpdateSample.js | 69 - .../v1/javascript/operationsListSample.js | 56 - .../privateEndpointConnectionsCreateSample.js | 78 - .../privateEndpointConnectionsDeleteSample.js | 62 - .../privateEndpointConnectionsGetSample.js | 62 - .../privateEndpointConnectionsListSample.js | 64 - ...vateLinkResourcesListByElasticSanSample.js | 58 - .../samples/v1/javascript/sample.env | 4 - .../samples/v1/javascript/skusListSample.js | 56 - .../v1/javascript/volumeGroupsCreateSample.js | 91 - .../v1/javascript/volumeGroupsDeleteSample.js | 62 - .../v1/javascript/volumeGroupsGetSample.js | 54 - .../volumeGroupsListByElasticSanSample.js | 58 - .../v1/javascript/volumeGroupsUpdateSample.js | 91 - .../javascript/volumeSnapshotsCreateSample.js | 84 - .../javascript/volumeSnapshotsDeleteSample.js | 66 - .../v1/javascript/volumeSnapshotsGetSample.js | 66 - .../volumeSnapshotsListByVolumeGroupSample.js | 71 - .../v1/javascript/volumesCreateSample.js | 76 - .../v1/javascript/volumesDeleteSample.js | 73 - .../samples/v1/javascript/volumesGetSample.js | 66 - .../volumesListByVolumeGroupSample.js | 68 - .../v1/javascript/volumesUpdateSample.js | 70 - .../samples/v1/typescript/README.md | 115 - .../samples/v1/typescript/sample.env | 4 - .../typescript/src/elasticSansCreateSample.ts | 83 - .../typescript/src/elasticSansDeleteSample.ts | 62 - .../v1/typescript/src/elasticSansGetSample.ts | 62 - .../elasticSansListByResourceGroupSample.ts | 64 - .../elasticSansListBySubscriptionSample.ts | 56 - .../typescript/src/elasticSansUpdateSample.ts | 73 - .../v1/typescript/src/operationsListSample.ts | 58 - .../privateEndpointConnectionsCreateSample.ts | 85 - .../privateEndpointConnectionsDeleteSample.ts | 66 - .../privateEndpointConnectionsGetSample.ts | 66 - .../privateEndpointConnectionsListSample.ts | 68 - ...vateLinkResourcesListByElasticSanSample.ts | 62 - .../v1/typescript/src/skusListSample.ts | 61 - .../src/volumeGroupsCreateSample.ts | 95 - .../src/volumeGroupsDeleteSample.ts | 66 - .../typescript/src/volumeGroupsGetSample.ts | 66 - .../src/volumeGroupsListByElasticSanSample.ts | 68 - .../src/volumeGroupsUpdateSample.ts | 95 - .../src/volumeSnapshotsCreateSample.ts | 88 - .../src/volumeSnapshotsDeleteSample.ts | 70 - .../src/volumeSnapshotsGetSample.ts | 70 - .../volumeSnapshotsListByVolumeGroupSample.ts | 78 - .../v1/typescript/src/volumesCreateSample.ts | 80 - .../v1/typescript/src/volumesDeleteSample.ts | 80 - .../v1/typescript/src/volumesGetSample.ts | 70 - .../src/volumesListByVolumeGroupSample.ts | 72 - .../v1/typescript/src/volumesUpdateSample.ts | 74 - .../samples/v1/typescript/tsconfig.json | 17 - .../samples/v2/javascript/README.md | 106 + .../v2/javascript/elasticSansCreateSample.js | 65 + .../v2/javascript/elasticSansDeleteSample.js | 38 + .../v2/javascript/elasticSansGetSample.js | 40 + .../elasticSansListByResourceGroupSample.js | 48 + .../elasticSansListBySubscriptionSample.js | 28 +- .../v2/javascript/elasticSansUpdateSample.js | 55 + .../v2/javascript/operationsListSample.js | 48 + .../{v1 => v2}/javascript/package.json | 8 +- .../privateEndpointConnectionsCreateSample.js | 60 + .../privateEndpointConnectionsDeleteSample.js | 46 + .../privateEndpointConnectionsGetSample.js | 48 + .../privateEndpointConnectionsListSample.js | 54 + ...vateLinkResourcesListByElasticSanSample.js | 46 + .../{v1-beta => v2}/javascript/sample.env | 0 .../samples/v2/javascript/skusListSample.js | 48 + .../v2/javascript/volumeGroupsCreateSample.js | 70 + .../v2/javascript/volumeGroupsDeleteSample.js | 38 + .../v2/javascript/volumeGroupsGetSample.js | 48 + .../volumeGroupsListByElasticSanSample.js | 54 + .../v2/javascript/volumeGroupsUpdateSample.js | 70 + .../javascript/volumeSnapshotsCreateSample.js | 66 + .../javascript/volumeSnapshotsDeleteSample.js | 48 + .../v2/javascript/volumeSnapshotsGetSample.js | 50 + .../volumeSnapshotsListByVolumeGroupSample.js | 57 + .../v2/javascript/volumesCreateSample.js | 58 + .../v2/javascript/volumesDeleteSample.js | 49 + .../samples/v2/javascript/volumesGetSample.js | 50 + .../volumesListByVolumeGroupSample.js | 56 + .../v2/javascript/volumesPreBackupSample.js | 30 + .../v2/javascript/volumesPreRestoreSample.js | 34 + .../v2/javascript/volumesUpdateSample.js | 57 + .../samples/v2/typescript/README.md | 119 + .../{v1 => v2}/typescript/package.json | 10 +- .../{v1-beta => v2}/typescript/sample.env | 0 .../typescript/src/elasticSansCreateSample.ts | 65 + .../typescript/src/elasticSansDeleteSample.ts | 38 + .../v2/typescript/src/elasticSansGetSample.ts | 40 + .../elasticSansListByResourceGroupSample.ts | 48 + .../elasticSansListBySubscriptionSample.ts | 30 +- .../typescript/src/elasticSansUpdateSample.ts | 55 + .../v2/typescript/src/operationsListSample.ts | 48 + .../privateEndpointConnectionsCreateSample.ts | 60 + .../privateEndpointConnectionsDeleteSample.ts | 46 + .../privateEndpointConnectionsGetSample.ts | 48 + .../privateEndpointConnectionsListSample.ts | 54 + ...vateLinkResourcesListByElasticSanSample.ts | 46 + .../v2/typescript/src/skusListSample.ts | 48 + .../src/volumeGroupsCreateSample.ts | 70 + .../src/volumeGroupsDeleteSample.ts | 38 + .../typescript/src/volumeGroupsGetSample.ts | 48 + .../src/volumeGroupsListByElasticSanSample.ts | 54 + .../src/volumeGroupsUpdateSample.ts | 70 + .../src/volumeSnapshotsCreateSample.ts | 66 + .../src/volumeSnapshotsDeleteSample.ts | 48 + .../src/volumeSnapshotsGetSample.ts | 50 + .../volumeSnapshotsListByVolumeGroupSample.ts | 57 + .../v2/typescript/src/volumesCreateSample.ts | 58 + .../v2/typescript/src/volumesDeleteSample.ts | 49 + .../v2/typescript/src/volumesGetSample.ts | 50 + .../src/volumesListByVolumeGroupSample.ts | 56 + .../typescript/src/volumesPreBackupSample.ts | 30 + .../typescript/src/volumesPreRestoreSample.ts | 34 + .../v2/typescript/src/volumesUpdateSample.ts | 57 + .../{v1-beta => v2}/typescript/tsconfig.json | 0 .../src/api/elasticSanManagementContext.ts | 74 + .../src/api/elasticSans/index.ts | 19 + .../src/api/elasticSans/operations.ts | 351 +++ .../src/api/elasticSans/options.ts | 31 + .../arm-elasticsan/src/api/index.ts | 8 + .../src/api/operations/index.ts | 5 + .../src/api/operations/operations.ts | 64 + .../src/api/operations/options.ts | 7 + .../api/privateEndpointConnections/index.ts | 10 + .../privateEndpointConnections/operations.ts | 287 +++ .../api/privateEndpointConnections/options.ts | 22 + .../src/api/privateLinkResources/index.ts | 5 + .../api/privateLinkResources/operations.ts | 68 + .../src/api/privateLinkResources/options.ts | 7 + .../arm-elasticsan/src/api/skus/index.ts | 5 + .../arm-elasticsan/src/api/skus/operations.ts | 63 + .../arm-elasticsan/src/api/skus/options.ts | 10 + .../src/api/volumeGroups/index.ts | 11 + .../src/api/volumeGroups/operations.ts | 318 +++ .../src/api/volumeGroups/options.ts | 28 + .../src/api/volumeSnapshots/index.ts | 10 + .../src/api/volumeSnapshots/operations.ts | 289 +++ .../src/api/volumeSnapshots/options.ts | 25 + .../arm-elasticsan/src/api/volumes/index.ts | 21 + .../src/api/volumes/operations.ts | 521 +++++ .../arm-elasticsan/src/api/volumes/options.ts | 45 + .../src/classic/elasticSans/index.ts | 108 + .../arm-elasticsan/src/classic/index.ts | 11 + .../src/classic/operations/index.ts | 28 + .../privateEndpointConnections/index.ts | 97 + .../src/classic/privateLinkResources/index.ts | 35 + .../arm-elasticsan/src/classic/skus/index.ts | 26 + .../src/classic/volumeGroups/index.ts | 110 + .../src/classic/volumeSnapshots/index.ts | 106 + .../src/classic/volumes/index.ts | 178 ++ .../src/elasticSanManagement.ts | 380 +--- sdk/elasticsans/arm-elasticsan/src/index.ts | 160 +- sdk/elasticsans/arm-elasticsan/src/logger.ts | 5 + sdk/elasticsans/arm-elasticsan/src/lroImpl.ts | 42 - .../arm-elasticsan/src/models/index.ts | 1674 +------------- .../arm-elasticsan/src/models/mappers.ts | 1915 ----------------- .../arm-elasticsan/src/models/models.ts | 1830 ++++++++++++++++ .../arm-elasticsan/src/models/parameters.ts | 289 --- .../src/operations/elasticSans.ts | 711 ------ .../arm-elasticsan/src/operations/index.ts | 16 - .../src/operations/operations.ts | 103 - .../operations/privateEndpointConnections.ts | 445 ---- .../src/operations/privateLinkResources.ts | 71 - .../arm-elasticsan/src/operations/skus.ts | 101 - .../src/operations/volumeGroups.ts | 650 ------ .../src/operations/volumeSnapshots.ts | 545 ----- .../arm-elasticsan/src/operations/volumes.ts | 994 --------- .../src/operationsInterfaces/elasticSans.ts | 139 -- .../src/operationsInterfaces/index.ts | 16 - .../src/operationsInterfaces/operations.ts | 22 - .../privateEndpointConnections.ts | 109 - .../privateLinkResources.ts | 27 - .../src/operationsInterfaces/skus.ts | 22 - .../src/operationsInterfaces/volumeGroups.ts | 147 -- .../operationsInterfaces/volumeSnapshots.ts | 121 -- .../src/operationsInterfaces/volumes.ts | 245 --- .../arm-elasticsan/src/pagingHelper.ts | 39 - .../src/restorePollerHelpers.ts | 233 ++ .../src/static-helpers/cloudSettingHelpers.ts | 42 + .../src/static-helpers/pagingHelpers.ts | 242 +++ .../src/static-helpers/pollingHelpers.ts | 127 ++ .../src/static-helpers/urlTemplate.ts | 210 ++ .../arm-elasticsan/test/snippets.spec.ts | 21 +- sdk/elasticsans/arm-elasticsan/tsconfig.json | 3 +- .../arm-elasticsan/tsconfig.samples.json | 4 +- .../arm-elasticsan/tsconfig.test.json | 13 +- .../arm-elasticsan/tsconfig.test.node.json | 10 - .../arm-elasticsan/tsp-location.yaml | 4 + .../arm-elasticsan/vitest.config.ts | 1 - .../arm-elasticsan/vitest.esm.config.ts | 8 + sdk/elasticsans/ci.mgmt.yml | 5 +- 311 files changed, 11244 insertions(+), 18672 deletions(-) delete mode 100644 sdk/elasticsans/arm-elasticsan/_meta.json create mode 100644 sdk/elasticsans/arm-elasticsan/eslint.config.mjs create mode 100644 sdk/elasticsans/arm-elasticsan/metadata.json create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples-dev/restoreVolumeSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/README.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansListByResourceGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/operationsListSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/package.json delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsListSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateLinkResourcesListByElasticSanSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/restoreVolumeSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/skusListSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsListByElasticSanSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsListByVolumeGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesListByVolumeGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreBackupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreRestoreSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/README.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/package.json delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansListByResourceGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/operationsListSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsListSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateLinkResourcesListByElasticSanSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/restoreVolumeSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/skusListSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsListByElasticSanSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesListByVolumeGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreBackupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreRestoreSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/sample.env delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/sample.env delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/tsconfig.json create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v1-beta => v2}/javascript/elasticSansListBySubscriptionSample.js (52%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/javascript/package.json (79%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v1-beta => v2}/javascript/sample.env (100%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/typescript/package.json (80%) rename sdk/elasticsans/arm-elasticsan/samples/{v1-beta => v2}/typescript/sample.env (100%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v1-beta => v2}/typescript/src/elasticSansListBySubscriptionSample.ts (52%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v1-beta => v2}/typescript/tsconfig.json (100%) create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/logger.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/lroImpl.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/models/mappers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/models/models.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/models/parameters.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/skus.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/tsconfig.test.node.json create mode 100644 sdk/elasticsans/arm-elasticsan/tsp-location.yaml create mode 100644 sdk/elasticsans/arm-elasticsan/vitest.esm.config.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08d286f9292c..09ad928368d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11849,46 +11849,49 @@ importers: sdk/elasticsans/arm-elasticsan: dependencies: + '@azure-rest/core-client': + specifier: ^2.3.1 + version: link:../../core/core-client-rest '@azure/abort-controller': specifier: ^2.1.2 version: link:../../core/abort-controller '@azure/core-auth': specifier: ^1.9.0 version: link:../../core/core-auth - '@azure/core-client': - specifier: ^1.9.3 - version: link:../../core/core-client '@azure/core-lro': - specifier: ^2.5.4 - version: 2.7.2 - '@azure/core-paging': - specifier: ^1.6.2 - version: link:../../core/core-paging + specifier: ^3.1.0 + version: link:../../core/core-lro '@azure/core-rest-pipeline': - specifier: ^1.19.1 + specifier: ^1.20.0 version: link:../../core/core-rest-pipeline + '@azure/core-util': + specifier: ^1.12.0 + version: link:../../core/core-util + '@azure/logger': + specifier: ^1.2.0 + version: link:../../core/logger tslib: specifier: ^2.8.1 version: 2.8.1 devDependencies: '@azure-tools/test-credential': - specifier: workspace:^ + specifier: workspace:* version: link:../../test-utils/test-credential '@azure-tools/test-recorder': - specifier: workspace:^ + specifier: workspace:* version: link:../../test-utils/recorder '@azure-tools/test-utils-vitest': - specifier: workspace:^ + specifier: workspace:* version: link:../../test-utils/test-utils-vitest '@azure/dev-tool': - specifier: workspace:^ + specifier: workspace:* version: link:../../../common/tools/dev-tool + '@azure/eslint-plugin-azure-sdk': + specifier: workspace:* + version: link:../../../common/tools/eslint-plugin-azure-sdk '@azure/identity': specifier: catalog:internal version: 4.11.1 - '@azure/logger': - specifier: ^1.1.4 - version: link:../../core/logger '@types/node': specifier: 'catalog:' version: 20.19.23 @@ -11904,9 +11907,15 @@ importers: dotenv: specifier: catalog:testing version: 16.6.1 + eslint: + specifier: 'catalog:' + version: 9.38.0 playwright: specifier: catalog:testing version: 1.56.1 + prettier: + specifier: 'catalog:' + version: 3.6.2 rimraf: specifier: 'catalog:' version: 6.0.1 diff --git a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md index 474a928833ea..1b41f2e0333a 100644 --- a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md +++ b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md @@ -1,4 +1,77 @@ # Release History + +## 2.0.0 (2025-10-30) + +### Features Added + - Added operation ElasticSansOperations.create + - Added operation ElasticSansOperations.delete + - Added operation ElasticSansOperations.update + - Added operation PrivateEndpointConnectionsOperations.create + - Added operation PrivateEndpointConnectionsOperations.delete + - Added operation VolumeGroupsOperations.create + - Added operation VolumeGroupsOperations.delete + - Added operation VolumeGroupsOperations.update + - Added operation VolumesOperations.create + - Added operation VolumesOperations.delete + - Added operation VolumesOperations.preBackup + - Added operation VolumesOperations.preRestore + - Added operation VolumesOperations.update + - Added operation VolumeSnapshotsOperations.create + - Added operation VolumeSnapshotsOperations.delete + - Added Interface AutoScaleProperties + - Added Interface DiskSnapshotList + - Added Interface PagedAsyncIterableIterator + - Added Interface PageSettings + - Added Interface PreValidationResponse + - Added Interface RestorePollerOptions + - Added Interface ScaleUpProperties + - Added Interface VolumeNameList + - Added Interface VolumesPreBackupOptionalParams + - Added Interface VolumesPreRestoreOptionalParams + - Interface ElasticSanProperties has a new optional parameter autoScaleProperties + - Interface ElasticSanUpdateProperties has a new optional parameter autoScaleProperties + - Added Type Alias AutoScalePolicyEnforcement + - Added Type Alias AzureSupportedClouds + - Added Enum AzureClouds + - Added Enum KnownAutoScalePolicyEnforcement + - Added Enum KnownVersions + - Enum KnownProvisioningStates has a new value Deleted + - Enum KnownProvisioningStates has a new value Restoring + +### Breaking Changes + - Removed operation ElasticSans.beginCreate + - Removed operation ElasticSans.beginCreateAndWait + - Removed operation ElasticSans.beginDelete + - Removed operation ElasticSans.beginDeleteAndWait + - Removed operation ElasticSans.beginUpdate + - Removed operation ElasticSans.beginUpdateAndWait + - Removed operation PrivateEndpointConnections.beginCreate + - Removed operation PrivateEndpointConnections.beginCreateAndWait + - Removed operation PrivateEndpointConnections.beginDelete + - Removed operation PrivateEndpointConnections.beginDeleteAndWait + - Removed operation VolumeGroups.beginCreate + - Removed operation VolumeGroups.beginCreateAndWait + - Removed operation VolumeGroups.beginDelete + - Removed operation VolumeGroups.beginDeleteAndWait + - Removed operation VolumeGroups.beginUpdate + - Removed operation VolumeGroups.beginUpdateAndWait + - Removed operation Volumes.beginCreate + - Removed operation Volumes.beginCreateAndWait + - Removed operation Volumes.beginDelete + - Removed operation Volumes.beginDeleteAndWait + - Removed operation Volumes.beginUpdate + - Removed operation Volumes.beginUpdateAndWait + - Removed operation VolumeSnapshots.beginCreate + - Removed operation VolumeSnapshots.beginCreateAndWait + - Removed operation VolumeSnapshots.beginDelete + - Removed operation VolumeSnapshots.beginDeleteAndWait + - Removed Interface ElasticSanList + - Removed Interface SkuInformationList + - Removed Interface SnapshotList + - Removed Interface VolumeGroupList + - Removed Interface VolumeList + - Parameter value of interface PrivateLinkResourceListResult is now required + ## 1.2.0-beta.2 (2025-04-18) Compared with version 1.1.0 diff --git a/sdk/elasticsans/arm-elasticsan/README.md b/sdk/elasticsans/arm-elasticsan/README.md index fa4771087607..fc33b33ce53f 100644 --- a/sdk/elasticsans/arm-elasticsan/README.md +++ b/sdk/elasticsans/arm-elasticsan/README.md @@ -2,12 +2,14 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ElasticSanManagement client. +(missing-service-description) Add service description +Key links: -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-elasticsan) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-elasticsan) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/samples) ## Getting started @@ -63,14 +65,15 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); ``` + ### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). @@ -96,7 +99,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## Next steps -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/samples) directory for detailed examples on how to use this library. ## Contributing @@ -106,9 +109,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -[azure_cli]: https://learn.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity diff --git a/sdk/elasticsans/arm-elasticsan/_meta.json b/sdk/elasticsans/arm-elasticsan/_meta.json deleted file mode 100644 index 8048079a7cdf..000000000000 --- a/sdk/elasticsans/arm-elasticsan/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "d7320555498a98cc30813b4cab5a2fa03735308f", - "readme": "specification/elasticsan/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\\elasticsan\\resource-manager\\readme.md --use=@autorest/typescript@6.0.38 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", - "use": "@autorest/typescript@6.0.38" -} \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/api-extractor.json b/sdk/elasticsans/arm-elasticsan/api-extractor.json index 16d81e2eb512..870d6d399477 100644 --- a/sdk/elasticsans/arm-elasticsan/api-extractor.json +++ b/sdk/elasticsans/arm-elasticsan/api-extractor.json @@ -1,3 +1 @@ -{ - "extends": "../../../api-extractor-base.json" -} +{ "extends": "../../../api-extractor-base.json" } diff --git a/sdk/elasticsans/arm-elasticsan/eslint.config.mjs b/sdk/elasticsans/arm-elasticsan/eslint.config.mjs new file mode 100644 index 000000000000..6d2f8a5914c3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, +]); diff --git a/sdk/elasticsans/arm-elasticsan/metadata.json b/sdk/elasticsans/arm-elasticsan/metadata.json new file mode 100644 index 000000000000..eee52676e924 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/metadata.json @@ -0,0 +1,115 @@ +{ + "apiVersion": "2025-09-01", + "emitterVersion": "0.45.1", + "crossLanguageDefinitions": { + "CrossLanguagePackageId": "Microsoft.ElasticSan", + "CrossLanguageDefinitionId": { + "@azure/arm-elasticsan!OperationListResult:interface": "Azure.ResourceManager.CommonTypes.OperationListResult", + "@azure/arm-elasticsan!Operation:interface": "Azure.ResourceManager.CommonTypes.Operation", + "@azure/arm-elasticsan!OperationDisplay:interface": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "@azure/arm-elasticsan!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "@azure/arm-elasticsan!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "@azure/arm-elasticsan!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "@azure/arm-elasticsan!ElasticSan:interface": "Microsoft.ElasticSan.ElasticSan", + "@azure/arm-elasticsan!ElasticSanProperties:interface": "Microsoft.ElasticSan.ElasticSanProperties", + "@azure/arm-elasticsan!Sku:interface": "Microsoft.ElasticSan.Sku", + "@azure/arm-elasticsan!PrivateEndpointConnection:interface": "Microsoft.ElasticSan.PrivateEndpointConnection", + "@azure/arm-elasticsan!PrivateEndpointConnectionProperties:interface": "Microsoft.ElasticSan.PrivateEndpointConnectionProperties", + "@azure/arm-elasticsan!PrivateEndpoint:interface": "Microsoft.ElasticSan.PrivateEndpoint", + "@azure/arm-elasticsan!PrivateLinkServiceConnectionState:interface": "Microsoft.ElasticSan.PrivateLinkServiceConnectionState", + "@azure/arm-elasticsan!ProxyResource:interface": "Azure.ResourceManager.CommonTypes.ProxyResource", + "@azure/arm-elasticsan!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", + "@azure/arm-elasticsan!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", + "@azure/arm-elasticsan!AutoScaleProperties:interface": "Microsoft.ElasticSan.AutoScaleProperties", + "@azure/arm-elasticsan!ScaleUpProperties:interface": "Microsoft.ElasticSan.ScaleUpProperties", + "@azure/arm-elasticsan!TrackedResource:interface": "Azure.ResourceManager.CommonTypes.TrackedResource", + "@azure/arm-elasticsan!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", + "@azure/arm-elasticsan!ElasticSanUpdate:interface": "Microsoft.ElasticSan.ElasticSanUpdate", + "@azure/arm-elasticsan!ElasticSanUpdateProperties:interface": "Microsoft.ElasticSan.ElasticSanUpdateProperties", + "@azure/arm-elasticsan!ElasticSanList:interface": "Microsoft.ElasticSan.ElasticSanList", + "@azure/arm-elasticsan!PrivateEndpointConnectionListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-elasticsan!Volume:interface": "Microsoft.ElasticSan.Volume", + "@azure/arm-elasticsan!VolumeProperties:interface": "Microsoft.ElasticSan.VolumeProperties", + "@azure/arm-elasticsan!SourceCreationData:interface": "Microsoft.ElasticSan.SourceCreationData", + "@azure/arm-elasticsan!IscsiTargetInfo:interface": "Microsoft.ElasticSan.IscsiTargetInfo", + "@azure/arm-elasticsan!ManagedByInfo:interface": "Microsoft.ElasticSan.ManagedByInfo", + "@azure/arm-elasticsan!VolumeUpdate:interface": "Microsoft.ElasticSan.VolumeUpdate", + "@azure/arm-elasticsan!VolumeUpdateProperties:interface": "Microsoft.ElasticSan.VolumeUpdateProperties", + "@azure/arm-elasticsan!VolumeList:interface": "Microsoft.ElasticSan.VolumeList", + "@azure/arm-elasticsan!VolumeNameList:interface": "Microsoft.ElasticSan.VolumeNameList", + "@azure/arm-elasticsan!PreValidationResponse:interface": "Microsoft.ElasticSan.PreValidationResponse", + "@azure/arm-elasticsan!DiskSnapshotList:interface": "Microsoft.ElasticSan.DiskSnapshotList", + "@azure/arm-elasticsan!VolumeGroup:interface": "Microsoft.ElasticSan.VolumeGroup", + "@azure/arm-elasticsan!Identity:interface": "Microsoft.ElasticSan.Identity", + "@azure/arm-elasticsan!UserAssignedIdentity:interface": "Microsoft.ElasticSan.UserAssignedIdentity", + "@azure/arm-elasticsan!VolumeGroupProperties:interface": "Microsoft.ElasticSan.VolumeGroupProperties", + "@azure/arm-elasticsan!EncryptionProperties:interface": "Microsoft.ElasticSan.EncryptionProperties", + "@azure/arm-elasticsan!KeyVaultProperties:interface": "Microsoft.ElasticSan.KeyVaultProperties", + "@azure/arm-elasticsan!EncryptionIdentity:interface": "Microsoft.ElasticSan.EncryptionIdentity", + "@azure/arm-elasticsan!NetworkRuleSet:interface": "Microsoft.ElasticSan.NetworkRuleSet", + "@azure/arm-elasticsan!VirtualNetworkRule:interface": "Microsoft.ElasticSan.VirtualNetworkRule", + "@azure/arm-elasticsan!VolumeGroupUpdate:interface": "Microsoft.ElasticSan.VolumeGroupUpdate", + "@azure/arm-elasticsan!VolumeGroupUpdateProperties:interface": "Microsoft.ElasticSan.VolumeGroupUpdateProperties", + "@azure/arm-elasticsan!VolumeGroupList:interface": "Microsoft.ElasticSan.VolumeGroupList", + "@azure/arm-elasticsan!PrivateLinkResourceListResult:interface": "Microsoft.ElasticSan.PrivateLinkResourceListResult", + "@azure/arm-elasticsan!PrivateLinkResource:interface": "Microsoft.ElasticSan.PrivateLinkResource", + "@azure/arm-elasticsan!PrivateLinkResourceProperties:interface": "Microsoft.ElasticSan.PrivateLinkResourceProperties", + "@azure/arm-elasticsan!Snapshot:interface": "Microsoft.ElasticSan.Snapshot", + "@azure/arm-elasticsan!SnapshotProperties:interface": "Microsoft.ElasticSan.SnapshotProperties", + "@azure/arm-elasticsan!SnapshotCreationData:interface": "Microsoft.ElasticSan.SnapshotCreationData", + "@azure/arm-elasticsan!SnapshotList:interface": "Microsoft.ElasticSan.SnapshotList", + "@azure/arm-elasticsan!SkuInformationList:interface": "Microsoft.ElasticSan.SkuInformationList", + "@azure/arm-elasticsan!SkuInformation:interface": "Microsoft.ElasticSan.SkuInformation", + "@azure/arm-elasticsan!SkuLocationInfo:interface": "Microsoft.ElasticSan.SkuLocationInfo", + "@azure/arm-elasticsan!SKUCapability:interface": "Microsoft.ElasticSan.SKUCapability", + "@azure/arm-elasticsan!KnownOrigin:enum": "Azure.ResourceManager.CommonTypes.Origin", + "@azure/arm-elasticsan!KnownActionType:enum": "Azure.ResourceManager.CommonTypes.ActionType", + "@azure/arm-elasticsan!KnownSkuName:enum": "Microsoft.ElasticSan.SkuName", + "@azure/arm-elasticsan!KnownSkuTier:enum": "Microsoft.ElasticSan.SkuTier", + "@azure/arm-elasticsan!KnownProvisioningStates:enum": "Microsoft.ElasticSan.ProvisioningStates", + "@azure/arm-elasticsan!KnownPrivateEndpointServiceConnectionStatus:enum": "Microsoft.ElasticSan.PrivateEndpointServiceConnectionStatus", + "@azure/arm-elasticsan!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", + "@azure/arm-elasticsan!KnownPublicNetworkAccess:enum": "Microsoft.ElasticSan.PublicNetworkAccess", + "@azure/arm-elasticsan!KnownAutoScalePolicyEnforcement:enum": "Microsoft.ElasticSan.AutoScalePolicyEnforcement", + "@azure/arm-elasticsan!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", + "@azure/arm-elasticsan!KnownVolumeCreateOption:enum": "Microsoft.ElasticSan.VolumeCreateOption", + "@azure/arm-elasticsan!KnownOperationalStatus:enum": "Microsoft.ElasticSan.OperationalStatus", + "@azure/arm-elasticsan!Knownx-ms-delete-snapshots:enum": "Microsoft.ElasticSan.x-ms-delete-snapshots", + "@azure/arm-elasticsan!Knownx-ms-force-delete:enum": "Microsoft.ElasticSan.x-ms-force-delete", + "@azure/arm-elasticsan!KnownIdentityType:enum": "Microsoft.ElasticSan.IdentityType", + "@azure/arm-elasticsan!KnownStorageTargetType:enum": "Microsoft.ElasticSan.StorageTargetType", + "@azure/arm-elasticsan!KnownEncryptionType:enum": "Microsoft.ElasticSan.EncryptionType", + "@azure/arm-elasticsan!KnownAction:enum": "Microsoft.ElasticSan.Action", + "@azure/arm-elasticsan!KnownVersions:enum": "Microsoft.ElasticSan.Versions", + "@azure/arm-elasticsan!SkusOperations#list:member": "Microsoft.ElasticSan.SkusOperationGroup.list", + "@azure/arm-elasticsan!VolumeSnapshotsOperations#listByVolumeGroup:member": "Microsoft.ElasticSan.Snapshots.listByVolumeGroup", + "@azure/arm-elasticsan!VolumeSnapshotsOperations#delete:member": "Microsoft.ElasticSan.Snapshots.delete", + "@azure/arm-elasticsan!VolumeSnapshotsOperations#create:member": "Microsoft.ElasticSan.Snapshots.create", + "@azure/arm-elasticsan!VolumeSnapshotsOperations#get:member": "Microsoft.ElasticSan.Snapshots.get", + "@azure/arm-elasticsan!PrivateLinkResourcesOperations#listByElasticSan:member": "Microsoft.ElasticSan.ElasticSans.listByElasticSan", + "@azure/arm-elasticsan!VolumeGroupsOperations#listByElasticSan:member": "Microsoft.ElasticSan.VolumeGroups.listByElasticSan", + "@azure/arm-elasticsan!VolumeGroupsOperations#delete:member": "Microsoft.ElasticSan.VolumeGroups.delete", + "@azure/arm-elasticsan!VolumeGroupsOperations#update:member": "Microsoft.ElasticSan.VolumeGroups.update", + "@azure/arm-elasticsan!VolumeGroupsOperations#create:member": "Microsoft.ElasticSan.VolumeGroups.create", + "@azure/arm-elasticsan!VolumeGroupsOperations#get:member": "Microsoft.ElasticSan.VolumeGroups.get", + "@azure/arm-elasticsan!VolumesOperations#preRestore:member": "Microsoft.ElasticSan.VolumeGroups.preRestore", + "@azure/arm-elasticsan!VolumesOperations#preBackup:member": "Microsoft.ElasticSan.VolumeGroups.preBackup", + "@azure/arm-elasticsan!VolumesOperations#listByVolumeGroup:member": "Microsoft.ElasticSan.Volumes.listByVolumeGroup", + "@azure/arm-elasticsan!VolumesOperations#delete:member": "Microsoft.ElasticSan.Volumes.delete", + "@azure/arm-elasticsan!VolumesOperations#update:member": "Microsoft.ElasticSan.Volumes.update", + "@azure/arm-elasticsan!VolumesOperations#create:member": "Microsoft.ElasticSan.Volumes.create", + "@azure/arm-elasticsan!VolumesOperations#get:member": "Microsoft.ElasticSan.Volumes.get", + "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#list:member": "Microsoft.ElasticSan.PrivateEndpointConnections.list", + "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#delete:member": "Microsoft.ElasticSan.PrivateEndpointConnections.delete", + "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#create:member": "Microsoft.ElasticSan.PrivateEndpointConnections.create", + "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#get:member": "Microsoft.ElasticSan.PrivateEndpointConnections.get", + "@azure/arm-elasticsan!ElasticSansOperations#listBySubscription:member": "Microsoft.ElasticSan.ElasticSans.listBySubscription", + "@azure/arm-elasticsan!ElasticSansOperations#listByResourceGroup:member": "Microsoft.ElasticSan.ElasticSans.listByResourceGroup", + "@azure/arm-elasticsan!ElasticSansOperations#delete:member": "Microsoft.ElasticSan.ElasticSans.delete", + "@azure/arm-elasticsan!ElasticSansOperations#update:member": "Microsoft.ElasticSan.ElasticSans.update", + "@azure/arm-elasticsan!ElasticSansOperations#create:member": "Microsoft.ElasticSan.ElasticSans.create", + "@azure/arm-elasticsan!ElasticSansOperations#get:member": "Microsoft.ElasticSan.ElasticSans.get", + "@azure/arm-elasticsan!OperationsOperations#list:member": "Azure.ResourceManager.Operations.list" + } + } +} diff --git a/sdk/elasticsans/arm-elasticsan/package.json b/sdk/elasticsans/arm-elasticsan/package.json index d9bb4cc998e7..efb8c6312e73 100644 --- a/sdk/elasticsans/arm-elasticsan/package.json +++ b/sdk/elasticsans/arm-elasticsan/package.json @@ -1,117 +1,128 @@ { "name": "@azure/arm-elasticsan", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", + "version": "2.0.0", "description": "A generated SDK for ElasticSanManagement.", - "version": "1.2.0-beta.2", "engines": { "node": ">=20.0.0" }, - "dependencies": { - "@azure/abort-controller": "^2.1.2", - "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.3", - "@azure/core-lro": "^2.5.4", - "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.1", - "tslib": "^2.8.1" + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/skus": "./src/api/skus/index.ts", + "./api/volumeSnapshots": "./src/api/volumeSnapshots/index.ts", + "./api/privateLinkResources": "./src/api/privateLinkResources/index.ts", + "./api/volumeGroups": "./src/api/volumeGroups/index.ts", + "./api/volumes": "./src/api/volumes/index.ts", + "./api/privateEndpointConnections": "./src/api/privateEndpointConnections/index.ts", + "./api/elasticSans": "./src/api/elasticSans/index.ts", + "./api/operations": "./src/api/operations/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false, + "project": "../../../tsconfig.src.build.json" }, + "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", - "types": "./dist/commonjs/index.d.ts", + "files": [ + "dist/", + "!dist/**/*.d.*ts.map", + "README.md", + "LICENSE" + ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/elasticSanManagementContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure/core-util": "^1.12.0", + "@azure-rest/core-client": "^2.3.1", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-lro": "^3.1.0", + "@azure/core-rest-pipeline": "^1.20.0", + "@azure/logger": "^1.2.0", + "tslib": "^2.8.1" + }, "devDependencies": { - "@azure-tools/test-credential": "workspace:^", - "@azure-tools/test-recorder": "workspace:^", - "@azure-tools/test-utils-vitest": "workspace:^", - "@azure/dev-tool": "workspace:^", + "@azure-tools/test-credential": "workspace:*", + "@azure-tools/test-recorder": "workspace:*", + "@azure-tools/test-utils-vitest": "workspace:*", + "@azure/dev-tool": "workspace:*", + "tshy": "catalog:", + "@azure/eslint-plugin-azure-sdk": "workspace:*", "@azure/identity": "catalog:internal", - "@azure/logger": "^1.1.4", "@types/node": "catalog:", + "cross-env": "catalog:", + "eslint": "catalog:", + "prettier": "catalog:", + "rimraf": "catalog:", "@vitest/browser": "catalog:testing", "@vitest/coverage-istanbul": "catalog:testing", - "cross-env": "catalog:", "dotenv": "catalog:testing", "playwright": "catalog:testing", - "rimraf": "catalog:", - "tshy": "catalog:", "typescript": "catalog:", "vitest": "catalog:testing" }, - "repository": { - "type": "git", - "url": "https://github.com/Azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "files": [ - "dist/", - "README.md", - "LICENSE", - "review/", - "CHANGELOG.md" - ], "scripts": { - "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", - "build:samples": "tsc -p tsconfig.samples.json", - "check-format": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", - "format": "echo skipped", - "lint": "echo skipped", + "extract-api": "rimraf review && dev-tool run extract-api", "pack": "pnpm pack 2>&1", + "lint": "echo skipped", + "lint:fix": "echo skipped", + "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "execute:samples": "dev-tool samples run samples-dev", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "test:browser": "dev-tool run build-test && dev-tool run test:vitest --browser", + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "test:node": "dev-tool run test:vitest", + "test:node:esm": "dev-tool run test:vitest --esm", "test": "npm run test:node && npm run test:browser", - "test:browser": "echo skipped", - "test:node": "dev-tool run build-test --no-browser-test && dev-tool run test:vitest", "update-snippets": "dev-tool run update-snippets" }, - "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/elasticSanManagement.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan", "//sampleConfiguration": { - "productName": "", + "productName": "@azure/arm-elasticsan", "productSlugs": [ "azure" ], "disableDocsMs": true, "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview" }, - "type": "module", - "tshy": { - "project": "../../../tsconfig.src.build.json", - "exports": { - "./package.json": "./package.json", - ".": "./src/index.ts" - }, - "dialects": [ - "esm", - "commonjs" - ], - "esmDialects": [ - "browser", - "react-native" - ], - "selfLink": false - }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -131,6 +142,189 @@ "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/skus": { + "browser": { + "types": "./dist/browser/api/skus/index.d.ts", + "default": "./dist/browser/api/skus/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/skus/index.d.ts", + "default": "./dist/react-native/api/skus/index.js" + }, + "import": { + "types": "./dist/esm/api/skus/index.d.ts", + "default": "./dist/esm/api/skus/index.js" + }, + "require": { + "types": "./dist/commonjs/api/skus/index.d.ts", + "default": "./dist/commonjs/api/skus/index.js" + } + }, + "./api/volumeSnapshots": { + "browser": { + "types": "./dist/browser/api/volumeSnapshots/index.d.ts", + "default": "./dist/browser/api/volumeSnapshots/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/volumeSnapshots/index.d.ts", + "default": "./dist/react-native/api/volumeSnapshots/index.js" + }, + "import": { + "types": "./dist/esm/api/volumeSnapshots/index.d.ts", + "default": "./dist/esm/api/volumeSnapshots/index.js" + }, + "require": { + "types": "./dist/commonjs/api/volumeSnapshots/index.d.ts", + "default": "./dist/commonjs/api/volumeSnapshots/index.js" + } + }, + "./api/privateLinkResources": { + "browser": { + "types": "./dist/browser/api/privateLinkResources/index.d.ts", + "default": "./dist/browser/api/privateLinkResources/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/privateLinkResources/index.d.ts", + "default": "./dist/react-native/api/privateLinkResources/index.js" + }, + "import": { + "types": "./dist/esm/api/privateLinkResources/index.d.ts", + "default": "./dist/esm/api/privateLinkResources/index.js" + }, + "require": { + "types": "./dist/commonjs/api/privateLinkResources/index.d.ts", + "default": "./dist/commonjs/api/privateLinkResources/index.js" + } + }, + "./api/volumeGroups": { + "browser": { + "types": "./dist/browser/api/volumeGroups/index.d.ts", + "default": "./dist/browser/api/volumeGroups/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/volumeGroups/index.d.ts", + "default": "./dist/react-native/api/volumeGroups/index.js" + }, + "import": { + "types": "./dist/esm/api/volumeGroups/index.d.ts", + "default": "./dist/esm/api/volumeGroups/index.js" + }, + "require": { + "types": "./dist/commonjs/api/volumeGroups/index.d.ts", + "default": "./dist/commonjs/api/volumeGroups/index.js" + } + }, + "./api/volumes": { + "browser": { + "types": "./dist/browser/api/volumes/index.d.ts", + "default": "./dist/browser/api/volumes/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/volumes/index.d.ts", + "default": "./dist/react-native/api/volumes/index.js" + }, + "import": { + "types": "./dist/esm/api/volumes/index.d.ts", + "default": "./dist/esm/api/volumes/index.js" + }, + "require": { + "types": "./dist/commonjs/api/volumes/index.d.ts", + "default": "./dist/commonjs/api/volumes/index.js" + } + }, + "./api/privateEndpointConnections": { + "browser": { + "types": "./dist/browser/api/privateEndpointConnections/index.d.ts", + "default": "./dist/browser/api/privateEndpointConnections/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/privateEndpointConnections/index.d.ts", + "default": "./dist/react-native/api/privateEndpointConnections/index.js" + }, + "import": { + "types": "./dist/esm/api/privateEndpointConnections/index.d.ts", + "default": "./dist/esm/api/privateEndpointConnections/index.js" + }, + "require": { + "types": "./dist/commonjs/api/privateEndpointConnections/index.d.ts", + "default": "./dist/commonjs/api/privateEndpointConnections/index.js" + } + }, + "./api/elasticSans": { + "browser": { + "types": "./dist/browser/api/elasticSans/index.d.ts", + "default": "./dist/browser/api/elasticSans/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/elasticSans/index.d.ts", + "default": "./dist/react-native/api/elasticSans/index.js" + }, + "import": { + "types": "./dist/esm/api/elasticSans/index.d.ts", + "default": "./dist/esm/api/elasticSans/index.js" + }, + "require": { + "types": "./dist/commonjs/api/elasticSans/index.d.ts", + "default": "./dist/commonjs/api/elasticSans/index.js" + } + }, + "./api/operations": { + "browser": { + "types": "./dist/browser/api/operations/index.d.ts", + "default": "./dist/browser/api/operations/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/operations/index.d.ts", + "default": "./dist/react-native/api/operations/index.js" + }, + "import": { + "types": "./dist/esm/api/operations/index.d.ts", + "default": "./dist/esm/api/operations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operations/index.d.ts", + "default": "./dist/commonjs/api/operations/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } } - } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" } diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md new file mode 100644 index 000000000000..89e5766dd1b5 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md @@ -0,0 +1,59 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): PollerLike, ElasticSan>; + +// @public +export interface ElasticSansCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ElasticSansDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ElasticSansGetOptionalParams extends OperationOptions { +} + +// @public +export interface ElasticSansListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface ElasticSansListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface ElasticSansUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams): Promise; + +// @public +export function listByResourceGroup(context: ElasticSanManagementContext, resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listBySubscription(context: ElasticSanManagementContext, options?: ElasticSansListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function update(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): PollerLike, ElasticSan>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md new file mode 100644 index 000000000000..e521128deefb --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md @@ -0,0 +1,28 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { TokenCredential } from '@azure/core-auth'; + +// @public +export function createElasticSanManagement(credential: TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams): ElasticSanManagementContext; + +// @public +export interface ElasticSanManagementContext extends Client { + apiVersion: string; + subscriptionId: string; +} + +// @public +export interface ElasticSanManagementOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md new file mode 100644 index 000000000000..bfd5273d96a8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function list(context: ElasticSanManagementContext, options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md new file mode 100644 index 000000000000..3df32b845e97 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md @@ -0,0 +1,44 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): PollerLike, PrivateEndpointConnection>; + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + +// @public +export function list(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md new file mode 100644 index 000000000000..8d565e21cec0 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function listByElasticSan(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams): Promise; + +// @public +export interface PrivateLinkResourcesListByElasticSanOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md new file mode 100644 index 000000000000..fae1f43efdd4 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md @@ -0,0 +1,20 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function list(context: ElasticSanManagementContext, options?: SkusListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface SkusListOptionalParams extends OperationOptions { + filter?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md new file mode 100644 index 000000000000..69b24af70294 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md @@ -0,0 +1,52 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): PollerLike, VolumeGroup>; + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams): Promise; + +// @public +export function listByElasticSan(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams): PagedAsyncIterableIterator; + +// @public +export function update(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): PollerLike, VolumeGroup>; + +// @public +export interface VolumeGroupsCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumeGroupsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumeGroupsGetOptionalParams extends OperationOptions { +} + +// @public +export interface VolumeGroupsListByElasticSanOptionalParams extends OperationOptions { +} + +// @public +export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md new file mode 100644 index 000000000000..e6f17b87a2f3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md @@ -0,0 +1,45 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams): PollerLike, Snapshot>; + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsGetOptionalParams): Promise; + +// @public +export function listByVolumeGroup(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeSnapshotsListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface VolumeSnapshotsCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumeSnapshotsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumeSnapshotsGetOptionalParams extends OperationOptions { +} + +// @public +export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends OperationOptions { + filter?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md new file mode 100644 index 000000000000..9c4f4aaf4398 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md @@ -0,0 +1,70 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): PollerLike, Volume>; + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; + +// @public +export function listByVolumeGroup(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function preBackup(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams): PollerLike, PreValidationResponse>; + +// @public +export function preRestore(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams): PollerLike, PreValidationResponse>; + +// @public +export function update(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): PollerLike, Volume>; + +// @public +export interface VolumesCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; + xMsDeleteSnapshots?: XMsDeleteSnapshots; + xMsForceDelete?: XMsForceDelete; +} + +// @public +export interface VolumesGetOptionalParams extends OperationOptions { +} + +// @public +export interface VolumesListByVolumeGroupOptionalParams extends OperationOptions { +} + +// @public +export interface VolumesPreBackupOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumesPreRestoreOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md new file mode 100644 index 000000000000..106fea2202b8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md @@ -0,0 +1,530 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type Action = string; + +// @public +export type ActionType = string; + +// @public +export type AutoScalePolicyEnforcement = string; + +// @public +export interface AutoScaleProperties { + scaleUpProperties?: ScaleUpProperties; +} + +// @public +export type CreatedByType = string; + +// @public +export interface DiskSnapshotList { + diskSnapshotIds: string[]; +} + +// @public +export interface ElasticSan extends TrackedResource { + properties: ElasticSanProperties; +} + +// @public +export interface ElasticSanProperties { + autoScaleProperties?: AutoScaleProperties; + availabilityZones?: string[]; + baseSizeTiB: number; + extendedCapacitySizeTiB: number; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningStates; + publicNetworkAccess?: PublicNetworkAccess; + sku: Sku; + readonly totalIops?: number; + readonly totalMBps?: number; + readonly totalSizeTiB?: number; + readonly totalVolumeSizeGiB?: number; + readonly volumeGroupCount?: number; +} + +// @public +export interface ElasticSanUpdate { + properties?: ElasticSanUpdateProperties; + tags?: Record; +} + +// @public +export interface ElasticSanUpdateProperties { + autoScaleProperties?: AutoScaleProperties; + baseSizeTiB?: number; + extendedCapacitySizeTiB?: number; + publicNetworkAccess?: PublicNetworkAccess; +} + +// @public +export interface EncryptionIdentity { + encryptionUserAssignedIdentity?: string; +} + +// @public +export interface EncryptionProperties { + encryptionIdentity?: EncryptionIdentity; + keyVaultProperties?: KeyVaultProperties; +} + +// @public +export type EncryptionType = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: any; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type: IdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type IdentityType = string; + +// @public +export interface IscsiTargetInfo { + readonly provisioningState?: ProvisioningStates; + status?: OperationalStatus; + readonly targetIqn?: string; + readonly targetPortalHostname?: string; + readonly targetPortalPort?: number; +} + +// @public +export interface KeyVaultProperties { + readonly currentVersionedKeyExpirationTimestamp?: Date; + readonly currentVersionedKeyIdentifier?: string; + keyName?: string; + keyVaultUri?: string; + keyVersion?: string; + readonly lastKeyRotationTimestamp?: Date; +} + +// @public +export enum KnownAction { + Allow = "Allow" +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownAutoScalePolicyEnforcement { + Disabled = "Disabled", + Enabled = "Enabled", + None = "None" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownEncryptionType { + EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" +} + +// @public +export enum KnownIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownOperationalStatus { + Healthy = "Healthy", + Invalid = "Invalid", + Running = "Running", + Stopped = "Stopped", + StoppedDeallocated = "Stopped (deallocated)", + Unhealthy = "Unhealthy", + Unknown = "Unknown", + Updating = "Updating" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + Approved = "Approved", + Failed = "Failed", + Pending = "Pending", + Rejected = "Rejected" +} + +// @public +export enum KnownProvisioningStates { + Canceled = "Canceled", + Creating = "Creating", + Deleted = "Deleted", + Deleting = "Deleting", + Failed = "Failed", + Invalid = "Invalid", + Pending = "Pending", + Restoring = "Restoring", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownSkuName { + PremiumLRS = "Premium_LRS", + PremiumZRS = "Premium_ZRS" +} + +// @public +export enum KnownSkuTier { + Premium = "Premium" +} + +// @public +export enum KnownStorageTargetType { + Iscsi = "Iscsi", + None = "None" +} + +// @public +export enum KnownVersions { + V20250901 = "2025-09-01" +} + +// @public +export enum KnownVolumeCreateOption { + Disk = "Disk", + DiskRestorePoint = "DiskRestorePoint", + DiskSnapshot = "DiskSnapshot", + None = "None", + VolumeSnapshot = "VolumeSnapshot" +} + +// @public +export enum KnownXMsDeleteSnapshots { + False = "false", + True = "true" +} + +// @public +export enum KnownXMsForceDelete { + False = "false", + True = "true" +} + +// @public +export interface ManagedByInfo { + resourceId?: string; +} + +// @public +export interface NetworkRuleSet { + virtualNetworkRules?: VirtualNetworkRule[]; +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export type OperationalStatus = string; + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export type Origin = string; + +// @public +export interface PreValidationResponse { + validationStatus?: string; +} + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends ProxyResource { + properties: PrivateEndpointConnectionProperties; +} + +// @public +export interface PrivateEndpointConnectionProperties { + groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: ProvisioningStates; +} + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export interface PrivateLinkResource extends Resource { + properties?: PrivateLinkResourceProperties; +} + +// @public +export interface PrivateLinkResourceListResult { + readonly nextLink?: string; + value: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + +// @public +export type ProvisioningStates = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export type PublicNetworkAccess = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ScaleUpProperties { + autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; + capacityUnitScaleUpLimitTiB?: number; + increaseCapacityUnitByTiB?: number; + unusedSizeTiB?: number; +} + +// @public +export interface Sku { + name: SkuName; + tier?: SkuTier; +} + +// @public +export interface SKUCapability { + readonly name?: string; + readonly value?: string; +} + +// @public +export interface SkuInformation { + readonly capabilities?: SKUCapability[]; + readonly locationInfo?: SkuLocationInfo[]; + readonly locations?: string[]; + name: SkuName; + readonly resourceType?: string; + tier?: SkuTier; +} + +// @public +export interface SkuLocationInfo { + readonly location?: string; + readonly zones?: string[]; +} + +// @public +export type SkuName = string; + +// @public +export type SkuTier = string; + +// @public +export interface Snapshot extends ProxyResource { + properties: SnapshotProperties; +} + +// @public +export interface SnapshotCreationData { + sourceId: string; +} + +// @public +export interface SnapshotProperties { + creationData: SnapshotCreationData; + readonly provisioningState?: ProvisioningStates; + readonly sourceVolumeSizeGiB?: number; + readonly volumeName?: string; +} + +// @public +export interface SourceCreationData { + createSource?: VolumeCreateOption; + sourceId?: string; +} + +// @public +export type StorageTargetType = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface VirtualNetworkRule { + action?: Action; + virtualNetworkResourceId: string; +} + +// @public +export interface Volume extends ProxyResource { + properties: VolumeProperties; +} + +// @public +export type VolumeCreateOption = string; + +// @public +export interface VolumeGroup extends ProxyResource { + identity?: Identity; + properties?: VolumeGroupProperties; +} + +// @public +export interface VolumeGroupProperties { + encryption?: EncryptionType; + encryptionProperties?: EncryptionProperties; + enforceDataIntegrityCheckForIscsi?: boolean; + networkAcls?: NetworkRuleSet; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + protocolType?: StorageTargetType; + readonly provisioningState?: ProvisioningStates; +} + +// @public +export interface VolumeGroupUpdate { + identity?: Identity; + properties?: VolumeGroupUpdateProperties; +} + +// @public +export interface VolumeGroupUpdateProperties { + encryption?: EncryptionType; + encryptionProperties?: EncryptionProperties; + enforceDataIntegrityCheckForIscsi?: boolean; + networkAcls?: NetworkRuleSet; + protocolType?: StorageTargetType; +} + +// @public +export interface VolumeNameList { + volumeNames: string[]; +} + +// @public +export interface VolumeProperties { + creationData?: SourceCreationData; + managedBy?: ManagedByInfo; + readonly provisioningState?: ProvisioningStates; + sizeGiB: number; + readonly storageTarget?: IscsiTargetInfo; + readonly volumeId?: string; +} + +// @public +export interface VolumeUpdate { + properties?: VolumeUpdateProperties; +} + +// @public +export interface VolumeUpdateProperties { + managedBy?: ManagedByInfo; + sizeGiB?: number; +} + +// @public +export type XMsDeleteSnapshots = string; + +// @public +export type XMsForceDelete = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md index eac940cfed92..ed31421d116c 100644 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md @@ -4,11 +4,14 @@ ```ts -import * as coreAuth from '@azure/core-auth'; -import * as coreClient from '@azure/core-client'; -import { OperationState } from '@azure/core-lro'; -import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { SimplePollerLike } from '@azure/core-lro'; +import type { AbortSignalLike } from '@azure/abort-controller'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PathUncheckedResponse } from '@azure-rest/core-client'; +import type { Pipeline } from '@azure/core-rest-pipeline'; +import type { PollerLike } from '@azure/core-lro'; +import type { TokenCredential } from '@azure/core-auth'; // @public export type Action = string; @@ -25,17 +28,22 @@ export interface AutoScaleProperties { } // @public -export type CreatedByType = string; +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" +} // @public -export interface DeleteRetentionPolicy { - // (undocumented) - policyState?: PolicyState; - retentionPeriodDays?: number; -} +export type AzureSupportedClouds = `${AzureClouds}`; // @public -export type DeleteType = string; +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export type CreatedByType = string; // @public export interface DiskSnapshotList { @@ -47,52 +55,24 @@ export interface ElasticSan extends TrackedResource { properties: ElasticSanProperties; } -// @public -export interface ElasticSanList { - readonly nextLink?: string; - value?: ElasticSan[]; -} - // @public (undocumented) -export class ElasticSanManagement extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams); - // (undocumented) - apiVersion: string; - beginRestoreVolume(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: RestoreVolumeOptionalParams): Promise, RestoreVolumeResponse>>; - beginRestoreVolumeAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: RestoreVolumeOptionalParams): Promise; - // (undocumented) - elasticSans: ElasticSans; - // (undocumented) - operations: Operations; - // (undocumented) - privateEndpointConnections: PrivateEndpointConnections; - // (undocumented) - privateLinkResources: PrivateLinkResources; - // (undocumented) - skus: Skus; - // (undocumented) - subscriptionId: string; - // (undocumented) - volumeGroups: VolumeGroups; - // (undocumented) - volumes: Volumes; - // (undocumented) - volumeSnapshots: VolumeSnapshots; -} - -// @public -export interface ElasticSanManagementOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - apiVersion?: string; - endpoint?: string; +export class ElasticSanManagement { + constructor(credential: TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams); + readonly elasticSans: ElasticSansOperations; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; + readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; + readonly privateLinkResources: PrivateLinkResourcesOperations; + readonly skus: SkusOperations; + readonly volumeGroups: VolumeGroupsOperations; + readonly volumes: VolumesOperations; + readonly volumeSnapshots: VolumeSnapshotsOperations; } // @public -export interface ElasticSanManagementRestoreVolumeHeaders { - // (undocumented) - location?: string; +export interface ElasticSanManagementOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; } // @public @@ -113,95 +93,46 @@ export interface ElasticSanProperties { } // @public -export interface ElasticSans { - beginCreate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise, ElasticSansCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise, ElasticSansUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: ElasticSansListBySubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface ElasticSansCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface ElasticSansCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type ElasticSansCreateResponse = ElasticSan; - -// @public -export interface ElasticSansDeleteHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface ElasticSansDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface ElasticSansDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface ElasticSansGetOptionalParams extends coreClient.OperationOptions { +export interface ElasticSansGetOptionalParams extends OperationOptions { } // @public -export type ElasticSansGetResponse = ElasticSan; - -// @public -export interface ElasticSansListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface ElasticSansListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type ElasticSansListByResourceGroupNextResponse = ElasticSanList; - -// @public -export interface ElasticSansListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface ElasticSansListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type ElasticSansListByResourceGroupResponse = ElasticSanList; - -// @public -export interface ElasticSansListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface ElasticSansOperations { + create: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams) => PollerLike, ElasticSan>; + delete: (resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: ElasticSansListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams) => PollerLike, ElasticSan>; } // @public -export type ElasticSansListBySubscriptionNextResponse = ElasticSanList; - -// @public -export interface ElasticSansListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ElasticSansListBySubscriptionResponse = ElasticSanList; - -// @public -export interface ElasticSansUpdateHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface ElasticSansUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface ElasticSansUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type ElasticSansUpdateResponse = ElasticSan; - // @public export interface ElasticSanUpdate { properties?: ElasticSanUpdateProperties; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -228,7 +159,7 @@ export type EncryptionType = string; // @public export interface ErrorAdditionalInfo { - readonly info?: Record; + readonly info?: any; readonly type?: string; } @@ -246,17 +177,12 @@ export interface ErrorResponse { error?: ErrorDetail; } -// @public -export function getContinuationToken(page: unknown): string | undefined; - // @public export interface Identity { readonly principalId?: string; readonly tenantId?: string; type: IdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentity; - }; + userAssignedIdentities?: Record; } // @public @@ -306,11 +232,6 @@ export enum KnownCreatedByType { User = "User" } -// @public -export enum KnownDeleteType { - Permanent = "permanent" -} - // @public export enum KnownEncryptionType { EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", @@ -343,12 +264,6 @@ export enum KnownOrigin { UserSystem = "user,system" } -// @public -export enum KnownPolicyState { - Disabled = "Disabled", - Enabled = "Enabled" -} - // @public export enum KnownPrivateEndpointServiceConnectionStatus { Approved = "Approved", @@ -367,7 +282,6 @@ export enum KnownProvisioningStates { Invalid = "Invalid", Pending = "Pending", Restoring = "Restoring", - SoftDeleting = "SoftDeleting", Succeeded = "Succeeded", Updating = "Updating" } @@ -395,6 +309,11 @@ export enum KnownStorageTargetType { None = "None" } +// @public +export enum KnownVersions { + V20250901 = "2025-09-01" +} + // @public export enum KnownVolumeCreateOption { Disk = "Disk", @@ -404,12 +323,6 @@ export enum KnownVolumeCreateOption { VolumeSnapshot = "VolumeSnapshot" } -// @public -export enum KnownXMsAccessSoftDeletedResources { - False = "false", - True = "true" -} - // @public export enum KnownXMsDeleteSnapshots { False = "false", @@ -453,28 +366,28 @@ export interface OperationDisplay { } // @public -export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; -} - -// @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +export interface OperationsListOptionalParams extends OperationOptions { } // @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; } // @public -export type OperationsListResponse = OperationListResult; +export type Origin = string; // @public -export type Origin = string; +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} // @public -export type PolicyState = string; +export interface PageSettings { + continuationToken?: string; +} // @public export interface PreValidationResponse { @@ -487,16 +400,10 @@ export interface PrivateEndpoint { } // @public -export interface PrivateEndpointConnection extends Resource { +export interface PrivateEndpointConnection extends ProxyResource { properties: PrivateEndpointConnectionProperties; } -// @public -export interface PrivateEndpointConnectionListResult { - readonly nextLink?: string; - value?: PrivateEndpointConnection[]; -} - // @public export interface PrivateEndpointConnectionProperties { groupIds?: string[]; @@ -506,49 +413,30 @@ export interface PrivateEndpointConnectionProperties { } // @public -export interface PrivateEndpointConnections { - beginCreate(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise, PrivateEndpointConnectionsCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; - list(resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface PrivateEndpointConnectionsCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; - -// @public -export interface PrivateEndpointConnectionsDeleteHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { } // @public -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; - -// @public -export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { } // @public -export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; +export interface PrivateEndpointConnectionsOperations { + create: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams) => PollerLike, PrivateEndpointConnection>; + delete: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams) => Promise; + list: (resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams) => PagedAsyncIterableIterator; +} // @public export type PrivateEndpointServiceConnectionStatus = string; @@ -561,7 +449,7 @@ export interface PrivateLinkResource extends Resource { // @public export interface PrivateLinkResourceListResult { readonly nextLink?: string; - value?: PrivateLinkResource[]; + value: PrivateLinkResource[]; } // @public @@ -572,17 +460,14 @@ export interface PrivateLinkResourceProperties { } // @public -export interface PrivateLinkResources { - listByElasticSan(resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams): Promise; +export interface PrivateLinkResourcesListByElasticSanOptionalParams extends OperationOptions { } // @public -export interface PrivateLinkResourcesListByElasticSanOptionalParams extends coreClient.OperationOptions { +export interface PrivateLinkResourcesOperations { + listByElasticSan: (resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams) => Promise; } -// @public -export type PrivateLinkResourcesListByElasticSanResponse = PrivateLinkResourceListResult; - // @public export interface PrivateLinkServiceConnectionState { actionsRequired?: string; @@ -609,14 +494,15 @@ export interface Resource { } // @public -export interface RestoreVolumeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export function restorePoller(client: ElasticSanManagement, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; updateIntervalInMs?: number; } -// @public -export type RestoreVolumeResponse = Volume; - // @public export interface ScaleUpProperties { autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; @@ -647,12 +533,6 @@ export interface SkuInformation { tier?: SkuTier; } -// @public -export interface SkuInformationList { - readonly nextLink?: string; - readonly value?: SkuInformation[]; -} - // @public export interface SkuLocationInfo { readonly location?: string; @@ -663,17 +543,14 @@ export interface SkuLocationInfo { export type SkuName = string; // @public -export interface Skus { - list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface SkusListOptionalParams extends coreClient.OperationOptions { +export interface SkusListOptionalParams extends OperationOptions { filter?: string; } // @public -export type SkusListResponse = SkuInformationList; +export interface SkusOperations { + list: (options?: SkusListOptionalParams) => PagedAsyncIterableIterator; +} // @public export type SkuTier = string; @@ -688,12 +565,6 @@ export interface SnapshotCreationData { sourceId: string; } -// @public -export interface SnapshotList { - readonly nextLink?: string; - value?: Snapshot[]; -} - // @public export interface SnapshotProperties { creationData: SnapshotCreationData; @@ -724,9 +595,7 @@ export interface SystemData { // @public export interface TrackedResource extends Resource { location: string; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -755,15 +624,8 @@ export interface VolumeGroup extends ProxyResource { properties?: VolumeGroupProperties; } -// @public -export interface VolumeGroupList { - readonly nextLink?: string; - value?: VolumeGroup[]; -} - // @public export interface VolumeGroupProperties { - deleteRetentionPolicy?: DeleteRetentionPolicy; encryption?: EncryptionType; encryptionProperties?: EncryptionProperties; enforceDataIntegrityCheckForIscsi?: boolean; @@ -774,76 +636,37 @@ export interface VolumeGroupProperties { } // @public -export interface VolumeGroups { - beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise, VolumeGroupsCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise, VolumeGroupsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams): Promise; - listByElasticSan(resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VolumeGroupsCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeGroupsCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VolumeGroupsCreateResponse = VolumeGroup; - -// @public -export interface VolumeGroupsDeleteHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface VolumeGroupsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeGroupsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VolumeGroupsGetOptionalParams extends coreClient.OperationOptions { +export interface VolumeGroupsGetOptionalParams extends OperationOptions { } // @public -export type VolumeGroupsGetResponse = VolumeGroup; - -// @public -export interface VolumeGroupsListByElasticSanNextOptionalParams extends coreClient.OperationOptions { - xMsAccessSoftDeletedResources?: XMsAccessSoftDeletedResources; +export interface VolumeGroupsListByElasticSanOptionalParams extends OperationOptions { } // @public -export type VolumeGroupsListByElasticSanNextResponse = VolumeGroupList; - -// @public -export interface VolumeGroupsListByElasticSanOptionalParams extends coreClient.OperationOptions { - xMsAccessSoftDeletedResources?: XMsAccessSoftDeletedResources; +export interface VolumeGroupsOperations { + create: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams) => PollerLike, VolumeGroup>; + delete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams) => Promise; + listByElasticSan: (resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams) => PollerLike, VolumeGroup>; } // @public -export type VolumeGroupsListByElasticSanResponse = VolumeGroupList; - -// @public -export interface VolumeGroupsUpdateHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface VolumeGroupsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VolumeGroupsUpdateResponse = VolumeGroup; - // @public export interface VolumeGroupUpdate { identity?: Identity; @@ -852,7 +675,6 @@ export interface VolumeGroupUpdate { // @public export interface VolumeGroupUpdateProperties { - deleteRetentionPolicy?: DeleteRetentionPolicy; encryption?: EncryptionType; encryptionProperties?: EncryptionProperties; enforceDataIntegrityCheckForIscsi?: boolean; @@ -860,12 +682,6 @@ export interface VolumeGroupUpdateProperties { protocolType?: StorageTargetType; } -// @public -export interface VolumeList { - readonly nextLink?: string; - value?: Volume[]; -} - // @public export interface VolumeNameList { volumeNames: string[]; @@ -882,166 +698,78 @@ export interface VolumeProperties { } // @public -export interface Volumes { - beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise, VolumesCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise; - beginPreBackup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams): Promise, VolumesPreBackupResponse>>; - beginPreBackupAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams): Promise; - beginPreRestore(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams): Promise, VolumesPreRestoreResponse>>; - beginPreRestoreAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams): Promise; - beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise, VolumesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; - listByVolumeGroup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VolumesCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumesCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VolumesCreateResponse = Volume; - -// @public -export interface VolumesDeleteHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { - deleteType?: DeleteType; - resumeFrom?: string; +export interface VolumesDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; xMsDeleteSnapshots?: XMsDeleteSnapshots; xMsForceDelete?: XMsForceDelete; } // @public -export interface VolumesGetOptionalParams extends coreClient.OperationOptions { +export interface VolumesGetOptionalParams extends OperationOptions { } // @public -export type VolumesGetResponse = Volume; - -// @public -export interface VolumesListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions { - xMsAccessSoftDeletedResources?: XMsAccessSoftDeletedResources; +export interface VolumesListByVolumeGroupOptionalParams extends OperationOptions { } // @public -export type VolumesListByVolumeGroupNextResponse = VolumeList; - -// @public -export interface VolumesListByVolumeGroupOptionalParams extends coreClient.OperationOptions { - xMsAccessSoftDeletedResources?: XMsAccessSoftDeletedResources; -} - -// @public -export type VolumesListByVolumeGroupResponse = VolumeList; - -// @public -export interface VolumeSnapshots { - beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams): Promise, VolumeSnapshotsCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsGetOptionalParams): Promise; - listByVolumeGroup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeSnapshotsListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VolumeSnapshotsCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeSnapshotsCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VolumeSnapshotsCreateResponse = Snapshot; - -// @public -export interface VolumeSnapshotsDeleteHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface VolumeSnapshotsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeSnapshotsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VolumeSnapshotsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VolumeSnapshotsGetResponse = Snapshot; - -// @public -export interface VolumeSnapshotsListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions { +export interface VolumeSnapshotsGetOptionalParams extends OperationOptions { } // @public -export type VolumeSnapshotsListByVolumeGroupNextResponse = SnapshotList; - -// @public -export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends coreClient.OperationOptions { +export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends OperationOptions { filter?: string; } // @public -export type VolumeSnapshotsListByVolumeGroupResponse = SnapshotList; - -// @public -export interface VolumesPreBackupHeaders { - // (undocumented) - location?: string; +export interface VolumeSnapshotsOperations { + create: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams) => PollerLike, Snapshot>; + delete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsGetOptionalParams) => Promise; + listByVolumeGroup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeSnapshotsListByVolumeGroupOptionalParams) => PagedAsyncIterableIterator; } // @public -export interface VolumesPreBackupOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface VolumesOperations { + create: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams) => PollerLike, Volume>; + delete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams) => Promise; + listByVolumeGroup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams) => PagedAsyncIterableIterator; + preBackup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams) => PollerLike, PreValidationResponse>; + preRestore: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams) => PollerLike, PreValidationResponse>; + update: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams) => PollerLike, Volume>; } // @public -export type VolumesPreBackupResponse = PreValidationResponse; - -// @public -export interface VolumesPreRestoreHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface VolumesPreRestoreOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumesPreBackupOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VolumesPreRestoreResponse = PreValidationResponse; - -// @public -export interface VolumesUpdateHeaders { - // (undocumented) - location?: string; +export interface VolumesPreRestoreOptionalParams extends OperationOptions { + updateIntervalInMs?: number; } // @public -export interface VolumesUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumesUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VolumesUpdateResponse = Volume; - // @public export interface VolumeUpdate { properties?: VolumeUpdateProperties; @@ -1053,9 +781,6 @@ export interface VolumeUpdateProperties { sizeGiB?: number; } -// @public -export type XMsAccessSoftDeletedResources = string; - // @public export type XMsDeleteSnapshots = string; diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts index 1323da7b5e35..1c7a449b10be 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts @@ -1,24 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Create ElasticSan. + * This sample demonstrates how to create ElasticSan. * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json */ - -import { ElasticSan, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function elasticSansCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { location: "France Central", properties: { autoScaleProperties: { @@ -36,44 +32,28 @@ async function elasticSansCreateMaximumSetGen(): Promise { sku: { name: "Premium_LRS", tier: "Premium" }, }, tags: { key9316: "ihndtieqibtob" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create ElasticSan. + * This sample demonstrates how to create ElasticSan. * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Create_MinimumSet_Gen.json + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MinimumSet_Gen.json */ async function elasticSansCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { location: "France Central", properties: { baseSizeTiB: 15, extendedCapacitySizeTiB: 27, sku: { name: "Premium_LRS" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts index 181755cac5e6..9bcc04f5edfd 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts @@ -1,51 +1,33 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to delete a Elastic San. + * + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json + */ async function elasticSansDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); } /** - * This sample demonstrates how to Delete a Elastic San. + * This sample demonstrates how to delete a Elastic San. * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MinimumSet_Gen.json */ async function elasticSansDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts index 5c17fcedce78..e80a93aa8f0e 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts @@ -1,50 +1,34 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to get a ElasticSan. + * + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json + */ async function elasticSansGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); console.log(result); } /** - * This sample demonstrates how to Get a ElasticSan. + * This sample demonstrates how to get a ElasticSan. * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MinimumSet_Gen.json */ async function elasticSansGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts index 6469f8762b00..a2ac1576753a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts @@ -1,52 +1,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. - * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + */ async function elasticSansListByResourceGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. + * This sample demonstrates how to gets a list of ElasticSan in a resource group. * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ async function elasticSansListByResourceGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts index ae2eed43a46a..1fc752343bbf 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts @@ -1,44 +1,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription - * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets a list of ElasticSans in a subscription + * + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json + */ async function elasticSansListBySubscriptionMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ async function elasticSansListBySubscriptionMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts index 413d8e8a7459..084de695151d 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts @@ -1,24 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Update a Elastic San. + * This sample demonstrates how to update a Elastic San. * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json */ - -import { ElasticSanUpdate, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function elasticSansUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { properties: { autoScaleProperties: { scaleUpProperties: { @@ -33,37 +29,21 @@ async function elasticSansUpdateMaximumSetGen(): Promise { publicNetworkAccess: "Enabled", }, tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Update a Elastic San. + * This sample demonstrates how to update a Elastic San. * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Update_MinimumSet_Gen.json + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MinimumSet_Gen.json */ async function elasticSansUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", {}); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts index ddbab142bcd7..61d0c64318ce 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts @@ -1,46 +1,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets a list of ElasticSan operations. - * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Operations_List_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json + */ async function operationsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSan operations. + * This sample demonstrates how to list the operations for the provider * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Operations_List_MinimumSet_Gen.json + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MinimumSet_Gen.json */ async function operationsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts index 9bf325b123ab..6fd03552435e 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts @@ -1,72 +1,53 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json */ - -import { - PrivateEndpointConnection, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { + properties: { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, + }, + }, ); console.log(result); } /** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MinimumSet_Gen.json */ async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { privateLinkServiceConnectionState: {} }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { properties: { privateLinkServiceConnectionState: {} } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts index e41bfe29f926..abc29f16677e 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -1,55 +1,41 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + */ async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", ); - console.log(result); } /** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MinimumSet_Gen.json */ async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts index b8558bdd5a62..f7fea37d0372 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts @@ -1,53 +1,41 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json + */ async function privateEndpointConnectionsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", ); console.log(result); } /** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MinimumSet_Gen.json */ async function privateEndpointConnectionsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts index a4a85c38223d..3616a6035b66 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts @@ -1,56 +1,48 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. - * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json + */ async function privateEndpointConnectionsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MinimumSet_Gen.json */ async function privateEndpointConnectionsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts index e6c40c4364e7..233d5378e795 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts @@ -1,49 +1,39 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + */ async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", ); console.log(result); } /** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json */ async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/restoreVolumeSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/restoreVolumeSample.ts deleted file mode 100644 index ce8d617ddf77..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/restoreVolumeSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * This sample demonstrates how to Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * - * @summary Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/RestoreVolume_MaximumSet_Gen.json - */ - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -async function restoreVolumeMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename-1741526907"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.beginRestoreVolumeAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * - * @summary Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/RestoreVolume_MinimumSet_Gen.json - */ -async function restoreVolumeMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename-1741526907"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.beginRestoreVolumeAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main(): Promise { - await restoreVolumeMaximumSetGen(); - await restoreVolumeMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts index 4e56305bb9bf..f70a88942fed 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts @@ -1,49 +1,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to List all the available Skus in the region and information related to them + * This sample demonstrates how to list all the available Skus in the region and information related to them * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Skus_List_MaximumSet_Gen.json + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json */ - -import { - SkusListOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function skusListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const filter = "obwwdrkq"; - const options: SkusListOptionalParams = { filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.skus.list(options)) { + for await (const item of client.skus.list({ filter: "obwwdrkq" })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List all the available Skus in the region and information related to them + * This sample demonstrates how to list all the available Skus in the region and information related to them * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Skus_List_MinimumSet_Gen.json + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MinimumSet_Gen.json */ async function skusListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.skus.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts index 333374b82cb1..4e691081e428 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts @@ -1,81 +1,63 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Create a Volume Group. + * This sample demonstrates how to create a Volume Group. * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json */ - -import { VolumeGroup, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumeGroupsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - deleteRetentionPolicy: { - policyState: "Enabled", - retentionPeriodDays: 14, - }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { + encryptionUserAssignedIdentity: "vgbeephfgecgg", + }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, - ], - }, - protocolType: "Iscsi", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Create a Volume Group. + * This sample demonstrates how to create a Volume Group. * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MinimumSet_Gen.json */ async function volumeGroupsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts index 3ad5020d903b..ac965081580a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts @@ -1,55 +1,33 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to delete an VolumeGroup. + * + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json + */ async function volumeGroupsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); } /** - * This sample demonstrates how to Delete an VolumeGroup. + * This sample demonstrates how to delete an VolumeGroup. * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MinimumSet_Gen.json */ async function volumeGroupsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts index ed88d87e72fd..a128c689a18d 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts @@ -1,53 +1,41 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to get an VolumeGroups. + * + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json + */ async function volumeGroupsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", ); console.log(result); } /** - * This sample demonstrates how to Get an VolumeGroups. + * This sample demonstrates how to get an VolumeGroups. * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MinimumSet_Gen.json */ async function volumeGroupsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts index 67aea133ece3..380a5aa9623f 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts @@ -1,69 +1,48 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to List VolumeGroups. + * This sample demonstrates how to list VolumeGroups. * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json */ - -import { - VolumeGroupsListByElasticSanOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumeGroupsListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const xMsAccessSoftDeletedResources = "true"; - const options: VolumeGroupsListByElasticSanOptionalParams = { - xMsAccessSoftDeletedResources, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - options, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List VolumeGroups. + * This sample demonstrates how to list VolumeGroups. * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json */ async function volumeGroupsListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const xMsAccessSoftDeletedResources = "true"; - const options: VolumeGroupsListByElasticSanOptionalParams = { - xMsAccessSoftDeletedResources, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - options, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts index 82f75bc0579e..c5238105f486 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts @@ -1,81 +1,63 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Update an VolumeGroup. + * This sample demonstrates how to update an VolumeGroup. * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json */ - -import { VolumeGroupUpdate, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumeGroupsUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - deleteRetentionPolicy: { - policyState: "Enabled", - retentionPeriodDays: 14, - }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { + encryptionUserAssignedIdentity: "vgbeephfgecgg", + }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, - ], - }, - protocolType: "Iscsi", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Update an VolumeGroup. + * This sample demonstrates how to update an VolumeGroup. * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MinimumSet_Gen.json */ async function volumeGroupsUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts index f442c61f404a..35de4b6c63f4 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts @@ -1,75 +1,59 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Create a Volume Snapshot. + * This sample demonstrates how to create a Volume Snapshot. * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Create_MaximumSet_Gen.json + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json */ - -import { Snapshot, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumeSnapshotsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }, ); console.log(result); } /** - * This sample demonstrates how to Create a Volume Snapshot. + * This sample demonstrates how to create a Volume Snapshot. * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Create_MinimumSet_Gen.json + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MinimumSet_Gen.json */ async function volumeSnapshotsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts index ffee17e6c36a..e8db98290e6c 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts @@ -1,59 +1,43 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to delete a Volume Snapshot. + * + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json + */ async function volumeSnapshotsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", ); - console.log(result); } /** - * This sample demonstrates how to Delete a Volume Snapshot. + * This sample demonstrates how to delete a Volume Snapshot. * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MinimumSet_Gen.json */ async function volumeSnapshotsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts index 1e4ac2f48d88..7f78d243e440 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts @@ -1,57 +1,43 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Get_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to get a Volume Snapshot. + * + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json + */ async function volumeSnapshotsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", ); console.log(result); } /** - * This sample demonstrates how to Get a Volume Snapshot. + * This sample demonstrates how to get a Volume Snapshot. * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Get_MinimumSet_Gen.json + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MinimumSet_Gen.json */ async function volumeSnapshotsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts index 1b59d51080bc..1e5259e46a94 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts @@ -1,66 +1,51 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json */ - -import { - VolumeSnapshotsListByVolumeGroupOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const filter = "volumeName eq "; - const options: VolumeSnapshotsListByVolumeGroupOptionalParams = { filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { filter: "volumeName eq " }, )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json */ async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts index bd2aa46a6679..df22ebd67cee 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts @@ -1,67 +1,51 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Create a Volume. + * This sample demonstrates how to create a Volume. * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Create_MaximumSet_Gen.json + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json */ - -import { Volume, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumesCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { - properties: { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { + properties: { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, + }, ); console.log(result); } /** - * This sample demonstrates how to Create a Volume. + * This sample demonstrates how to create a Volume. * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Create_MinimumSet_Gen.json + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MinimumSet_Gen.json */ async function volumesCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { properties: { sizeGiB: 9 } }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { properties: { sizeGiB: 9 } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts index d4f58ae49bce..39b9e7aa96bf 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts @@ -1,74 +1,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Delete an Volume. + * This sample demonstrates how to delete an Volume. * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json */ - -import { - VolumesDeleteOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumesDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const xMsDeleteSnapshots = "true"; - const xMsForceDelete = "true"; - const deleteType = "permanent"; - const options: VolumesDeleteOptionalParams = { - xMsDeleteSnapshots, - xMsForceDelete, - deleteType, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { xMsDeleteSnapshots: "true", xMsForceDelete: "true" }, ); - console.log(result); } /** - * This sample demonstrates how to Delete an Volume. + * This sample demonstrates how to delete an Volume. * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Delete_MinimumSet_Gen.json + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MinimumSet_Gen.json */ async function volumesDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const deleteType = "permanent"; - const options: VolumesDeleteOptionalParams = { deleteType }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts index d641c49c7298..3a086869b011 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts @@ -1,57 +1,43 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Get_MaximumSet_Gen.json - */ - import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to get an Volume. + * + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json + */ async function volumesGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", ); console.log(result); } /** - * This sample demonstrates how to Get an Volume. + * This sample demonstrates how to get an Volume. * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Get_MinimumSet_Gen.json + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MinimumSet_Gen.json */ async function volumesGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts index 8878d2743ec4..a0050c15050a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts @@ -1,73 +1,50 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to List Volumes in a VolumeGroup. + * This sample demonstrates how to list Volumes in a VolumeGroup. * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json */ - -import { - VolumesListByVolumeGroupOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumesListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const xMsAccessSoftDeletedResources = "true"; - const options: VolumesListByVolumeGroupOptionalParams = { - xMsAccessSoftDeletedResources, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, + "resourcegroupname", + "elasticsanname", + "volumegroupname", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List Volumes in a VolumeGroup. + * This sample demonstrates how to list Volumes in a VolumeGroup. * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MinimumSet_Gen.json */ async function volumesListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const xMsAccessSoftDeletedResources = "true"; - const options: VolumesListByVolumeGroupOptionalParams = { - xMsAccessSoftDeletedResources, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, + "resourcegroupname", + "elasticsanname", + "volumegroupname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts index 8237a0300edc..b75df801c2bf 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts @@ -1,32 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Validate whether a disk snapshot backup can be taken for list of volumes. + * This sample demonstrates how to validate whether a disk snapshot backup can be taken for list of volumes. * - * @summary Validate whether a disk snapshot backup can be taken for list of volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreBackup_MaximumSet_Gen.json + * @summary validate whether a disk snapshot backup can be taken for list of volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json */ - -import { VolumeNameList, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumeGroupsPreBackupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeNameList = { volumeNames: ["volumename"] }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreBackupAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, + const result = await client.volumes.preBackup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { volumeNames: ["volumename"] }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts index 41a772680da7..1ab7276bf849 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts @@ -1,36 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * This sample demonstrates how to validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. * - * @summary Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreRestore_MaximumSet_Gen.json + * @summary validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json */ - -import { DiskSnapshotList, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumeGroupsPreRestoreMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: DiskSnapshotList = { - diskSnapshotIds: [ - "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", - ], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreRestoreAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, + const result = await client.volumes.preRestore( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + diskSnapshotIds: [ + "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", + ], + }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts index 8fd467e958dc..7142de252f04 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts @@ -1,66 +1,50 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Update an Volume. + * This sample demonstrates how to update an Volume. * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Update_MaximumSet_Gen.json + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json */ - -import { VolumeUpdate, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - async function volumesUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = { - properties: { - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 7, - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { + properties: { + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 7, + }, + }, ); console.log(result); } /** - * This sample demonstrates how to Update an Volume. + * This sample demonstrates how to update an Volume. * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Update_MinimumSet_Gen.json + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MinimumSet_Gen.json */ async function volumesUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + {}, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/README.md deleted file mode 100644 index 72eaf9a1c996..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# 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** | -| ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [elasticSansCreateSample.js][elasticsanscreatesample] | Create ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json | -| [elasticSansDeleteSample.js][elasticsansdeletesample] | Delete a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json | -| [elasticSansGetSample.js][elasticsansgetsample] | Get a ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json | -| [elasticSansListByResourceGroupSample.js][elasticsanslistbyresourcegroupsample] | Gets a list of ElasticSan in a resource group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | -| [elasticSansListBySubscriptionSample.js][elasticsanslistbysubscriptionsample] | Gets a list of ElasticSans in a subscription x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json | -| [elasticSansUpdateSample.js][elasticsansupdatesample] | Update a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json | -| [operationsListSample.js][operationslistsample] | Gets a list of ElasticSan operations. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Operations_List_MaximumSet_Gen.json | -| [privateEndpointConnectionsCreateSample.js][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json | -| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | List all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json | -| [privateLinkResourcesListByElasticSanSample.js][privatelinkresourceslistbyelasticsansample] | Gets the private link resources that need to be created for a elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | -| [restoreVolumeSample.js][restorevolumesample] | Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/RestoreVolume_MaximumSet_Gen.json | -| [skusListSample.js][skuslistsample] | List all the available Skus in the region and information related to them x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Skus_List_MaximumSet_Gen.json | -| [volumeGroupsCreateSample.js][volumegroupscreatesample] | Create a Volume Group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json | -| [volumeGroupsDeleteSample.js][volumegroupsdeletesample] | Delete an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json | -| [volumeGroupsGetSample.js][volumegroupsgetsample] | Get an VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json | -| [volumeGroupsListByElasticSanSample.js][volumegroupslistbyelasticsansample] | List VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | -| [volumeGroupsUpdateSample.js][volumegroupsupdatesample] | Update an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json | -| [volumeSnapshotsCreateSample.js][volumesnapshotscreatesample] | Create a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Create_MaximumSet_Gen.json | -| [volumeSnapshotsDeleteSample.js][volumesnapshotsdeletesample] | Delete a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json | -| [volumeSnapshotsGetSample.js][volumesnapshotsgetsample] | Get a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Get_MaximumSet_Gen.json | -| [volumeSnapshotsListByVolumeGroupSample.js][volumesnapshotslistbyvolumegroupsample] | List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesCreateSample.js][volumescreatesample] | Create a Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Create_MaximumSet_Gen.json | -| [volumesDeleteSample.js][volumesdeletesample] | Delete an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json | -| [volumesGetSample.js][volumesgetsample] | Get an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Get_MaximumSet_Gen.json | -| [volumesListByVolumeGroupSample.js][volumeslistbyvolumegroupsample] | List Volumes in a VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesPreBackupSample.js][volumesprebackupsample] | Validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreBackup_MaximumSet_Gen.json | -| [volumesPreRestoreSample.js][volumesprerestoresample] | Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreRestore_MaximumSet_Gen.json | -| [volumesUpdateSample.js][volumesupdatesample] | Update an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node elasticSansCreateSample.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 -cross-env ELASTICSANS_SUBSCRIPTION_ID="" ELASTICSANS_RESOURCE_GROUP="" node elasticSansCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansCreateSample.js -[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansDeleteSample.js -[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansGetSample.js -[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansListByResourceGroupSample.js -[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansListBySubscriptionSample.js -[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansUpdateSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/operationsListSample.js -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsCreateSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsListSample.js -[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateLinkResourcesListByElasticSanSample.js -[restorevolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/restoreVolumeSample.js -[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/skusListSample.js -[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsCreateSample.js -[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsDeleteSample.js -[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsGetSample.js -[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsListByElasticSanSample.js -[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsUpdateSample.js -[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsCreateSample.js -[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsDeleteSample.js -[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsGetSample.js -[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsListByVolumeGroupSample.js -[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesCreateSample.js -[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesDeleteSample.js -[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesGetSample.js -[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesListByVolumeGroupSample.js -[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreBackupSample.js -[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreRestoreSample.js -[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesUpdateSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansCreateSample.js deleted file mode 100644 index 97adaf58958d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansCreateSample.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json - */ -async function elasticSansCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = { - location: "France Central", - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, - }, - tags: { key9316: "ihndtieqibtob" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Create_MinimumSet_Gen.json - */ -async function elasticSansCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = { - location: "France Central", - properties: { - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main() { - await elasticSansCreateMaximumSetGen(); - await elasticSansCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansDeleteSample.js deleted file mode 100644 index e6d45490f0ac..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansDeleteSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json - */ -async function elasticSansDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait(resourceGroupName, elasticSanName); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json - */ -async function elasticSansDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait(resourceGroupName, elasticSanName); - console.log(result); -} - -async function main() { - await elasticSansDeleteMaximumSetGen(); - await elasticSansDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansGetSample.js deleted file mode 100644 index b491bef06afb..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansGetSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json - */ -async function elasticSansGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get(resourceGroupName, elasticSanName); - console.log(result); -} - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json - */ -async function elasticSansGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get(resourceGroupName, elasticSanName); - console.log(result); -} - -async function main() { - await elasticSansGetMaximumSetGen(); - await elasticSansGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansListByResourceGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansListByResourceGroupSample.js deleted file mode 100644 index b6d8b39c47b4..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansListByResourceGroupSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. - * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json - */ -async function elasticSansListByResourceGroupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. - * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json - */ -async function elasticSansListByResourceGroupMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await elasticSansListByResourceGroupMaximumSetGen(); - await elasticSansListByResourceGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansUpdateSample.js deleted file mode 100644 index 7e54b1415a88..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansUpdateSample.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json - */ -async function elasticSansUpdateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = { - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", - }, - tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Update_MinimumSet_Gen.json - */ -async function elasticSansUpdateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main() { - await elasticSansUpdateMaximumSetGen(); - await elasticSansUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/operationsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/operationsListSample.js deleted file mode 100644 index c5c068826655..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of ElasticSan operations. - * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen() { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSan operations. - * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await operationsListMaximumSetGen(); - await operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/package.json b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/package.json deleted file mode 100644 index 664b3a869831..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-elasticsan-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=20.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/elasticsans/arm-elasticsan" - }, - "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/elasticsans/arm-elasticsan", - "dependencies": { - "@azure/arm-elasticsan": "next", - "dotenv": "latest", - "@azure/identity": "^4.9.0" - } -} diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsCreateSample.js deleted file mode 100644 index 5e662f27a932..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsCreateSample.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters = { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters = { - properties: { privateLinkServiceConnectionState: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -async function main() { - await privateEndpointConnectionsCreateMaximumSetGen(); - await privateEndpointConnectionsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsDeleteSample.js deleted file mode 100644 index 3da0585ebe26..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsDeleteSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - await privateEndpointConnectionsDeleteMaximumSetGen(); - await privateEndpointConnectionsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsGetSample.js deleted file mode 100644 index ee37130e9f6b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsGetSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - await privateEndpointConnectionsGetMaximumSetGen(); - await privateEndpointConnectionsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsListSample.js deleted file mode 100644 index fceff73e0e7b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateEndpointConnectionsListSample.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. - * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsListMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. - * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsListMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await privateEndpointConnectionsListMaximumSetGen(); - await privateEndpointConnectionsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateLinkResourcesListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateLinkResourcesListByElasticSanSample.js deleted file mode 100644 index c8001361b7a5..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/privateLinkResourcesListByElasticSanSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main() { - await privateLinkResourcesListByElasticSanMaximumSetGen(); - await privateLinkResourcesListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/restoreVolumeSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/restoreVolumeSample.js deleted file mode 100644 index 8516c7c8c48f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/restoreVolumeSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * - * @summary Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/RestoreVolume_MaximumSet_Gen.json - */ -async function restoreVolumeMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename-1741526907"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.beginRestoreVolumeAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * - * @summary Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/RestoreVolume_MinimumSet_Gen.json - */ -async function restoreVolumeMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename-1741526907"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.beginRestoreVolumeAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main() { - await restoreVolumeMaximumSetGen(); - await restoreVolumeMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/skusListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/skusListSample.js deleted file mode 100644 index 7c9e53a709bc..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/skusListSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Skus_List_MaximumSet_Gen.json - */ -async function skusListMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const filter = "obwwdrkq"; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.skus.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Skus_List_MinimumSet_Gen.json - */ -async function skusListMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.skus.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await skusListMaximumSetGen(); - await skusListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsCreateSample.js deleted file mode 100644 index 83816c2bfd97..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsCreateSample.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json - */ -async function volumeGroupsCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - deleteRetentionPolicy: { - policyState: "Enabled", - retentionPeriodDays: 14, - }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json - */ -async function volumeGroupsCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeGroupsCreateMaximumSetGen(); - await volumeGroupsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsDeleteSample.js deleted file mode 100644 index fb878e27640e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsDeleteSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json - */ -async function volumeGroupsDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json - */ -async function volumeGroupsDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -async function main() { - await volumeGroupsDeleteMaximumSetGen(); - await volumeGroupsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsGetSample.js deleted file mode 100644 index ea61e69188ab..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsGetSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json - */ -async function volumeGroupsGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get(resourceGroupName, elasticSanName, volumeGroupName); - console.log(result); -} - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json - */ -async function volumeGroupsGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get(resourceGroupName, elasticSanName, volumeGroupName); - console.log(result); -} - -async function main() { - await volumeGroupsGetMaximumSetGen(); - await volumeGroupsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsListByElasticSanSample.js deleted file mode 100644 index cc2b16ddd708..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsListByElasticSanSample.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const xMsAccessSoftDeletedResources = "true"; - const options = { - xMsAccessSoftDeletedResources, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const xMsAccessSoftDeletedResources = "true"; - const options = { - xMsAccessSoftDeletedResources, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await volumeGroupsListByElasticSanMaximumSetGen(); - await volumeGroupsListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsUpdateSample.js deleted file mode 100644 index a6b9fda0c327..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeGroupsUpdateSample.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json - */ -async function volumeGroupsUpdateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - deleteRetentionPolicy: { - policyState: "Enabled", - retentionPeriodDays: 14, - }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json - */ -async function volumeGroupsUpdateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeGroupsUpdateMaximumSetGen(); - await volumeGroupsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsCreateSample.js deleted file mode 100644 index cc520ce9885e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsCreateSample.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Create_MaximumSet_Gen.json - */ -async function volumeSnapshotsCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Create_MinimumSet_Gen.json - */ -async function volumeSnapshotsCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeSnapshotsCreateMaximumSetGen(); - await volumeSnapshotsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsDeleteSample.js deleted file mode 100644 index 332d10256723..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsDeleteSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json - */ -async function volumeSnapshotsDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json - */ -async function volumeSnapshotsDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main() { - await volumeSnapshotsDeleteMaximumSetGen(); - await volumeSnapshotsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsGetSample.js deleted file mode 100644 index 82aceb2d578f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsGetSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Get_MaximumSet_Gen.json - */ -async function volumeSnapshotsGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Get_MinimumSet_Gen.json - */ -async function volumeSnapshotsGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main() { - await volumeSnapshotsGetMaximumSetGen(); - await volumeSnapshotsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsListByVolumeGroupSample.js deleted file mode 100644 index 7fc018006287..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumeSnapshotsListByVolumeGroupSample.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const filter = "volumeName eq "; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await volumeSnapshotsListByVolumeGroupMaximumSetGen(); - await volumeSnapshotsListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesCreateSample.js deleted file mode 100644 index fa89d95d73d6..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesCreateSample.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Create_MaximumSet_Gen.json - */ -async function volumesCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = { - properties: { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Create_MinimumSet_Gen.json - */ -async function volumesCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = { properties: { sizeGiB: 9 } }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumesCreateMaximumSetGen(); - await volumesCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesDeleteSample.js deleted file mode 100644 index f0371ac0c680..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesDeleteSample.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json - */ -async function volumesDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const xMsDeleteSnapshots = "true"; - const xMsForceDelete = "true"; - const deleteType = "permanent"; - const options = { - xMsDeleteSnapshots, - xMsForceDelete, - deleteType, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Delete_MinimumSet_Gen.json - */ -async function volumesDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const deleteType = "permanent"; - const options = { deleteType }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - console.log(result); -} - -async function main() { - await volumesDeleteMaximumSetGen(); - await volumesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesGetSample.js deleted file mode 100644 index 42a428a36f3b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesGetSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Get_MaximumSet_Gen.json - */ -async function volumesGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Get_MinimumSet_Gen.json - */ -async function volumesGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main() { - await volumesGetMaximumSetGen(); - await volumesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesListByVolumeGroupSample.js deleted file mode 100644 index 98edca57336b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesListByVolumeGroupSample.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumesListByVolumeGroupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const xMsAccessSoftDeletedResources = "true"; - const options = { - xMsAccessSoftDeletedResources, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumesListByVolumeGroupMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const xMsAccessSoftDeletedResources = "true"; - const options = { - xMsAccessSoftDeletedResources, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await volumesListByVolumeGroupMaximumSetGen(); - await volumesListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreBackupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreBackupSample.js deleted file mode 100644 index 7aea96461dff..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreBackupSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Validate whether a disk snapshot backup can be taken for list of volumes. - * - * @summary Validate whether a disk snapshot backup can be taken for list of volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreBackup_MaximumSet_Gen.json - */ -async function volumeGroupsPreBackupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { volumeNames: ["volumename"] }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreBackupAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeGroupsPreBackupMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreRestoreSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreRestoreSample.js deleted file mode 100644 index 84334c9082c5..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesPreRestoreSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * - * @summary Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreRestore_MaximumSet_Gen.json - */ -async function volumeGroupsPreRestoreMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { - diskSnapshotIds: [ - "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreRestoreAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeGroupsPreRestoreMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesUpdateSample.js deleted file mode 100644 index 386fefbc6088..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/volumesUpdateSample.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Update_MaximumSet_Gen.json - */ -async function volumesUpdateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = { - properties: { - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 7, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Update_MinimumSet_Gen.json - */ -async function volumesUpdateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumesUpdateMaximumSetGen(); - await volumesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/README.md deleted file mode 100644 index 92dabf64d69e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# 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** | -| ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [elasticSansCreateSample.ts][elasticsanscreatesample] | Create ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json | -| [elasticSansDeleteSample.ts][elasticsansdeletesample] | Delete a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json | -| [elasticSansGetSample.ts][elasticsansgetsample] | Get a ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json | -| [elasticSansListByResourceGroupSample.ts][elasticsanslistbyresourcegroupsample] | Gets a list of ElasticSan in a resource group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | -| [elasticSansListBySubscriptionSample.ts][elasticsanslistbysubscriptionsample] | Gets a list of ElasticSans in a subscription x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json | -| [elasticSansUpdateSample.ts][elasticsansupdatesample] | Update a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json | -| [operationsListSample.ts][operationslistsample] | Gets a list of ElasticSan operations. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Operations_List_MaximumSet_Gen.json | -| [privateEndpointConnectionsCreateSample.ts][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json | -| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | List all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json | -| [privateLinkResourcesListByElasticSanSample.ts][privatelinkresourceslistbyelasticsansample] | Gets the private link resources that need to be created for a elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | -| [restoreVolumeSample.ts][restorevolumesample] | Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/RestoreVolume_MaximumSet_Gen.json | -| [skusListSample.ts][skuslistsample] | List all the available Skus in the region and information related to them x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Skus_List_MaximumSet_Gen.json | -| [volumeGroupsCreateSample.ts][volumegroupscreatesample] | Create a Volume Group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json | -| [volumeGroupsDeleteSample.ts][volumegroupsdeletesample] | Delete an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json | -| [volumeGroupsGetSample.ts][volumegroupsgetsample] | Get an VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json | -| [volumeGroupsListByElasticSanSample.ts][volumegroupslistbyelasticsansample] | List VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | -| [volumeGroupsUpdateSample.ts][volumegroupsupdatesample] | Update an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json | -| [volumeSnapshotsCreateSample.ts][volumesnapshotscreatesample] | Create a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Create_MaximumSet_Gen.json | -| [volumeSnapshotsDeleteSample.ts][volumesnapshotsdeletesample] | Delete a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json | -| [volumeSnapshotsGetSample.ts][volumesnapshotsgetsample] | Get a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Get_MaximumSet_Gen.json | -| [volumeSnapshotsListByVolumeGroupSample.ts][volumesnapshotslistbyvolumegroupsample] | List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesCreateSample.ts][volumescreatesample] | Create a Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Create_MaximumSet_Gen.json | -| [volumesDeleteSample.ts][volumesdeletesample] | Delete an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json | -| [volumesGetSample.ts][volumesgetsample] | Get an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Get_MaximumSet_Gen.json | -| [volumesListByVolumeGroupSample.ts][volumeslistbyvolumegroupsample] | List Volumes in a VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesPreBackupSample.ts][volumesprebackupsample] | Validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreBackup_MaximumSet_Gen.json | -| [volumesPreRestoreSample.ts][volumesprerestoresample] | Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreRestore_MaximumSet_Gen.json | -| [volumesUpdateSample.ts][volumesupdatesample] | Update an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/elasticSansCreateSample.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 -cross-env ELASTICSANS_SUBSCRIPTION_ID="" ELASTICSANS_RESOURCE_GROUP="" node dist/elasticSansCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansCreateSample.ts -[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansDeleteSample.ts -[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansGetSample.ts -[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansListByResourceGroupSample.ts -[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansListBySubscriptionSample.ts -[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansUpdateSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/operationsListSample.ts -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsCreateSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsListSample.ts -[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateLinkResourcesListByElasticSanSample.ts -[restorevolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/restoreVolumeSample.ts -[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/skusListSample.ts -[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsCreateSample.ts -[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsDeleteSample.ts -[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsGetSample.ts -[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsListByElasticSanSample.ts -[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsUpdateSample.ts -[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsCreateSample.ts -[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsDeleteSample.ts -[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsGetSample.ts -[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts -[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesCreateSample.ts -[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesDeleteSample.ts -[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesGetSample.ts -[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesListByVolumeGroupSample.ts -[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreBackupSample.ts -[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreRestoreSample.ts -[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesUpdateSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/package.json b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/package.json deleted file mode 100644 index 98172df093b1..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-elasticsan-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=20.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/elasticsans/arm-elasticsan" - }, - "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/elasticsans/arm-elasticsan", - "dependencies": { - "@azure/arm-elasticsan": "next", - "dotenv": "latest", - "@azure/identity": "^4.9.0" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "typescript": "~5.8.2", - "rimraf": "latest" - } -} diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansCreateSample.ts deleted file mode 100644 index 833455d84a75..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansCreateSample.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSan, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json - */ -async function elasticSansCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { - location: "France Central", - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, - }, - tags: { key9316: "ihndtieqibtob" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Create_MinimumSet_Gen.json - */ -async function elasticSansCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { - location: "France Central", - properties: { - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await elasticSansCreateMaximumSetGen(); - await elasticSansCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansDeleteSample.ts deleted file mode 100644 index 56b385a0e33d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansDeleteSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json - */ -async function elasticSansDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json - */ -async function elasticSansDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main(): Promise { - await elasticSansDeleteMaximumSetGen(); - await elasticSansDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansGetSample.ts deleted file mode 100644 index 5b60995838b6..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansGetSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json - */ -async function elasticSansGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json - */ -async function elasticSansGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main(): Promise { - await elasticSansGetMaximumSetGen(); - await elasticSansGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansListByResourceGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansListByResourceGroupSample.ts deleted file mode 100644 index 068f8623176f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansListByResourceGroupSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. - * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json - */ -async function elasticSansListByResourceGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. - * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json - */ -async function elasticSansListByResourceGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await elasticSansListByResourceGroupMaximumSetGen(); - await elasticSansListByResourceGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansUpdateSample.ts deleted file mode 100644 index ce988aeeb4e2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansUpdateSample.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanUpdate, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json - */ -async function elasticSansUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = { - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", - }, - tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_Update_MinimumSet_Gen.json - */ -async function elasticSansUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await elasticSansUpdateMaximumSetGen(); - await elasticSansUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/operationsListSample.ts deleted file mode 100644 index 5acfca4799f8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of ElasticSan operations. - * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSan operations. - * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await operationsListMaximumSetGen(); - await operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsCreateSample.ts deleted file mode 100644 index ad423d79caa0..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsCreateSample.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - PrivateEndpointConnection, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { privateLinkServiceConnectionState: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await privateEndpointConnectionsCreateMaximumSetGen(); - await privateEndpointConnectionsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index ff1f50b9932f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main(): Promise { - await privateEndpointConnectionsDeleteMaximumSetGen(); - await privateEndpointConnectionsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index dd3016ef069c..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main(): Promise { - await privateEndpointConnectionsGetMaximumSetGen(); - await privateEndpointConnectionsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsListSample.ts deleted file mode 100644 index dd1b3c0362d9..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateEndpointConnectionsListSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. - * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. - * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await privateEndpointConnectionsListMaximumSetGen(); - await privateEndpointConnectionsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateLinkResourcesListByElasticSanSample.ts deleted file mode 100644 index 943c0ed018a5..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/privateLinkResourcesListByElasticSanSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main(): Promise { - await privateLinkResourcesListByElasticSanMaximumSetGen(); - await privateLinkResourcesListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/restoreVolumeSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/restoreVolumeSample.ts deleted file mode 100644 index a1df76263556..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/restoreVolumeSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * - * @summary Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/RestoreVolume_MaximumSet_Gen.json - */ -async function restoreVolumeMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename-1741526907"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.beginRestoreVolumeAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * - * @summary Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/RestoreVolume_MinimumSet_Gen.json - */ -async function restoreVolumeMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename-1741526907"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.beginRestoreVolumeAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main(): Promise { - await restoreVolumeMaximumSetGen(); - await restoreVolumeMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/skusListSample.ts deleted file mode 100644 index 56fd1332f05b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/skusListSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SkusListOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Skus_List_MaximumSet_Gen.json - */ -async function skusListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const filter = "obwwdrkq"; - const options: SkusListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.skus.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Skus_List_MinimumSet_Gen.json - */ -async function skusListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.skus.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await skusListMaximumSetGen(); - await skusListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsCreateSample.ts deleted file mode 100644 index bfa7c6b9f7ee..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsCreateSample.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { VolumeGroup, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json - */ -async function volumeGroupsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - deleteRetentionPolicy: { - policyState: "Enabled", - retentionPeriodDays: 14, - }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, - ], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json - */ -async function volumeGroupsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsCreateMaximumSetGen(); - await volumeGroupsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsDeleteSample.ts deleted file mode 100644 index fd3f45e8387c..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsDeleteSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json - */ -async function volumeGroupsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json - */ -async function volumeGroupsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsDeleteMaximumSetGen(); - await volumeGroupsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsGetSample.ts deleted file mode 100644 index 19a96a2bb0c5..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsGetSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json - */ -async function volumeGroupsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json - */ -async function volumeGroupsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsGetMaximumSetGen(); - await volumeGroupsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsListByElasticSanSample.ts deleted file mode 100644 index c8c173212a91..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsListByElasticSanSample.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - VolumeGroupsListByElasticSanOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const xMsAccessSoftDeletedResources = "true"; - const options: VolumeGroupsListByElasticSanOptionalParams = { - xMsAccessSoftDeletedResources, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const xMsAccessSoftDeletedResources = "true"; - const options: VolumeGroupsListByElasticSanOptionalParams = { - xMsAccessSoftDeletedResources, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await volumeGroupsListByElasticSanMaximumSetGen(); - await volumeGroupsListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsUpdateSample.ts deleted file mode 100644 index a8d0be2e8b40..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeGroupsUpdateSample.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { VolumeGroupUpdate, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json - */ -async function volumeGroupsUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - deleteRetentionPolicy: { - policyState: "Enabled", - retentionPeriodDays: 14, - }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, - ], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json - */ -async function volumeGroupsUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsUpdateMaximumSetGen(); - await volumeGroupsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsCreateSample.ts deleted file mode 100644 index ad97c079595a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsCreateSample.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Snapshot, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Create_MaximumSet_Gen.json - */ -async function volumeSnapshotsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Create_MinimumSet_Gen.json - */ -async function volumeSnapshotsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeSnapshotsCreateMaximumSetGen(); - await volumeSnapshotsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsDeleteSample.ts deleted file mode 100644 index 173e1ea1f958..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsDeleteSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json - */ -async function volumeSnapshotsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json - */ -async function volumeSnapshotsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main(): Promise { - await volumeSnapshotsDeleteMaximumSetGen(); - await volumeSnapshotsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsGetSample.ts deleted file mode 100644 index 7159d75d6bb9..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsGetSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Get_MaximumSet_Gen.json - */ -async function volumeSnapshotsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_Get_MinimumSet_Gen.json - */ -async function volumeSnapshotsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main(): Promise { - await volumeSnapshotsGetMaximumSetGen(); - await volumeSnapshotsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts deleted file mode 100644 index e7a2f2e9dde2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - VolumeSnapshotsListByVolumeGroupOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const filter = "volumeName eq "; - const options: VolumeSnapshotsListByVolumeGroupOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await volumeSnapshotsListByVolumeGroupMaximumSetGen(); - await volumeSnapshotsListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesCreateSample.ts deleted file mode 100644 index 0a41094f574d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesCreateSample.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Volume, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Create_MaximumSet_Gen.json - */ -async function volumesCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { - properties: { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Create_MinimumSet_Gen.json - */ -async function volumesCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { properties: { sizeGiB: 9 } }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumesCreateMaximumSetGen(); - await volumesCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesDeleteSample.ts deleted file mode 100644 index 7dfdd2cc86ec..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesDeleteSample.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - VolumesDeleteOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json - */ -async function volumesDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const xMsDeleteSnapshots = "true"; - const xMsForceDelete = "true"; - const deleteType = "permanent"; - const options: VolumesDeleteOptionalParams = { - xMsDeleteSnapshots, - xMsForceDelete, - deleteType, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Delete_MinimumSet_Gen.json - */ -async function volumesDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const deleteType = "permanent"; - const options: VolumesDeleteOptionalParams = { deleteType }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await volumesDeleteMaximumSetGen(); - await volumesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesGetSample.ts deleted file mode 100644 index ffefec70c523..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesGetSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Get_MaximumSet_Gen.json - */ -async function volumesGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Get_MinimumSet_Gen.json - */ -async function volumesGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main(): Promise { - await volumesGetMaximumSetGen(); - await volumesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesListByVolumeGroupSample.ts deleted file mode 100644 index f6bd8d67c666..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesListByVolumeGroupSample.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - VolumesListByVolumeGroupOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumesListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const xMsAccessSoftDeletedResources = "true"; - const options: VolumesListByVolumeGroupOptionalParams = { - xMsAccessSoftDeletedResources, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumesListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const xMsAccessSoftDeletedResources = "true"; - const options: VolumesListByVolumeGroupOptionalParams = { - xMsAccessSoftDeletedResources, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await volumesListByVolumeGroupMaximumSetGen(); - await volumesListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreBackupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreBackupSample.ts deleted file mode 100644 index 0b3b3022855f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreBackupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { VolumeNameList, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Validate whether a disk snapshot backup can be taken for list of volumes. - * - * @summary Validate whether a disk snapshot backup can be taken for list of volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreBackup_MaximumSet_Gen.json - */ -async function volumeGroupsPreBackupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeNameList = { volumeNames: ["volumename"] }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreBackupAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsPreBackupMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreRestoreSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreRestoreSample.ts deleted file mode 100644 index 0f8212e4909a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesPreRestoreSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DiskSnapshotList, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * - * @summary Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_PreRestore_MaximumSet_Gen.json - */ -async function volumeGroupsPreRestoreMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: DiskSnapshotList = { - diskSnapshotIds: [ - "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreRestoreAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsPreRestoreMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesUpdateSample.ts deleted file mode 100644 index 21dbd5e09895..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/volumesUpdateSample.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { VolumeUpdate, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Update_MaximumSet_Gen.json - */ -async function volumesUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = { - properties: { - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 7, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/Volumes_Update_MinimumSet_Gen.json - */ -async function volumesUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumesUpdateMaximumSetGen(); - await volumesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md deleted file mode 100644 index a94e72857bea..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [elasticSansCreateSample.js][elasticsanscreatesample] | Create ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Create_MaximumSet_Gen.json | -| [elasticSansDeleteSample.js][elasticsansdeletesample] | Delete a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Delete_MaximumSet_Gen.json | -| [elasticSansGetSample.js][elasticsansgetsample] | Get a ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Get_MaximumSet_Gen.json | -| [elasticSansListByResourceGroupSample.js][elasticsanslistbyresourcegroupsample] | Gets a list of ElasticSan in a resource group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | -| [elasticSansListBySubscriptionSample.js][elasticsanslistbysubscriptionsample] | Gets a list of ElasticSans in a subscription x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json | -| [elasticSansUpdateSample.js][elasticsansupdatesample] | Update a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Update_MaximumSet_Gen.json | -| [operationsListSample.js][operationslistsample] | Gets a list of ElasticSan operations. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Operations_List_MaximumSet_Gen.json | -| [privateEndpointConnectionsCreateSample.js][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json | -| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | List all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json | -| [privateLinkResourcesListByElasticSanSample.js][privatelinkresourceslistbyelasticsansample] | Gets the private link resources that need to be created for a elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | -| [skusListSample.js][skuslistsample] | List all the available Skus in the region and information related to them x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Skus_List_MaximumSet_Gen.json | -| [volumeGroupsCreateSample.js][volumegroupscreatesample] | Create a Volume Group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Create_MaximumSet_Gen.json | -| [volumeGroupsDeleteSample.js][volumegroupsdeletesample] | Delete an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json | -| [volumeGroupsGetSample.js][volumegroupsgetsample] | Get an VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Get_MaximumSet_Gen.json | -| [volumeGroupsListByElasticSanSample.js][volumegroupslistbyelasticsansample] | List VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | -| [volumeGroupsUpdateSample.js][volumegroupsupdatesample] | Update an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Update_MaximumSet_Gen.json | -| [volumeSnapshotsCreateSample.js][volumesnapshotscreatesample] | Create a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json | -| [volumeSnapshotsDeleteSample.js][volumesnapshotsdeletesample] | Delete a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json | -| [volumeSnapshotsGetSample.js][volumesnapshotsgetsample] | Get a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json | -| [volumeSnapshotsListByVolumeGroupSample.js][volumesnapshotslistbyvolumegroupsample] | List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesCreateSample.js][volumescreatesample] | Create a Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Create_MaximumSet_Gen.json | -| [volumesDeleteSample.js][volumesdeletesample] | Delete an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Delete_MaximumSet_Gen.json | -| [volumesGetSample.js][volumesgetsample] | Get an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Get_MaximumSet_Gen.json | -| [volumesListByVolumeGroupSample.js][volumeslistbyvolumegroupsample] | List Volumes in a VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesUpdateSample.js][volumesupdatesample] | Update an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node elasticSansCreateSample.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 -cross-env ELASTICSANS_SUBSCRIPTION_ID="" ELASTICSANS_RESOURCE_GROUP="" node elasticSansCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js -[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js -[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js -[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js -[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js -[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js -[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js -[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js -[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js -[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js -[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js -[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js -[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js -[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js -[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js -[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js -[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js -[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js -[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js -[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js -[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js -[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js deleted file mode 100644 index a5f3dba033ce..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Create_MaximumSet_Gen.json - */ -async function elasticSansCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = { - location: "France Central", - properties: { - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, - }, - tags: { key9316: "ihndtieqibtob" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Create_MinimumSet_Gen.json - */ -async function elasticSansCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = { - location: "France Central", - properties: { - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main() { - elasticSansCreateMaximumSetGen(); - elasticSansCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js deleted file mode 100644 index a64d70980d79..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Delete_MaximumSet_Gen.json - */ -async function elasticSansDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait(resourceGroupName, elasticSanName); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Delete_MinimumSet_Gen.json - */ -async function elasticSansDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait(resourceGroupName, elasticSanName); - console.log(result); -} - -async function main() { - elasticSansDeleteMaximumSetGen(); - elasticSansDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js deleted file mode 100644 index 822a2ad447b8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Get_MaximumSet_Gen.json - */ -async function elasticSansGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get(resourceGroupName, elasticSanName); - console.log(result); -} - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Get_MinimumSet_Gen.json - */ -async function elasticSansGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get(resourceGroupName, elasticSanName); - console.log(result); -} - -async function main() { - elasticSansGetMaximumSetGen(); - elasticSansGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js deleted file mode 100644 index 9b5e14d0fb21..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. - * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json - */ -async function elasticSansListByResourceGroupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.elasticSans.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. - * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json - */ -async function elasticSansListByResourceGroupMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.elasticSans.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - elasticSansListByResourceGroupMaximumSetGen(); - elasticSansListByResourceGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js deleted file mode 100644 index 51df8fc47b71..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription - * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json - */ -async function elasticSansListBySubscriptionMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.elasticSans.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription - * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json - */ -async function elasticSansListBySubscriptionMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.elasticSans.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - elasticSansListBySubscriptionMaximumSetGen(); - elasticSansListBySubscriptionMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js deleted file mode 100644 index 1113e9dfde17..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Update_MaximumSet_Gen.json - */ -async function elasticSansUpdateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = { - properties: { - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", - }, - tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Update_MinimumSet_Gen.json - */ -async function elasticSansUpdateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main() { - elasticSansUpdateMaximumSetGen(); - elasticSansUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index a626e86ae087..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of ElasticSan operations. - * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen() { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSan operations. - * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsListMaximumSetGen(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js deleted file mode 100644 index 70109fc0b329..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters = { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters = { - properties: { privateLinkServiceConnectionState: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -async function main() { - privateEndpointConnectionsCreateMaximumSetGen(); - privateEndpointConnectionsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js deleted file mode 100644 index 5a5d472a6af2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - privateEndpointConnectionsDeleteMaximumSetGen(); - privateEndpointConnectionsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js deleted file mode 100644 index 1ffc361f99d7..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - privateEndpointConnectionsGetMaximumSetGen(); - privateEndpointConnectionsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js deleted file mode 100644 index 2dc9e095c782..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. - * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsListMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. - * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsListMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateEndpointConnectionsListMaximumSetGen(); - privateEndpointConnectionsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js deleted file mode 100644 index 19eef44693e2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main() { - privateLinkResourcesListByElasticSanMaximumSetGen(); - privateLinkResourcesListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/sample.env b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js deleted file mode 100644 index a66e03c8b154..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Skus_List_MaximumSet_Gen.json - */ -async function skusListMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const filter = "obwwdrkq"; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.skus.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Skus_List_MinimumSet_Gen.json - */ -async function skusListMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.skus.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - skusListMaximumSetGen(); - skusListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js deleted file mode 100644 index 770bf0a59d79..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Create_MaximumSet_Gen.json - */ -async function volumeGroupsCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { - identity: { type: "None", userAssignedIdentities: { key1006: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "gfhkfbozahmmwluqndfgxunssafa", - }, - keyVaultProperties: { - keyName: "lunpapamzeimppgobraxjt", - keyVaultUri: "https://microsoft.com/a", - keyVersion: "oemygbnfmqhijmonkqfqmy", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { - action: "Allow", - virtualNetworkResourceId: "bkhwaiqvvaguymsmnzzbzz", - }, - ], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Create_MinimumSet_Gen.json - */ -async function volumeGroupsCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - volumeGroupsCreateMaximumSetGen(); - volumeGroupsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js deleted file mode 100644 index bbd511157a94..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json - */ -async function volumeGroupsDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json - */ -async function volumeGroupsDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -async function main() { - volumeGroupsDeleteMaximumSetGen(); - volumeGroupsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js deleted file mode 100644 index 25e1fd487d80..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Get_MaximumSet_Gen.json - */ -async function volumeGroupsGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get(resourceGroupName, elasticSanName, volumeGroupName); - console.log(result); -} - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Get_MinimumSet_Gen.json - */ -async function volumeGroupsGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get(resourceGroupName, elasticSanName, volumeGroupName); - console.log(result); -} - -async function main() { - volumeGroupsGetMaximumSetGen(); - volumeGroupsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js deleted file mode 100644 index 82e6849373d0..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumeGroups.listByElasticSan(resourceGroupName, elasticSanName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumeGroups.listByElasticSan(resourceGroupName, elasticSanName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - volumeGroupsListByElasticSanMaximumSetGen(); - volumeGroupsListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js deleted file mode 100644 index 6a92aa9aae8d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Update_MaximumSet_Gen.json - */ -async function volumeGroupsUpdateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { - identity: { type: "None", userAssignedIdentities: { key1006: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "gfhkfbozahmmwluqndfgxunssafa", - }, - keyVaultProperties: { - keyName: "lunpapamzeimppgobraxjt", - keyVaultUri: "https://microsoft.com/a", - keyVersion: "oemygbnfmqhijmonkqfqmy", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { - action: "Allow", - virtualNetworkResourceId: "bkhwaiqvvaguymsmnzzbzz", - }, - ], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Update_MinimumSet_Gen.json - */ -async function volumeGroupsUpdateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - volumeGroupsUpdateMaximumSetGen(); - volumeGroupsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js deleted file mode 100644 index e89ca515666c..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json - */ -async function volumeSnapshotsCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json - */ -async function volumeSnapshotsCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -async function main() { - volumeSnapshotsCreateMaximumSetGen(); - volumeSnapshotsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js deleted file mode 100644 index e454b0ec048f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json - */ -async function volumeSnapshotsDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json - */ -async function volumeSnapshotsDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main() { - volumeSnapshotsDeleteMaximumSetGen(); - volumeSnapshotsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js deleted file mode 100644 index 35cb98efb3cf..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json - */ -async function volumeSnapshotsGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json - */ -async function volumeSnapshotsGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main() { - volumeSnapshotsGetMaximumSetGen(); - volumeSnapshotsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js deleted file mode 100644 index b2aabdda3f40..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const filter = "volumeName eq "; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - volumeSnapshotsListByVolumeGroupMaximumSetGen(); - volumeSnapshotsListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js deleted file mode 100644 index 40040b37ea16..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Create_MaximumSet_Gen.json - */ -async function volumesCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = { - properties: { - creationData: { createSource: "None", sourceId: "ARM Id of Resource" }, - managedBy: { resourceId: "mtkeip" }, - sizeGiB: 9, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Create_MinimumSet_Gen.json - */ -async function volumesCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = { properties: { sizeGiB: 9 } }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main() { - volumesCreateMaximumSetGen(); - volumesCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js deleted file mode 100644 index 4a0c518e54f9..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Delete_MaximumSet_Gen.json - */ -async function volumesDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const xMsDeleteSnapshots = "true"; - const xMsForceDelete = "true"; - const options = { - xMsDeleteSnapshots, - xMsForceDelete, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Delete_MinimumSet_Gen.json - */ -async function volumesDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main() { - volumesDeleteMaximumSetGen(); - volumesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js deleted file mode 100644 index 5a9e637b568c..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Get_MaximumSet_Gen.json - */ -async function volumesGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Get_MinimumSet_Gen.json - */ -async function volumesGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main() { - volumesGetMaximumSetGen(); - volumesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js deleted file mode 100644 index 11e21e9bbd12..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumesListByVolumeGroupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumesListByVolumeGroupMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - volumesListByVolumeGroupMaximumSetGen(); - volumesListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js deleted file mode 100644 index 28ec2c454381..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Update_MaximumSet_Gen.json - */ -async function volumesUpdateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = { properties: { sizeGiB: 11 } }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Update_MinimumSet_Gen.json - */ -async function volumesUpdateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main() { - volumesUpdateMaximumSetGen(); - volumesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md deleted file mode 100644 index 0cf2f6317983..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [elasticSansCreateSample.ts][elasticsanscreatesample] | Create ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Create_MaximumSet_Gen.json | -| [elasticSansDeleteSample.ts][elasticsansdeletesample] | Delete a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Delete_MaximumSet_Gen.json | -| [elasticSansGetSample.ts][elasticsansgetsample] | Get a ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Get_MaximumSet_Gen.json | -| [elasticSansListByResourceGroupSample.ts][elasticsanslistbyresourcegroupsample] | Gets a list of ElasticSan in a resource group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | -| [elasticSansListBySubscriptionSample.ts][elasticsanslistbysubscriptionsample] | Gets a list of ElasticSans in a subscription x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json | -| [elasticSansUpdateSample.ts][elasticsansupdatesample] | Update a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Update_MaximumSet_Gen.json | -| [operationsListSample.ts][operationslistsample] | Gets a list of ElasticSan operations. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Operations_List_MaximumSet_Gen.json | -| [privateEndpointConnectionsCreateSample.ts][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json | -| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | List all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json | -| [privateLinkResourcesListByElasticSanSample.ts][privatelinkresourceslistbyelasticsansample] | Gets the private link resources that need to be created for a elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | -| [skusListSample.ts][skuslistsample] | List all the available Skus in the region and information related to them x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Skus_List_MaximumSet_Gen.json | -| [volumeGroupsCreateSample.ts][volumegroupscreatesample] | Create a Volume Group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Create_MaximumSet_Gen.json | -| [volumeGroupsDeleteSample.ts][volumegroupsdeletesample] | Delete an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json | -| [volumeGroupsGetSample.ts][volumegroupsgetsample] | Get an VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Get_MaximumSet_Gen.json | -| [volumeGroupsListByElasticSanSample.ts][volumegroupslistbyelasticsansample] | List VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | -| [volumeGroupsUpdateSample.ts][volumegroupsupdatesample] | Update an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Update_MaximumSet_Gen.json | -| [volumeSnapshotsCreateSample.ts][volumesnapshotscreatesample] | Create a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json | -| [volumeSnapshotsDeleteSample.ts][volumesnapshotsdeletesample] | Delete a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json | -| [volumeSnapshotsGetSample.ts][volumesnapshotsgetsample] | Get a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json | -| [volumeSnapshotsListByVolumeGroupSample.ts][volumesnapshotslistbyvolumegroupsample] | List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesCreateSample.ts][volumescreatesample] | Create a Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Create_MaximumSet_Gen.json | -| [volumesDeleteSample.ts][volumesdeletesample] | Delete an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Delete_MaximumSet_Gen.json | -| [volumesGetSample.ts][volumesgetsample] | Get an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Get_MaximumSet_Gen.json | -| [volumesListByVolumeGroupSample.ts][volumeslistbyvolumegroupsample] | List Volumes in a VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesUpdateSample.ts][volumesupdatesample] | Update an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/elasticSansCreateSample.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 -cross-env ELASTICSANS_SUBSCRIPTION_ID="" ELASTICSANS_RESOURCE_GROUP="" node dist/elasticSansCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts -[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts -[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts -[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts -[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts -[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts -[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts -[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts -[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts -[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts -[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts -[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts -[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts -[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts -[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts -[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts -[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts -[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts -[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts -[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts -[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts -[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/sample.env b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts deleted file mode 100644 index d44a858e6d5e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSan, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Create_MaximumSet_Gen.json - */ -async function elasticSansCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { - location: "France Central", - properties: { - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, - }, - tags: { key9316: "ihndtieqibtob" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Create_MinimumSet_Gen.json - */ -async function elasticSansCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { - location: "France Central", - properties: { - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - elasticSansCreateMaximumSetGen(); - elasticSansCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts deleted file mode 100644 index 81353e730afd..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Delete_MaximumSet_Gen.json - */ -async function elasticSansDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Delete_MinimumSet_Gen.json - */ -async function elasticSansDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main(): Promise { - elasticSansDeleteMaximumSetGen(); - elasticSansDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts deleted file mode 100644 index 39273a4f00f5..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Get_MaximumSet_Gen.json - */ -async function elasticSansGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Get_MinimumSet_Gen.json - */ -async function elasticSansGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main(): Promise { - elasticSansGetMaximumSetGen(); - elasticSansGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts deleted file mode 100644 index 8e89e701a789..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. - * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json - */ -async function elasticSansListByResourceGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. - * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json - */ -async function elasticSansListByResourceGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - elasticSansListByResourceGroupMaximumSetGen(); - elasticSansListByResourceGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts deleted file mode 100644 index 448bf40e20f1..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription - * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json - */ -async function elasticSansListBySubscriptionMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.elasticSans.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription - * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json - */ -async function elasticSansListBySubscriptionMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.elasticSans.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - elasticSansListBySubscriptionMaximumSetGen(); - elasticSansListBySubscriptionMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts deleted file mode 100644 index 60fd577b6ba2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanUpdate, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Update_MaximumSet_Gen.json - */ -async function elasticSansUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = { - properties: { - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", - }, - tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/ElasticSans_Update_MinimumSet_Gen.json - */ -async function elasticSansUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - elasticSansUpdateMaximumSetGen(); - elasticSansUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index 8f6867455697..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of ElasticSan operations. - * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of ElasticSan operations. - * - * @summary Gets a list of ElasticSan operations. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - operationsListMaximumSetGen(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts deleted file mode 100644 index 144f7817b1f3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - PrivateEndpointConnection, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { privateLinkServiceConnectionState: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - privateEndpointConnectionsCreateMaximumSetGen(); - privateEndpointConnectionsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index eb12c6432fe2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main(): Promise { - privateEndpointConnectionsDeleteMaximumSetGen(); - privateEndpointConnectionsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index adfa86ba26ad..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main(): Promise { - privateEndpointConnectionsGetMaximumSetGen(); - privateEndpointConnectionsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts deleted file mode 100644 index 10c79282b795..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. - * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. - * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - privateEndpointConnectionsListMaximumSetGen(); - privateEndpointConnectionsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts deleted file mode 100644 index d8d4b2671ecb..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main(): Promise { - privateLinkResourcesListByElasticSanMaximumSetGen(); - privateLinkResourcesListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts deleted file mode 100644 index 24a4e453354e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SkusListOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Skus_List_MaximumSet_Gen.json - */ -async function skusListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const filter = "obwwdrkq"; - const options: SkusListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.skus.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Skus_List_MinimumSet_Gen.json - */ -async function skusListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.skus.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - skusListMaximumSetGen(); - skusListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts deleted file mode 100644 index 39321af95f81..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { VolumeGroup, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Create_MaximumSet_Gen.json - */ -async function volumeGroupsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = { - identity: { type: "None", userAssignedIdentities: { key1006: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "gfhkfbozahmmwluqndfgxunssafa", - }, - keyVaultProperties: { - keyName: "lunpapamzeimppgobraxjt", - keyVaultUri: "https://microsoft.com/a", - keyVersion: "oemygbnfmqhijmonkqfqmy", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { - action: "Allow", - virtualNetworkResourceId: "bkhwaiqvvaguymsmnzzbzz", - }, - ], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Create_MinimumSet_Gen.json - */ -async function volumeGroupsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - volumeGroupsCreateMaximumSetGen(); - volumeGroupsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts deleted file mode 100644 index 321e21bed8ad..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json - */ -async function volumeGroupsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json - */ -async function volumeGroupsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -async function main(): Promise { - volumeGroupsDeleteMaximumSetGen(); - volumeGroupsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts deleted file mode 100644 index 52c7fb166f4d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Get_MaximumSet_Gen.json - */ -async function volumeGroupsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Get_MinimumSet_Gen.json - */ -async function volumeGroupsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -async function main(): Promise { - volumeGroupsGetMaximumSetGen(); - volumeGroupsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts deleted file mode 100644 index 402d3db0b6e2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - volumeGroupsListByElasticSanMaximumSetGen(); - volumeGroupsListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts deleted file mode 100644 index 1aaf7f8841dc..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { VolumeGroupUpdate, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Update_MaximumSet_Gen.json - */ -async function volumeGroupsUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = { - identity: { type: "None", userAssignedIdentities: { key1006: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "gfhkfbozahmmwluqndfgxunssafa", - }, - keyVaultProperties: { - keyName: "lunpapamzeimppgobraxjt", - keyVaultUri: "https://microsoft.com/a", - keyVersion: "oemygbnfmqhijmonkqfqmy", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { - action: "Allow", - virtualNetworkResourceId: "bkhwaiqvvaguymsmnzzbzz", - }, - ], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeGroups_Update_MinimumSet_Gen.json - */ -async function volumeGroupsUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - volumeGroupsUpdateMaximumSetGen(); - volumeGroupsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts deleted file mode 100644 index 1082ef3f4046..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Snapshot, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json - */ -async function volumeSnapshotsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json - */ -async function volumeSnapshotsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - volumeSnapshotsCreateMaximumSetGen(); - volumeSnapshotsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts deleted file mode 100644 index bbb5de622875..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json - */ -async function volumeSnapshotsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json - */ -async function volumeSnapshotsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main(): Promise { - volumeSnapshotsDeleteMaximumSetGen(); - volumeSnapshotsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts deleted file mode 100644 index 7f54dd3471e9..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json - */ -async function volumeSnapshotsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json - */ -async function volumeSnapshotsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main(): Promise { - volumeSnapshotsGetMaximumSetGen(); - volumeSnapshotsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts deleted file mode 100644 index 6756fdd73417..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - VolumeSnapshotsListByVolumeGroupOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const filter = "volumeName eq "; - const options: VolumeSnapshotsListByVolumeGroupOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - volumeSnapshotsListByVolumeGroupMaximumSetGen(); - volumeSnapshotsListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts deleted file mode 100644 index 129155ed803e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Volume, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Create_MaximumSet_Gen.json - */ -async function volumesCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { - properties: { - creationData: { createSource: "None", sourceId: "ARM Id of Resource" }, - managedBy: { resourceId: "mtkeip" }, - sizeGiB: 9, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Create_MinimumSet_Gen.json - */ -async function volumesCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { properties: { sizeGiB: 9 } }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - volumesCreateMaximumSetGen(); - volumesCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts deleted file mode 100644 index 6baec4f2421d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - VolumesDeleteOptionalParams, - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Delete_MaximumSet_Gen.json - */ -async function volumesDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const xMsDeleteSnapshots = "true"; - const xMsForceDelete = "true"; - const options: VolumesDeleteOptionalParams = { - xMsDeleteSnapshots, - xMsForceDelete, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Delete_MinimumSet_Gen.json - */ -async function volumesDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main(): Promise { - volumesDeleteMaximumSetGen(); - volumesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts deleted file mode 100644 index bbe0a2ada9c4..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Get_MaximumSet_Gen.json - */ -async function volumesGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Get_MinimumSet_Gen.json - */ -async function volumesGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main(): Promise { - volumesGetMaximumSetGen(); - volumesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts deleted file mode 100644 index a9fe820dad16..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumesListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumesListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - volumesListByVolumeGroupMaximumSetGen(); - volumesListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts deleted file mode 100644 index 28134e572c52..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { VolumeUpdate, ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Update_MaximumSet_Gen.json - */ -async function volumesUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = { properties: { sizeGiB: 11 } }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/examples/Volumes_Update_MinimumSet_Gen.json - */ -async function volumesUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - volumesUpdateMaximumSetGen(); - volumesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/tsconfig.json b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md new file mode 100644 index 000000000000..cf625441dc6f --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md @@ -0,0 +1,106 @@ +# @azure/arm-elasticsan client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for @azure/arm-elasticsan in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [elasticSansCreateSample.js][elasticsanscreatesample] | create ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json | +| [elasticSansDeleteSample.js][elasticsansdeletesample] | delete a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json | +| [elasticSansGetSample.js][elasticsansgetsample] | get a ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json | +| [elasticSansListByResourceGroupSample.js][elasticsanslistbyresourcegroupsample] | gets a list of ElasticSan in a resource group. x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | +| [elasticSansListBySubscriptionSample.js][elasticsanslistbysubscriptionsample] | gets a list of ElasticSans in a subscription x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json | +| [elasticSansUpdateSample.js][elasticsansupdatesample] | update a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json | +| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json | +| [privateEndpointConnectionsCreateSample.js][privateendpointconnectionscreatesample] | update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json | +| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | list all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json | +| [privateLinkResourcesListByElasticSanSample.js][privatelinkresourceslistbyelasticsansample] | gets the private link resources that need to be created for a elastic San. x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | +| [skusListSample.js][skuslistsample] | list all the available Skus in the region and information related to them x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json | +| [volumeGroupsCreateSample.js][volumegroupscreatesample] | create a Volume Group. x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json | +| [volumeGroupsDeleteSample.js][volumegroupsdeletesample] | delete an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json | +| [volumeGroupsGetSample.js][volumegroupsgetsample] | get an VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json | +| [volumeGroupsListByElasticSanSample.js][volumegroupslistbyelasticsansample] | list VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | +| [volumeGroupsUpdateSample.js][volumegroupsupdatesample] | update an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json | +| [volumeSnapshotsCreateSample.js][volumesnapshotscreatesample] | create a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json | +| [volumeSnapshotsDeleteSample.js][volumesnapshotsdeletesample] | delete a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json | +| [volumeSnapshotsGetSample.js][volumesnapshotsgetsample] | get a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json | +| [volumeSnapshotsListByVolumeGroupSample.js][volumesnapshotslistbyvolumegroupsample] | list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesCreateSample.js][volumescreatesample] | create a Volume. x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json | +| [volumesDeleteSample.js][volumesdeletesample] | delete an Volume. x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json | +| [volumesGetSample.js][volumesgetsample] | get an Volume. x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json | +| [volumesListByVolumeGroupSample.js][volumeslistbyvolumegroupsample] | list Volumes in a VolumeGroup. x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesPreBackupSample.js][volumesprebackupsample] | validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json | +| [volumesPreRestoreSample.js][volumesprerestoresample] | validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json | +| [volumesUpdateSample.js][volumesupdatesample] | update an Volume. x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node elasticSansCreateSample.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 +node elasticSansCreateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js +[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js +[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js +[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js +[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js +[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js +[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js +[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js +[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js +[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js +[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js +[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js +[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js +[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js +[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js +[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js +[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js +[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js new file mode 100644 index 000000000000..8546fcc60505 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create ElasticSan. + * + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json + */ +async function elasticSansCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + location: "France Central", + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + availabilityZones: ["1"], + baseSizeTiB: 5, + extendedCapacitySizeTiB: 25, + publicNetworkAccess: "Enabled", + sku: { name: "Premium_LRS", tier: "Premium" }, + }, + tags: { key9316: "ihndtieqibtob" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create ElasticSan. + * + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MinimumSet_Gen.json + */ +async function elasticSansCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + location: "France Central", + properties: { + baseSizeTiB: 15, + extendedCapacitySizeTiB: 27, + sku: { name: "Premium_LRS" }, + }, + }); + console.log(result); +} + +async function main() { + await elasticSansCreateMaximumSetGen(); + await elasticSansCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js new file mode 100644 index 000000000000..d36487a88c75 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a Elastic San. + * + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json + */ +async function elasticSansDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); +} + +/** + * This sample demonstrates how to delete a Elastic San. + * + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MinimumSet_Gen.json + */ +async function elasticSansDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); +} + +async function main() { + await elasticSansDeleteMaximumSetGen(); + await elasticSansDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js new file mode 100644 index 000000000000..0c66343632cb --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a ElasticSan. + * + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json + */ +async function elasticSansGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + console.log(result); +} + +/** + * This sample demonstrates how to get a ElasticSan. + * + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MinimumSet_Gen.json + */ +async function elasticSansGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + console.log(result); +} + +async function main() { + await elasticSansGetMaximumSetGen(); + await elasticSansGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js new file mode 100644 index 000000000000..43425daa3ffd --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + */ +async function elasticSansListByResourceGroupMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + */ +async function elasticSansListByResourceGroupMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await elasticSansListByResourceGroupMaximumSetGen(); + await elasticSansListByResourceGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansListBySubscriptionSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js similarity index 52% rename from sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansListBySubscriptionSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js index b8d755be6229..fbd12a16fea1 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/elasticSansListBySubscriptionSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js @@ -1,48 +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 { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ async function elasticSansListBySubscriptionMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ async function elasticSansListBySubscriptionMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js new file mode 100644 index 000000000000..4ada1c52889d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a Elastic San. + * + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json + */ +async function elasticSansUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", + }, + tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to update a Elastic San. + * + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MinimumSet_Gen.json + */ +async function elasticSansUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", {}); + console.log(result); +} + +async function main() { + await elasticSansUpdateMaximumSetGen(); + await elasticSansUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js new file mode 100644 index 000000000000..6f3cf9abc31f --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await operationsListMaximumSetGen(); + await operationsListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/package.json b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/package.json similarity index 79% rename from sdk/elasticsans/arm-elasticsan/samples/v1/javascript/package.json rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/package.json index 45c81bebc00d..666539d4ef7b 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/package.json +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-elasticsan-js", "private": true, "version": "1.0.0", - "description": " client library samples for JavaScript", + "description": "@azure/arm-elasticsan client library samples for JavaScript", "engines": { "node": ">=20.0.0" }, @@ -14,6 +14,7 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" @@ -27,6 +28,9 @@ "dependencies": { "@azure/arm-elasticsan": "latest", "dotenv": "latest", - "@azure/identity": "^4.0.1" + "@azure/identity": "^4.11.1" + }, + "devDependencies": { + "cross-env": "latest" } } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js new file mode 100644 index 000000000000..01924887ee54 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { + properties: { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { properties: { privateLinkServiceConnectionState: {} } }, + ); + console.log(result); +} + +async function main() { + await privateEndpointConnectionsCreateMaximumSetGen(); + await privateEndpointConnectionsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js new file mode 100644 index 000000000000..140151618cc1 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); +} + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); +} + +async function main() { + await privateEndpointConnectionsDeleteMaximumSetGen(); + await privateEndpointConnectionsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..229aff5a10c3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); + console.log(result); +} + +async function main() { + await privateEndpointConnectionsGetMaximumSetGen(); + await privateEndpointConnectionsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js new file mode 100644 index 000000000000..00aeb2a50d1b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.privateEndpointConnections.list( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.privateEndpointConnections.list( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await privateEndpointConnectionsListMaximumSetGen(); + await privateEndpointConnectionsListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js new file mode 100644 index 000000000000..da29e9a59320 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + "resourcegroupname", + "elasticsanname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + "resourcegroupname", + "elasticsanname", + ); + console.log(result); +} + +async function main() { + await privateLinkResourcesListByElasticSanMaximumSetGen(); + await privateLinkResourcesListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/sample.env b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/sample.env similarity index 100% rename from sdk/elasticsans/arm-elasticsan/samples/v1-beta/javascript/sample.env rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/sample.env diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js new file mode 100644 index 000000000000..ee66ec740044 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list all the available Skus in the region and information related to them + * + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json + */ +async function skusListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.skus.list({ filter: "obwwdrkq" })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list all the available Skus in the region and information related to them + * + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MinimumSet_Gen.json + */ +async function skusListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.skus.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await skusListMaximumSetGen(); + await skusListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js new file mode 100644 index 000000000000..ebafbdfa3694 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create a Volume Group. + * + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json + */ +async function volumeGroupsCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { + encryptionUserAssignedIdentity: "vgbeephfgecgg", + }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume Group. + * + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MinimumSet_Gen.json + */ +async function volumeGroupsCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, + ); + console.log(result); +} + +async function main() { + await volumeGroupsCreateMaximumSetGen(); + await volumeGroupsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js new file mode 100644 index 000000000000..d621f38ce0b2 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete an VolumeGroup. + * + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json + */ +async function volumeGroupsDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); +} + +/** + * This sample demonstrates how to delete an VolumeGroup. + * + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MinimumSet_Gen.json + */ +async function volumeGroupsDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); +} + +async function main() { + await volumeGroupsDeleteMaximumSetGen(); + await volumeGroupsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js new file mode 100644 index 000000000000..d3ef3cb3ce45 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get an VolumeGroups. + * + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json + */ +async function volumeGroupsGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get an VolumeGroups. + * + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MinimumSet_Gen.json + */ +async function volumeGroupsGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + ); + console.log(result); +} + +async function main() { + await volumeGroupsGetMaximumSetGen(); + await volumeGroupsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js new file mode 100644 index 000000000000..631796fbda96 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list VolumeGroups. + * + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + */ +async function volumeGroupsListByElasticSanMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeGroups.listByElasticSan( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list VolumeGroups. + * + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + */ +async function volumeGroupsListByElasticSanMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeGroups.listByElasticSan( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await volumeGroupsListByElasticSanMaximumSetGen(); + await volumeGroupsListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js new file mode 100644 index 000000000000..dc661bdb46f5 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update an VolumeGroup. + * + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json + */ +async function volumeGroupsUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { + encryptionUserAssignedIdentity: "vgbeephfgecgg", + }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update an VolumeGroup. + * + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MinimumSet_Gen.json + */ +async function volumeGroupsUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, + ); + console.log(result); +} + +async function main() { + await volumeGroupsUpdateMaximumSetGen(); + await volumeGroupsUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js new file mode 100644 index 000000000000..fd3b55af627f --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create a Volume Snapshot. + * + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json + */ +async function volumeSnapshotsCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume Snapshot. + * + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MinimumSet_Gen.json + */ +async function volumeSnapshotsCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }, + ); + console.log(result); +} + +async function main() { + await volumeSnapshotsCreateMaximumSetGen(); + await volumeSnapshotsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js new file mode 100644 index 000000000000..82bc0741abfc --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a Volume Snapshot. + * + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json + */ +async function volumeSnapshotsDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); +} + +/** + * This sample demonstrates how to delete a Volume Snapshot. + * + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MinimumSet_Gen.json + */ +async function volumeSnapshotsDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); +} + +async function main() { + await volumeSnapshotsDeleteMaximumSetGen(); + await volumeSnapshotsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js new file mode 100644 index 000000000000..7271fd913ba7 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a Volume Snapshot. + * + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json + */ +async function volumeSnapshotsGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get a Volume Snapshot. + * + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MinimumSet_Gen.json + */ +async function volumeSnapshotsGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); + console.log(result); +} + +async function main() { + await volumeSnapshotsGetMaximumSetGen(); + await volumeSnapshotsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js new file mode 100644 index 000000000000..4b891d95a2c5 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { filter: "volumeName eq " }, + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await volumeSnapshotsListByVolumeGroupMaximumSetGen(); + await volumeSnapshotsListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js new file mode 100644 index 000000000000..7122c688916f --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create a Volume. + * + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json + */ +async function volumesCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { + properties: { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume. + * + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MinimumSet_Gen.json + */ +async function volumesCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { properties: { sizeGiB: 9 } }, + ); + console.log(result); +} + +async function main() { + await volumesCreateMaximumSetGen(); + await volumesCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js new file mode 100644 index 000000000000..c8e310e3895a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete an Volume. + * + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json + */ +async function volumesDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { xMsDeleteSnapshots: "true", xMsForceDelete: "true" }, + ); +} + +/** + * This sample demonstrates how to delete an Volume. + * + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MinimumSet_Gen.json + */ +async function volumesDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); +} + +async function main() { + await volumesDeleteMaximumSetGen(); + await volumesDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js new file mode 100644 index 000000000000..8987e9ec5d3e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get an Volume. + * + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json + */ +async function volumesGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get an Volume. + * + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MinimumSet_Gen.json + */ +async function volumesGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); + console.log(result); +} + +async function main() { + await volumesGetMaximumSetGen(); + await volumesGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js new file mode 100644 index 000000000000..00e72f6c8cbe --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list Volumes in a VolumeGroup. + * + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumesListByVolumeGroupMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list Volumes in a VolumeGroup. + * + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumesListByVolumeGroupMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await volumesListByVolumeGroupMaximumSetGen(); + await volumesListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js new file mode 100644 index 000000000000..ddb7ebd7b6e3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to validate whether a disk snapshot backup can be taken for list of volumes. + * + * @summary validate whether a disk snapshot backup can be taken for list of volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json + */ +async function volumeGroupsPreBackupMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.preBackup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { volumeNames: ["volumename"] }, + ); + console.log(result); +} + +async function main() { + await volumeGroupsPreBackupMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js new file mode 100644 index 000000000000..4aacd52202f7 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * + * @summary validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json + */ +async function volumeGroupsPreRestoreMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.preRestore( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + diskSnapshotIds: [ + "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", + ], + }, + ); + console.log(result); +} + +async function main() { + await volumeGroupsPreRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js new file mode 100644 index 000000000000..af4209331362 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update an Volume. + * + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json + */ +async function volumesUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { + properties: { + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 7, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update an Volume. + * + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MinimumSet_Gen.json + */ +async function volumesUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + {}, + ); + console.log(result); +} + +async function main() { + await volumesUpdateMaximumSetGen(); + await volumesUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md new file mode 100644 index 000000000000..86f4280f52cc --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md @@ -0,0 +1,119 @@ +# @azure/arm-elasticsan client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for @azure/arm-elasticsan in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [elasticSansCreateSample.ts][elasticsanscreatesample] | create ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json | +| [elasticSansDeleteSample.ts][elasticsansdeletesample] | delete a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json | +| [elasticSansGetSample.ts][elasticsansgetsample] | get a ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json | +| [elasticSansListByResourceGroupSample.ts][elasticsanslistbyresourcegroupsample] | gets a list of ElasticSan in a resource group. x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | +| [elasticSansListBySubscriptionSample.ts][elasticsanslistbysubscriptionsample] | gets a list of ElasticSans in a subscription x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json | +| [elasticSansUpdateSample.ts][elasticsansupdatesample] | update a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json | +| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json | +| [privateEndpointConnectionsCreateSample.ts][privateendpointconnectionscreatesample] | update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json | +| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | list all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json | +| [privateLinkResourcesListByElasticSanSample.ts][privatelinkresourceslistbyelasticsansample] | gets the private link resources that need to be created for a elastic San. x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | +| [skusListSample.ts][skuslistsample] | list all the available Skus in the region and information related to them x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json | +| [volumeGroupsCreateSample.ts][volumegroupscreatesample] | create a Volume Group. x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json | +| [volumeGroupsDeleteSample.ts][volumegroupsdeletesample] | delete an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json | +| [volumeGroupsGetSample.ts][volumegroupsgetsample] | get an VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json | +| [volumeGroupsListByElasticSanSample.ts][volumegroupslistbyelasticsansample] | list VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | +| [volumeGroupsUpdateSample.ts][volumegroupsupdatesample] | update an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json | +| [volumeSnapshotsCreateSample.ts][volumesnapshotscreatesample] | create a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json | +| [volumeSnapshotsDeleteSample.ts][volumesnapshotsdeletesample] | delete a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json | +| [volumeSnapshotsGetSample.ts][volumesnapshotsgetsample] | get a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json | +| [volumeSnapshotsListByVolumeGroupSample.ts][volumesnapshotslistbyvolumegroupsample] | list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesCreateSample.ts][volumescreatesample] | create a Volume. x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json | +| [volumesDeleteSample.ts][volumesdeletesample] | delete an Volume. x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json | +| [volumesGetSample.ts][volumesgetsample] | get an Volume. x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json | +| [volumesListByVolumeGroupSample.ts][volumeslistbyvolumegroupsample] | list Volumes in a VolumeGroup. x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesPreBackupSample.ts][volumesprebackupsample] | validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json | +| [volumesPreRestoreSample.ts][volumesprerestoresample] | validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json | +| [volumesUpdateSample.ts][volumesupdatesample] | update an Volume. x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/elasticSansCreateSample.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 +node dist/elasticSansCreateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts +[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts +[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts +[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts +[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts +[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts +[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts +[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts +[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts +[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts +[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts +[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts +[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts +[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts +[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts +[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts +[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts +[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/package.json b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/package.json similarity index 80% rename from sdk/elasticsans/arm-elasticsan/samples/v1/typescript/package.json rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/package.json index 74936a44b28b..d7dd3a2f35cb 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/package.json +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-elasticsan-ts", "private": true, "version": "1.0.0", - "description": " client library samples for TypeScript", + "description": "@azure/arm-elasticsan client library samples for TypeScript", "engines": { "node": ">=20.0.0" }, @@ -18,6 +18,7 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" @@ -31,11 +32,12 @@ "dependencies": { "@azure/arm-elasticsan": "latest", "dotenv": "latest", - "@azure/identity": "^4.0.1" + "@azure/identity": "^4.11.1" }, "devDependencies": { "@types/node": "^20.0.0", - "typescript": "~5.8.2", - "rimraf": "latest" + "cross-env": "latest", + "rimraf": "latest", + "typescript": "~5.9.3" } } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/sample.env b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/sample.env similarity index 100% rename from sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/sample.env rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/sample.env diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts new file mode 100644 index 000000000000..1c7a449b10be --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create ElasticSan. + * + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json + */ +async function elasticSansCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + location: "France Central", + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + availabilityZones: ["1"], + baseSizeTiB: 5, + extendedCapacitySizeTiB: 25, + publicNetworkAccess: "Enabled", + sku: { name: "Premium_LRS", tier: "Premium" }, + }, + tags: { key9316: "ihndtieqibtob" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create ElasticSan. + * + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MinimumSet_Gen.json + */ +async function elasticSansCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + location: "France Central", + properties: { + baseSizeTiB: 15, + extendedCapacitySizeTiB: 27, + sku: { name: "Premium_LRS" }, + }, + }); + console.log(result); +} + +async function main(): Promise { + await elasticSansCreateMaximumSetGen(); + await elasticSansCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts new file mode 100644 index 000000000000..9bcc04f5edfd --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a Elastic San. + * + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json + */ +async function elasticSansDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); +} + +/** + * This sample demonstrates how to delete a Elastic San. + * + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MinimumSet_Gen.json + */ +async function elasticSansDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); +} + +async function main(): Promise { + await elasticSansDeleteMaximumSetGen(); + await elasticSansDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts new file mode 100644 index 000000000000..e80a93aa8f0e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a ElasticSan. + * + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json + */ +async function elasticSansGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + console.log(result); +} + +/** + * This sample demonstrates how to get a ElasticSan. + * + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MinimumSet_Gen.json + */ +async function elasticSansGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + console.log(result); +} + +async function main(): Promise { + await elasticSansGetMaximumSetGen(); + await elasticSansGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts new file mode 100644 index 000000000000..a2ac1576753a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + */ +async function elasticSansListByResourceGroupMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + */ +async function elasticSansListByResourceGroupMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await elasticSansListByResourceGroupMaximumSetGen(); + await elasticSansListByResourceGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansListBySubscriptionSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts similarity index 52% rename from sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansListBySubscriptionSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts index 4d98342f83c2..1fc752343bbf 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/src/elasticSansListBySubscriptionSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts @@ -1,50 +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 { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ async function elasticSansListBySubscriptionMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ async function elasticSansListBySubscriptionMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts new file mode 100644 index 000000000000..084de695151d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a Elastic San. + * + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json + */ +async function elasticSansUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", + }, + tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to update a Elastic San. + * + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MinimumSet_Gen.json + */ +async function elasticSansUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", {}); + console.log(result); +} + +async function main(): Promise { + await elasticSansUpdateMaximumSetGen(); + await elasticSansUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..61d0c64318ce --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await operationsListMaximumSetGen(); + await operationsListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts new file mode 100644 index 000000000000..6fd03552435e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { + properties: { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { properties: { privateLinkServiceConnectionState: {} } }, + ); + console.log(result); +} + +async function main(): Promise { + await privateEndpointConnectionsCreateMaximumSetGen(); + await privateEndpointConnectionsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..abc29f16677e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); +} + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); +} + +async function main(): Promise { + await privateEndpointConnectionsDeleteMaximumSetGen(); + await privateEndpointConnectionsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..f7fea37d0372 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); + console.log(result); +} + +async function main(): Promise { + await privateEndpointConnectionsGetMaximumSetGen(); + await privateEndpointConnectionsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts new file mode 100644 index 000000000000..3616a6035b66 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.privateEndpointConnections.list( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.privateEndpointConnections.list( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await privateEndpointConnectionsListMaximumSetGen(); + await privateEndpointConnectionsListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts new file mode 100644 index 000000000000..233d5378e795 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + "resourcegroupname", + "elasticsanname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + "resourcegroupname", + "elasticsanname", + ); + console.log(result); +} + +async function main(): Promise { + await privateLinkResourcesListByElasticSanMaximumSetGen(); + await privateLinkResourcesListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts new file mode 100644 index 000000000000..f70a88942fed --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list all the available Skus in the region and information related to them + * + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json + */ +async function skusListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.skus.list({ filter: "obwwdrkq" })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list all the available Skus in the region and information related to them + * + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MinimumSet_Gen.json + */ +async function skusListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.skus.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await skusListMaximumSetGen(); + await skusListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts new file mode 100644 index 000000000000..4e691081e428 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create a Volume Group. + * + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json + */ +async function volumeGroupsCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { + encryptionUserAssignedIdentity: "vgbeephfgecgg", + }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume Group. + * + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MinimumSet_Gen.json + */ +async function volumeGroupsCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsCreateMaximumSetGen(); + await volumeGroupsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts new file mode 100644 index 000000000000..ac965081580a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete an VolumeGroup. + * + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json + */ +async function volumeGroupsDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); +} + +/** + * This sample demonstrates how to delete an VolumeGroup. + * + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MinimumSet_Gen.json + */ +async function volumeGroupsDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); +} + +async function main(): Promise { + await volumeGroupsDeleteMaximumSetGen(); + await volumeGroupsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts new file mode 100644 index 000000000000..a128c689a18d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get an VolumeGroups. + * + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json + */ +async function volumeGroupsGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get an VolumeGroups. + * + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MinimumSet_Gen.json + */ +async function volumeGroupsGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsGetMaximumSetGen(); + await volumeGroupsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts new file mode 100644 index 000000000000..380a5aa9623f --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list VolumeGroups. + * + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + */ +async function volumeGroupsListByElasticSanMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeGroups.listByElasticSan( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list VolumeGroups. + * + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + */ +async function volumeGroupsListByElasticSanMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeGroups.listByElasticSan( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await volumeGroupsListByElasticSanMaximumSetGen(); + await volumeGroupsListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts new file mode 100644 index 000000000000..c5238105f486 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update an VolumeGroup. + * + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json + */ +async function volumeGroupsUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { + encryptionUserAssignedIdentity: "vgbeephfgecgg", + }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update an VolumeGroup. + * + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MinimumSet_Gen.json + */ +async function volumeGroupsUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsUpdateMaximumSetGen(); + await volumeGroupsUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts new file mode 100644 index 000000000000..35de4b6c63f4 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create a Volume Snapshot. + * + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json + */ +async function volumeSnapshotsCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume Snapshot. + * + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MinimumSet_Gen.json + */ +async function volumeSnapshotsCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await volumeSnapshotsCreateMaximumSetGen(); + await volumeSnapshotsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts new file mode 100644 index 000000000000..e8db98290e6c --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a Volume Snapshot. + * + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json + */ +async function volumeSnapshotsDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); +} + +/** + * This sample demonstrates how to delete a Volume Snapshot. + * + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MinimumSet_Gen.json + */ +async function volumeSnapshotsDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); +} + +async function main(): Promise { + await volumeSnapshotsDeleteMaximumSetGen(); + await volumeSnapshotsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts new file mode 100644 index 000000000000..7f78d243e440 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a Volume Snapshot. + * + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json + */ +async function volumeSnapshotsGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get a Volume Snapshot. + * + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MinimumSet_Gen.json + */ +async function volumeSnapshotsGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); + console.log(result); +} + +async function main(): Promise { + await volumeSnapshotsGetMaximumSetGen(); + await volumeSnapshotsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts new file mode 100644 index 000000000000..1e5259e46a94 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { filter: "volumeName eq " }, + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await volumeSnapshotsListByVolumeGroupMaximumSetGen(); + await volumeSnapshotsListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts new file mode 100644 index 000000000000..df22ebd67cee --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create a Volume. + * + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json + */ +async function volumesCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { + properties: { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume. + * + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MinimumSet_Gen.json + */ +async function volumesCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { properties: { sizeGiB: 9 } }, + ); + console.log(result); +} + +async function main(): Promise { + await volumesCreateMaximumSetGen(); + await volumesCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts new file mode 100644 index 000000000000..39b9e7aa96bf --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete an Volume. + * + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json + */ +async function volumesDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { xMsDeleteSnapshots: "true", xMsForceDelete: "true" }, + ); +} + +/** + * This sample demonstrates how to delete an Volume. + * + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MinimumSet_Gen.json + */ +async function volumesDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); +} + +async function main(): Promise { + await volumesDeleteMaximumSetGen(); + await volumesDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts new file mode 100644 index 000000000000..3a086869b011 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get an Volume. + * + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json + */ +async function volumesGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get an Volume. + * + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MinimumSet_Gen.json + */ +async function volumesGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); + console.log(result); +} + +async function main(): Promise { + await volumesGetMaximumSetGen(); + await volumesGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts new file mode 100644 index 000000000000..a0050c15050a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list Volumes in a VolumeGroup. + * + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumesListByVolumeGroupMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list Volumes in a VolumeGroup. + * + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumesListByVolumeGroupMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await volumesListByVolumeGroupMaximumSetGen(); + await volumesListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts new file mode 100644 index 000000000000..b75df801c2bf --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to validate whether a disk snapshot backup can be taken for list of volumes. + * + * @summary validate whether a disk snapshot backup can be taken for list of volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json + */ +async function volumeGroupsPreBackupMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.preBackup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { volumeNames: ["volumename"] }, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsPreBackupMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts new file mode 100644 index 000000000000..1ab7276bf849 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * + * @summary validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json + */ +async function volumeGroupsPreRestoreMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.preRestore( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + diskSnapshotIds: [ + "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", + ], + }, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsPreRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts new file mode 100644 index 000000000000..7142de252f04 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update an Volume. + * + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json + */ +async function volumesUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { + properties: { + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 7, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update an Volume. + * + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MinimumSet_Gen.json + */ +async function volumesUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await volumesUpdateMaximumSetGen(); + await volumesUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/tsconfig.json b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/tsconfig.json similarity index 100% rename from sdk/elasticsans/arm-elasticsan/samples/v1-beta/typescript/tsconfig.json rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/tsconfig.json diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts new file mode 100644 index 000000000000..36ecf17053b9 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import type { AzureSupportedClouds } from "../static-helpers/cloudSettingHelpers.js"; +import { getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import type { Client, ClientOptions } from "@azure-rest/core-client"; +import { getClient } from "@azure-rest/core-client"; +import type { TokenCredential } from "@azure/core-auth"; + +/** (missing-service-description) Add service description */ +export interface ElasticSanManagementContext extends Client { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion: string; + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} + +/** Optional parameters for the client. */ +export interface ElasticSanManagementOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +/** (missing-service-description) Add service description */ +export function createElasticSanManagement( + credential: TokenCredential, + subscriptionId: string, + options: ElasticSanManagementOptionalParams = {}, +): ElasticSanManagementContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-elasticsan/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { + scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], + }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2025-09-01"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return { + ...clientContext, + apiVersion, + subscriptionId, + } as ElasticSanManagementContext; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts new file mode 100644 index 000000000000..4638e024014e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansDeleteOptionalParams, + ElasticSansUpdateOptionalParams, + ElasticSansCreateOptionalParams, + ElasticSansGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts new file mode 100644 index 000000000000..29aef0562568 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { ElasticSan, ElasticSanUpdate, _ElasticSanList } from "../../models/models.js"; +import { + errorResponseDeserializer, + elasticSanSerializer, + elasticSanDeserializer, + elasticSanUpdateSerializer, + _elasticSanListDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansDeleteOptionalParams, + ElasticSansUpdateOptionalParams, + ElasticSansCreateOptionalParams, + ElasticSansGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listBySubscriptionSend( + context: Client, + options: ElasticSansListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_ElasticSanList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _elasticSanListDeserializer(result.body); +} + +/** Gets a list of ElasticSans in a subscription */ +export function listBySubscription( + context: Client, + options: ElasticSansListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: ElasticSansListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_ElasticSanList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _elasticSanListDeserializer(result.body); +} + +/** Gets a list of ElasticSan in a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: ElasticSansListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: ElasticSansDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete a Elastic San. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: ElasticSansDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, elasticSanName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options: ElasticSansUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: elasticSanUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return elasticSanDeserializer(result.body); +} + +/** Update a Elastic San. */ +export function update( + context: Client, + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options: ElasticSansUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, ElasticSan> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, elasticSanName, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, ElasticSan>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options: ElasticSansCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: elasticSanSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return elasticSanDeserializer(result.body); +} + +/** Create ElasticSan. */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options: ElasticSansCreateOptionalParams = { requestOptions: {} }, +): PollerLike, ElasticSan> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend(context, resourceGroupName, elasticSanName, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, ElasticSan>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: ElasticSansGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return elasticSanDeserializer(result.body); +} + +/** Get a ElasticSan. */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: ElasticSansGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, elasticSanName, options); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts new file mode 100644 index 000000000000..1f22eab99e21 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ElasticSansListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ElasticSansListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ElasticSansDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ElasticSansUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ElasticSansCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ElasticSansGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/index.ts new file mode 100644 index 000000000000..b78c2b276cec --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createElasticSanManagement, + ElasticSanManagementContext, + ElasticSanManagementOptionalParams, +} from "./elasticSanManagementContext.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts new file mode 100644 index 000000000000..24a804d14fcf --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts new file mode 100644 index 000000000000..1127cae6935c --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { _OperationListResult, Operation } from "../../models/models.js"; +import { + _operationListResultDeserializer, + errorResponseDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { OperationsListOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.ElasticSan/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _operationListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts new file mode 100644 index 000000000000..b9a3fd9758a3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts new file mode 100644 index 000000000000..c7afff4982ae --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, create, get } from "./operations.js"; +export { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts new file mode 100644 index 000000000000..cb822d102194 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { + PrivateEndpointConnection, + _PrivateEndpointConnectionListResult, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + privateEndpointConnectionSerializer, + privateEndpointConnectionDeserializer, + _privateEndpointConnectionListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: PrivateEndpointConnectionsListOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_PrivateEndpointConnectionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _privateEndpointConnectionListResultDeserializer(result.body); +} + +/** List all Private Endpoint Connections associated with the Elastic San. */ +export function list( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: PrivateEndpointConnectionsListOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, elasticSanName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsDeleteOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified private endpoint connection associated with the Elastic San */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsDeleteOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options: PrivateEndpointConnectionsCreateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: privateEndpointConnectionSerializer(parameters), + }); +} + +export async function _createDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Update the state of specified private endpoint connection associated with the Elastic San */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options: PrivateEndpointConnectionsCreateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, PrivateEndpointConnection> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, PrivateEndpointConnection>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Gets the specified private endpoint connection associated with the Elastic San */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts new file mode 100644 index 000000000000..689834e08f57 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts new file mode 100644 index 000000000000..d5c988e5a1b6 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByElasticSan } from "./operations.js"; +export { PrivateLinkResourcesListByElasticSanOptionalParams } from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts new file mode 100644 index 000000000000..27b7e4c52c60 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { PrivateLinkResourceListResult } from "../../models/models.js"; +import { + errorResponseDeserializer, + privateLinkResourceListResultDeserializer, +} from "../../models/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { PrivateLinkResourcesListByElasticSanOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listByElasticSanSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: PrivateLinkResourcesListByElasticSanOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByElasticSanDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return privateLinkResourceListResultDeserializer(result.body); +} + +/** Gets the private link resources that need to be created for a elastic San. */ +export async function listByElasticSan( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: PrivateLinkResourcesListByElasticSanOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _listByElasticSanSend(context, resourceGroupName, elasticSanName, options); + return _listByElasticSanDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts new file mode 100644 index 000000000000..9db7ac557807 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByElasticSanOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts new file mode 100644 index 000000000000..b8728b770497 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { SkusListOptionalParams } from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts new file mode 100644 index 000000000000..d375cbdba4bd --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { _SkuInformationList, SkuInformation } from "../../models/models.js"; +import { errorResponseDeserializer, _skuInformationListDeserializer } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { SkusListOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: SkusListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_SkuInformationList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _skuInformationListDeserializer(result.body); +} + +/** List all the available Skus in the region and information related to them */ +export function list( + context: Client, + options: SkusListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts new file mode 100644 index 000000000000..b2213de33fc1 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SkusListOptionalParams extends OperationOptions { + /** Specify $filter='location eq ' to filter on location. */ + filter?: string; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts new file mode 100644 index 000000000000..4ddfa1645112 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByElasticSan, $delete, update, create, get } from "./operations.js"; +export { + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsCreateOptionalParams, + VolumeGroupsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts new file mode 100644 index 000000000000..910353a23969 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { VolumeGroup, VolumeGroupUpdate, _VolumeGroupList } from "../../models/models.js"; +import { + errorResponseDeserializer, + volumeGroupSerializer, + volumeGroupDeserializer, + volumeGroupUpdateSerializer, + _volumeGroupListDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsCreateOptionalParams, + VolumeGroupsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByElasticSanSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: VolumeGroupsListByElasticSanOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByElasticSanDeserialize( + result: PathUncheckedResponse, +): Promise<_VolumeGroupList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _volumeGroupListDeserializer(result.body); +} + +/** List VolumeGroups. */ +export function listByElasticSan( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: VolumeGroupsListByElasticSanOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByElasticSanSend(context, resourceGroupName, elasticSanName, options), + _listByElasticSanDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeGroupsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete an VolumeGroup. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeGroupsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, elasticSanName, volumeGroupName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options: VolumeGroupsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: volumeGroupUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeGroupDeserializer(result.body); +} + +/** Update an VolumeGroup. */ +export function update( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options: VolumeGroupsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VolumeGroup> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, VolumeGroup>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options: VolumeGroupsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: volumeGroupSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeGroupDeserializer(result.body); +} + +/** Create a Volume Group. */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options: VolumeGroupsCreateOptionalParams = { requestOptions: {} }, +): PollerLike, VolumeGroup> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, VolumeGroup>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeGroupsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeGroupDeserializer(result.body); +} + +/** Get an VolumeGroups. */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeGroupsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts new file mode 100644 index 000000000000..12d120a9c455 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VolumeGroupsListByElasticSanOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VolumeGroupsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeGroupsCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeGroupsGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts new file mode 100644 index 000000000000..eb2b6e895b40 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByVolumeGroup, $delete, create, get } from "./operations.js"; +export { + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts new file mode 100644 index 000000000000..405e6ac1c7f2 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { Snapshot, _SnapshotList } from "../../models/models.js"; +import { + errorResponseDeserializer, + snapshotSerializer, + snapshotDeserializer, + _snapshotListDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByVolumeGroupSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeSnapshotsListByVolumeGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion, + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByVolumeGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_SnapshotList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _snapshotListDeserializer(result.body); +} + +/** List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter */ +export function listByVolumeGroup( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeSnapshotsListByVolumeGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByVolumeGroupSend(context, resourceGroupName, elasticSanName, volumeGroupName, options), + _listByVolumeGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options: VolumeSnapshotsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + snapshotName: snapshotName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete a Volume Snapshot. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options: VolumeSnapshotsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options: VolumeSnapshotsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + snapshotName: snapshotName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: snapshotSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return snapshotDeserializer(result.body); +} + +/** Create a Volume Snapshot. */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options: VolumeSnapshotsCreateOptionalParams = { requestOptions: {} }, +): PollerLike, Snapshot> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, Snapshot>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options: VolumeSnapshotsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + snapshotName: snapshotName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return snapshotDeserializer(result.body); +} + +/** Get a Volume Snapshot. */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options: VolumeSnapshotsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts new file mode 100644 index 000000000000..cc3e99fd0dd9 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends OperationOptions { + /** Specify $filter='volumeName eq ' to filter on volume. */ + filter?: string; +} + +/** Optional parameters. */ +export interface VolumeSnapshotsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeSnapshotsCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeSnapshotsGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts new file mode 100644 index 000000000000..5240bc680a08 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + preRestore, + preBackup, + listByVolumeGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + VolumesPreRestoreOptionalParams, + VolumesPreBackupOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesCreateOptionalParams, + VolumesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts new file mode 100644 index 000000000000..f7a379bdfe6e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { + Volume, + VolumeUpdate, + _VolumeList, + VolumeNameList, + PreValidationResponse, + DiskSnapshotList, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + volumeSerializer, + volumeDeserializer, + volumeUpdateSerializer, + _volumeListDeserializer, + volumeNameListSerializer, + preValidationResponseDeserializer, + diskSnapshotListSerializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VolumesPreRestoreOptionalParams, + VolumesPreBackupOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesCreateOptionalParams, + VolumesGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _preRestoreSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options: VolumesPreRestoreOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: diskSnapshotListSerializer(parameters), + }); +} + +export async function _preRestoreDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return preValidationResponseDeserializer(result.body); +} + +/** Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. */ +export function preRestore( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options: VolumesPreRestoreOptionalParams = { requestOptions: {} }, +): PollerLike, PreValidationResponse> { + return getLongRunningPoller(context, _preRestoreDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _preRestoreSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, PreValidationResponse>; +} + +export function _preBackupSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options: VolumesPreBackupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: volumeNameListSerializer(parameters), + }); +} + +export async function _preBackupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return preValidationResponseDeserializer(result.body); +} + +/** Validate whether a disk snapshot backup can be taken for list of volumes. */ +export function preBackup( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options: VolumesPreBackupOptionalParams = { requestOptions: {} }, +): PollerLike, PreValidationResponse> { + return getLongRunningPoller(context, _preBackupDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _preBackupSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, PreValidationResponse>; +} + +export function _listByVolumeGroupSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumesListByVolumeGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByVolumeGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_VolumeList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _volumeListDeserializer(result.body); +} + +/** List Volumes in a VolumeGroup. */ +export function listByVolumeGroup( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumesListByVolumeGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByVolumeGroupSend(context, resourceGroupName, elasticSanName, volumeGroupName, options), + _listByVolumeGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options: VolumesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + volumeName: volumeName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ + ...operationOptionsToRequestParameters(options), + headers: { + ...(options?.xMsDeleteSnapshots !== undefined + ? { "x-ms-delete-snapshots": options?.xMsDeleteSnapshots } + : {}), + ...(options?.xMsForceDelete !== undefined + ? { "x-ms-force-delete": options?.xMsForceDelete } + : {}), + ...options.requestOptions?.headers, + }, + }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete an Volume. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options: VolumesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options: VolumesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + volumeName: volumeName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: volumeUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeDeserializer(result.body); +} + +/** Update an Volume. */ +export function update( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options: VolumesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Volume> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, Volume>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options: VolumesCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + volumeName: volumeName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: volumeSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeDeserializer(result.body); +} + +/** Create a Volume. */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options: VolumesCreateOptionalParams = { requestOptions: {} }, +): PollerLike, Volume> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, Volume>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options: VolumesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + volumeName: volumeName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeDeserializer(result.body); +} + +/** Get an Volume. */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options: VolumesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts new file mode 100644 index 000000000000..df5e283bb7c8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { XMsDeleteSnapshots, XMsForceDelete } from "../../models/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VolumesPreRestoreOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumesPreBackupOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumesListByVolumeGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VolumesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Optional, used to delete snapshots under volume. Allowed value are only true or false. Default value is false. */ + xMsDeleteSnapshots?: XMsDeleteSnapshots; + /** Optional, used to delete volume if active sessions present. Allowed value are only true or false. Default value is false. */ + xMsForceDelete?: XMsForceDelete; +} + +/** Optional parameters. */ +export interface VolumesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumesCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumesGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts new file mode 100644 index 000000000000..9b0789c3dc5c --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "../../api/elasticSans/operations.js"; +import type { + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansDeleteOptionalParams, + ElasticSansUpdateOptionalParams, + ElasticSansCreateOptionalParams, + ElasticSansGetOptionalParams, +} from "../../api/elasticSans/options.js"; +import type { ElasticSan, ElasticSanUpdate } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a ElasticSans operations. */ +export interface ElasticSansOperations { + /** Gets a list of ElasticSans in a subscription */ + listBySubscription: ( + options?: ElasticSansListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets a list of ElasticSan in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a Elastic San. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ) => PollerLike, void>; + /** Update a Elastic San. */ + update: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ) => PollerLike, ElasticSan>; + /** Create ElasticSan. */ + create: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ) => PollerLike, ElasticSan>; + /** Get a ElasticSan. */ + get: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansGetOptionalParams, + ) => Promise; +} + +function _getElasticSans(context: ElasticSanManagementContext) { + return { + listBySubscription: (options?: ElasticSansListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ) => $delete(context, resourceGroupName, elasticSanName, options), + update: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ) => update(context, resourceGroupName, elasticSanName, parameters, options), + create: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ) => create(context, resourceGroupName, elasticSanName, parameters, options), + get: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, options), + }; +} + +export function _getElasticSansOperations( + context: ElasticSanManagementContext, +): ElasticSansOperations { + return { + ..._getElasticSans(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/index.ts new file mode 100644 index 000000000000..9fe4a49d838b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { ElasticSansOperations } from "./elasticSans/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { PrivateEndpointConnectionsOperations } from "./privateEndpointConnections/index.js"; +export { PrivateLinkResourcesOperations } from "./privateLinkResources/index.js"; +export { SkusOperations } from "./skus/index.js"; +export { VolumeGroupsOperations } from "./volumeGroups/index.js"; +export { VolumesOperations } from "./volumes/index.js"; +export { VolumeSnapshotsOperations } from "./volumeSnapshots/index.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts new file mode 100644 index 000000000000..af7a1bdd4416 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { list } from "../../api/operations/operations.js"; +import type { OperationsListOptionalParams } from "../../api/operations/options.js"; +import type { Operation } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getOperations(context: ElasticSanManagementContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations( + context: ElasticSanManagementContext, +): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts new file mode 100644 index 000000000000..cefdcf7e9a67 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { list, $delete, create, get } from "../../api/privateEndpointConnections/operations.js"; +import type { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "../../api/privateEndpointConnections/options.js"; +import type { PrivateEndpointConnection } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a PrivateEndpointConnections operations. */ +export interface PrivateEndpointConnectionsOperations { + /** List all Private Endpoint Connections associated with the Elastic San. */ + list: ( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified private endpoint connection associated with the Elastic San */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => PollerLike, void>; + /** Update the state of specified private endpoint connection associated with the Elastic San */ + create: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => PollerLike, PrivateEndpointConnection>; + /** Gets the specified private endpoint connection associated with the Elastic San */ + get: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ) => Promise; +} + +function _getPrivateEndpointConnections(context: ElasticSanManagementContext) { + return { + list: ( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ) => list(context, resourceGroupName, elasticSanName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => + $delete(context, resourceGroupName, elasticSanName, privateEndpointConnectionName, options), + create: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => + create( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + options, + ), + get: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, privateEndpointConnectionName, options), + }; +} + +export function _getPrivateEndpointConnectionsOperations( + context: ElasticSanManagementContext, +): PrivateEndpointConnectionsOperations { + return { + ..._getPrivateEndpointConnections(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts new file mode 100644 index 000000000000..8387dbc9c878 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { listByElasticSan } from "../../api/privateLinkResources/operations.js"; +import type { PrivateLinkResourcesListByElasticSanOptionalParams } from "../../api/privateLinkResources/options.js"; +import type { PrivateLinkResourceListResult } from "../../models/models.js"; + +/** Interface representing a PrivateLinkResources operations. */ +export interface PrivateLinkResourcesOperations { + /** Gets the private link resources that need to be created for a elastic San. */ + listByElasticSan: ( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateLinkResourcesListByElasticSanOptionalParams, + ) => Promise; +} + +function _getPrivateLinkResources(context: ElasticSanManagementContext) { + return { + listByElasticSan: ( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateLinkResourcesListByElasticSanOptionalParams, + ) => listByElasticSan(context, resourceGroupName, elasticSanName, options), + }; +} + +export function _getPrivateLinkResourcesOperations( + context: ElasticSanManagementContext, +): PrivateLinkResourcesOperations { + return { + ..._getPrivateLinkResources(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts new file mode 100644 index 000000000000..8796ec7e12b8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { list } from "../../api/skus/operations.js"; +import type { SkusListOptionalParams } from "../../api/skus/options.js"; +import type { SkuInformation } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Skus operations. */ +export interface SkusOperations { + /** List all the available Skus in the region and information related to them */ + list: (options?: SkusListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getSkus(context: ElasticSanManagementContext) { + return { + list: (options?: SkusListOptionalParams) => list(context, options), + }; +} + +export function _getSkusOperations(context: ElasticSanManagementContext): SkusOperations { + return { + ..._getSkus(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts new file mode 100644 index 000000000000..c4880caf0c29 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { + listByElasticSan, + $delete, + update, + create, + get, +} from "../../api/volumeGroups/operations.js"; +import type { + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsCreateOptionalParams, + VolumeGroupsGetOptionalParams, +} from "../../api/volumeGroups/options.js"; +import type { VolumeGroup, VolumeGroupUpdate } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VolumeGroups operations. */ +export interface VolumeGroupsOperations { + /** List VolumeGroups. */ + listByElasticSan: ( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete an VolumeGroup. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ) => PollerLike, void>; + /** Update an VolumeGroup. */ + update: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ) => PollerLike, VolumeGroup>; + /** Create a Volume Group. */ + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ) => PollerLike, VolumeGroup>; + /** Get an VolumeGroups. */ + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsGetOptionalParams, + ) => Promise; +} + +function _getVolumeGroups(context: ElasticSanManagementContext) { + return { + listByElasticSan: ( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams, + ) => listByElasticSan(context, resourceGroupName, elasticSanName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, elasticSanName, volumeGroupName, options), + update: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ) => update(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ) => create(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, volumeGroupName, options), + }; +} + +export function _getVolumeGroupsOperations( + context: ElasticSanManagementContext, +): VolumeGroupsOperations { + return { + ..._getVolumeGroups(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts new file mode 100644 index 000000000000..955835d91e56 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { listByVolumeGroup, $delete, create, get } from "../../api/volumeSnapshots/operations.js"; +import type { + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsGetOptionalParams, +} from "../../api/volumeSnapshots/options.js"; +import type { Snapshot } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VolumeSnapshots operations. */ +export interface VolumeSnapshotsOperations { + /** List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter */ + listByVolumeGroup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeSnapshotsListByVolumeGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a Volume Snapshot. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ) => PollerLike, void>; + /** Create a Volume Snapshot. */ + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ) => PollerLike, Snapshot>; + /** Get a Volume Snapshot. */ + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsGetOptionalParams, + ) => Promise; +} + +function _getVolumeSnapshots(context: ElasticSanManagementContext) { + return { + listByVolumeGroup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeSnapshotsListByVolumeGroupOptionalParams, + ) => listByVolumeGroup(context, resourceGroupName, elasticSanName, volumeGroupName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ) => + $delete(context, resourceGroupName, elasticSanName, volumeGroupName, snapshotName, options), + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ) => + create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + options, + ), + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, volumeGroupName, snapshotName, options), + }; +} + +export function _getVolumeSnapshotsOperations( + context: ElasticSanManagementContext, +): VolumeSnapshotsOperations { + return { + ..._getVolumeSnapshots(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts new file mode 100644 index 000000000000..04cb5aae383e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { + preRestore, + preBackup, + listByVolumeGroup, + $delete, + update, + create, + get, +} from "../../api/volumes/operations.js"; +import type { + VolumesPreRestoreOptionalParams, + VolumesPreBackupOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesCreateOptionalParams, + VolumesGetOptionalParams, +} from "../../api/volumes/options.js"; +import type { + Volume, + VolumeUpdate, + VolumeNameList, + PreValidationResponse, + DiskSnapshotList, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Volumes operations. */ +export interface VolumesOperations { + /** Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. */ + preRestore: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ) => PollerLike, PreValidationResponse>; + /** Validate whether a disk snapshot backup can be taken for list of volumes. */ + preBackup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ) => PollerLike, PreValidationResponse>; + /** List Volumes in a VolumeGroup. */ + listByVolumeGroup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete an Volume. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ) => PollerLike, void>; + /** Update an Volume. */ + update: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ) => PollerLike, Volume>; + /** Create a Volume. */ + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ) => PollerLike, Volume>; + /** Get an Volume. */ + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams, + ) => Promise; +} + +function _getVolumes(context: ElasticSanManagementContext) { + return { + preRestore: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ) => + preRestore(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + preBackup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ) => + preBackup(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + listByVolumeGroup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams, + ) => listByVolumeGroup(context, resourceGroupName, elasticSanName, volumeGroupName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, elasticSanName, volumeGroupName, volumeName, options), + update: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ), + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ) => + create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ), + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, volumeGroupName, volumeName, options), + }; +} + +export function _getVolumesOperations(context: ElasticSanManagementContext): VolumesOperations { + return { + ..._getVolumes(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts index 5f2fbb6469ab..b235466430a8 100644 --- a/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts +++ b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts @@ -1,328 +1,76 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { - PipelineRequest, - PipelineResponse, - SendRequest, -} from "@azure/core-rest-pipeline"; -import * as coreAuth from "@azure/core-auth"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "./lroImpl.js"; -import { - OperationsImpl, - SkusImpl, - ElasticSansImpl, - VolumeGroupsImpl, - VolumesImpl, - PrivateEndpointConnectionsImpl, - PrivateLinkResourcesImpl, - VolumeSnapshotsImpl, -} from "./operations/index.js"; -import { - Operations, - Skus, - ElasticSans, - VolumeGroups, - Volumes, - PrivateEndpointConnections, - PrivateLinkResources, - VolumeSnapshots, -} from "./operationsInterfaces/index.js"; -import * as Parameters from "./models/parameters.js"; -import * as Mappers from "./models/mappers.js"; -import { +import type { + ElasticSanManagementContext, ElasticSanManagementOptionalParams, - RestoreVolumeOptionalParams, - RestoreVolumeResponse, -} from "./models/index.js"; +} from "./api/index.js"; +import { createElasticSanManagement } from "./api/index.js"; +import type { ElasticSansOperations } from "./classic/elasticSans/index.js"; +import { _getElasticSansOperations } from "./classic/elasticSans/index.js"; +import type { OperationsOperations } from "./classic/operations/index.js"; +import { _getOperationsOperations } from "./classic/operations/index.js"; +import type { PrivateEndpointConnectionsOperations } from "./classic/privateEndpointConnections/index.js"; +import { _getPrivateEndpointConnectionsOperations } from "./classic/privateEndpointConnections/index.js"; +import type { PrivateLinkResourcesOperations } from "./classic/privateLinkResources/index.js"; +import { _getPrivateLinkResourcesOperations } from "./classic/privateLinkResources/index.js"; +import type { SkusOperations } from "./classic/skus/index.js"; +import { _getSkusOperations } from "./classic/skus/index.js"; +import type { VolumeGroupsOperations } from "./classic/volumeGroups/index.js"; +import { _getVolumeGroupsOperations } from "./classic/volumeGroups/index.js"; +import type { VolumeSnapshotsOperations } from "./classic/volumeSnapshots/index.js"; +import { _getVolumeSnapshotsOperations } from "./classic/volumeSnapshots/index.js"; +import type { VolumesOperations } from "./classic/volumes/index.js"; +import { _getVolumesOperations } from "./classic/volumes/index.js"; +import type { TokenCredential } from "@azure/core-auth"; +import type { Pipeline } from "@azure/core-rest-pipeline"; -export class ElasticSanManagement extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; +export { ElasticSanManagementOptionalParams } from "./api/elasticSanManagementContext.js"; - /** - * Initializes a new instance of the ElasticSanManagement class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. - * @param options The parameter options - */ +export class ElasticSanManagement { + private _client: ElasticSanManagementContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + /** (missing-service-description) Add service description */ constructor( - credentials: coreAuth.TokenCredential, + credential: TokenCredential, subscriptionId: string, - options?: ElasticSanManagementOptionalParams, + options: ElasticSanManagementOptionalParams = {}, ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ElasticSanManagementOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials, - }; - - const packageDetails = `azsdk-js-arm-elasticsan/1.2.0-beta.2`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createElasticSanManagement(credential, subscriptionId, { ...options, - userAgentOptions: { - userAgentPrefix, - }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com", - }; - super(optionsWithDefaults); - - let bearerTokenAuthenticationPolicyFound: boolean = false; - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = - options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName, - ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName, - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge, - }, - }), - ); - } - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-07-01-preview"; - this.operations = new OperationsImpl(this); - this.skus = new SkusImpl(this); - this.elasticSans = new ElasticSansImpl(this); - this.volumeGroups = new VolumeGroupsImpl(this); - this.volumes = new VolumesImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); - this.privateLinkResources = new PrivateLinkResourcesImpl(this); - this.volumeSnapshots = new VolumeSnapshotsImpl(this); - this.addCustomApiVersionPolicy(options.apiVersion); - } - - /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ - private addCustomApiVersionPolicy(apiVersion?: string) { - if (!apiVersion) { - return; - } - const apiVersionPolicy = { - name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest, - ): Promise { - const param = request.url.split("?"); - if (param.length > 1) { - const newParams = param[1].split("&").map((item) => { - if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; - } else { - return item; - } - }); - request.url = param[0] + "?" + newParams.join("&"); - } - return next(request); - }, - }; - this.pipeline.addPolicy(apiVersionPolicy); - } - - /** - * Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted - * volumes by volume group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - async beginRestoreVolume( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: RestoreVolumeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - RestoreVolumeResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.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, - elasticSanName, - volumeGroupName, - volumeName, - options, - }, - spec: restoreVolumeOperationSpec, - }); - const poller = await createHttpPoller< - RestoreVolumeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", + userAgentOptions: { userAgentPrefix }, }); - await poller.poll(); - return poller; + this.pipeline = this._client.pipeline; + this.skus = _getSkusOperations(this._client); + this.volumeSnapshots = _getVolumeSnapshotsOperations(this._client); + this.privateLinkResources = _getPrivateLinkResourcesOperations(this._client); + this.volumeGroups = _getVolumeGroupsOperations(this._client); + this.volumes = _getVolumesOperations(this._client); + this.privateEndpointConnections = _getPrivateEndpointConnectionsOperations(this._client); + this.elasticSans = _getElasticSansOperations(this._client); + this.operations = _getOperationsOperations(this._client); } - /** - * Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted - * volumes by volume group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - async beginRestoreVolumeAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: RestoreVolumeOptionalParams, - ): Promise { - const poller = await this.beginRestoreVolume( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - return poller.pollUntilDone(); - } - - operations: Operations; - skus: Skus; - elasticSans: ElasticSans; - volumeGroups: VolumeGroups; - volumes: Volumes; - privateEndpointConnections: PrivateEndpointConnections; - privateLinkResources: PrivateLinkResources; - volumeSnapshots: VolumeSnapshots; + /** The operation groups for skus */ + public readonly skus: SkusOperations; + /** The operation groups for volumeSnapshots */ + public readonly volumeSnapshots: VolumeSnapshotsOperations; + /** The operation groups for privateLinkResources */ + public readonly privateLinkResources: PrivateLinkResourcesOperations; + /** The operation groups for volumeGroups */ + public readonly volumeGroups: VolumeGroupsOperations; + /** The operation groups for volumes */ + public readonly volumes: VolumesOperations; + /** The operation groups for privateEndpointConnections */ + public readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; + /** The operation groups for elasticSans */ + public readonly elasticSans: ElasticSansOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; } -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const restoreVolumeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}/restore", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.Volume, - }, - 201: { - bodyMapper: Mappers.Volume, - }, - 202: { - bodyMapper: Mappers.Volume, - }, - 204: { - bodyMapper: Mappers.Volume, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.volumeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/index.ts b/sdk/elasticsans/arm-elasticsan/src/index.ts index 1cc42ab32d67..670685d0cf3a 100644 --- a/sdk/elasticsans/arm-elasticsan/src/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/index.ts @@ -1,13 +1,151 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureClouds, AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; -/// -export { getContinuationToken } from "./pagingHelper.js"; -export * from "./models/index.js"; export { ElasticSanManagement } from "./elasticSanManagement.js"; -export * from "./operationsInterfaces/index.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + ElasticSan, + ElasticSanProperties, + Sku, + KnownSkuName, + SkuName, + KnownSkuTier, + SkuTier, + KnownProvisioningStates, + ProvisioningStates, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + KnownPrivateEndpointServiceConnectionStatus, + PrivateEndpointServiceConnectionStatus, + KnownPublicNetworkAccess, + PublicNetworkAccess, + AutoScaleProperties, + ScaleUpProperties, + KnownAutoScalePolicyEnforcement, + AutoScalePolicyEnforcement, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + TrackedResource, + ElasticSanUpdate, + ElasticSanUpdateProperties, + Volume, + VolumeProperties, + SourceCreationData, + KnownVolumeCreateOption, + VolumeCreateOption, + IscsiTargetInfo, + KnownOperationalStatus, + OperationalStatus, + ManagedByInfo, + VolumeUpdate, + VolumeUpdateProperties, + VolumeNameList, + PreValidationResponse, + DiskSnapshotList, + VolumeGroup, + Identity, + KnownIdentityType, + IdentityType, + UserAssignedIdentity, + VolumeGroupProperties, + KnownStorageTargetType, + StorageTargetType, + KnownEncryptionType, + EncryptionType, + EncryptionProperties, + KeyVaultProperties, + EncryptionIdentity, + NetworkRuleSet, + VirtualNetworkRule, + KnownAction, + Action, + VolumeGroupUpdate, + VolumeGroupUpdateProperties, + PrivateLinkResourceListResult, + PrivateLinkResource, + PrivateLinkResourceProperties, + Snapshot, + SnapshotProperties, + SnapshotCreationData, + SkuInformation, + SkuLocationInfo, + SKUCapability, + KnownXMsDeleteSnapshots, + XMsDeleteSnapshots, + KnownXMsForceDelete, + XMsForceDelete, + KnownVersions, +} from "./models/index.js"; +export { ElasticSanManagementOptionalParams } from "./api/index.js"; +export { + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansDeleteOptionalParams, + ElasticSansUpdateOptionalParams, + ElasticSansCreateOptionalParams, + ElasticSansGetOptionalParams, +} from "./api/elasticSans/index.js"; +export { OperationsListOptionalParams } from "./api/operations/index.js"; +export { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./api/privateEndpointConnections/index.js"; +export { PrivateLinkResourcesListByElasticSanOptionalParams } from "./api/privateLinkResources/index.js"; +export { SkusListOptionalParams } from "./api/skus/index.js"; +export { + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsCreateOptionalParams, + VolumeGroupsGetOptionalParams, +} from "./api/volumeGroups/index.js"; +export { + VolumesPreRestoreOptionalParams, + VolumesPreBackupOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesCreateOptionalParams, + VolumesGetOptionalParams, +} from "./api/volumes/index.js"; +export { + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsGetOptionalParams, +} from "./api/volumeSnapshots/index.js"; +export { + ElasticSansOperations, + OperationsOperations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + SkusOperations, + VolumeGroupsOperations, + VolumesOperations, + VolumeSnapshotsOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds, AzureSupportedClouds }; diff --git a/sdk/elasticsans/arm-elasticsan/src/logger.ts b/sdk/elasticsans/arm-elasticsan/src/logger.ts new file mode 100644 index 000000000000..cc7e3e30af65 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-elasticsan"); diff --git a/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts b/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts deleted file mode 100644 index 5f88efab981b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { AbortSignalLike } from "@azure/abort-controller"; -import { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export function createLroSpec(inputs: { - sendOperationFn: (args: any, spec: any) => Promise>; - args: Record; - spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record; -}): LongRunningOperation { - const { args, spec, sendOperationFn } = inputs; - return { - requestMethod: spec.httpMethod, - requestPath: spec.path!, - sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike }, - ) => { - const { requestBody, ...restSpec } = spec; - return sendOperationFn(args, { - ...restSpec, - httpMethod: "GET", - path, - abortSignal: options?.abortSignal, - }); - }, - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/models/index.ts b/sdk/elasticsans/arm-elasticsan/src/models/index.ts index 840b828b026f..c96145b6e392 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/index.ts @@ -1,1584 +1,90 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface OperationListResult { - /** - * List of operations supported by the resource provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Operation[]; - /** - * URL to get the next set of operation list results (if there are any). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Details of a REST API operation, returned from the Resource Provider Operations API */ -export interface Operation { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ - display?: OperationDisplay; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly actionType?: ActionType; -} - -/** Localized display information for this particular operation. */ -export interface OperationDisplay { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - -/** List of SKU Information objects */ -export interface SkuInformationList { - /** - * List of ResourceType Sku - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: SkuInformation[]; - /** - * URI to fetch the next section of the paginated response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** ElasticSAN SKU and its properties */ -export interface SkuInformation { - /** Sku Name */ - name: SkuName; - /** Sku Tier */ - tier?: SkuTier; - /** - * The type of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceType?: string; - /** - * The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly locations?: string[]; - /** - * Availability of the SKU for the location/zone - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly locationInfo?: SkuLocationInfo[]; - /** - * The capability information in the specified SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capabilities?: SKUCapability[]; -} - -/** The location info. */ -export interface SkuLocationInfo { - /** - * The location. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** - * The zones. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly zones?: string[]; -} - -/** The capability information in the specified SKU. */ -export interface SKUCapability { - /** - * The name of capability. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * A string value to indicate states of given capability. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: string; -} - -/** List of Elastic Sans */ -export interface ElasticSanList { - /** An array of Elastic San objects. */ - value?: ElasticSan[]; - /** - * URI to fetch the next section of the paginated response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Elastic San response properties. */ -export interface ElasticSanProperties { - /** resource sku */ - sku: Sku; - /** Logical zone for Elastic San resource; example: ["1"]. */ - availabilityZones?: string[]; - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** Base size of the Elastic San appliance in TiB. */ - baseSizeTiB: number; - /** Extended size of the Elastic San appliance in TiB. */ - extendedCapacitySizeTiB: number; - /** - * Total size of the provisioned Volumes in GiB. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly totalVolumeSizeGiB?: number; - /** - * Total number of volume groups in this Elastic San appliance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly volumeGroupCount?: number; - /** - * Total Provisioned IOPS of the Elastic San appliance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly totalIops?: number; - /** - * Total Provisioned MBps Elastic San appliance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly totalMBps?: number; - /** - * Total size of the Elastic San appliance in TB. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly totalSizeTiB?: number; - /** - * The list of Private Endpoint Connections. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Auto Scale Properties for Elastic San Appliance. */ - autoScaleProperties?: AutoScaleProperties; -} - -/** The SKU name. Required for account creation; optional for update. */ -export interface Sku { - /** The sku name. */ - name: SkuName; - /** The sku tier. */ - tier?: SkuTier; -} - -/** Response for PrivateEndpoint connection properties */ -export interface PrivateEndpointConnectionProperties { - /** - * Provisioning State of Private Endpoint connection resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** Private Endpoint resource */ - privateEndpoint?: PrivateEndpoint; - /** Private Link Service Connection State. */ - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; - /** List of resources private endpoint is mapped */ - groupIds?: string[]; -} - -/** Response for PrivateEndpoint */ -export interface PrivateEndpoint { - /** - * The ARM identifier for Private Endpoint - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -/** Response for Private Link Service Connection state */ -export interface PrivateLinkServiceConnectionState { - /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - status?: PrivateEndpointServiceConnectionStatus; - /** The reason for approval/rejection of the connection. */ - description?: string; - /** A message indicating if changes on the service provider require any updates on the consumer. */ - actionsRequired?: string; -} - -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; -} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - -/** The auto scale settings on Elastic San Appliance. */ -export interface AutoScaleProperties { - /** Scale up settings on Elastic San Appliance. */ - scaleUpProperties?: ScaleUpProperties; -} - -/** Scale up properties on Elastic San Appliance. */ -export interface ScaleUpProperties { - /** Unused size on Elastic San appliance in TiB. */ - unusedSizeTiB?: number; - /** Unit to increase Capacity Unit on Elastic San appliance in TiB. */ - increaseCapacityUnitByTiB?: number; - /** Maximum scale up size on Elastic San appliance in TiB. */ - capacityUnitScaleUpLimitTiB?: number; - /** Enable or Disable scale up setting on Elastic San Appliance. */ - autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; -} - -/** Response for ElasticSan update request. */ -export interface ElasticSanUpdate { - /** Properties of ElasticSan. */ - properties?: ElasticSanUpdateProperties; - /** Update tags */ - tags?: { [propertyName: string]: string }; -} - -/** Elastic San update properties. */ -export interface ElasticSanUpdateProperties { - /** Base size of the Elastic San appliance in TiB. */ - baseSizeTiB?: number; - /** Extended size of the Elastic San appliance in TiB. */ - extendedCapacitySizeTiB?: number; - /** Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Auto Scale Properties for Elastic San Appliance. */ - autoScaleProperties?: AutoScaleProperties; -} - -/** List of Volume Groups */ -export interface VolumeGroupList { - /** An array of Volume Groups objects. */ - value?: VolumeGroup[]; - /** - * URI to fetch the next section of the paginated response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Identity for the resource. */ -export interface Identity { - /** - * The principal ID of resource identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The identity type. */ - type: IdentityType; - /** Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this volume group. The key is the ARM resource identifier of the identity. */ - userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; -} - -/** UserAssignedIdentity for the resource. */ -export interface UserAssignedIdentity { - /** - * The principal ID of the identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The client ID of the identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly clientId?: string; -} - -/** VolumeGroup response properties. */ -export interface VolumeGroupProperties { - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** Type of storage target */ - protocolType?: StorageTargetType; - /** Type of encryption */ - encryption?: EncryptionType; - /** Encryption Properties describing Key Vault and Identity information */ - encryptionProperties?: EncryptionProperties; - /** A collection of rules governing the accessibility from specific network locations. */ - networkAcls?: NetworkRuleSet; - /** - * The list of Private Endpoint Connections. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** A boolean indicating whether or not Data Integrity Check is enabled */ - enforceDataIntegrityCheckForIscsi?: boolean; - /** The retention policy for the soft deleted volume group and its associated resources. */ - deleteRetentionPolicy?: DeleteRetentionPolicy; -} - -/** The encryption settings on the volume group. */ -export interface EncryptionProperties { - /** Properties provided by key vault. */ - keyVaultProperties?: KeyVaultProperties; - /** The identity to be used with service-side encryption at rest. */ - encryptionIdentity?: EncryptionIdentity; -} - -/** Properties of key vault. */ -export interface KeyVaultProperties { - /** The name of KeyVault key. */ - keyName?: string; - /** The version of KeyVault key. */ - keyVersion?: string; - /** The Uri of KeyVault. */ - keyVaultUri?: string; - /** - * The object identifier of the current versioned Key Vault Key in use. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly currentVersionedKeyIdentifier?: string; - /** - * Timestamp of last rotation of the Key Vault Key. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastKeyRotationTimestamp?: Date; - /** - * This is a read only property that represents the expiration time of the current version of the customer managed key used for encryption. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly currentVersionedKeyExpirationTimestamp?: Date; -} - -/** Encryption identity for the volume group. */ -export interface EncryptionIdentity { - /** Resource identifier of the UserAssigned identity to be associated with server-side encryption on the volume group. */ - encryptionUserAssignedIdentity?: string; -} - -/** A set of rules governing the network accessibility. */ -export interface NetworkRuleSet { - /** The list of virtual network rules. */ - virtualNetworkRules?: VirtualNetworkRule[]; -} - -/** Virtual Network rule. */ -export interface VirtualNetworkRule { - /** Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. */ - virtualNetworkResourceId: string; - /** The action of virtual network rule. */ - action?: Action; -} - -/** Response for Delete Retention Policy object */ -export interface DeleteRetentionPolicy { - policyState?: PolicyState; - /** The number of days to retain the resources after deletion. */ - retentionPeriodDays?: number; -} - -/** Volume Group request. */ -export interface VolumeGroupUpdate { - /** The identity of the resource. */ - identity?: Identity; - /** Properties of VolumeGroup. */ - properties?: VolumeGroupUpdateProperties; -} - -/** VolumeGroup response properties. */ -export interface VolumeGroupUpdateProperties { - /** Type of storage target */ - protocolType?: StorageTargetType; - /** Type of encryption */ - encryption?: EncryptionType; - /** Encryption Properties describing Key Vault and Identity information */ - encryptionProperties?: EncryptionProperties; - /** A collection of rules governing the accessibility from specific network locations. */ - networkAcls?: NetworkRuleSet; - /** A boolean indicating whether or not Data Integrity Check is enabled */ - enforceDataIntegrityCheckForIscsi?: boolean; - /** The retention policy for the soft deleted volume group and its associated resources */ - deleteRetentionPolicy?: DeleteRetentionPolicy; -} - -/** Volume response properties. */ -export interface VolumeProperties { - /** - * Unique Id of the volume in GUID format - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly volumeId?: string; - /** State of the operation on the resource. */ - creationData?: SourceCreationData; - /** Volume size. */ - sizeGiB: number; - /** - * Storage target information - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly storageTarget?: IscsiTargetInfo; - /** Parent resource information. */ - managedBy?: ManagedByInfo; - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; -} - -/** Data source used when creating the volume. */ -export interface SourceCreationData { - /** This enumerates the possible sources of a volume creation. */ - createSource?: VolumeCreateOption; - /** Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ - sourceId?: string; -} - -/** Iscsi target information */ -export interface IscsiTargetInfo { - /** - * iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly targetIqn?: string; - /** - * iSCSI Target Portal Host Name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly targetPortalHostname?: string; - /** - * iSCSI Target Portal Port - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly targetPortalPort?: number; - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** Operational status of the iSCSI Target. */ - status?: OperationalStatus; -} - -/** Parent resource information. */ -export interface ManagedByInfo { - /** Resource ID of the resource managing the volume, this is a restricted field and can only be set for internal use. */ - resourceId?: string; -} - -/** Response for Volume request. */ -export interface VolumeUpdate { - /** Properties of Volume. */ - properties?: VolumeUpdateProperties; -} - -/** Volume response properties. */ -export interface VolumeUpdateProperties { - /** Volume size. */ - sizeGiB?: number; - /** Parent resource information. */ - managedBy?: ManagedByInfo; -} - -/** List of Volumes */ -export interface VolumeList { - /** An array of Volume objects. */ - value?: Volume[]; - /** - * URI to fetch the next section of the paginated response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** List of private endpoint connections associated with SAN */ -export interface PrivateEndpointConnectionListResult { - /** Array of private endpoint connections */ - value?: PrivateEndpointConnection[]; - /** - * URI to fetch the next section of the paginated response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** A list of private link resources */ -export interface PrivateLinkResourceListResult { - /** Array of private link resources */ - value?: PrivateLinkResource[]; - /** - * URI to fetch the next section of the paginated response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Properties of a private link resource. */ -export interface PrivateLinkResourceProperties { - /** - * The private link resource group id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly groupId?: string; - /** - * The private link resource required member names. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requiredMembers?: string[]; - /** The private link resource Private link DNS zone name. */ - requiredZoneNames?: string[]; -} - -/** List of Snapshots */ -export interface SnapshotList { - /** An array of Snapshot objects. */ - value?: Snapshot[]; - /** - * URI to fetch the next section of the paginated response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Properties for Snapshot. */ -export interface SnapshotProperties { - /** Data used when creating a volume snapshot. */ - creationData: SnapshotCreationData; - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** - * Size of Source Volume - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sourceVolumeSizeGiB?: number; - /** - * Source Volume Name of a snapshot - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly volumeName?: string; -} - -/** Data used when creating a volume snapshot. */ -export interface SnapshotCreationData { - /** Fully qualified resource ID of the volume. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" */ - sourceId: string; -} - -/** object to hold array of volume names */ -export interface VolumeNameList { - /** array of volume names */ - volumeNames: string[]; -} - -/** response object for pre validation api */ -export interface PreValidationResponse { - /** a status value indicating success or failure of validation */ - validationStatus?: string; -} - -/** object to hold array of Disk Snapshot ARM IDs */ -export interface DiskSnapshotList { - /** array of DiskSnapshot ARM IDs */ - diskSnapshotIds: string[]; -} - -/** Response for PrivateEndpoint Connection object */ -export interface PrivateEndpointConnection extends Resource { - /** Private Endpoint Connection Properties. */ - properties: PrivateEndpointConnectionProperties; -} - -/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends Resource { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The geo-location where the resource lives */ - location: string; -} - -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - -/** A private link resource */ -export interface PrivateLinkResource extends Resource { - /** Resource properties. */ - properties?: PrivateLinkResourceProperties; -} - -/** Response for ElasticSan request. */ -export interface ElasticSan extends TrackedResource { - /** Properties of ElasticSan. */ - properties: ElasticSanProperties; -} - -/** Response for Volume Group request. */ -export interface VolumeGroup extends ProxyResource { - /** The identity of the resource. */ - identity?: Identity; - /** Properties of VolumeGroup. */ - properties?: VolumeGroupProperties; -} - -/** Response for Volume request. */ -export interface Volume extends ProxyResource { - /** Properties of Volume. */ - properties: VolumeProperties; -} - -/** Response for Volume Snapshot request. */ -export interface Snapshot extends ProxyResource { - /** Properties of Volume Snapshot. */ - properties: SnapshotProperties; -} - -/** Defines headers for ElasticSans_update operation. */ -export interface ElasticSansUpdateHeaders { - location?: string; -} - -/** Defines headers for ElasticSans_delete operation. */ -export interface ElasticSansDeleteHeaders { - location?: string; -} - -/** Defines headers for VolumeGroups_update operation. */ -export interface VolumeGroupsUpdateHeaders { - location?: string; -} - -/** Defines headers for VolumeGroups_delete operation. */ -export interface VolumeGroupsDeleteHeaders { - location?: string; -} - -/** Defines headers for Volumes_update operation. */ -export interface VolumesUpdateHeaders { - location?: string; -} - -/** Defines headers for Volumes_delete operation. */ -export interface VolumesDeleteHeaders { - location?: string; -} - -/** Defines headers for Volumes_preBackup operation. */ -export interface VolumesPreBackupHeaders { - location?: string; -} - -/** Defines headers for Volumes_preRestore operation. */ -export interface VolumesPreRestoreHeaders { - location?: string; -} - -/** Defines headers for ElasticSanManagement_restoreVolume operation. */ -export interface ElasticSanManagementRestoreVolumeHeaders { - location?: string; -} - -/** Defines headers for PrivateEndpointConnections_delete operation. */ -export interface PrivateEndpointConnectionsDeleteHeaders { - location?: string; -} - -/** Defines headers for VolumeSnapshots_delete operation. */ -export interface VolumeSnapshotsDeleteHeaders { - location?: string; -} - -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - UserSystem = "user,system", -} - -/** - * Defines values for Origin. \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** - */ -export type Origin = string; - -/** Known values of {@link ActionType} that the service accepts. */ -export enum KnownActionType { - /** Internal */ - Internal = "Internal", -} - -/** - * Defines values for ActionType. \ - * {@link KnownActionType} can be used interchangeably with ActionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Internal** - */ -export type ActionType = string; - -/** Known values of {@link SkuName} that the service accepts. */ -export enum KnownSkuName { - /** Premium locally redundant storage */ - PremiumLRS = "Premium_LRS", - /** Premium zone redundant storage */ - PremiumZRS = "Premium_ZRS", -} - -/** - * Defines values for SkuName. \ - * {@link KnownSkuName} can be used interchangeably with SkuName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Premium_LRS**: Premium locally redundant storage \ - * **Premium_ZRS**: Premium zone redundant storage - */ -export type SkuName = string; - -/** Known values of {@link SkuTier} that the service accepts. */ -export enum KnownSkuTier { - /** Premium Tier */ - Premium = "Premium", -} - -/** - * Defines values for SkuTier. \ - * {@link KnownSkuTier} can be used interchangeably with SkuTier, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Premium**: Premium Tier - */ -export type SkuTier = string; - -/** Known values of {@link ProvisioningStates} that the service accepts. */ -export enum KnownProvisioningStates { - /** Invalid */ - Invalid = "Invalid", - /** Succeeded */ - Succeeded = "Succeeded", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled", - /** Pending */ - Pending = "Pending", - /** Creating */ - Creating = "Creating", - /** Updating */ - Updating = "Updating", - /** Deleting */ - Deleting = "Deleting", - /** Deleted */ - Deleted = "Deleted", - /** Restoring */ - Restoring = "Restoring", - /** SoftDeleting */ - SoftDeleting = "SoftDeleting", -} - -/** - * Defines values for ProvisioningStates. \ - * {@link KnownProvisioningStates} can be used interchangeably with ProvisioningStates, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invalid** \ - * **Succeeded** \ - * **Failed** \ - * **Canceled** \ - * **Pending** \ - * **Creating** \ - * **Updating** \ - * **Deleting** \ - * **Deleted** \ - * **Restoring** \ - * **SoftDeleting** - */ -export type ProvisioningStates = string; - -/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ -export enum KnownPrivateEndpointServiceConnectionStatus { - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Failed */ - Failed = "Failed", - /** Rejected */ - Rejected = "Rejected", -} - -/** - * Defines values for PrivateEndpointServiceConnectionStatus. \ - * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Pending** \ - * **Approved** \ - * **Failed** \ - * **Rejected** - */ -export type PrivateEndpointServiceConnectionStatus = string; - -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key", -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - -/** Known values of {@link PublicNetworkAccess} that the service accepts. */ -export enum KnownPublicNetworkAccess { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Defines values for PublicNetworkAccess. \ - * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** - */ -export type PublicNetworkAccess = string; - -/** Known values of {@link AutoScalePolicyEnforcement} that the service accepts. */ -export enum KnownAutoScalePolicyEnforcement { - /** None */ - None = "None", - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Defines values for AutoScalePolicyEnforcement. \ - * {@link KnownAutoScalePolicyEnforcement} can be used interchangeably with AutoScalePolicyEnforcement, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **Enabled** \ - * **Disabled** - */ -export type AutoScalePolicyEnforcement = string; - -/** Known values of {@link XMsAccessSoftDeletedResources} that the service accepts. */ -export enum KnownXMsAccessSoftDeletedResources { - /** True */ - True = "true", - /** False */ - False = "false", -} - -/** - * Defines values for XMsAccessSoftDeletedResources. \ - * {@link KnownXMsAccessSoftDeletedResources} can be used interchangeably with XMsAccessSoftDeletedResources, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true** \ - * **false** - */ -export type XMsAccessSoftDeletedResources = string; - -/** Known values of {@link IdentityType} that the service accepts. */ -export enum KnownIdentityType { - /** None */ - None = "None", - /** SystemAssigned */ - SystemAssigned = "SystemAssigned", - /** UserAssigned */ - UserAssigned = "UserAssigned", -} - -/** - * Defines values for IdentityType. \ - * {@link KnownIdentityType} can be used interchangeably with IdentityType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **SystemAssigned** \ - * **UserAssigned** - */ -export type IdentityType = string; - -/** Known values of {@link StorageTargetType} that the service accepts. */ -export enum KnownStorageTargetType { - /** Iscsi */ - Iscsi = "Iscsi", - /** None */ - None = "None", -} - -/** - * Defines values for StorageTargetType. \ - * {@link KnownStorageTargetType} can be used interchangeably with StorageTargetType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Iscsi** \ - * **None** - */ -export type StorageTargetType = string; - -/** Known values of {@link EncryptionType} that the service accepts. */ -export enum KnownEncryptionType { - /** Volume is encrypted at rest with Platform managed key. It is the default encryption type. */ - EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", - /** Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ - EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", -} - -/** - * Defines values for EncryptionType. \ - * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EncryptionAtRestWithPlatformKey**: Volume is encrypted at rest with Platform managed key. It is the default encryption type. \ - * **EncryptionAtRestWithCustomerManagedKey**: Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. - */ -export type EncryptionType = string; - -/** Known values of {@link Action} that the service accepts. */ -export enum KnownAction { - /** Allow */ - Allow = "Allow", -} - -/** - * Defines values for Action. \ - * {@link KnownAction} can be used interchangeably with Action, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Allow** - */ -export type Action = string; - -/** Known values of {@link PolicyState} that the service accepts. */ -export enum KnownPolicyState { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Defines values for PolicyState. \ - * {@link KnownPolicyState} can be used interchangeably with PolicyState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** - */ -export type PolicyState = string; - -/** Known values of {@link VolumeCreateOption} that the service accepts. */ -export enum KnownVolumeCreateOption { - /** None */ - None = "None", - /** VolumeSnapshot */ - VolumeSnapshot = "VolumeSnapshot", - /** DiskSnapshot */ - DiskSnapshot = "DiskSnapshot", - /** Disk */ - Disk = "Disk", - /** DiskRestorePoint */ - DiskRestorePoint = "DiskRestorePoint", -} - -/** - * Defines values for VolumeCreateOption. \ - * {@link KnownVolumeCreateOption} can be used interchangeably with VolumeCreateOption, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **VolumeSnapshot** \ - * **DiskSnapshot** \ - * **Disk** \ - * **DiskRestorePoint** - */ -export type VolumeCreateOption = string; - -/** Known values of {@link OperationalStatus} that the service accepts. */ -export enum KnownOperationalStatus { - /** Invalid */ - Invalid = "Invalid", - /** Unknown */ - Unknown = "Unknown", - /** Healthy */ - Healthy = "Healthy", - /** Unhealthy */ - Unhealthy = "Unhealthy", - /** Updating */ - Updating = "Updating", - /** Running */ - Running = "Running", - /** Stopped */ - Stopped = "Stopped", - /** StoppedDeallocated */ - StoppedDeallocated = "Stopped (deallocated)", -} - -/** - * Defines values for OperationalStatus. \ - * {@link KnownOperationalStatus} can be used interchangeably with OperationalStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invalid** \ - * **Unknown** \ - * **Healthy** \ - * **Unhealthy** \ - * **Updating** \ - * **Running** \ - * **Stopped** \ - * **Stopped (deallocated)** - */ -export type OperationalStatus = string; - -/** Known values of {@link XMsDeleteSnapshots} that the service accepts. */ -export enum KnownXMsDeleteSnapshots { - /** True */ - True = "true", - /** False */ - False = "false", -} - -/** - * Defines values for XMsDeleteSnapshots. \ - * {@link KnownXMsDeleteSnapshots} can be used interchangeably with XMsDeleteSnapshots, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true** \ - * **false** - */ -export type XMsDeleteSnapshots = string; - -/** Known values of {@link XMsForceDelete} that the service accepts. */ -export enum KnownXMsForceDelete { - /** True */ - True = "true", - /** False */ - False = "false", -} - -/** - * Defines values for XMsForceDelete. \ - * {@link KnownXMsForceDelete} can be used interchangeably with XMsForceDelete, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true** \ - * **false** - */ -export type XMsForceDelete = string; - -/** Known values of {@link DeleteType} that the service accepts. */ -export enum KnownDeleteType { - /** Permanent */ - Permanent = "permanent", -} - -/** - * Defines values for DeleteType. \ - * {@link KnownDeleteType} can be used interchangeably with DeleteType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **permanent** - */ -export type DeleteType = string; - -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; - -/** Optional parameters. */ -export interface SkusListOptionalParams extends coreClient.OperationOptions { - /** Specify $filter='location eq ' to filter on location. */ - filter?: string; -} - -/** Contains response data for the list operation. */ -export type SkusListResponse = SkuInformationList; - -/** Optional parameters. */ -export interface ElasticSansListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type ElasticSansListBySubscriptionResponse = ElasticSanList; - -/** Optional parameters. */ -export interface ElasticSansListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type ElasticSansListByResourceGroupResponse = ElasticSanList; - -/** Optional parameters. */ -export interface ElasticSansCreateOptionalParams - 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 ElasticSansCreateResponse = ElasticSan; - -/** Optional parameters. */ -export interface ElasticSansUpdateOptionalParams - 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 ElasticSansUpdateResponse = ElasticSan; - -/** Optional parameters. */ -export interface ElasticSansDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface ElasticSansGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type ElasticSansGetResponse = ElasticSan; - -/** Optional parameters. */ -export interface ElasticSansListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type ElasticSansListBySubscriptionNextResponse = ElasticSanList; - -/** Optional parameters. */ -export interface ElasticSansListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type ElasticSansListByResourceGroupNextResponse = ElasticSanList; - -/** Optional parameters. */ -export interface VolumeGroupsListByElasticSanOptionalParams - extends coreClient.OperationOptions { - /** Optional, returns only soft deleted volume groups if set to true. If set to false or if not specified, returns only active volume groups. */ - xMsAccessSoftDeletedResources?: XMsAccessSoftDeletedResources; -} - -/** Contains response data for the listByElasticSan operation. */ -export type VolumeGroupsListByElasticSanResponse = VolumeGroupList; - -/** Optional parameters. */ -export interface VolumeGroupsCreateOptionalParams - 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 VolumeGroupsCreateResponse = VolumeGroup; - -/** Optional parameters. */ -export interface VolumeGroupsUpdateOptionalParams - 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 VolumeGroupsUpdateResponse = VolumeGroup; - -/** Optional parameters. */ -export interface VolumeGroupsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VolumeGroupsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VolumeGroupsGetResponse = VolumeGroup; - -/** Optional parameters. */ -export interface VolumeGroupsListByElasticSanNextOptionalParams - extends coreClient.OperationOptions { - /** Optional, returns only soft deleted volume groups if set to true. If set to false or if not specified, returns only active volume groups. */ - xMsAccessSoftDeletedResources?: XMsAccessSoftDeletedResources; -} - -/** Contains response data for the listByElasticSanNext operation. */ -export type VolumeGroupsListByElasticSanNextResponse = VolumeGroupList; - -/** Optional parameters. */ -export interface VolumesCreateOptionalParams - 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 VolumesCreateResponse = Volume; - -/** Optional parameters. */ -export interface VolumesUpdateOptionalParams - 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 VolumesUpdateResponse = Volume; - -/** Optional parameters. */ -export interface VolumesDeleteOptionalParams - extends coreClient.OperationOptions { - /** Optional, used to delete snapshots under volume. Allowed value are only true or false. Default value is false. */ - xMsDeleteSnapshots?: XMsDeleteSnapshots; - /** Optional, used to delete volume if active sessions present. Allowed value are only true or false. Default value is false. */ - xMsForceDelete?: XMsForceDelete; - /** Optional. Specifies that the delete operation should be a permanent delete for the soft deleted volume. The value of deleteType can only be 'permanent'. */ - deleteType?: DeleteType; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VolumesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VolumesGetResponse = Volume; - -/** Optional parameters. */ -export interface VolumesListByVolumeGroupOptionalParams - extends coreClient.OperationOptions { - /** Optional, returns only soft deleted volumes if set to true. If set to false or if not specified, returns only active volumes. */ - xMsAccessSoftDeletedResources?: XMsAccessSoftDeletedResources; -} - -/** Contains response data for the listByVolumeGroup operation. */ -export type VolumesListByVolumeGroupResponse = VolumeList; - -/** Optional parameters. */ -export interface VolumesPreBackupOptionalParams - 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 preBackup operation. */ -export type VolumesPreBackupResponse = PreValidationResponse; - -/** Optional parameters. */ -export interface VolumesPreRestoreOptionalParams - 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 preRestore operation. */ -export type VolumesPreRestoreResponse = PreValidationResponse; - -/** Optional parameters. */ -export interface VolumesListByVolumeGroupNextOptionalParams - extends coreClient.OperationOptions { - /** Optional, returns only soft deleted volumes if set to true. If set to false or if not specified, returns only active volumes. */ - xMsAccessSoftDeletedResources?: XMsAccessSoftDeletedResources; -} - -/** Contains response data for the listByVolumeGroupNext operation. */ -export type VolumesListByVolumeGroupNextResponse = VolumeList; - -/** Optional parameters. */ -export interface RestoreVolumeOptionalParams - 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 restoreVolume operation. */ -export type RestoreVolumeResponse = Volume; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsCreateOptionalParams - 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 PrivateEndpointConnectionsCreateResponse = - PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type PrivateEndpointConnectionsListResponse = - PrivateEndpointConnectionListResult; - -/** Optional parameters. */ -export interface PrivateLinkResourcesListByElasticSanOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByElasticSan operation. */ -export type PrivateLinkResourcesListByElasticSanResponse = - PrivateLinkResourceListResult; - -/** Optional parameters. */ -export interface VolumeSnapshotsListByVolumeGroupOptionalParams - extends coreClient.OperationOptions { - /** Specify $filter='volumeName eq ' to filter on volume. */ - filter?: string; -} - -/** Contains response data for the listByVolumeGroup operation. */ -export type VolumeSnapshotsListByVolumeGroupResponse = SnapshotList; - -/** Optional parameters. */ -export interface VolumeSnapshotsCreateOptionalParams - 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 VolumeSnapshotsCreateResponse = Snapshot; - -/** Optional parameters. */ -export interface VolumeSnapshotsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VolumeSnapshotsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VolumeSnapshotsGetResponse = Snapshot; - -/** Optional parameters. */ -export interface VolumeSnapshotsListByVolumeGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByVolumeGroupNext operation. */ -export type VolumeSnapshotsListByVolumeGroupNextResponse = SnapshotList; - -/** Optional parameters. */ -export interface ElasticSanManagementOptionalParams - extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Api Version */ - apiVersion?: string; - /** Overrides client endpoint. */ - endpoint?: string; -} +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + ElasticSan, + ElasticSanProperties, + Sku, + KnownSkuName, + SkuName, + KnownSkuTier, + SkuTier, + KnownProvisioningStates, + ProvisioningStates, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + KnownPrivateEndpointServiceConnectionStatus, + PrivateEndpointServiceConnectionStatus, + KnownPublicNetworkAccess, + PublicNetworkAccess, + AutoScaleProperties, + ScaleUpProperties, + KnownAutoScalePolicyEnforcement, + AutoScalePolicyEnforcement, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + TrackedResource, + ElasticSanUpdate, + ElasticSanUpdateProperties, + Volume, + VolumeProperties, + SourceCreationData, + KnownVolumeCreateOption, + VolumeCreateOption, + IscsiTargetInfo, + KnownOperationalStatus, + OperationalStatus, + ManagedByInfo, + VolumeUpdate, + VolumeUpdateProperties, + VolumeNameList, + PreValidationResponse, + DiskSnapshotList, + VolumeGroup, + Identity, + KnownIdentityType, + IdentityType, + UserAssignedIdentity, + VolumeGroupProperties, + KnownStorageTargetType, + StorageTargetType, + KnownEncryptionType, + EncryptionType, + EncryptionProperties, + KeyVaultProperties, + EncryptionIdentity, + NetworkRuleSet, + VirtualNetworkRule, + KnownAction, + Action, + VolumeGroupUpdate, + VolumeGroupUpdateProperties, + PrivateLinkResourceListResult, + PrivateLinkResource, + PrivateLinkResourceProperties, + Snapshot, + SnapshotProperties, + SnapshotCreationData, + SkuInformation, + SkuLocationInfo, + SKUCapability, + KnownXMsDeleteSnapshots, + XMsDeleteSnapshots, + KnownXMsForceDelete, + XMsForceDelete, + KnownVersions, +} from "./models.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts deleted file mode 100644 index 5c362f408f18..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts +++ /dev/null @@ -1,1915 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean", - }, - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay", - }, - }, - origin: { - serializedName: "origin", - readOnly: true, - type: { - name: "String", - }, - }, - actionType: { - serializedName: "actionType", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String", - }, - }, - resource: { - serializedName: "resource", - readOnly: true, - type: { - name: "String", - }, - }, - operation: { - serializedName: "operation", - readOnly: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, - }, - }, - }, - }, -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const SkuInformationList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkuInformationList", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuInformation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SkuInformation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkuInformation", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - type: { - name: "String", - }, - }, - resourceType: { - serializedName: "resourceType", - readOnly: true, - type: { - name: "String", - }, - }, - locations: { - serializedName: "locations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - locationInfo: { - serializedName: "locationInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuLocationInfo", - }, - }, - }, - }, - capabilities: { - serializedName: "capabilities", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SKUCapability", - }, - }, - }, - }, - }, - }, -}; - -export const SkuLocationInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkuLocationInfo", - modelProperties: { - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - zones: { - serializedName: "zones", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const SKUCapability: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SKUCapability", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ElasticSanList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSanList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ElasticSan", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ElasticSanProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSanProperties", - modelProperties: { - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - availabilityZones: { - serializedName: "availabilityZones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - baseSizeTiB: { - serializedName: "baseSizeTiB", - required: true, - type: { - name: "Number", - }, - }, - extendedCapacitySizeTiB: { - serializedName: "extendedCapacitySizeTiB", - required: true, - type: { - name: "Number", - }, - }, - totalVolumeSizeGiB: { - serializedName: "totalVolumeSizeGiB", - readOnly: true, - type: { - name: "Number", - }, - }, - volumeGroupCount: { - serializedName: "volumeGroupCount", - readOnly: true, - type: { - name: "Number", - }, - }, - totalIops: { - serializedName: "totalIops", - readOnly: true, - type: { - name: "Number", - }, - }, - totalMBps: { - serializedName: "totalMBps", - readOnly: true, - type: { - name: "Number", - }, - }, - totalSizeTiB: { - serializedName: "totalSizeTiB", - readOnly: true, - type: { - name: "Number", - }, - }, - privateEndpointConnections: { - serializedName: "privateEndpointConnections", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - publicNetworkAccess: { - serializedName: "publicNetworkAccess", - type: { - name: "String", - }, - }, - autoScaleProperties: { - serializedName: "autoScaleProperties", - type: { - name: "Composite", - className: "AutoScaleProperties", - }, - }, - }, - }, -}; - -export const Sku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Sku", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionProperties", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - privateEndpoint: { - serializedName: "privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint", - }, - }, - privateLinkServiceConnectionState: { - serializedName: "privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - }, - }, - groupIds: { - serializedName: "groupIds", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - actionsRequired: { - serializedName: "actionsRequired", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - }, - }, -}; - -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String", - }, - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String", - }, - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime", - }, - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String", - }, - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String", - }, - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const AutoScaleProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutoScaleProperties", - modelProperties: { - scaleUpProperties: { - serializedName: "scaleUpProperties", - type: { - name: "Composite", - className: "ScaleUpProperties", - }, - }, - }, - }, -}; - -export const ScaleUpProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScaleUpProperties", - modelProperties: { - unusedSizeTiB: { - serializedName: "unusedSizeTiB", - type: { - name: "Number", - }, - }, - increaseCapacityUnitByTiB: { - serializedName: "increaseCapacityUnitByTiB", - type: { - name: "Number", - }, - }, - capacityUnitScaleUpLimitTiB: { - serializedName: "capacityUnitScaleUpLimitTiB", - type: { - name: "Number", - }, - }, - autoScalePolicyEnforcement: { - serializedName: "autoScalePolicyEnforcement", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ElasticSanUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSanUpdate", - modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ElasticSanUpdateProperties", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const ElasticSanUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSanUpdateProperties", - modelProperties: { - baseSizeTiB: { - serializedName: "baseSizeTiB", - type: { - name: "Number", - }, - }, - extendedCapacitySizeTiB: { - serializedName: "extendedCapacitySizeTiB", - type: { - name: "Number", - }, - }, - publicNetworkAccess: { - serializedName: "publicNetworkAccess", - type: { - name: "String", - }, - }, - autoScaleProperties: { - serializedName: "autoScaleProperties", - type: { - name: "Composite", - className: "AutoScaleProperties", - }, - }, - }, - }, -}; - -export const VolumeGroupList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VolumeGroup", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Identity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Identity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - required: true, - type: { - name: "String", - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserAssignedIdentity" }, - }, - }, - }, - }, - }, -}; - -export const UserAssignedIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - clientId: { - serializedName: "clientId", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeGroupProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupProperties", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - protocolType: { - serializedName: "protocolType", - type: { - name: "String", - }, - }, - encryption: { - serializedName: "encryption", - type: { - name: "String", - }, - }, - encryptionProperties: { - serializedName: "encryptionProperties", - type: { - name: "Composite", - className: "EncryptionProperties", - }, - }, - networkAcls: { - serializedName: "networkAcls", - type: { - name: "Composite", - className: "NetworkRuleSet", - }, - }, - privateEndpointConnections: { - serializedName: "privateEndpointConnections", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - enforceDataIntegrityCheckForIscsi: { - serializedName: "enforceDataIntegrityCheckForIscsi", - type: { - name: "Boolean", - }, - }, - deleteRetentionPolicy: { - serializedName: "deleteRetentionPolicy", - type: { - name: "Composite", - className: "DeleteRetentionPolicy", - }, - }, - }, - }, -}; - -export const EncryptionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionProperties", - modelProperties: { - keyVaultProperties: { - serializedName: "keyVaultProperties", - type: { - name: "Composite", - className: "KeyVaultProperties", - }, - }, - encryptionIdentity: { - serializedName: "identity", - type: { - name: "Composite", - className: "EncryptionIdentity", - }, - }, - }, - }, -}; - -export const KeyVaultProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultProperties", - modelProperties: { - keyName: { - serializedName: "keyName", - type: { - name: "String", - }, - }, - keyVersion: { - serializedName: "keyVersion", - type: { - name: "String", - }, - }, - keyVaultUri: { - serializedName: "keyVaultUri", - type: { - name: "String", - }, - }, - currentVersionedKeyIdentifier: { - serializedName: "currentVersionedKeyIdentifier", - readOnly: true, - type: { - name: "String", - }, - }, - lastKeyRotationTimestamp: { - serializedName: "lastKeyRotationTimestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - currentVersionedKeyExpirationTimestamp: { - serializedName: "currentVersionedKeyExpirationTimestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const EncryptionIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionIdentity", - modelProperties: { - encryptionUserAssignedIdentity: { - serializedName: "userAssignedIdentity", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const NetworkRuleSet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkRuleSet", - modelProperties: { - virtualNetworkRules: { - serializedName: "virtualNetworkRules", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualNetworkRule", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualNetworkRule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualNetworkRule", - modelProperties: { - virtualNetworkResourceId: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - action: { - defaultValue: "Allow", - serializedName: "action", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeleteRetentionPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeleteRetentionPolicy", - modelProperties: { - policyState: { - serializedName: "policyState", - type: { - name: "String", - }, - }, - retentionPeriodDays: { - constraints: { - InclusiveMinimum: 0, - }, - serializedName: "retentionPeriodDays", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumeGroupUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupUpdate", - modelProperties: { - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VolumeGroupUpdateProperties", - }, - }, - }, - }, -}; - -export const VolumeGroupUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupUpdateProperties", - modelProperties: { - protocolType: { - serializedName: "protocolType", - type: { - name: "String", - }, - }, - encryption: { - serializedName: "encryption", - type: { - name: "String", - }, - }, - encryptionProperties: { - serializedName: "encryptionProperties", - type: { - name: "Composite", - className: "EncryptionProperties", - }, - }, - networkAcls: { - serializedName: "networkAcls", - type: { - name: "Composite", - className: "NetworkRuleSet", - }, - }, - enforceDataIntegrityCheckForIscsi: { - serializedName: "enforceDataIntegrityCheckForIscsi", - type: { - name: "Boolean", - }, - }, - deleteRetentionPolicy: { - serializedName: "deleteRetentionPolicy", - type: { - name: "Composite", - className: "DeleteRetentionPolicy", - }, - }, - }, - }, -}; - -export const VolumeProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeProperties", - modelProperties: { - volumeId: { - serializedName: "volumeId", - readOnly: true, - type: { - name: "String", - }, - }, - creationData: { - serializedName: "creationData", - type: { - name: "Composite", - className: "SourceCreationData", - }, - }, - sizeGiB: { - serializedName: "sizeGiB", - required: true, - type: { - name: "Number", - }, - }, - storageTarget: { - serializedName: "storageTarget", - type: { - name: "Composite", - className: "IscsiTargetInfo", - }, - }, - managedBy: { - serializedName: "managedBy", - type: { - name: "Composite", - className: "ManagedByInfo", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SourceCreationData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SourceCreationData", - modelProperties: { - createSource: { - serializedName: "createSource", - type: { - name: "String", - }, - }, - sourceId: { - serializedName: "sourceId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const IscsiTargetInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "IscsiTargetInfo", - modelProperties: { - targetIqn: { - serializedName: "targetIqn", - readOnly: true, - type: { - name: "String", - }, - }, - targetPortalHostname: { - serializedName: "targetPortalHostname", - readOnly: true, - type: { - name: "String", - }, - }, - targetPortalPort: { - serializedName: "targetPortalPort", - readOnly: true, - type: { - name: "Number", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ManagedByInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagedByInfo", - modelProperties: { - resourceId: { - serializedName: "resourceId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeUpdate", - modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VolumeUpdateProperties", - }, - }, - }, - }, -}; - -export const VolumeUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeUpdateProperties", - modelProperties: { - sizeGiB: { - serializedName: "sizeGiB", - type: { - name: "Number", - }, - }, - managedBy: { - serializedName: "managedBy", - type: { - name: "Composite", - className: "ManagedByInfo", - }, - }, - }, - }, -}; - -export const VolumeList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Volume", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateLinkResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceProperties", - modelProperties: { - groupId: { - serializedName: "groupId", - readOnly: true, - type: { - name: "String", - }, - }, - requiredMembers: { - serializedName: "requiredMembers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - requiredZoneNames: { - serializedName: "requiredZoneNames", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const SnapshotList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Snapshot", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SnapshotProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotProperties", - modelProperties: { - creationData: { - serializedName: "creationData", - type: { - name: "Composite", - className: "SnapshotCreationData", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - sourceVolumeSizeGiB: { - serializedName: "sourceVolumeSizeGiB", - readOnly: true, - type: { - name: "Number", - }, - }, - volumeName: { - serializedName: "volumeName", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SnapshotCreationData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotCreationData", - modelProperties: { - sourceId: { - serializedName: "sourceId", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeNameList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeNameList", - modelProperties: { - volumeNames: { - serializedName: "volumeNames", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const PreValidationResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PreValidationResponse", - modelProperties: { - validationStatus: { - serializedName: "validationStatus", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskSnapshotList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskSnapshotList", - modelProperties: { - diskSnapshotIds: { - serializedName: "diskSnapshotIds", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const PrivateEndpointConnection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...Resource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "PrivateEndpointConnectionProperties", - }, - }, - }, - }, -}; - -export const TrackedResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TrackedResource", - modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties, - }, - }, -}; - -export const PrivateLinkResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResource", - modelProperties: { - ...Resource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "PrivateLinkResourceProperties", - }, - }, - }, - }, -}; - -export const ElasticSan: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSan", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ElasticSanProperties", - }, - }, - }, - }, -}; - -export const VolumeGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroup", - modelProperties: { - ...ProxyResource.type.modelProperties, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VolumeGroupProperties", - }, - }, - }, - }, -}; - -export const Volume: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Volume", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VolumeProperties", - }, - }, - }, - }, -}; - -export const Snapshot: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Snapshot", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "SnapshotProperties", - }, - }, - }, - }, -}; - -export const ElasticSansUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSansUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ElasticSansDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSansDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeGroupsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeGroupsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumesUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumesDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumesDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumesPreBackupHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumesPreBackupHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumesPreRestoreHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumesPreRestoreHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ElasticSanManagementRestoreVolumeHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "ElasticSanManagementRestoreVolumeHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "PrivateEndpointConnectionsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const VolumeSnapshotsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeSnapshotsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/models/models.ts b/sdk/elasticsans/arm-elasticsan/src/models/models.ts new file mode 100644 index 000000000000..5d6e51ea44e8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/models/models.ts @@ -0,0 +1,1830 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface _OperationListResult { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + readonly actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; +} + +/** Localized display information for and operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ +export enum KnownOrigin { + /** Indicates the operation is initiated by a user. */ + User = "user", + /** Indicates the operation is initiated by a system. */ + System = "system", + /** Indicates the operation is initiated by a user or system. */ + UserSystem = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user**: Indicates the operation is initiated by a user. \ + * **system**: Indicates the operation is initiated by a system. \ + * **user,system**: Indicates the operation is initiated by a user or system. + */ +export type Origin = string; + +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +export enum KnownActionType { + /** Actions are for internal-only APIs. */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal**: Actions are for internal-only APIs. + */ +export type ActionType = string; + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: any; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: item["info"], + }; +} + +/** Response for ElasticSan request. */ +export interface ElasticSan extends TrackedResource { + /** Properties of ElasticSan. */ + properties: ElasticSanProperties; +} + +export function elasticSanSerializer(item: ElasticSan): any { + return { + tags: item["tags"], + location: item["location"], + properties: elasticSanPropertiesSerializer(item["properties"]), + }; +} + +export function elasticSanDeserializer(item: any): ElasticSan { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: elasticSanPropertiesDeserializer(item["properties"]), + }; +} + +/** Elastic San response properties. */ +export interface ElasticSanProperties { + /** resource sku */ + sku: Sku; + /** Logical zone for Elastic San resource; example: ["1"]. */ + availabilityZones?: string[]; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB: number; + /** Total size of the provisioned Volumes in GiB. */ + readonly totalVolumeSizeGiB?: number; + /** Total number of volume groups in this Elastic San appliance. */ + readonly volumeGroupCount?: number; + /** Total Provisioned IOPS of the Elastic San appliance. */ + readonly totalIops?: number; + /** Total Provisioned MBps Elastic San appliance. */ + readonly totalMBps?: number; + /** Total size of the Elastic San appliance in TB. */ + readonly totalSizeTiB?: number; + /** The list of Private Endpoint Connections. */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Auto Scale Properties for Elastic San Appliance. */ + autoScaleProperties?: AutoScaleProperties; +} + +export function elasticSanPropertiesSerializer(item: ElasticSanProperties): any { + return { + sku: skuSerializer(item["sku"]), + availabilityZones: !item["availabilityZones"] + ? item["availabilityZones"] + : item["availabilityZones"].map((p: any) => { + return p; + }), + baseSizeTiB: item["baseSizeTiB"], + extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], + publicNetworkAccess: item["publicNetworkAccess"], + autoScaleProperties: !item["autoScaleProperties"] + ? item["autoScaleProperties"] + : autoScalePropertiesSerializer(item["autoScaleProperties"]), + }; +} + +export function elasticSanPropertiesDeserializer(item: any): ElasticSanProperties { + return { + sku: skuDeserializer(item["sku"]), + availabilityZones: !item["availabilityZones"] + ? item["availabilityZones"] + : item["availabilityZones"].map((p: any) => { + return p; + }), + provisioningState: item["provisioningState"], + baseSizeTiB: item["baseSizeTiB"], + extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], + totalVolumeSizeGiB: item["totalVolumeSizeGiB"], + volumeGroupCount: item["volumeGroupCount"], + totalIops: item["totalIops"], + totalMBps: item["totalMBps"], + totalSizeTiB: item["totalSizeTiB"], + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + publicNetworkAccess: item["publicNetworkAccess"], + autoScaleProperties: !item["autoScaleProperties"] + ? item["autoScaleProperties"] + : autoScalePropertiesDeserializer(item["autoScaleProperties"]), + }; +} + +/** The SKU name. Required for account creation; optional for update. */ +export interface Sku { + /** The sku name. */ + name: SkuName; + /** The sku tier. */ + tier?: SkuTier; +} + +export function skuSerializer(item: Sku): any { + return { name: item["name"], tier: item["tier"] }; +} + +export function skuDeserializer(item: any): Sku { + return { + name: item["name"], + tier: item["tier"], + }; +} + +/** The sku name. */ +export enum KnownSkuName { + /** Premium locally redundant storage */ + PremiumLRS = "Premium_LRS", + /** Premium zone redundant storage */ + PremiumZRS = "Premium_ZRS", +} + +/** + * The sku name. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Premium_LRS**: Premium locally redundant storage \ + * **Premium_ZRS**: Premium zone redundant storage + */ +export type SkuName = string; + +/** The sku tier. */ +export enum KnownSkuTier { + /** Premium Tier */ + Premium = "Premium", +} + +/** + * The sku tier. \ + * {@link KnownSkuTier} can be used interchangeably with SkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Premium**: Premium Tier + */ +export type SkuTier = string; + +/** Provisioning state of the iSCSI Target. */ +export enum KnownProvisioningStates { + /** Invalid */ + Invalid = "Invalid", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Pending */ + Pending = "Pending", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", + /** Deleted */ + Deleted = "Deleted", + /** Restoring */ + Restoring = "Restoring", +} + +/** + * Provisioning state of the iSCSI Target. \ + * {@link KnownProvisioningStates} can be used interchangeably with ProvisioningStates, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Pending** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Deleted** \ + * **Restoring** + */ +export type ProvisioningStates = string; + +export function privateEndpointConnectionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionSerializer(item); + }); +} + +export function privateEndpointConnectionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionDeserializer(item); + }); +} + +/** Response for PrivateEndpoint Connection object */ +export interface PrivateEndpointConnection extends ProxyResource { + /** Private Endpoint Connection Properties. */ + properties: PrivateEndpointConnectionProperties; +} + +export function privateEndpointConnectionSerializer(item: PrivateEndpointConnection): any { + return { + properties: privateEndpointConnectionPropertiesSerializer(item["properties"]), + }; +} + +export function privateEndpointConnectionDeserializer(item: any): PrivateEndpointConnection { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: privateEndpointConnectionPropertiesDeserializer(item["properties"]), + }; +} + +/** Response for PrivateEndpoint connection properties */ +export interface PrivateEndpointConnectionProperties { + /** Provisioning State of Private Endpoint connection resource */ + readonly provisioningState?: ProvisioningStates; + /** Private Endpoint resource */ + privateEndpoint?: PrivateEndpoint; + /** Private Link Service Connection State. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** List of resources private endpoint is mapped */ + groupIds?: string[]; +} + +export function privateEndpointConnectionPropertiesSerializer( + item: PrivateEndpointConnectionProperties, +): any { + return { + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointSerializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateSerializer( + item["privateLinkServiceConnectionState"], + ), + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + }; +} + +export function privateEndpointConnectionPropertiesDeserializer( + item: any, +): PrivateEndpointConnectionProperties { + return { + provisioningState: item["provisioningState"], + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointDeserializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateDeserializer( + item["privateLinkServiceConnectionState"], + ), + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + }; +} + +/** Response for PrivateEndpoint */ +export interface PrivateEndpoint { + /** The ARM identifier for Private Endpoint */ + readonly id?: string; +} + +export function privateEndpointSerializer(item: PrivateEndpoint): any { + return item; +} + +export function privateEndpointDeserializer(item: any): PrivateEndpoint { + return { + id: item["id"], + }; +} + +/** Response for Private Link Service Connection state */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +export function privateLinkServiceConnectionStateSerializer( + item: PrivateLinkServiceConnectionState, +): any { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +export function privateLinkServiceConnectionStateDeserializer( + item: any, +): PrivateLinkServiceConnectionState { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +/** The private endpoint connection status. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Failed */ + Failed = "Failed", + /** Rejected */ + Rejected = "Rejected", +} + +/** + * The private endpoint connection status. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Failed** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type PublicNetworkAccess = string; + +/** The auto scale settings on Elastic San Appliance. */ +export interface AutoScaleProperties { + /** Scale up settings on Elastic San Appliance. */ + scaleUpProperties?: ScaleUpProperties; +} + +export function autoScalePropertiesSerializer(item: AutoScaleProperties): any { + return { + scaleUpProperties: !item["scaleUpProperties"] + ? item["scaleUpProperties"] + : scaleUpPropertiesSerializer(item["scaleUpProperties"]), + }; +} + +export function autoScalePropertiesDeserializer(item: any): AutoScaleProperties { + return { + scaleUpProperties: !item["scaleUpProperties"] + ? item["scaleUpProperties"] + : scaleUpPropertiesDeserializer(item["scaleUpProperties"]), + }; +} + +/** Scale up properties on Elastic San Appliance. */ +export interface ScaleUpProperties { + /** Unused size on Elastic San appliance in TiB. */ + unusedSizeTiB?: number; + /** Unit to increase Capacity Unit on Elastic San appliance in TiB. */ + increaseCapacityUnitByTiB?: number; + /** Maximum scale up size on Elastic San appliance in TiB. */ + capacityUnitScaleUpLimitTiB?: number; + /** Enable or Disable scale up setting on Elastic San Appliance. */ + autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; +} + +export function scaleUpPropertiesSerializer(item: ScaleUpProperties): any { + return { + unusedSizeTiB: item["unusedSizeTiB"], + increaseCapacityUnitByTiB: item["increaseCapacityUnitByTiB"], + capacityUnitScaleUpLimitTiB: item["capacityUnitScaleUpLimitTiB"], + autoScalePolicyEnforcement: item["autoScalePolicyEnforcement"], + }; +} + +export function scaleUpPropertiesDeserializer(item: any): ScaleUpProperties { + return { + unusedSizeTiB: item["unusedSizeTiB"], + increaseCapacityUnitByTiB: item["increaseCapacityUnitByTiB"], + capacityUnitScaleUpLimitTiB: item["capacityUnitScaleUpLimitTiB"], + autoScalePolicyEnforcement: item["autoScalePolicyEnforcement"], + }; +} + +/** Enable or Disable scale up setting on Elastic San Appliance. */ +export enum KnownAutoScalePolicyEnforcement { + /** None */ + None = "None", + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * Enable or Disable scale up setting on Elastic San Appliance. \ + * {@link KnownAutoScalePolicyEnforcement} can be used interchangeably with AutoScalePolicyEnforcement, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Enabled** \ + * **Disabled** + */ +export type AutoScalePolicyEnforcement = string; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceSerializer(item: ProxyResource): any { + return item; +} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: item["tags"], + location: item["location"], + }; +} + +/** Response for ElasticSan update request. */ +export interface ElasticSanUpdate { + /** Properties of ElasticSan. */ + properties?: ElasticSanUpdateProperties; + /** Update tags */ + tags?: Record; +} + +export function elasticSanUpdateSerializer(item: ElasticSanUpdate): any { + return { + properties: !item["properties"] + ? item["properties"] + : elasticSanUpdatePropertiesSerializer(item["properties"]), + tags: item["tags"], + }; +} + +/** Elastic San update properties. */ +export interface ElasticSanUpdateProperties { + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB?: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB?: number; + /** Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Auto Scale Properties for Elastic San Appliance. */ + autoScaleProperties?: AutoScaleProperties; +} + +export function elasticSanUpdatePropertiesSerializer(item: ElasticSanUpdateProperties): any { + return { + baseSizeTiB: item["baseSizeTiB"], + extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], + publicNetworkAccess: item["publicNetworkAccess"], + autoScaleProperties: !item["autoScaleProperties"] + ? item["autoScaleProperties"] + : autoScalePropertiesSerializer(item["autoScaleProperties"]), + }; +} + +/** List of Elastic Sans */ +export interface _ElasticSanList { + /** The ElasticSan items on this page */ + value: ElasticSan[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _elasticSanListDeserializer(item: any): _ElasticSanList { + return { + value: elasticSanArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function elasticSanArraySerializer(result: Array): any[] { + return result.map((item) => { + return elasticSanSerializer(item); + }); +} + +export function elasticSanArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return elasticSanDeserializer(item); + }); +} + +/** The response of a PrivateEndpointConnection list operation. */ +export interface _PrivateEndpointConnectionListResult { + /** The PrivateEndpointConnection items on this page */ + value: PrivateEndpointConnection[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _privateEndpointConnectionListResultDeserializer( + item: any, +): _PrivateEndpointConnectionListResult { + return { + value: privateEndpointConnectionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +/** Response for Volume request. */ +export interface Volume extends ProxyResource { + /** Properties of Volume. */ + properties: VolumeProperties; +} + +export function volumeSerializer(item: Volume): any { + return { properties: volumePropertiesSerializer(item["properties"]) }; +} + +export function volumeDeserializer(item: any): Volume { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: volumePropertiesDeserializer(item["properties"]), + }; +} + +/** Volume response properties. */ +export interface VolumeProperties { + /** Unique Id of the volume in GUID format */ + readonly volumeId?: string; + /** State of the operation on the resource. */ + creationData?: SourceCreationData; + /** Volume size. */ + sizeGiB: number; + /** Storage target information */ + readonly storageTarget?: IscsiTargetInfo; + /** Parent resource information. */ + managedBy?: ManagedByInfo; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; +} + +export function volumePropertiesSerializer(item: VolumeProperties): any { + return { + creationData: !item["creationData"] + ? item["creationData"] + : sourceCreationDataSerializer(item["creationData"]), + sizeGiB: item["sizeGiB"], + managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), + }; +} + +export function volumePropertiesDeserializer(item: any): VolumeProperties { + return { + volumeId: item["volumeId"], + creationData: !item["creationData"] + ? item["creationData"] + : sourceCreationDataDeserializer(item["creationData"]), + sizeGiB: item["sizeGiB"], + storageTarget: !item["storageTarget"] + ? item["storageTarget"] + : iscsiTargetInfoDeserializer(item["storageTarget"]), + managedBy: !item["managedBy"] + ? item["managedBy"] + : managedByInfoDeserializer(item["managedBy"]), + provisioningState: item["provisioningState"], + }; +} + +/** Data source used when creating the volume. */ +export interface SourceCreationData { + /** This enumerates the possible sources of a volume creation. */ + createSource?: VolumeCreateOption; + /** Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ + sourceId?: string; +} + +export function sourceCreationDataSerializer(item: SourceCreationData): any { + return { createSource: item["createSource"], sourceId: item["sourceId"] }; +} + +export function sourceCreationDataDeserializer(item: any): SourceCreationData { + return { + createSource: item["createSource"], + sourceId: item["sourceId"], + }; +} + +/** This enumerates the possible sources of a volume creation. */ +export enum KnownVolumeCreateOption { + /** None */ + None = "None", + /** VolumeSnapshot */ + VolumeSnapshot = "VolumeSnapshot", + /** DiskSnapshot */ + DiskSnapshot = "DiskSnapshot", + /** Disk */ + Disk = "Disk", + /** DiskRestorePoint */ + DiskRestorePoint = "DiskRestorePoint", +} + +/** + * This enumerates the possible sources of a volume creation. \ + * {@link KnownVolumeCreateOption} can be used interchangeably with VolumeCreateOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **VolumeSnapshot** \ + * **DiskSnapshot** \ + * **Disk** \ + * **DiskRestorePoint** + */ +export type VolumeCreateOption = string; + +/** Iscsi target information */ +export interface IscsiTargetInfo { + /** iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". */ + readonly targetIqn?: string; + /** iSCSI Target Portal Host Name */ + readonly targetPortalHostname?: string; + /** iSCSI Target Portal Port */ + readonly targetPortalPort?: number; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Operational status of the iSCSI Target. */ + status?: OperationalStatus; +} + +export function iscsiTargetInfoDeserializer(item: any): IscsiTargetInfo { + return { + targetIqn: item["targetIqn"], + targetPortalHostname: item["targetPortalHostname"], + targetPortalPort: item["targetPortalPort"], + provisioningState: item["provisioningState"], + status: item["status"], + }; +} + +/** Operational status of the resource. */ +export enum KnownOperationalStatus { + /** Invalid */ + Invalid = "Invalid", + /** Unknown */ + Unknown = "Unknown", + /** Healthy */ + Healthy = "Healthy", + /** Unhealthy */ + Unhealthy = "Unhealthy", + /** Updating */ + Updating = "Updating", + /** Running */ + Running = "Running", + /** Stopped */ + Stopped = "Stopped", + /** Stopped (deallocated) */ + StoppedDeallocated = "Stopped (deallocated)", +} + +/** + * Operational status of the resource. \ + * {@link KnownOperationalStatus} can be used interchangeably with OperationalStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Unknown** \ + * **Healthy** \ + * **Unhealthy** \ + * **Updating** \ + * **Running** \ + * **Stopped** \ + * **Stopped (deallocated)** + */ +export type OperationalStatus = string; + +/** Parent resource information. */ +export interface ManagedByInfo { + /** Resource ID of the resource managing the volume, this is a restricted field and can only be set for internal use. */ + resourceId?: string; +} + +export function managedByInfoSerializer(item: ManagedByInfo): any { + return { resourceId: item["resourceId"] }; +} + +export function managedByInfoDeserializer(item: any): ManagedByInfo { + return { + resourceId: item["resourceId"], + }; +} + +/** Response for Volume request. */ +export interface VolumeUpdate { + /** Properties of Volume. */ + properties?: VolumeUpdateProperties; +} + +export function volumeUpdateSerializer(item: VolumeUpdate): any { + return { + properties: !item["properties"] + ? item["properties"] + : volumeUpdatePropertiesSerializer(item["properties"]), + }; +} + +/** Volume response properties. */ +export interface VolumeUpdateProperties { + /** Volume size. */ + sizeGiB?: number; + /** Parent resource information. */ + managedBy?: ManagedByInfo; +} + +export function volumeUpdatePropertiesSerializer(item: VolumeUpdateProperties): any { + return { + sizeGiB: item["sizeGiB"], + managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), + }; +} + +/** List of Volumes */ +export interface _VolumeList { + /** The Volume items on this page */ + value: Volume[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _volumeListDeserializer(item: any): _VolumeList { + return { + value: volumeArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function volumeArraySerializer(result: Array): any[] { + return result.map((item) => { + return volumeSerializer(item); + }); +} + +export function volumeArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return volumeDeserializer(item); + }); +} + +/** object to hold array of volume names */ +export interface VolumeNameList { + /** array of volume names */ + volumeNames: string[]; +} + +export function volumeNameListSerializer(item: VolumeNameList): any { + return { + volumeNames: item["volumeNames"].map((p: any) => { + return p; + }), + }; +} + +/** response object for pre validation api */ +export interface PreValidationResponse { + /** a status value indicating success or failure of validation */ + validationStatus?: string; +} + +export function preValidationResponseDeserializer(item: any): PreValidationResponse { + return { + validationStatus: item["validationStatus"], + }; +} + +/** object to hold array of Disk Snapshot ARM IDs */ +export interface DiskSnapshotList { + /** array of DiskSnapshot ARM IDs */ + diskSnapshotIds: string[]; +} + +export function diskSnapshotListSerializer(item: DiskSnapshotList): any { + return { + diskSnapshotIds: item["diskSnapshotIds"].map((p: any) => { + return p; + }), + }; +} + +/** Response for Volume Group request. */ +export interface VolumeGroup extends ProxyResource { + /** The identity of the resource. */ + identity?: Identity; + /** Properties of VolumeGroup. */ + properties?: VolumeGroupProperties; +} + +export function volumeGroupSerializer(item: VolumeGroup): any { + return { + identity: !item["identity"] ? item["identity"] : identitySerializer(item["identity"]), + properties: !item["properties"] + ? item["properties"] + : volumeGroupPropertiesSerializer(item["properties"]), + }; +} + +export function volumeGroupDeserializer(item: any): VolumeGroup { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + identity: !item["identity"] ? item["identity"] : identityDeserializer(item["identity"]), + properties: !item["properties"] + ? item["properties"] + : volumeGroupPropertiesDeserializer(item["properties"]), + }; +} + +/** Identity for the resource. */ +export interface Identity { + /** The principal ID of resource identity. */ + readonly principalId?: string; + /** The tenant ID of resource. */ + readonly tenantId?: string; + /** The identity type. */ + type: IdentityType; + /** Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this volume group. The key is the ARM resource identifier of the identity. */ + userAssignedIdentities?: Record; +} + +export function identitySerializer(item: Identity): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function identityDeserializer(item: any): Identity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** The identity type. */ +export enum KnownIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", +} + +/** + * The identity type. \ + * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** + */ +export type IdentityType = string; + +export function userAssignedIdentityRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentitySerializer(item[key]); + }); + return result; +} + +export function userAssignedIdentityRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentityDeserializer(item[key]); + }); + return result; +} + +/** UserAssignedIdentity for the resource. */ +export interface UserAssignedIdentity { + /** The principal ID of the identity. */ + readonly principalId?: string; + /** The client ID of the identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitySerializer(item: UserAssignedIdentity): any { + return item; +} + +export function userAssignedIdentityDeserializer(item: any): UserAssignedIdentity { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** VolumeGroup response properties. */ +export interface VolumeGroupProperties { + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** Encryption Properties describing Key Vault and Identity information */ + encryptionProperties?: EncryptionProperties; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; + /** The list of Private Endpoint Connections. */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** A boolean indicating whether or not Data Integrity Check is enabled */ + enforceDataIntegrityCheckForIscsi?: boolean; +} + +export function volumeGroupPropertiesSerializer(item: VolumeGroupProperties): any { + return { + protocolType: item["protocolType"], + encryption: item["encryption"], + encryptionProperties: !item["encryptionProperties"] + ? item["encryptionProperties"] + : encryptionPropertiesSerializer(item["encryptionProperties"]), + networkAcls: !item["networkAcls"] + ? item["networkAcls"] + : networkRuleSetSerializer(item["networkAcls"]), + enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], + }; +} + +export function volumeGroupPropertiesDeserializer(item: any): VolumeGroupProperties { + return { + provisioningState: item["provisioningState"], + protocolType: item["protocolType"], + encryption: item["encryption"], + encryptionProperties: !item["encryptionProperties"] + ? item["encryptionProperties"] + : encryptionPropertiesDeserializer(item["encryptionProperties"]), + networkAcls: !item["networkAcls"] + ? item["networkAcls"] + : networkRuleSetDeserializer(item["networkAcls"]), + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], + }; +} + +/** Storage Target type. */ +export enum KnownStorageTargetType { + /** Iscsi */ + Iscsi = "Iscsi", + /** None */ + None = "None", +} + +/** + * Storage Target type. \ + * {@link KnownStorageTargetType} can be used interchangeably with StorageTargetType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Iscsi** \ + * **None** + */ +export type StorageTargetType = string; + +/** The type of key used to encrypt the data of the disk. */ +export enum KnownEncryptionType { + /** Volume is encrypted at rest with Platform managed key. It is the default encryption type. */ + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", + /** Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ + EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", +} + +/** + * The type of key used to encrypt the data of the disk. \ + * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptionAtRestWithPlatformKey**: Volume is encrypted at rest with Platform managed key. It is the default encryption type. \ + * **EncryptionAtRestWithCustomerManagedKey**: Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. + */ +export type EncryptionType = string; + +/** The encryption settings on the volume group. */ +export interface EncryptionProperties { + /** Properties provided by key vault. */ + keyVaultProperties?: KeyVaultProperties; + /** The identity to be used with service-side encryption at rest. */ + encryptionIdentity?: EncryptionIdentity; +} + +export function encryptionPropertiesSerializer(item: EncryptionProperties): any { + return { + keyVaultProperties: !item["keyVaultProperties"] + ? item["keyVaultProperties"] + : keyVaultPropertiesSerializer(item["keyVaultProperties"]), + identity: !item["encryptionIdentity"] + ? item["encryptionIdentity"] + : encryptionIdentitySerializer(item["encryptionIdentity"]), + }; +} + +export function encryptionPropertiesDeserializer(item: any): EncryptionProperties { + return { + keyVaultProperties: !item["keyVaultProperties"] + ? item["keyVaultProperties"] + : keyVaultPropertiesDeserializer(item["keyVaultProperties"]), + encryptionIdentity: !item["identity"] + ? item["identity"] + : encryptionIdentityDeserializer(item["identity"]), + }; +} + +/** Properties of key vault. */ +export interface KeyVaultProperties { + /** The name of KeyVault key. */ + keyName?: string; + /** The version of KeyVault key. */ + keyVersion?: string; + /** The Uri of KeyVault. */ + keyVaultUri?: string; + /** The object identifier of the current versioned Key Vault Key in use. */ + readonly currentVersionedKeyIdentifier?: string; + /** Timestamp of last rotation of the Key Vault Key. */ + readonly lastKeyRotationTimestamp?: Date; + /** This is a read only property that represents the expiration time of the current version of the customer managed key used for encryption. */ + readonly currentVersionedKeyExpirationTimestamp?: Date; +} + +export function keyVaultPropertiesSerializer(item: KeyVaultProperties): any { + return { + keyName: item["keyName"], + keyVersion: item["keyVersion"], + keyVaultUri: item["keyVaultUri"], + }; +} + +export function keyVaultPropertiesDeserializer(item: any): KeyVaultProperties { + return { + keyName: item["keyName"], + keyVersion: item["keyVersion"], + keyVaultUri: item["keyVaultUri"], + currentVersionedKeyIdentifier: item["currentVersionedKeyIdentifier"], + lastKeyRotationTimestamp: !item["lastKeyRotationTimestamp"] + ? item["lastKeyRotationTimestamp"] + : new Date(item["lastKeyRotationTimestamp"]), + currentVersionedKeyExpirationTimestamp: !item["currentVersionedKeyExpirationTimestamp"] + ? item["currentVersionedKeyExpirationTimestamp"] + : new Date(item["currentVersionedKeyExpirationTimestamp"]), + }; +} + +/** Encryption identity for the volume group. */ +export interface EncryptionIdentity { + /** Resource identifier of the UserAssigned identity to be associated with server-side encryption on the volume group. */ + encryptionUserAssignedIdentity?: string; +} + +export function encryptionIdentitySerializer(item: EncryptionIdentity): any { + return { userAssignedIdentity: item["encryptionUserAssignedIdentity"] }; +} + +export function encryptionIdentityDeserializer(item: any): EncryptionIdentity { + return { + encryptionUserAssignedIdentity: item["userAssignedIdentity"], + }; +} + +/** A set of rules governing the network accessibility. */ +export interface NetworkRuleSet { + /** The list of virtual network rules. */ + virtualNetworkRules?: VirtualNetworkRule[]; +} + +export function networkRuleSetSerializer(item: NetworkRuleSet): any { + return { + virtualNetworkRules: !item["virtualNetworkRules"] + ? item["virtualNetworkRules"] + : virtualNetworkRuleArraySerializer(item["virtualNetworkRules"]), + }; +} + +export function networkRuleSetDeserializer(item: any): NetworkRuleSet { + return { + virtualNetworkRules: !item["virtualNetworkRules"] + ? item["virtualNetworkRules"] + : virtualNetworkRuleArrayDeserializer(item["virtualNetworkRules"]), + }; +} + +export function virtualNetworkRuleArraySerializer(result: Array): any[] { + return result.map((item) => { + return virtualNetworkRuleSerializer(item); + }); +} + +export function virtualNetworkRuleArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualNetworkRuleDeserializer(item); + }); +} + +/** Virtual Network rule. */ +export interface VirtualNetworkRule { + /** Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. */ + virtualNetworkResourceId: string; + /** The action of virtual network rule. */ + action?: Action; +} + +export function virtualNetworkRuleSerializer(item: VirtualNetworkRule): any { + return { id: item["virtualNetworkResourceId"], action: item["action"] }; +} + +export function virtualNetworkRuleDeserializer(item: any): VirtualNetworkRule { + return { + virtualNetworkResourceId: item["id"], + action: item["action"], + }; +} + +/** The action of virtual network rule. */ +export enum KnownAction { + /** Allow */ + Allow = "Allow", +} + +/** + * The action of virtual network rule. \ + * {@link KnownAction} can be used interchangeably with Action, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** + */ +export type Action = string; + +/** Volume Group request. */ +export interface VolumeGroupUpdate { + /** The identity of the resource. */ + identity?: Identity; + /** Properties of VolumeGroup. */ + properties?: VolumeGroupUpdateProperties; +} + +export function volumeGroupUpdateSerializer(item: VolumeGroupUpdate): any { + return { + identity: !item["identity"] ? item["identity"] : identitySerializer(item["identity"]), + properties: !item["properties"] + ? item["properties"] + : volumeGroupUpdatePropertiesSerializer(item["properties"]), + }; +} + +/** VolumeGroup response properties. */ +export interface VolumeGroupUpdateProperties { + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** Encryption Properties describing Key Vault and Identity information */ + encryptionProperties?: EncryptionProperties; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; + /** A boolean indicating whether or not Data Integrity Check is enabled */ + enforceDataIntegrityCheckForIscsi?: boolean; +} + +export function volumeGroupUpdatePropertiesSerializer(item: VolumeGroupUpdateProperties): any { + return { + protocolType: item["protocolType"], + encryption: item["encryption"], + encryptionProperties: !item["encryptionProperties"] + ? item["encryptionProperties"] + : encryptionPropertiesSerializer(item["encryptionProperties"]), + networkAcls: !item["networkAcls"] + ? item["networkAcls"] + : networkRuleSetSerializer(item["networkAcls"]), + enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], + }; +} + +/** List of Volume Groups */ +export interface _VolumeGroupList { + /** The VolumeGroup items on this page */ + value: VolumeGroup[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _volumeGroupListDeserializer(item: any): _VolumeGroupList { + return { + value: volumeGroupArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function volumeGroupArraySerializer(result: Array): any[] { + return result.map((item) => { + return volumeGroupSerializer(item); + }); +} + +export function volumeGroupArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return volumeGroupDeserializer(item); + }); +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value: PrivateLinkResource[]; + /** URI to fetch the next section of the paginated response. */ + readonly nextLink?: string; +} + +export function privateLinkResourceListResultDeserializer( + item: any, +): PrivateLinkResourceListResult { + return { + value: privateLinkResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function privateLinkResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return privateLinkResourceDeserializer(item); + }); +} + +/** A private link resource */ +export interface PrivateLinkResource extends Resource { + /** Resource properties. */ + properties?: PrivateLinkResourceProperties; +} + +export function privateLinkResourceDeserializer(item: any): PrivateLinkResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : privateLinkResourcePropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourceProperties { + /** The private link resource group id. */ + readonly groupId?: string; + /** The private link resource required member names. */ + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +export function privateLinkResourcePropertiesDeserializer( + item: any, +): PrivateLinkResourceProperties { + return { + groupId: item["groupId"], + requiredMembers: !item["requiredMembers"] + ? item["requiredMembers"] + : item["requiredMembers"].map((p: any) => { + return p; + }), + requiredZoneNames: !item["requiredZoneNames"] + ? item["requiredZoneNames"] + : item["requiredZoneNames"].map((p: any) => { + return p; + }), + }; +} + +/** Response for Volume Snapshot request. */ +export interface Snapshot extends ProxyResource { + /** Properties of Volume Snapshot. */ + properties: SnapshotProperties; +} + +export function snapshotSerializer(item: Snapshot): any { + return { properties: snapshotPropertiesSerializer(item["properties"]) }; +} + +export function snapshotDeserializer(item: any): Snapshot { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: snapshotPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties for Snapshot. */ +export interface SnapshotProperties { + /** Data used when creating a volume snapshot. */ + creationData: SnapshotCreationData; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Size of Source Volume */ + readonly sourceVolumeSizeGiB?: number; + /** Source Volume Name of a snapshot */ + readonly volumeName?: string; +} + +export function snapshotPropertiesSerializer(item: SnapshotProperties): any { + return { creationData: snapshotCreationDataSerializer(item["creationData"]) }; +} + +export function snapshotPropertiesDeserializer(item: any): SnapshotProperties { + return { + creationData: snapshotCreationDataDeserializer(item["creationData"]), + provisioningState: item["provisioningState"], + sourceVolumeSizeGiB: item["sourceVolumeSizeGiB"], + volumeName: item["volumeName"], + }; +} + +/** Data used when creating a volume snapshot. */ +export interface SnapshotCreationData { + /** Fully qualified resource ID of the volume. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" */ + sourceId: string; +} + +export function snapshotCreationDataSerializer(item: SnapshotCreationData): any { + return { sourceId: item["sourceId"] }; +} + +export function snapshotCreationDataDeserializer(item: any): SnapshotCreationData { + return { + sourceId: item["sourceId"], + }; +} + +/** List of Snapshots */ +export interface _SnapshotList { + /** The Snapshot items on this page */ + value: Snapshot[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _snapshotListDeserializer(item: any): _SnapshotList { + return { + value: snapshotArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function snapshotArraySerializer(result: Array): any[] { + return result.map((item) => { + return snapshotSerializer(item); + }); +} + +export function snapshotArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return snapshotDeserializer(item); + }); +} + +/** List of SKU Information objects */ +export interface _SkuInformationList { + /** The SkuInformation items on this page */ + readonly value: SkuInformation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _skuInformationListDeserializer(item: any): _SkuInformationList { + return { + value: skuInformationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function skuInformationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return skuInformationDeserializer(item); + }); +} + +/** ElasticSAN SKU and its properties */ +export interface SkuInformation { + /** Sku Name */ + name: SkuName; + /** Sku Tier */ + tier?: SkuTier; + /** The type of the resource. */ + readonly resourceType?: string; + /** The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). */ + readonly locations?: string[]; + /** Availability of the SKU for the location/zone */ + readonly locationInfo?: SkuLocationInfo[]; + /** The capability information in the specified SKU. */ + readonly capabilities?: SKUCapability[]; +} + +export function skuInformationDeserializer(item: any): SkuInformation { + return { + name: item["name"], + tier: item["tier"], + resourceType: item["resourceType"], + locations: !item["locations"] + ? item["locations"] + : item["locations"].map((p: any) => { + return p; + }), + locationInfo: !item["locationInfo"] + ? item["locationInfo"] + : skuLocationInfoArrayDeserializer(item["locationInfo"]), + capabilities: !item["capabilities"] + ? item["capabilities"] + : skuCapabilityArrayDeserializer(item["capabilities"]), + }; +} + +export function skuLocationInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return skuLocationInfoDeserializer(item); + }); +} + +/** The location info. */ +export interface SkuLocationInfo { + /** The location. */ + readonly location?: string; + /** The zones. */ + readonly zones?: string[]; +} + +export function skuLocationInfoDeserializer(item: any): SkuLocationInfo { + return { + location: item["location"], + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +export function skuCapabilityArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return skuCapabilityDeserializer(item); + }); +} + +/** The capability information in the specified SKU. */ +export interface SKUCapability { + /** The name of capability. */ + readonly name?: string; + /** A string value to indicate states of given capability. */ + readonly value?: string; +} + +export function skuCapabilityDeserializer(item: any): SKUCapability { + return { + name: item["name"], + value: item["value"], + }; +} + +/** Known values of {@link x-ms-delete-snapshots} that the service accepts. */ +export enum KnownXMsDeleteSnapshots { + /** true */ + True = "true", + /** false */ + False = "false", +} + +/** Type of XMsDeleteSnapshots */ +export type XMsDeleteSnapshots = string; + +/** Known values of {@link x-ms-force-delete} that the service accepts. */ +export enum KnownXMsForceDelete { + /** true */ + True = "true", + /** false */ + False = "false", +} + +/** Type of XMsForceDelete */ +export type XMsForceDelete = string; + +/** The available API versions. */ +export enum KnownVersions { + /** The 2025-09-01 stable API version. */ + V20250901 = "2025-09-01", +} diff --git a/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts deleted file mode 100644 index c065b34c5ade..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - OperationParameter, - OperationURLParameter, - OperationQueryParameter, -} from "@azure/core-client"; -import { - ElasticSan as ElasticSanMapper, - ElasticSanUpdate as ElasticSanUpdateMapper, - VolumeGroup as VolumeGroupMapper, - VolumeGroupUpdate as VolumeGroupUpdateMapper, - Volume as VolumeMapper, - VolumeUpdate as VolumeUpdateMapper, - VolumeNameList as VolumeNameListMapper, - DiskSnapshotList as DiskSnapshotListMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper, - Snapshot as SnapshotMapper, -} from "../models/mappers.js"; - -export const accept: OperationParameter = { - parameterPath: "accept", - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Accept", - type: { - name: "String", - }, - }, -}; - -export const $host: OperationURLParameter = { - parameterPath: "$host", - mapper: { - serializedName: "$host", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2024-07-01-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - constraints: { - MinLength: 1, - }, - serializedName: "subscriptionId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String", - }, - }, -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - MaxLength: 90, - MinLength: 1, - }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: ElasticSanMapper, -}; - -export const elasticSanName: OperationURLParameter = { - parameterPath: "elasticSanName", - mapper: { - constraints: { - Pattern: new RegExp("^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"), - MaxLength: 24, - MinLength: 3, - }, - serializedName: "elasticSanName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: ElasticSanUpdateMapper, -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const xMsAccessSoftDeletedResources: OperationParameter = { - parameterPath: ["options", "xMsAccessSoftDeletedResources"], - mapper: { - serializedName: "x-ms-access-soft-deleted-resources", - type: { - name: "String", - }, - }, -}; - -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeGroupMapper, -}; - -export const volumeGroupName: OperationURLParameter = { - parameterPath: "volumeGroupName", - mapper: { - constraints: { - Pattern: new RegExp("^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"), - MaxLength: 63, - MinLength: 3, - }, - serializedName: "volumeGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeGroupUpdateMapper, -}; - -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeMapper, -}; - -export const volumeName: OperationURLParameter = { - parameterPath: "volumeName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-z0-9]+(-[a-z0-9A-Z]+)*$"), - MaxLength: 63, - MinLength: 3, - }, - serializedName: "volumeName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters5: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeUpdateMapper, -}; - -export const xMsDeleteSnapshots: OperationParameter = { - parameterPath: ["options", "xMsDeleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - type: { - name: "String", - }, - }, -}; - -export const xMsForceDelete: OperationParameter = { - parameterPath: ["options", "xMsForceDelete"], - mapper: { - serializedName: "x-ms-force-delete", - type: { - name: "String", - }, - }, -}; - -export const deleteType: OperationQueryParameter = { - parameterPath: ["options", "deleteType"], - mapper: { - serializedName: "deleteType", - type: { - name: "String", - }, - }, -}; - -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeNameListMapper, -}; - -export const parameters7: OperationParameter = { - parameterPath: "parameters", - mapper: DiskSnapshotListMapper, -}; - -export const parameters8: OperationParameter = { - parameterPath: "parameters", - mapper: PrivateEndpointConnectionMapper, -}; - -export const privateEndpointConnectionName: OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", - mapper: { - serializedName: "privateEndpointConnectionName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters9: OperationParameter = { - parameterPath: "parameters", - mapper: SnapshotMapper, -}; - -export const snapshotName: OperationURLParameter = { - parameterPath: "snapshotName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-z0-9]+(?:[._-][a-z0-9]+)*$"), - MaxLength: 80, - MinLength: 1, - }, - serializedName: "snapshotName", - required: true, - type: { - name: "String", - }, - }, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts deleted file mode 100644 index 8549059c3dfb..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts +++ /dev/null @@ -1,711 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { ElasticSans } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { ElasticSanManagement } from "../elasticSanManagement.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - ElasticSan, - ElasticSansListBySubscriptionNextOptionalParams, - ElasticSansListBySubscriptionOptionalParams, - ElasticSansListBySubscriptionResponse, - ElasticSansListByResourceGroupNextOptionalParams, - ElasticSansListByResourceGroupOptionalParams, - ElasticSansListByResourceGroupResponse, - ElasticSansCreateOptionalParams, - ElasticSansCreateResponse, - ElasticSanUpdate, - ElasticSansUpdateOptionalParams, - ElasticSansUpdateResponse, - ElasticSansDeleteOptionalParams, - ElasticSansGetOptionalParams, - ElasticSansGetResponse, - ElasticSansListBySubscriptionNextResponse, - ElasticSansListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing ElasticSans operations. */ -export class ElasticSansImpl implements ElasticSans { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class ElasticSans class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * Gets a list of ElasticSans in a subscription - * @param options The options parameters. - */ - public listBySubscription( - options?: ElasticSansListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: ElasticSansListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ElasticSansListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: ElasticSansListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Gets a list of ElasticSan in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ElasticSansListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Gets a list of ElasticSans in a subscription - * @param options The options parameters. - */ - private _listBySubscription( - options?: ElasticSansListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * Gets a list of ElasticSan in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Create ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - ElasticSansCreateResponse - > - > { - 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, elasticSanName, parameters, options }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - ElasticSansCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - elasticSanName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - ElasticSansUpdateResponse - > - > { - 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, elasticSanName, parameters, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - ElasticSansUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - elasticSanName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ): Promise, void>> { - 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, elasticSanName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - elasticSanName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Get a ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, options }, - getOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: ElasticSansListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: ElasticSansListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSanList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSanList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ElasticSan, - }, - 201: { - bodyMapper: Mappers.ElasticSan, - }, - 202: { - bodyMapper: Mappers.ElasticSan, - }, - 204: { - bodyMapper: Mappers.ElasticSan, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.ElasticSan, - }, - 201: { - bodyMapper: Mappers.ElasticSan, - }, - 202: { - bodyMapper: Mappers.ElasticSan, - }, - 204: { - bodyMapper: Mappers.ElasticSan, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSan, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSanList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSanList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/operations/index.ts deleted file mode 100644 index ab7ae726ad7b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./operations.js"; -export * from "./skus.js"; -export * from "./elasticSans.js"; -export * from "./volumeGroups.js"; -export * from "./volumes.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkResources.js"; -export * from "./volumeSnapshots.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts b/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts deleted file mode 100644 index dc2e75e683c4..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { Operations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { ElasticSanManagement } from "../elasticSanManagement.js"; -import { - Operation, - OperationsListOptionalParams, - OperationsListResponse, -} from "../models/index.js"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * Gets a list of ElasticSan operations. - * @param options The options parameters. - */ - public list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: OperationsListResponse; - result = await this._list(options); - yield result.value || []; - } - - private async *listPagingAll( - options?: OperationsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Gets a list of ElasticSan operations. - * @param options The options parameters. - */ - private _list( - options?: OperationsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.ElasticSan/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts deleted file mode 100644 index a8aa4b1a4489..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts +++ /dev/null @@ -1,445 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PrivateEndpointConnections } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { ElasticSanManagement } from "../elasticSanManagement.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - PrivateEndpointConnection, - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsListResponse, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsCreateResponse, - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Class containing PrivateEndpointConnections operations. */ -export class PrivateEndpointConnectionsImpl - implements PrivateEndpointConnections -{ - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class PrivateEndpointConnections class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List all Private Endpoint Connections associated with the Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, elasticSanName, 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( - resourceGroupName, - elasticSanName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: PrivateEndpointConnectionsListResponse; - result = await this._list(resourceGroupName, elasticSanName, options); - yield result.value || []; - } - - private async *listPagingAll( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - elasticSanName, - options, - )) { - yield* page; - } - } - - /** - * Update the state of specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param parameters Private Endpoint Connection Approval object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionsCreateResponse - > - > { - 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, - elasticSanName, - privateEndpointConnectionName, - parameters, - options, - }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - PrivateEndpointConnectionsCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update the state of specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param parameters Private Endpoint Connection Approval object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - options, - }, - getOperationSpec, - ); - } - - /** - * Deletes the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise, void>> { - 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, - elasticSanName, - privateEndpointConnectionName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * List all Private Endpoint Connections associated with the Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, options }, - listOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 201: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 202: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 204: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters8, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts b/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts deleted file mode 100644 index 8a8402e92288..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PrivateLinkResources } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { ElasticSanManagement } from "../elasticSanManagement.js"; -import { - PrivateLinkResourcesListByElasticSanOptionalParams, - PrivateLinkResourcesListByElasticSanResponse, -} from "../models/index.js"; - -/** Class containing PrivateLinkResources operations. */ -export class PrivateLinkResourcesImpl implements PrivateLinkResources { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class PrivateLinkResources class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * Gets the private link resources that need to be created for a elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateLinkResourcesListByElasticSanOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, options }, - listByElasticSanOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByElasticSanOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateLinkResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts b/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts deleted file mode 100644 index d740c08f8e80..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { Skus } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { ElasticSanManagement } from "../elasticSanManagement.js"; -import { - SkuInformation, - SkusListOptionalParams, - SkusListResponse, -} from "../models/index.js"; - -/// -/** Class containing Skus operations. */ -export class SkusImpl implements Skus { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class Skus class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List all the available Skus in the region and information related to them - * @param options The options parameters. - */ - public list( - options?: SkusListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: SkusListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: SkusListResponse; - result = await this._list(options); - yield result.value || []; - } - - private async *listPagingAll( - options?: SkusListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * List all the available Skus in the region and information related to them - * @param options The options parameters. - */ - private _list(options?: SkusListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SkuInformationList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts deleted file mode 100644 index cc7240d4bfec..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts +++ /dev/null @@ -1,650 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { VolumeGroups } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { ElasticSanManagement } from "../elasticSanManagement.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - VolumeGroup, - VolumeGroupsListByElasticSanNextOptionalParams, - VolumeGroupsListByElasticSanOptionalParams, - VolumeGroupsListByElasticSanResponse, - VolumeGroupsCreateOptionalParams, - VolumeGroupsCreateResponse, - VolumeGroupUpdate, - VolumeGroupsUpdateOptionalParams, - VolumeGroupsUpdateResponse, - VolumeGroupsDeleteOptionalParams, - VolumeGroupsGetOptionalParams, - VolumeGroupsGetResponse, - VolumeGroupsListByElasticSanNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VolumeGroups operations. */ -export class VolumeGroupsImpl implements VolumeGroups { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class VolumeGroups class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - public listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByElasticSanPagingAll( - resourceGroupName, - elasticSanName, - 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.listByElasticSanPagingPage( - resourceGroupName, - elasticSanName, - options, - settings, - ); - }, - }; - } - - private async *listByElasticSanPagingPage( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VolumeGroupsListByElasticSanResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByElasticSan( - resourceGroupName, - elasticSanName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByElasticSanNext( - resourceGroupName, - elasticSanName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByElasticSanPagingAll( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByElasticSanPagingPage( - resourceGroupName, - elasticSanName, - options, - )) { - yield* page; - } - } - - /** - * List VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - private _listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, options }, - listByElasticSanOperationSpec, - ); - } - - /** - * Create a Volume Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumeGroupsCreateResponse - > - > { - 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, - elasticSanName, - volumeGroupName, - parameters, - options, - }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - VolumeGroupsCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create a Volume Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumeGroupsUpdateResponse - > - > { - 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, - elasticSanName, - volumeGroupName, - parameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VolumeGroupsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ): Promise, void>> { - 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, elasticSanName, volumeGroupName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Get an VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, options }, - getOperationSpec, - ); - } - - /** - * ListByElasticSanNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param nextLink The nextLink from the previous successful call to the ListByElasticSan method. - * @param options The options parameters. - */ - private _listByElasticSanNext( - resourceGroupName: string, - elasticSanName: string, - nextLink: string, - options?: VolumeGroupsListByElasticSanNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, nextLink, options }, - listByElasticSanNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByElasticSanOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumeGroups", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroupList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [ - Parameters.accept, - Parameters.xMsAccessSoftDeletedResources, - ], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroup, - }, - 201: { - bodyMapper: Mappers.VolumeGroup, - }, - 202: { - bodyMapper: Mappers.VolumeGroup, - }, - 204: { - bodyMapper: Mappers.VolumeGroup, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroup, - }, - 201: { - bodyMapper: Mappers.VolumeGroup, - }, - 202: { - bodyMapper: Mappers.VolumeGroup, - }, - 204: { - bodyMapper: Mappers.VolumeGroup, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroup, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByElasticSanNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroupList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.nextLink, - ], - headerParameters: [ - Parameters.accept, - Parameters.xMsAccessSoftDeletedResources, - ], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts deleted file mode 100644 index 8679013c5aeb..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts +++ /dev/null @@ -1,545 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { VolumeSnapshots } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { ElasticSanManagement } from "../elasticSanManagement.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - Snapshot, - VolumeSnapshotsListByVolumeGroupNextOptionalParams, - VolumeSnapshotsListByVolumeGroupOptionalParams, - VolumeSnapshotsListByVolumeGroupResponse, - VolumeSnapshotsCreateOptionalParams, - VolumeSnapshotsCreateResponse, - VolumeSnapshotsDeleteOptionalParams, - VolumeSnapshotsGetOptionalParams, - VolumeSnapshotsGetResponse, - VolumeSnapshotsListByVolumeGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VolumeSnapshots operations. */ -export class VolumeSnapshotsImpl implements VolumeSnapshots { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class VolumeSnapshots class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - public listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByVolumeGroupPagingAll( - resourceGroupName, - elasticSanName, - volumeGroupName, - 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.listByVolumeGroupPagingPage( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByVolumeGroupPagingPage( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VolumeSnapshotsListByVolumeGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByVolumeGroupNext( - resourceGroupName, - elasticSanName, - volumeGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByVolumeGroupPagingAll( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByVolumeGroupPagingPage( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - yield* page; - } - } - - /** - * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - private _listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, options }, - listByVolumeGroupOperationSpec, - ); - } - - /** - * Create a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param parameters Snapshot object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumeSnapshotsCreateResponse - > - > { - 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, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - options, - }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - VolumeSnapshotsCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param parameters Snapshot object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ): Promise, void>> { - 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, - elasticSanName, - volumeGroupName, - snapshotName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Get a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - options, - }, - getOperationSpec, - ); - } - - /** - * ListByVolumeGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param nextLink The nextLink from the previous successful call to the ListByVolumeGroup method. - * @param options The options parameters. - */ - private _listByVolumeGroupNext( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - nextLink: string, - options?: VolumeSnapshotsListByVolumeGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, nextLink, options }, - listByVolumeGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByVolumeGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SnapshotList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Snapshot, - }, - 201: { - bodyMapper: Mappers.Snapshot, - }, - 202: { - bodyMapper: Mappers.Snapshot, - }, - 204: { - bodyMapper: Mappers.Snapshot, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters9, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Snapshot, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SnapshotList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.nextLink, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts deleted file mode 100644 index dc62fefbffd4..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts +++ /dev/null @@ -1,994 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { Volumes } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { ElasticSanManagement } from "../elasticSanManagement.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - Volume, - VolumesListByVolumeGroupNextOptionalParams, - VolumesListByVolumeGroupOptionalParams, - VolumesListByVolumeGroupResponse, - VolumesCreateOptionalParams, - VolumesCreateResponse, - VolumeUpdate, - VolumesUpdateOptionalParams, - VolumesUpdateResponse, - VolumesDeleteOptionalParams, - VolumesGetOptionalParams, - VolumesGetResponse, - VolumeNameList, - VolumesPreBackupOptionalParams, - VolumesPreBackupResponse, - DiskSnapshotList, - VolumesPreRestoreOptionalParams, - VolumesPreRestoreResponse, - VolumesListByVolumeGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Volumes operations. */ -export class VolumesImpl implements Volumes { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class Volumes class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List Volumes in a VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - public listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByVolumeGroupPagingAll( - resourceGroupName, - elasticSanName, - volumeGroupName, - 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.listByVolumeGroupPagingPage( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByVolumeGroupPagingPage( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VolumesListByVolumeGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByVolumeGroupNext( - resourceGroupName, - elasticSanName, - volumeGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByVolumeGroupPagingAll( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByVolumeGroupPagingPage( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - yield* page; - } - } - - /** - * Create a Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumesCreateResponse - > - > { - 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, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - VolumesCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create a Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumesUpdateResponse - > - > { - 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, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VolumesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ): Promise, void>> { - 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, - elasticSanName, - volumeGroupName, - volumeName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Get an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - }, - getOperationSpec, - ); - } - - /** - * List Volumes in a VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - private _listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, options }, - listByVolumeGroupOperationSpec, - ); - } - - /** - * Validate whether a disk snapshot backup can be taken for list of volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Name List (currently only one volume name in the list is supported. Server - * would return error if list is bigger) - * @param options The options parameters. - */ - async beginPreBackup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumesPreBackupResponse - > - > { - 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, - elasticSanName, - volumeGroupName, - parameters, - options, - }, - spec: preBackupOperationSpec, - }); - const poller = await createHttpPoller< - VolumesPreBackupResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Validate whether a disk snapshot backup can be taken for list of volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Name List (currently only one volume name in the list is supported. Server - * would return error if list is bigger) - * @param options The options parameters. - */ - async beginPreBackupAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ): Promise { - const poller = await this.beginPreBackup( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and - * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if - * list is bigger) - * @param options The options parameters. - */ - async beginPreRestore( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumesPreRestoreResponse - > - > { - 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, - elasticSanName, - volumeGroupName, - parameters, - options, - }, - spec: preRestoreOperationSpec, - }); - const poller = await createHttpPoller< - VolumesPreRestoreResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and - * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if - * list is bigger) - * @param options The options parameters. - */ - async beginPreRestoreAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ): Promise { - const poller = await this.beginPreRestore( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByVolumeGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param nextLink The nextLink from the previous successful call to the ListByVolumeGroup method. - * @param options The options parameters. - */ - private _listByVolumeGroupNext( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - nextLink: string, - options?: VolumesListByVolumeGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, nextLink, options }, - listByVolumeGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Volume, - }, - 201: { - bodyMapper: Mappers.Volume, - }, - 202: { - bodyMapper: Mappers.Volume, - }, - 204: { - bodyMapper: Mappers.Volume, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.volumeName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Volume, - }, - 201: { - bodyMapper: Mappers.Volume, - }, - 202: { - bodyMapper: Mappers.Volume, - }, - 204: { - bodyMapper: Mappers.Volume, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.volumeName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.deleteType], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.volumeName, - ], - headerParameters: [ - Parameters.accept, - Parameters.xMsDeleteSnapshots, - Parameters.xMsForceDelete, - ], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Volume, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.volumeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByVolumeGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [ - Parameters.accept, - Parameters.xMsAccessSoftDeletedResources, - ], - serializer, -}; -const preBackupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PreValidationResponse, - }, - 201: { - bodyMapper: Mappers.PreValidationResponse, - }, - 202: { - bodyMapper: Mappers.PreValidationResponse, - }, - 204: { - bodyMapper: Mappers.PreValidationResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const preRestoreOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PreValidationResponse, - }, - 201: { - bodyMapper: Mappers.PreValidationResponse, - }, - 202: { - bodyMapper: Mappers.PreValidationResponse, - }, - 204: { - bodyMapper: Mappers.PreValidationResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.nextLink, - Parameters.volumeGroupName, - ], - headerParameters: [ - Parameters.accept, - Parameters.xMsAccessSoftDeletedResources, - ], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts deleted file mode 100644 index 483f1455d6c1..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - ElasticSan, - ElasticSansListBySubscriptionOptionalParams, - ElasticSansListByResourceGroupOptionalParams, - ElasticSansCreateOptionalParams, - ElasticSansCreateResponse, - ElasticSanUpdate, - ElasticSansUpdateOptionalParams, - ElasticSansUpdateResponse, - ElasticSansDeleteOptionalParams, - ElasticSansGetOptionalParams, - ElasticSansGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a ElasticSans. */ -export interface ElasticSans { - /** - * Gets a list of ElasticSans in a subscription - * @param options The options parameters. - */ - listBySubscription( - options?: ElasticSansListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a list of ElasticSan in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Create ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - ElasticSansCreateResponse - > - >; - /** - * Create ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ): Promise; - /** - * Update a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - ElasticSansUpdateResponse - > - >; - /** - * Update a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ): Promise; - /** - * Delete a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ): Promise; - /** - * Get a ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansGetOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts deleted file mode 100644 index ab7ae726ad7b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./operations.js"; -export * from "./skus.js"; -export * from "./elasticSans.js"; -export * from "./volumeGroups.js"; -export * from "./volumes.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkResources.js"; -export * from "./volumeSnapshots.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts deleted file mode 100644 index 8863765ba989..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Operation, OperationsListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * Gets a list of ElasticSan operations. - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts deleted file mode 100644 index bde981322bac..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - PrivateEndpointConnection, - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsCreateResponse, - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a PrivateEndpointConnections. */ -export interface PrivateEndpointConnections { - /** - * List all Private Endpoint Connections associated with the Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Update the state of specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param parameters Private Endpoint Connection Approval object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionsCreateResponse - > - >; - /** - * Update the state of specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param parameters Private Endpoint Connection Approval object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ): Promise; - /** - * Gets the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ): Promise; - /** - * Deletes the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts deleted file mode 100644 index b8476b54fa43..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - PrivateLinkResourcesListByElasticSanOptionalParams, - PrivateLinkResourcesListByElasticSanResponse, -} from "../models/index.js"; - -/** Interface representing a PrivateLinkResources. */ -export interface PrivateLinkResources { - /** - * Gets the private link resources that need to be created for a elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateLinkResourcesListByElasticSanOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts deleted file mode 100644 index 01336e8b61bb..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SkuInformation, SkusListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a Skus. */ -export interface Skus { - /** - * List all the available Skus in the region and information related to them - * @param options The options parameters. - */ - list( - options?: SkusListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts deleted file mode 100644 index 23e050a912d3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - VolumeGroup, - VolumeGroupsListByElasticSanOptionalParams, - VolumeGroupsCreateOptionalParams, - VolumeGroupsCreateResponse, - VolumeGroupUpdate, - VolumeGroupsUpdateOptionalParams, - VolumeGroupsUpdateResponse, - VolumeGroupsDeleteOptionalParams, - VolumeGroupsGetOptionalParams, - VolumeGroupsGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a VolumeGroups. */ -export interface VolumeGroups { - /** - * List VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Create a Volume Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumeGroupsCreateResponse - > - >; - /** - * Create a Volume Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ): Promise; - /** - * Update an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumeGroupsUpdateResponse - > - >; - /** - * Update an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ): Promise; - /** - * Delete an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ): Promise; - /** - * Get an VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsGetOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts deleted file mode 100644 index f4675d9b5c53..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - Snapshot, - VolumeSnapshotsListByVolumeGroupOptionalParams, - VolumeSnapshotsCreateOptionalParams, - VolumeSnapshotsCreateResponse, - VolumeSnapshotsDeleteOptionalParams, - VolumeSnapshotsGetOptionalParams, - VolumeSnapshotsGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a VolumeSnapshots. */ -export interface VolumeSnapshots { - /** - * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Create a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param parameters Snapshot object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumeSnapshotsCreateResponse - > - >; - /** - * Create a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param parameters Snapshot object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ): Promise; - /** - * Delete a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ): Promise; - /** - * Get a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsGetOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts deleted file mode 100644 index e15213d37256..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - Volume, - VolumesListByVolumeGroupOptionalParams, - VolumesCreateOptionalParams, - VolumesCreateResponse, - VolumeUpdate, - VolumesUpdateOptionalParams, - VolumesUpdateResponse, - VolumesDeleteOptionalParams, - VolumesGetOptionalParams, - VolumesGetResponse, - VolumeNameList, - VolumesPreBackupOptionalParams, - VolumesPreBackupResponse, - DiskSnapshotList, - VolumesPreRestoreOptionalParams, - VolumesPreRestoreResponse, -} from "../models/index.js"; - -/// -/** Interface representing a Volumes. */ -export interface Volumes { - /** - * List Volumes in a VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Create a Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumesCreateResponse - > - >; - /** - * Create a Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ): Promise; - /** - * Update an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumesUpdateResponse - > - >; - /** - * Update an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ): Promise; - /** - * Delete an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ): Promise; - /** - * Get an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesGetOptionalParams, - ): Promise; - /** - * Validate whether a disk snapshot backup can be taken for list of volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Name List (currently only one volume name in the list is supported. Server - * would return error if list is bigger) - * @param options The options parameters. - */ - beginPreBackup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumesPreBackupResponse - > - >; - /** - * Validate whether a disk snapshot backup can be taken for list of volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Name List (currently only one volume name in the list is supported. Server - * would return error if list is bigger) - * @param options The options parameters. - */ - beginPreBackupAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ): Promise; - /** - * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and - * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if - * list is bigger) - * @param options The options parameters. - */ - beginPreRestore( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VolumesPreRestoreResponse - > - >; - /** - * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and - * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if - * list is bigger) - * @param options The options parameters. - */ - beginPreRestoreAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts b/sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts deleted file mode 100644 index 205cccc26592..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given the last `.value` produced by the `byPage` iterator, - * returns a continuation token that can be used to begin paging from - * that point later. - * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. - * @returns The continuation token that can be passed into byPage() during future calls. - */ -export function getContinuationToken(page: unknown): string | undefined { - if (typeof page !== "object" || page === null) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined, -): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..ff29eed1fe2d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagement } from "./elasticSanManagement.js"; +import { _$deleteDeserialize, _createDeserialize } from "./api/volumeSnapshots/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeVolumeGroups, + _updateDeserialize, + _createDeserialize as _createDeserializeVolumeGroups, +} from "./api/volumeGroups/operations.js"; +import { + _preRestoreDeserialize, + _preBackupDeserialize, + _$deleteDeserialize as _$deleteDeserializeVolumes, + _updateDeserialize as _updateDeserializeVolumes, + _createDeserialize as _createDeserializeVolumes, +} from "./api/volumes/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializePrivateEndpointConnections, + _createDeserialize as _createDeserializePrivateEndpointConnections, +} from "./api/privateEndpointConnections/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeElasticSans, + _updateDeserialize as _updateDeserializeElasticSans, + _createDeserialize as _createDeserializeElasticSans, +} from "./api/elasticSans/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; +import type { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro"; +import { deserializeState } from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: ElasticSanManagement, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + deserializer: Function; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}": + { + deserializer: _$deleteDeserialize, + expectedStatuses: ["200", "202", "204"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}": + { + deserializer: _createDeserialize, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}": + { + deserializer: _$deleteDeserializeVolumeGroups, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}": + { deserializer: _updateDeserialize, expectedStatuses: ["200", "202"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}": + { + deserializer: _createDeserializeVolumeGroups, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore": + { deserializer: _preRestoreDeserialize, expectedStatuses: ["202", "200"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup": + { deserializer: _preBackupDeserialize, expectedStatuses: ["202", "200"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}": + { + deserializer: _$deleteDeserializeVolumes, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}": + { + deserializer: _updateDeserializeVolumes, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}": + { + deserializer: _createDeserializeVolumes, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}": + { + deserializer: _$deleteDeserializePrivateEndpointConnections, + expectedStatuses: ["200", "202", "204"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}": + { + deserializer: _createDeserializePrivateEndpointConnections, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}": + { + deserializer: _$deleteDeserializeElasticSans, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}": + { + deserializer: _updateDeserializeElasticSans, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}": + { + deserializer: _createDeserializeElasticSans, + expectedStatuses: ["200", "201", "202"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..613112c6e397 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..11248b3804e4 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..63b3c201e5a8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + OperationResponse, +} from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..657898dd38ff --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// --------------------- +// interfaces +// --------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string): string { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string): string { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any): boolean { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false): string { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions): string { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions): string | undefined { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + return template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + op = expr[0]; + expr = expr.slice(1); + } + const varList = expr.split(/,/g); + const result = []; + for (const varSpec of varList) { + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: result.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + result.push(varValue); + } + } + return result.join(""); + }); +} diff --git a/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts b/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts index eee14e8ffed9..411f19c69d70 100644 --- a/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts +++ b/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts @@ -1,34 +1,23 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. import { ElasticSanManagement } from "../src/index.js"; -import { - DefaultAzureCredential, - InteractiveBrowserCredential, -} from "@azure/identity"; +import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new ElasticSanManagement( - new DefaultAzureCredential(), - subscriptionId, - ); + const client = new ElasticSanManagement(new DefaultAzureCredential(), subscriptionId); }); it("ReadmeSampleCreateClient_Browser", async () => { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); }); diff --git a/sdk/elasticsans/arm-elasticsan/tsconfig.json b/sdk/elasticsans/arm-elasticsan/tsconfig.json index d466f1460665..0e57dbd186e5 100644 --- a/sdk/elasticsans/arm-elasticsan/tsconfig.json +++ b/sdk/elasticsans/arm-elasticsan/tsconfig.json @@ -12,6 +12,5 @@ { "path": "./tsconfig.snippets.json" } - ], - "files": [] + ] } diff --git a/sdk/elasticsans/arm-elasticsan/tsconfig.samples.json b/sdk/elasticsans/arm-elasticsan/tsconfig.samples.json index 47a77442a951..42f3a42c059a 100644 --- a/sdk/elasticsans/arm-elasticsan/tsconfig.samples.json +++ b/sdk/elasticsans/arm-elasticsan/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-elasticsan": [ - "./dist/esm" - ] + "@azure/arm-elasticsan": ["./dist/esm"] } } } diff --git a/sdk/elasticsans/arm-elasticsan/tsconfig.test.json b/sdk/elasticsans/arm-elasticsan/tsconfig.test.json index 42798ad68913..290ca214aebc 100644 --- a/sdk/elasticsans/arm-elasticsan/tsconfig.test.json +++ b/sdk/elasticsans/arm-elasticsan/tsconfig.test.json @@ -1,14 +1,3 @@ { - "references": [ - { - "path": "./tsconfig.test.node.json" - }, - { - "path": "./tsconfig.browser.config.json" - } - ], - "compilerOptions": { - "composite": true - }, - "files": [] + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] } diff --git a/sdk/elasticsans/arm-elasticsan/tsconfig.test.node.json b/sdk/elasticsans/arm-elasticsan/tsconfig.test.node.json deleted file mode 100644 index 34e5a01aa104..000000000000 --- a/sdk/elasticsans/arm-elasticsan/tsconfig.test.node.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.test.node.base.json", - "compilerOptions": { - "paths": { - "@azure/arm-elasticsan": ["./src/index.ts"], - "@azure/arm-elasticsan/*": ["./src/*"], - "$internal/*": ["./src/*"] - } - } -} diff --git a/sdk/elasticsans/arm-elasticsan/tsp-location.yaml b/sdk/elasticsans/arm-elasticsan/tsp-location.yaml new file mode 100644 index 000000000000..afa137486310 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan +commit: c86c7e36fb15171a9967d9fdc47784f2e4202ca6 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/elasticsans/arm-elasticsan/vitest.config.ts b/sdk/elasticsans/arm-elasticsan/vitest.config.ts index cc5cd85d4131..0dfa15cc4498 100644 --- a/sdk/elasticsans/arm-elasticsan/vitest.config.ts +++ b/sdk/elasticsans/arm-elasticsan/vitest.config.ts @@ -1,4 +1,3 @@ - // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/elasticsans/arm-elasticsan/vitest.esm.config.ts b/sdk/elasticsans/arm-elasticsan/vitest.esm.config.ts new file mode 100644 index 000000000000..5e9735e9b144 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/vitest.esm.config.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig(vitestConfig, vitestEsmConfig); diff --git a/sdk/elasticsans/ci.mgmt.yml b/sdk/elasticsans/ci.mgmt.yml index eddc36f8ea96..7e490e5037b7 100644 --- a/sdk/elasticsans/ci.mgmt.yml +++ b/sdk/elasticsans/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -13,7 +13,6 @@ trigger: include: - sdk/elasticsans/arm-elasticsan - sdk/elasticsans/ci.mgmt.yml - pr: branches: include: @@ -27,7 +26,6 @@ pr: include: - sdk/elasticsans/arm-elasticsan - sdk/elasticsans/ci.mgmt.yml - extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -35,4 +33,3 @@ extends: Artifacts: - name: azure-arm-elasticsan safeName: azurearmelasticsan - \ No newline at end of file From 21cb5de697136401f3d9a3322aee9150cec8e5a6 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Wed, 19 Nov 2025 15:00:29 +0800 Subject: [PATCH 2/8] regen from generated swagger --- pnpm-lock.yaml | 35 +- sdk/elasticsans/arm-elasticsan/CHANGELOG.md | 81 +- sdk/elasticsans/arm-elasticsan/README.md | 18 +- sdk/elasticsans/arm-elasticsan/_meta.json | 8 + .../arm-elasticsan/api-extractor.json | 4 +- .../arm-elasticsan/eslint.config.mjs | 14 - sdk/elasticsans/arm-elasticsan/metadata.json | 115 - sdk/elasticsans/arm-elasticsan/package.json | 351 +-- ...arm-elasticsan-api-elasticSans-node.api.md | 59 - .../review/arm-elasticsan-api-node.api.md | 28 - .../arm-elasticsan-api-operations-node.api.md | 19 - ...api-privateEndpointConnections-node.api.md | 44 - ...icsan-api-privateLinkResources-node.api.md | 19 - .../arm-elasticsan-api-skus-node.api.md | 20 - ...rm-elasticsan-api-volumeGroups-node.api.md | 52 - ...elasticsan-api-volumeSnapshots-node.api.md | 45 - .../arm-elasticsan-api-volumes-node.api.md | 70 - .../review/arm-elasticsan-models-node.api.md | 530 ----- .../review/arm-elasticsan-node.api.md | 532 +++-- .../samples-dev/elasticSansCreateSample.ts | 52 +- .../samples-dev/elasticSansDeleteSample.ts | 37 +- .../samples-dev/elasticSansGetSample.ts | 35 +- .../elasticSansListByResourceGroupSample.ts | 33 +- .../elasticSansListBySubscriptionSample.ts | 21 +- .../samples-dev/elasticSansUpdateSample.ts | 46 +- .../samples-dev/operationsListSample.ts | 23 +- .../privateEndpointConnectionsCreateSample.ts | 77 +- .../privateEndpointConnectionsDeleteSample.ts | 45 +- .../privateEndpointConnectionsGetSample.ts | 39 +- .../privateEndpointConnectionsListSample.ts | 35 +- ...vateLinkResourcesListByElasticSanSample.ts | 33 +- .../samples-dev/skusListSample.ts | 31 +- .../samples-dev/volumeGroupsCreateSample.ts | 88 +- .../samples-dev/volumeGroupsDeleteSample.ts | 41 +- .../samples-dev/volumeGroupsGetSample.ts | 39 +- .../volumeGroupsListByElasticSanSample.ts | 35 +- .../samples-dev/volumeGroupsUpdateSample.ts | 88 +- .../volumeSnapshotsCreateSample.ts | 84 +- .../volumeSnapshotsDeleteSample.ts | 51 +- .../samples-dev/volumeSnapshotsGetSample.ts | 45 +- .../volumeSnapshotsListByVolumeGroupSample.ts | 51 +- .../samples-dev/volumesCreateSample.ts | 68 +- .../samples-dev/volumesDeleteSample.ts | 65 +- .../samples-dev/volumesGetSample.ts | 45 +- .../volumesListByVolumeGroupSample.ts | 41 +- .../samples-dev/volumesPreBackupSample.ts | 26 +- .../samples-dev/volumesPreRestoreSample.ts | 34 +- .../samples-dev/volumesUpdateSample.ts | 66 +- .../samples/v1/javascript/README.md | 106 + .../javascript/elasticSansCreateSample.js | 47 +- .../v1/javascript/elasticSansDeleteSample.js | 45 + .../v1/javascript/elasticSansGetSample.js | 45 + .../elasticSansListByResourceGroupSample.js | 25 +- .../elasticSansListBySubscriptionSample.js | 19 +- .../v1/javascript/elasticSansUpdateSample.js | 70 + .../javascript/operationsListSample.js | 21 +- .../{v2 => v1}/javascript/package.json | 6 +- .../privateEndpointConnectionsCreateSample.js | 71 + .../privateEndpointConnectionsDeleteSample.js | 55 + .../privateEndpointConnectionsGetSample.js | 55 + .../privateEndpointConnectionsListSample.js | 31 +- ...vateLinkResourcesListByElasticSanSample.js | 51 + .../samples/{v2 => v1}/javascript/sample.env | 0 .../{v2 => v1}/javascript/skusListSample.js | 23 +- .../v1/javascript/volumeGroupsCreateSample.js | 77 + .../v1/javascript/volumeGroupsDeleteSample.js | 55 + .../v1/javascript/volumeGroupsGetSample.js | 47 + .../volumeGroupsListByElasticSanSample.js | 57 + .../v1/javascript/volumeGroupsUpdateSample.js | 77 + .../javascript/volumeSnapshotsCreateSample.js | 77 + .../javascript/volumeSnapshotsDeleteSample.js | 59 + .../v1/javascript/volumeSnapshotsGetSample.js | 59 + .../volumeSnapshotsListByVolumeGroupSample.js | 64 + .../v1/javascript/volumesCreateSample.js | 69 + .../v1/javascript/volumesDeleteSample.js | 66 + .../samples/v1/javascript/volumesGetSample.js | 59 + .../volumesListByVolumeGroupSample.js | 61 + .../v1/javascript/volumesPreBackupSample.js | 35 + .../v1/javascript/volumesPreRestoreSample.js | 39 + .../v1/javascript/volumesUpdateSample.js | 68 + .../samples/v1/typescript/README.md | 119 + .../{v2 => v1}/typescript/package.json | 6 +- .../samples/{v2 => v1}/typescript/sample.env | 0 .../typescript/src/elasticSansCreateSample.ts | 52 +- .../typescript/src/elasticSansDeleteSample.ts | 55 + .../v1/typescript/src/elasticSansGetSample.ts | 55 + .../elasticSansListByResourceGroupSample.ts | 33 +- .../elasticSansListBySubscriptionSample.ts | 21 +- .../typescript/src/elasticSansUpdateSample.ts | 75 + .../typescript/src/operationsListSample.ts | 23 +- .../privateEndpointConnectionsCreateSample.ts | 79 + .../privateEndpointConnectionsDeleteSample.ts | 59 + .../privateEndpointConnectionsGetSample.ts | 59 + .../privateEndpointConnectionsListSample.ts | 35 +- ...vateLinkResourcesListByElasticSanSample.ts | 55 + .../v1/typescript/src/skusListSample.ts | 55 + .../src/volumeGroupsCreateSample.ts | 84 + .../src/volumeGroupsDeleteSample.ts | 59 + .../typescript/src/volumeGroupsGetSample.ts | 59 + .../src/volumeGroupsListByElasticSanSample.ts | 35 +- .../src/volumeGroupsUpdateSample.ts | 84 + .../src/volumeSnapshotsCreateSample.ts | 82 + .../src/volumeSnapshotsDeleteSample.ts | 63 + .../src/volumeSnapshotsGetSample.ts | 63 + .../volumeSnapshotsListByVolumeGroupSample.ts | 72 + .../v1/typescript/src/volumesCreateSample.ts | 74 + .../v1/typescript/src/volumesDeleteSample.ts | 74 + .../v1/typescript/src/volumesGetSample.ts | 63 + .../src/volumesListByVolumeGroupSample.ts | 65 + .../typescript/src/volumesPreBackupSample.ts | 38 + .../typescript/src/volumesPreRestoreSample.ts | 42 + .../v1/typescript/src/volumesUpdateSample.ts | 73 + .../{v2 => v1}/typescript/tsconfig.json | 0 .../samples/v2/javascript/README.md | 106 - .../v2/javascript/elasticSansDeleteSample.js | 38 - .../v2/javascript/elasticSansGetSample.js | 40 - .../v2/javascript/elasticSansUpdateSample.js | 55 - .../privateEndpointConnectionsCreateSample.js | 60 - .../privateEndpointConnectionsDeleteSample.js | 46 - .../privateEndpointConnectionsGetSample.js | 48 - ...vateLinkResourcesListByElasticSanSample.js | 46 - .../v2/javascript/volumeGroupsCreateSample.js | 70 - .../v2/javascript/volumeGroupsDeleteSample.js | 38 - .../v2/javascript/volumeGroupsGetSample.js | 48 - .../volumeGroupsListByElasticSanSample.js | 54 - .../v2/javascript/volumeGroupsUpdateSample.js | 70 - .../javascript/volumeSnapshotsCreateSample.js | 66 - .../javascript/volumeSnapshotsDeleteSample.js | 48 - .../v2/javascript/volumeSnapshotsGetSample.js | 50 - .../volumeSnapshotsListByVolumeGroupSample.js | 57 - .../v2/javascript/volumesCreateSample.js | 58 - .../v2/javascript/volumesDeleteSample.js | 49 - .../samples/v2/javascript/volumesGetSample.js | 50 - .../volumesListByVolumeGroupSample.js | 56 - .../v2/javascript/volumesPreBackupSample.js | 30 - .../v2/javascript/volumesPreRestoreSample.js | 34 - .../v2/javascript/volumesUpdateSample.js | 57 - .../samples/v2/typescript/README.md | 119 - .../typescript/src/elasticSansDeleteSample.ts | 38 - .../v2/typescript/src/elasticSansGetSample.ts | 40 - .../typescript/src/elasticSansUpdateSample.ts | 55 - .../privateEndpointConnectionsCreateSample.ts | 60 - .../privateEndpointConnectionsDeleteSample.ts | 46 - .../privateEndpointConnectionsGetSample.ts | 48 - ...vateLinkResourcesListByElasticSanSample.ts | 46 - .../v2/typescript/src/skusListSample.ts | 48 - .../src/volumeGroupsCreateSample.ts | 70 - .../src/volumeGroupsDeleteSample.ts | 38 - .../typescript/src/volumeGroupsGetSample.ts | 48 - .../src/volumeGroupsUpdateSample.ts | 70 - .../src/volumeSnapshotsCreateSample.ts | 66 - .../src/volumeSnapshotsDeleteSample.ts | 48 - .../src/volumeSnapshotsGetSample.ts | 50 - .../volumeSnapshotsListByVolumeGroupSample.ts | 57 - .../v2/typescript/src/volumesCreateSample.ts | 58 - .../v2/typescript/src/volumesDeleteSample.ts | 49 - .../v2/typescript/src/volumesGetSample.ts | 50 - .../src/volumesListByVolumeGroupSample.ts | 56 - .../typescript/src/volumesPreBackupSample.ts | 30 - .../typescript/src/volumesPreRestoreSample.ts | 34 - .../v2/typescript/src/volumesUpdateSample.ts | 57 - .../src/api/elasticSanManagementContext.ts | 74 - .../src/api/elasticSans/index.ts | 19 - .../src/api/elasticSans/operations.ts | 351 --- .../src/api/elasticSans/options.ts | 31 - .../arm-elasticsan/src/api/index.ts | 8 - .../src/api/operations/index.ts | 5 - .../src/api/operations/operations.ts | 64 - .../src/api/operations/options.ts | 7 - .../api/privateEndpointConnections/index.ts | 10 - .../privateEndpointConnections/operations.ts | 287 --- .../api/privateEndpointConnections/options.ts | 22 - .../src/api/privateLinkResources/index.ts | 5 - .../api/privateLinkResources/operations.ts | 68 - .../src/api/privateLinkResources/options.ts | 7 - .../arm-elasticsan/src/api/skus/index.ts | 5 - .../arm-elasticsan/src/api/skus/operations.ts | 63 - .../arm-elasticsan/src/api/skus/options.ts | 10 - .../src/api/volumeGroups/index.ts | 11 - .../src/api/volumeGroups/operations.ts | 318 --- .../src/api/volumeGroups/options.ts | 28 - .../src/api/volumeSnapshots/index.ts | 10 - .../src/api/volumeSnapshots/operations.ts | 289 --- .../src/api/volumeSnapshots/options.ts | 25 - .../arm-elasticsan/src/api/volumes/index.ts | 21 - .../src/api/volumes/operations.ts | 521 ----- .../arm-elasticsan/src/api/volumes/options.ts | 45 - .../src/classic/elasticSans/index.ts | 108 - .../arm-elasticsan/src/classic/index.ts | 11 - .../src/classic/operations/index.ts | 28 - .../privateEndpointConnections/index.ts | 97 - .../src/classic/privateLinkResources/index.ts | 35 - .../arm-elasticsan/src/classic/skus/index.ts | 26 - .../src/classic/volumeGroups/index.ts | 110 - .../src/classic/volumeSnapshots/index.ts | 106 - .../src/classic/volumes/index.ts | 178 -- .../src/elasticSanManagement.ts | 210 +- sdk/elasticsans/arm-elasticsan/src/index.ts | 152 +- sdk/elasticsans/arm-elasticsan/src/logger.ts | 5 - sdk/elasticsans/arm-elasticsan/src/lroImpl.ts | 34 + .../arm-elasticsan/src/models/index.ts | 1613 ++++++++++++- .../arm-elasticsan/src/models/mappers.ts | 2024 +++++++++++++++++ .../arm-elasticsan/src/models/models.ts | 1830 --------------- .../arm-elasticsan/src/models/parameters.ts | 267 +++ .../src/operations/elasticSans.ts | 661 ++++++ .../arm-elasticsan/src/operations/index.ts | 14 + .../src/operations/operations.ts | 140 ++ .../operations/privateEndpointConnections.ts | 483 ++++ .../src/operations/privateLinkResources.ts | 69 + .../arm-elasticsan/src/operations/skus.ts | 140 ++ .../src/operations/volumeGroups.ts | 622 +++++ .../src/operations/volumeSnapshots.ts | 535 +++++ .../arm-elasticsan/src/operations/volumes.ts | 956 ++++++++ .../src/operationsInterfaces/elasticSans.ts | 131 ++ .../src/operationsInterfaces/index.ts | 14 + .../src/operationsInterfaces/operations.ts | 18 + .../privateEndpointConnections.ts | 107 + .../privateLinkResources.ts | 25 + .../src/operationsInterfaces/skus.ts | 18 + .../src/operationsInterfaces/volumeGroups.ts | 139 ++ .../operationsInterfaces/volumeSnapshots.ts | 116 + .../src/operationsInterfaces/volumes.ts | 225 ++ .../arm-elasticsan/src/pagingHelper.ts | 34 + .../src/restorePollerHelpers.ts | 233 -- .../src/static-helpers/cloudSettingHelpers.ts | 42 - .../src/static-helpers/pagingHelpers.ts | 242 -- .../src/static-helpers/pollingHelpers.ts | 127 -- .../src/static-helpers/urlTemplate.ts | 210 -- .../arm-elasticsan/test/snippets.spec.ts | 2 +- .../arm-elasticsan/tsconfig.test.json | 13 +- .../arm-elasticsan/tsconfig.test.node.json | 10 + .../arm-elasticsan/tsp-location.yaml | 4 - 232 files changed, 13181 insertions(+), 10710 deletions(-) create mode 100644 sdk/elasticsans/arm-elasticsan/_meta.json delete mode 100644 sdk/elasticsans/arm-elasticsan/eslint.config.mjs delete mode 100644 sdk/elasticsans/arm-elasticsan/metadata.json delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/javascript/elasticSansCreateSample.js (52%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/javascript/elasticSansListByResourceGroupSample.js (51%) rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/javascript/elasticSansListBySubscriptionSample.js (58%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/javascript/operationsListSample.js (55%) rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/javascript/package.json (87%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/javascript/privateEndpointConnectionsListSample.js (50%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/javascript/sample.env (100%) rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/javascript/skusListSample.js (54%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/typescript/package.json (89%) rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/typescript/sample.env (100%) rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/typescript/src/elasticSansCreateSample.ts (51%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/typescript/src/elasticSansListByResourceGroupSample.ts (51%) rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/typescript/src/elasticSansListBySubscriptionSample.ts (58%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/typescript/src/operationsListSample.ts (56%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/typescript/src/privateEndpointConnectionsListSample.ts (51%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/typescript/src/volumeGroupsListByElasticSanSample.ts (50%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v2 => v1}/typescript/tsconfig.json (100%) delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/logger.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/lroImpl.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/models/mappers.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/models/models.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/models/parameters.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/skus.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts create mode 100644 sdk/elasticsans/arm-elasticsan/tsconfig.test.node.json delete mode 100644 sdk/elasticsans/arm-elasticsan/tsp-location.yaml diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e6fef8ebb470..2e948fc644ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12149,49 +12149,46 @@ importers: sdk/elasticsans/arm-elasticsan: dependencies: - '@azure-rest/core-client': - specifier: ^2.3.1 - version: link:../../core/core-client-rest '@azure/abort-controller': specifier: ^2.1.2 version: link:../../core/abort-controller '@azure/core-auth': specifier: ^1.9.0 version: link:../../core/core-auth + '@azure/core-client': + specifier: ^1.9.3 + version: link:../../core/core-client '@azure/core-lro': - specifier: ^3.1.0 - version: link:../../core/core-lro + specifier: ^2.5.4 + version: 2.7.2 + '@azure/core-paging': + specifier: ^1.6.2 + version: link:../../core/core-paging '@azure/core-rest-pipeline': - specifier: ^1.20.0 + specifier: ^1.19.1 version: link:../../core/core-rest-pipeline - '@azure/core-util': - specifier: ^1.12.0 - version: link:../../core/core-util - '@azure/logger': - specifier: ^1.2.0 - version: link:../../core/logger tslib: specifier: ^2.8.1 version: 2.8.1 devDependencies: '@azure-tools/test-credential': - specifier: workspace:* + specifier: workspace:^ version: link:../../test-utils/test-credential '@azure-tools/test-recorder': - specifier: workspace:* + specifier: workspace:^ version: link:../../test-utils/recorder '@azure-tools/test-utils-vitest': - specifier: workspace:* + specifier: workspace:^ version: link:../../test-utils/test-utils-vitest '@azure/dev-tool': - specifier: workspace:* + specifier: workspace:^ version: link:../../../common/tools/dev-tool - '@azure/eslint-plugin-azure-sdk': - specifier: workspace:* - version: link:../../../common/tools/eslint-plugin-azure-sdk '@azure/identity': specifier: catalog:internal version: 4.11.1 + '@azure/logger': + specifier: workspace:^ + version: link:../../core/logger '@types/node': specifier: 'catalog:' version: 20.19.25 diff --git a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md index 1b41f2e0333a..fd2858e0b738 100644 --- a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md +++ b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md @@ -1,77 +1,46 @@ # Release History -## 2.0.0 (2025-10-30) +## 1.2.0 (2025-11-19) ### Features Added - - Added operation ElasticSansOperations.create - - Added operation ElasticSansOperations.delete - - Added operation ElasticSansOperations.update - - Added operation PrivateEndpointConnectionsOperations.create - - Added operation PrivateEndpointConnectionsOperations.delete - - Added operation VolumeGroupsOperations.create - - Added operation VolumeGroupsOperations.delete - - Added operation VolumeGroupsOperations.update - - Added operation VolumesOperations.create - - Added operation VolumesOperations.delete - - Added operation VolumesOperations.preBackup - - Added operation VolumesOperations.preRestore - - Added operation VolumesOperations.update - - Added operation VolumeSnapshotsOperations.create - - Added operation VolumeSnapshotsOperations.delete + - Added operation Volumes.beginPreBackup + - Added operation Volumes.beginPreBackupAndWait + - Added operation Volumes.beginPreRestore + - Added operation Volumes.beginPreRestoreAndWait - Added Interface AutoScaleProperties - Added Interface DiskSnapshotList - - Added Interface PagedAsyncIterableIterator - - Added Interface PageSettings + - Added Interface ElasticSansCreateHeaders - Added Interface PreValidationResponse - - Added Interface RestorePollerOptions + - Added Interface PrivateEndpointConnectionsCreateHeaders - Added Interface ScaleUpProperties + - Added Interface VolumeGroupsCreateHeaders - Added Interface VolumeNameList + - Added Interface VolumesCreateHeaders + - Added Interface VolumeSnapshotsCreateHeaders + - Added Interface VolumesPreBackupHeaders - Added Interface VolumesPreBackupOptionalParams + - Added Interface VolumesPreRestoreHeaders - Added Interface VolumesPreRestoreOptionalParams - Interface ElasticSanProperties has a new optional parameter autoScaleProperties + - Interface ElasticSansDeleteHeaders has a new optional parameter retryAfter + - Interface ElasticSansUpdateHeaders has a new optional parameter retryAfter - Interface ElasticSanUpdateProperties has a new optional parameter autoScaleProperties + - Interface PrivateEndpointConnectionsDeleteHeaders has a new optional parameter retryAfter + - Interface VolumeGroupsDeleteHeaders has a new optional parameter retryAfter + - Interface VolumeGroupsUpdateHeaders has a new optional parameter retryAfter + - Interface VolumesDeleteHeaders has a new optional parameter retryAfter + - Interface VolumeSnapshotsDeleteHeaders has a new optional parameter retryAfter + - Interface VolumesUpdateHeaders has a new optional parameter retryAfter - Added Type Alias AutoScalePolicyEnforcement - - Added Type Alias AzureSupportedClouds - - Added Enum AzureClouds + - Added Type Alias OperationsListNextResponse + - Added Type Alias PrivateEndpointConnectionsListNextResponse + - Added Type Alias SkusListNextResponse + - Added Type Alias VolumesPreBackupResponse + - Added Type Alias VolumesPreRestoreResponse - Added Enum KnownAutoScalePolicyEnforcement - - Added Enum KnownVersions - Enum KnownProvisioningStates has a new value Deleted - Enum KnownProvisioningStates has a new value Restoring -### Breaking Changes - - Removed operation ElasticSans.beginCreate - - Removed operation ElasticSans.beginCreateAndWait - - Removed operation ElasticSans.beginDelete - - Removed operation ElasticSans.beginDeleteAndWait - - Removed operation ElasticSans.beginUpdate - - Removed operation ElasticSans.beginUpdateAndWait - - Removed operation PrivateEndpointConnections.beginCreate - - Removed operation PrivateEndpointConnections.beginCreateAndWait - - Removed operation PrivateEndpointConnections.beginDelete - - Removed operation PrivateEndpointConnections.beginDeleteAndWait - - Removed operation VolumeGroups.beginCreate - - Removed operation VolumeGroups.beginCreateAndWait - - Removed operation VolumeGroups.beginDelete - - Removed operation VolumeGroups.beginDeleteAndWait - - Removed operation VolumeGroups.beginUpdate - - Removed operation VolumeGroups.beginUpdateAndWait - - Removed operation Volumes.beginCreate - - Removed operation Volumes.beginCreateAndWait - - Removed operation Volumes.beginDelete - - Removed operation Volumes.beginDeleteAndWait - - Removed operation Volumes.beginUpdate - - Removed operation Volumes.beginUpdateAndWait - - Removed operation VolumeSnapshots.beginCreate - - Removed operation VolumeSnapshots.beginCreateAndWait - - Removed operation VolumeSnapshots.beginDelete - - Removed operation VolumeSnapshots.beginDeleteAndWait - - Removed Interface ElasticSanList - - Removed Interface SkuInformationList - - Removed Interface SnapshotList - - Removed Interface VolumeGroupList - - Removed Interface VolumeList - - Parameter value of interface PrivateLinkResourceListResult is now required - ## 1.2.0-beta.2 (2025-04-18) Compared with version 1.1.0 diff --git a/sdk/elasticsans/arm-elasticsan/README.md b/sdk/elasticsans/arm-elasticsan/README.md index fc33b33ce53f..844e1ebfe13f 100644 --- a/sdk/elasticsans/arm-elasticsan/README.md +++ b/sdk/elasticsans/arm-elasticsan/README.md @@ -4,12 +4,10 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f (missing-service-description) Add service description -Key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan) -- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-elasticsan) -- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/samples) +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-elasticsan) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -65,15 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; +const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); ``` - ### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). @@ -99,7 +96,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## Next steps -Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/samples) directory for detailed examples on how to use this library. +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. ## Contributing @@ -109,6 +106,9 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +[azure_cli]: https://learn.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity diff --git a/sdk/elasticsans/arm-elasticsan/_meta.json b/sdk/elasticsans/arm-elasticsan/_meta.json new file mode 100644 index 000000000000..95f7cb24602f --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "5476ceee2ed3364cdedec8e0d002d2e45389a8f0", + "readme": "specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/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=C:\\Users\\v-ziweichen.FAREAST\\Documents\\Git\\azure-sdk\\azure-sdk-for-js ..\\..\\azure-rest-api-specs\\specification\\elasticsan\\resource-manager\\Microsoft.ElasticSan\\ElasticSan\\readme.md --use=@autorest/typescript@6.0.51 --generate-sample=true", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.14.8", + "use": "@autorest/typescript@6.0.51" +} diff --git a/sdk/elasticsans/arm-elasticsan/api-extractor.json b/sdk/elasticsans/arm-elasticsan/api-extractor.json index 870d6d399477..16d81e2eb512 100644 --- a/sdk/elasticsans/arm-elasticsan/api-extractor.json +++ b/sdk/elasticsans/arm-elasticsan/api-extractor.json @@ -1 +1,3 @@ -{ "extends": "../../../api-extractor-base.json" } +{ + "extends": "../../../api-extractor-base.json" +} diff --git a/sdk/elasticsans/arm-elasticsan/eslint.config.mjs b/sdk/elasticsans/arm-elasticsan/eslint.config.mjs deleted file mode 100644 index 6d2f8a5914c3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/eslint.config.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; - -export default azsdkEslint.config([ - { - rules: { - "@azure/azure-sdk/ts-modules-only-named": "warn", - "@azure/azure-sdk/ts-package-json-types": "warn", - "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", - "@azure/azure-sdk/ts-package-json-files-required": "off", - "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", - "tsdoc/syntax": "warn", - }, - }, -]); diff --git a/sdk/elasticsans/arm-elasticsan/metadata.json b/sdk/elasticsans/arm-elasticsan/metadata.json deleted file mode 100644 index eee52676e924..000000000000 --- a/sdk/elasticsans/arm-elasticsan/metadata.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "apiVersion": "2025-09-01", - "emitterVersion": "0.45.1", - "crossLanguageDefinitions": { - "CrossLanguagePackageId": "Microsoft.ElasticSan", - "CrossLanguageDefinitionId": { - "@azure/arm-elasticsan!OperationListResult:interface": "Azure.ResourceManager.CommonTypes.OperationListResult", - "@azure/arm-elasticsan!Operation:interface": "Azure.ResourceManager.CommonTypes.Operation", - "@azure/arm-elasticsan!OperationDisplay:interface": "Azure.ResourceManager.CommonTypes.OperationDisplay", - "@azure/arm-elasticsan!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", - "@azure/arm-elasticsan!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", - "@azure/arm-elasticsan!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", - "@azure/arm-elasticsan!ElasticSan:interface": "Microsoft.ElasticSan.ElasticSan", - "@azure/arm-elasticsan!ElasticSanProperties:interface": "Microsoft.ElasticSan.ElasticSanProperties", - "@azure/arm-elasticsan!Sku:interface": "Microsoft.ElasticSan.Sku", - "@azure/arm-elasticsan!PrivateEndpointConnection:interface": "Microsoft.ElasticSan.PrivateEndpointConnection", - "@azure/arm-elasticsan!PrivateEndpointConnectionProperties:interface": "Microsoft.ElasticSan.PrivateEndpointConnectionProperties", - "@azure/arm-elasticsan!PrivateEndpoint:interface": "Microsoft.ElasticSan.PrivateEndpoint", - "@azure/arm-elasticsan!PrivateLinkServiceConnectionState:interface": "Microsoft.ElasticSan.PrivateLinkServiceConnectionState", - "@azure/arm-elasticsan!ProxyResource:interface": "Azure.ResourceManager.CommonTypes.ProxyResource", - "@azure/arm-elasticsan!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", - "@azure/arm-elasticsan!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", - "@azure/arm-elasticsan!AutoScaleProperties:interface": "Microsoft.ElasticSan.AutoScaleProperties", - "@azure/arm-elasticsan!ScaleUpProperties:interface": "Microsoft.ElasticSan.ScaleUpProperties", - "@azure/arm-elasticsan!TrackedResource:interface": "Azure.ResourceManager.CommonTypes.TrackedResource", - "@azure/arm-elasticsan!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", - "@azure/arm-elasticsan!ElasticSanUpdate:interface": "Microsoft.ElasticSan.ElasticSanUpdate", - "@azure/arm-elasticsan!ElasticSanUpdateProperties:interface": "Microsoft.ElasticSan.ElasticSanUpdateProperties", - "@azure/arm-elasticsan!ElasticSanList:interface": "Microsoft.ElasticSan.ElasticSanList", - "@azure/arm-elasticsan!PrivateEndpointConnectionListResult:interface": "Azure.ResourceManager.ResourceListResult", - "@azure/arm-elasticsan!Volume:interface": "Microsoft.ElasticSan.Volume", - "@azure/arm-elasticsan!VolumeProperties:interface": "Microsoft.ElasticSan.VolumeProperties", - "@azure/arm-elasticsan!SourceCreationData:interface": "Microsoft.ElasticSan.SourceCreationData", - "@azure/arm-elasticsan!IscsiTargetInfo:interface": "Microsoft.ElasticSan.IscsiTargetInfo", - "@azure/arm-elasticsan!ManagedByInfo:interface": "Microsoft.ElasticSan.ManagedByInfo", - "@azure/arm-elasticsan!VolumeUpdate:interface": "Microsoft.ElasticSan.VolumeUpdate", - "@azure/arm-elasticsan!VolumeUpdateProperties:interface": "Microsoft.ElasticSan.VolumeUpdateProperties", - "@azure/arm-elasticsan!VolumeList:interface": "Microsoft.ElasticSan.VolumeList", - "@azure/arm-elasticsan!VolumeNameList:interface": "Microsoft.ElasticSan.VolumeNameList", - "@azure/arm-elasticsan!PreValidationResponse:interface": "Microsoft.ElasticSan.PreValidationResponse", - "@azure/arm-elasticsan!DiskSnapshotList:interface": "Microsoft.ElasticSan.DiskSnapshotList", - "@azure/arm-elasticsan!VolumeGroup:interface": "Microsoft.ElasticSan.VolumeGroup", - "@azure/arm-elasticsan!Identity:interface": "Microsoft.ElasticSan.Identity", - "@azure/arm-elasticsan!UserAssignedIdentity:interface": "Microsoft.ElasticSan.UserAssignedIdentity", - "@azure/arm-elasticsan!VolumeGroupProperties:interface": "Microsoft.ElasticSan.VolumeGroupProperties", - "@azure/arm-elasticsan!EncryptionProperties:interface": "Microsoft.ElasticSan.EncryptionProperties", - "@azure/arm-elasticsan!KeyVaultProperties:interface": "Microsoft.ElasticSan.KeyVaultProperties", - "@azure/arm-elasticsan!EncryptionIdentity:interface": "Microsoft.ElasticSan.EncryptionIdentity", - "@azure/arm-elasticsan!NetworkRuleSet:interface": "Microsoft.ElasticSan.NetworkRuleSet", - "@azure/arm-elasticsan!VirtualNetworkRule:interface": "Microsoft.ElasticSan.VirtualNetworkRule", - "@azure/arm-elasticsan!VolumeGroupUpdate:interface": "Microsoft.ElasticSan.VolumeGroupUpdate", - "@azure/arm-elasticsan!VolumeGroupUpdateProperties:interface": "Microsoft.ElasticSan.VolumeGroupUpdateProperties", - "@azure/arm-elasticsan!VolumeGroupList:interface": "Microsoft.ElasticSan.VolumeGroupList", - "@azure/arm-elasticsan!PrivateLinkResourceListResult:interface": "Microsoft.ElasticSan.PrivateLinkResourceListResult", - "@azure/arm-elasticsan!PrivateLinkResource:interface": "Microsoft.ElasticSan.PrivateLinkResource", - "@azure/arm-elasticsan!PrivateLinkResourceProperties:interface": "Microsoft.ElasticSan.PrivateLinkResourceProperties", - "@azure/arm-elasticsan!Snapshot:interface": "Microsoft.ElasticSan.Snapshot", - "@azure/arm-elasticsan!SnapshotProperties:interface": "Microsoft.ElasticSan.SnapshotProperties", - "@azure/arm-elasticsan!SnapshotCreationData:interface": "Microsoft.ElasticSan.SnapshotCreationData", - "@azure/arm-elasticsan!SnapshotList:interface": "Microsoft.ElasticSan.SnapshotList", - "@azure/arm-elasticsan!SkuInformationList:interface": "Microsoft.ElasticSan.SkuInformationList", - "@azure/arm-elasticsan!SkuInformation:interface": "Microsoft.ElasticSan.SkuInformation", - "@azure/arm-elasticsan!SkuLocationInfo:interface": "Microsoft.ElasticSan.SkuLocationInfo", - "@azure/arm-elasticsan!SKUCapability:interface": "Microsoft.ElasticSan.SKUCapability", - "@azure/arm-elasticsan!KnownOrigin:enum": "Azure.ResourceManager.CommonTypes.Origin", - "@azure/arm-elasticsan!KnownActionType:enum": "Azure.ResourceManager.CommonTypes.ActionType", - "@azure/arm-elasticsan!KnownSkuName:enum": "Microsoft.ElasticSan.SkuName", - "@azure/arm-elasticsan!KnownSkuTier:enum": "Microsoft.ElasticSan.SkuTier", - "@azure/arm-elasticsan!KnownProvisioningStates:enum": "Microsoft.ElasticSan.ProvisioningStates", - "@azure/arm-elasticsan!KnownPrivateEndpointServiceConnectionStatus:enum": "Microsoft.ElasticSan.PrivateEndpointServiceConnectionStatus", - "@azure/arm-elasticsan!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", - "@azure/arm-elasticsan!KnownPublicNetworkAccess:enum": "Microsoft.ElasticSan.PublicNetworkAccess", - "@azure/arm-elasticsan!KnownAutoScalePolicyEnforcement:enum": "Microsoft.ElasticSan.AutoScalePolicyEnforcement", - "@azure/arm-elasticsan!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", - "@azure/arm-elasticsan!KnownVolumeCreateOption:enum": "Microsoft.ElasticSan.VolumeCreateOption", - "@azure/arm-elasticsan!KnownOperationalStatus:enum": "Microsoft.ElasticSan.OperationalStatus", - "@azure/arm-elasticsan!Knownx-ms-delete-snapshots:enum": "Microsoft.ElasticSan.x-ms-delete-snapshots", - "@azure/arm-elasticsan!Knownx-ms-force-delete:enum": "Microsoft.ElasticSan.x-ms-force-delete", - "@azure/arm-elasticsan!KnownIdentityType:enum": "Microsoft.ElasticSan.IdentityType", - "@azure/arm-elasticsan!KnownStorageTargetType:enum": "Microsoft.ElasticSan.StorageTargetType", - "@azure/arm-elasticsan!KnownEncryptionType:enum": "Microsoft.ElasticSan.EncryptionType", - "@azure/arm-elasticsan!KnownAction:enum": "Microsoft.ElasticSan.Action", - "@azure/arm-elasticsan!KnownVersions:enum": "Microsoft.ElasticSan.Versions", - "@azure/arm-elasticsan!SkusOperations#list:member": "Microsoft.ElasticSan.SkusOperationGroup.list", - "@azure/arm-elasticsan!VolumeSnapshotsOperations#listByVolumeGroup:member": "Microsoft.ElasticSan.Snapshots.listByVolumeGroup", - "@azure/arm-elasticsan!VolumeSnapshotsOperations#delete:member": "Microsoft.ElasticSan.Snapshots.delete", - "@azure/arm-elasticsan!VolumeSnapshotsOperations#create:member": "Microsoft.ElasticSan.Snapshots.create", - "@azure/arm-elasticsan!VolumeSnapshotsOperations#get:member": "Microsoft.ElasticSan.Snapshots.get", - "@azure/arm-elasticsan!PrivateLinkResourcesOperations#listByElasticSan:member": "Microsoft.ElasticSan.ElasticSans.listByElasticSan", - "@azure/arm-elasticsan!VolumeGroupsOperations#listByElasticSan:member": "Microsoft.ElasticSan.VolumeGroups.listByElasticSan", - "@azure/arm-elasticsan!VolumeGroupsOperations#delete:member": "Microsoft.ElasticSan.VolumeGroups.delete", - "@azure/arm-elasticsan!VolumeGroupsOperations#update:member": "Microsoft.ElasticSan.VolumeGroups.update", - "@azure/arm-elasticsan!VolumeGroupsOperations#create:member": "Microsoft.ElasticSan.VolumeGroups.create", - "@azure/arm-elasticsan!VolumeGroupsOperations#get:member": "Microsoft.ElasticSan.VolumeGroups.get", - "@azure/arm-elasticsan!VolumesOperations#preRestore:member": "Microsoft.ElasticSan.VolumeGroups.preRestore", - "@azure/arm-elasticsan!VolumesOperations#preBackup:member": "Microsoft.ElasticSan.VolumeGroups.preBackup", - "@azure/arm-elasticsan!VolumesOperations#listByVolumeGroup:member": "Microsoft.ElasticSan.Volumes.listByVolumeGroup", - "@azure/arm-elasticsan!VolumesOperations#delete:member": "Microsoft.ElasticSan.Volumes.delete", - "@azure/arm-elasticsan!VolumesOperations#update:member": "Microsoft.ElasticSan.Volumes.update", - "@azure/arm-elasticsan!VolumesOperations#create:member": "Microsoft.ElasticSan.Volumes.create", - "@azure/arm-elasticsan!VolumesOperations#get:member": "Microsoft.ElasticSan.Volumes.get", - "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#list:member": "Microsoft.ElasticSan.PrivateEndpointConnections.list", - "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#delete:member": "Microsoft.ElasticSan.PrivateEndpointConnections.delete", - "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#create:member": "Microsoft.ElasticSan.PrivateEndpointConnections.create", - "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#get:member": "Microsoft.ElasticSan.PrivateEndpointConnections.get", - "@azure/arm-elasticsan!ElasticSansOperations#listBySubscription:member": "Microsoft.ElasticSan.ElasticSans.listBySubscription", - "@azure/arm-elasticsan!ElasticSansOperations#listByResourceGroup:member": "Microsoft.ElasticSan.ElasticSans.listByResourceGroup", - "@azure/arm-elasticsan!ElasticSansOperations#delete:member": "Microsoft.ElasticSan.ElasticSans.delete", - "@azure/arm-elasticsan!ElasticSansOperations#update:member": "Microsoft.ElasticSan.ElasticSans.update", - "@azure/arm-elasticsan!ElasticSansOperations#create:member": "Microsoft.ElasticSan.ElasticSans.create", - "@azure/arm-elasticsan!ElasticSansOperations#get:member": "Microsoft.ElasticSan.ElasticSans.get", - "@azure/arm-elasticsan!OperationsOperations#list:member": "Azure.ResourceManager.Operations.list" - } - } -} diff --git a/sdk/elasticsans/arm-elasticsan/package.json b/sdk/elasticsans/arm-elasticsan/package.json index 446d8275831d..9865c89648b3 100644 --- a/sdk/elasticsans/arm-elasticsan/package.json +++ b/sdk/elasticsans/arm-elasticsan/package.json @@ -1,122 +1,110 @@ { "name": "@azure/arm-elasticsan", - "version": "2.0.0", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", "description": "A generated SDK for ElasticSanManagement.", + "version": "1.2.0", "engines": { "node": ">=20.0.0" }, - "sideEffects": false, - "autoPublish": false, - "tshy": { - "exports": { - "./package.json": "./package.json", - ".": "./src/index.ts", - "./api": "./src/api/index.ts", - "./api/skus": "./src/api/skus/index.ts", - "./api/volumeSnapshots": "./src/api/volumeSnapshots/index.ts", - "./api/privateLinkResources": "./src/api/privateLinkResources/index.ts", - "./api/volumeGroups": "./src/api/volumeGroups/index.ts", - "./api/volumes": "./src/api/volumes/index.ts", - "./api/privateEndpointConnections": "./src/api/privateEndpointConnections/index.ts", - "./api/elasticSans": "./src/api/elasticSans/index.ts", - "./api/operations": "./src/api/operations/index.ts", - "./models": "./src/models/index.ts" - }, - "dialects": [ - "esm", - "commonjs" - ], - "esmDialects": [ - "browser", - "react-native" - ], - "selfLink": false, - "project": "../../../tsconfig.src.build.json" + "dependencies": { + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", + "@azure/core-paging": "^1.6.2", + "@azure/core-client": "^1.9.3", + "@azure/core-auth": "^1.9.0", + "@azure/core-rest-pipeline": "^1.19.1", + "tslib": "^2.8.1" }, - "type": "module", - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "keywords": [ "node", "azure", - "cloud", "typescript", "browser", - "isomorphic" + "isomorphic", + "cloud" ], - "author": "Microsoft Corporation", "license": "MIT", - "files": [ - "dist/", - "!dist/**/*.d.*ts.map", - "README.md", - "LICENSE" - ], - "sdk-type": "mgmt", - "repository": "github:Azure/azure-sdk-for-js", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md", - "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", - "//metadata": { - "constantPaths": [ - { - "path": "src/api/elasticSanManagementContext.ts", - "prefix": "userAgentInfo" - } - ] - }, - "dependencies": { - "@azure/core-util": "^1.12.0", - "@azure-rest/core-client": "^2.3.1", - "@azure/abort-controller": "^2.1.2", - "@azure/core-auth": "^1.9.0", - "@azure/core-lro": "^3.1.0", - "@azure/core-rest-pipeline": "^1.20.0", - "@azure/logger": "^1.2.0", - "tslib": "^2.8.1" - }, + "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { - "@azure-tools/test-credential": "workspace:*", - "@azure-tools/test-recorder": "workspace:*", - "@azure-tools/test-utils-vitest": "workspace:*", - "@azure/dev-tool": "workspace:*", - "tshy": "catalog:", - "@azure/eslint-plugin-azure-sdk": "workspace:*", - "@azure/identity": "catalog:internal", - "@types/node": "catalog:", + "typescript": "catalog:", + "rimraf": "catalog:", + "dotenv": "catalog:testing", + "@azure/dev-tool": "workspace:^", "cross-env": "catalog:", "eslint": "catalog:", "prettier": "catalog:", - "rimraf": "catalog:", + "tshy": "catalog:", + "@azure/identity": "catalog:internal", + "@azure/logger": "workspace:^", + "@azure-tools/test-recorder": "workspace:^", + "@azure-tools/test-credential": "workspace:^", + "@azure-tools/test-utils-vitest": "workspace:^", + "@types/node": "catalog:", "@vitest/browser-playwright": "catalog:testing", "@vitest/coverage-istanbul": "catalog:testing", - "dotenv": "catalog:testing", "playwright": "catalog:testing", - "typescript": "catalog:", "vitest": "catalog:testing" }, + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/", + "README.md", + "LICENSE" + ], "scripts": { - "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "extract-api": "rimraf review && dev-tool run extract-api", + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", "pack": "pnpm pack 2>&1", + "extract-api": "dev-tool run extract-api", "lint": "echo skipped", - "lint:fix": "echo skipped", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", - "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", - "execute:samples": "dev-tool samples run samples-dev", - "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", - "generate:client": "echo skipped", - "test:browser": "dev-tool run build-test && dev-tool run test:vitest --browser", - "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", - "test:node": "dev-tool run test:vitest", - "test:node:esm": "dev-tool run test:vitest --esm", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "execute:samples": "echo skipped", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "test": "npm run test:node && npm run test:browser", - "update-snippets": "dev-tool run update-snippets" + "test:node": "dev-tool run test:vitest", + "test:browser": "echo skipped", + "update-snippets": "dev-tool run update-snippets", + "test:node:esm": "dev-tool run test:vitest --esm" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/elasticSanManagement.ts", + "prefix": "packageDetails" + } + ] }, + "autoPublish": true, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "tshy": { + "project": "../../../tsconfig.src.build.json", + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan", "//sampleConfiguration": { - "productName": "@azure/arm-elasticsan", + "productName": "", "productSlugs": [ "azure" ], @@ -142,189 +130,6 @@ "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } - }, - "./api": { - "browser": { - "types": "./dist/browser/api/index.d.ts", - "default": "./dist/browser/api/index.js" - }, - "react-native": { - "types": "./dist/react-native/api/index.d.ts", - "default": "./dist/react-native/api/index.js" - }, - "import": { - "types": "./dist/esm/api/index.d.ts", - "default": "./dist/esm/api/index.js" - }, - "require": { - "types": "./dist/commonjs/api/index.d.ts", - "default": "./dist/commonjs/api/index.js" - } - }, - "./api/skus": { - "browser": { - "types": "./dist/browser/api/skus/index.d.ts", - "default": "./dist/browser/api/skus/index.js" - }, - "react-native": { - "types": "./dist/react-native/api/skus/index.d.ts", - "default": "./dist/react-native/api/skus/index.js" - }, - "import": { - "types": "./dist/esm/api/skus/index.d.ts", - "default": "./dist/esm/api/skus/index.js" - }, - "require": { - "types": "./dist/commonjs/api/skus/index.d.ts", - "default": "./dist/commonjs/api/skus/index.js" - } - }, - "./api/volumeSnapshots": { - "browser": { - "types": "./dist/browser/api/volumeSnapshots/index.d.ts", - "default": "./dist/browser/api/volumeSnapshots/index.js" - }, - "react-native": { - "types": "./dist/react-native/api/volumeSnapshots/index.d.ts", - "default": "./dist/react-native/api/volumeSnapshots/index.js" - }, - "import": { - "types": "./dist/esm/api/volumeSnapshots/index.d.ts", - "default": "./dist/esm/api/volumeSnapshots/index.js" - }, - "require": { - "types": "./dist/commonjs/api/volumeSnapshots/index.d.ts", - "default": "./dist/commonjs/api/volumeSnapshots/index.js" - } - }, - "./api/privateLinkResources": { - "browser": { - "types": "./dist/browser/api/privateLinkResources/index.d.ts", - "default": "./dist/browser/api/privateLinkResources/index.js" - }, - "react-native": { - "types": "./dist/react-native/api/privateLinkResources/index.d.ts", - "default": "./dist/react-native/api/privateLinkResources/index.js" - }, - "import": { - "types": "./dist/esm/api/privateLinkResources/index.d.ts", - "default": "./dist/esm/api/privateLinkResources/index.js" - }, - "require": { - "types": "./dist/commonjs/api/privateLinkResources/index.d.ts", - "default": "./dist/commonjs/api/privateLinkResources/index.js" - } - }, - "./api/volumeGroups": { - "browser": { - "types": "./dist/browser/api/volumeGroups/index.d.ts", - "default": "./dist/browser/api/volumeGroups/index.js" - }, - "react-native": { - "types": "./dist/react-native/api/volumeGroups/index.d.ts", - "default": "./dist/react-native/api/volumeGroups/index.js" - }, - "import": { - "types": "./dist/esm/api/volumeGroups/index.d.ts", - "default": "./dist/esm/api/volumeGroups/index.js" - }, - "require": { - "types": "./dist/commonjs/api/volumeGroups/index.d.ts", - "default": "./dist/commonjs/api/volumeGroups/index.js" - } - }, - "./api/volumes": { - "browser": { - "types": "./dist/browser/api/volumes/index.d.ts", - "default": "./dist/browser/api/volumes/index.js" - }, - "react-native": { - "types": "./dist/react-native/api/volumes/index.d.ts", - "default": "./dist/react-native/api/volumes/index.js" - }, - "import": { - "types": "./dist/esm/api/volumes/index.d.ts", - "default": "./dist/esm/api/volumes/index.js" - }, - "require": { - "types": "./dist/commonjs/api/volumes/index.d.ts", - "default": "./dist/commonjs/api/volumes/index.js" - } - }, - "./api/privateEndpointConnections": { - "browser": { - "types": "./dist/browser/api/privateEndpointConnections/index.d.ts", - "default": "./dist/browser/api/privateEndpointConnections/index.js" - }, - "react-native": { - "types": "./dist/react-native/api/privateEndpointConnections/index.d.ts", - "default": "./dist/react-native/api/privateEndpointConnections/index.js" - }, - "import": { - "types": "./dist/esm/api/privateEndpointConnections/index.d.ts", - "default": "./dist/esm/api/privateEndpointConnections/index.js" - }, - "require": { - "types": "./dist/commonjs/api/privateEndpointConnections/index.d.ts", - "default": "./dist/commonjs/api/privateEndpointConnections/index.js" - } - }, - "./api/elasticSans": { - "browser": { - "types": "./dist/browser/api/elasticSans/index.d.ts", - "default": "./dist/browser/api/elasticSans/index.js" - }, - "react-native": { - "types": "./dist/react-native/api/elasticSans/index.d.ts", - "default": "./dist/react-native/api/elasticSans/index.js" - }, - "import": { - "types": "./dist/esm/api/elasticSans/index.d.ts", - "default": "./dist/esm/api/elasticSans/index.js" - }, - "require": { - "types": "./dist/commonjs/api/elasticSans/index.d.ts", - "default": "./dist/commonjs/api/elasticSans/index.js" - } - }, - "./api/operations": { - "browser": { - "types": "./dist/browser/api/operations/index.d.ts", - "default": "./dist/browser/api/operations/index.js" - }, - "react-native": { - "types": "./dist/react-native/api/operations/index.d.ts", - "default": "./dist/react-native/api/operations/index.js" - }, - "import": { - "types": "./dist/esm/api/operations/index.d.ts", - "default": "./dist/esm/api/operations/index.js" - }, - "require": { - "types": "./dist/commonjs/api/operations/index.d.ts", - "default": "./dist/commonjs/api/operations/index.js" - } - }, - "./models": { - "browser": { - "types": "./dist/browser/models/index.d.ts", - "default": "./dist/browser/models/index.js" - }, - "react-native": { - "types": "./dist/react-native/models/index.d.ts", - "default": "./dist/react-native/models/index.js" - }, - "import": { - "types": "./dist/esm/models/index.d.ts", - "default": "./dist/esm/models/index.js" - }, - "require": { - "types": "./dist/commonjs/models/index.d.ts", - "default": "./dist/commonjs/models/index.js" - } } - }, - "main": "./dist/commonjs/index.js", - "types": "./dist/commonjs/index.d.ts", - "module": "./dist/esm/index.js" + } } diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md deleted file mode 100644 index 89e5766dd1b5..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md +++ /dev/null @@ -1,59 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import type { Client } from '@azure-rest/core-client'; -import type { OperationOptions } from '@azure-rest/core-client'; -import type { OperationState } from '@azure/core-lro'; -import type { PollerLike } from '@azure/core-lro'; - -// @public -export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): PollerLike, void>; - -// @public -export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): PollerLike, ElasticSan>; - -// @public -export interface ElasticSansCreateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface ElasticSansDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface ElasticSansGetOptionalParams extends OperationOptions { -} - -// @public -export interface ElasticSansListByResourceGroupOptionalParams extends OperationOptions { -} - -// @public -export interface ElasticSansListBySubscriptionOptionalParams extends OperationOptions { -} - -// @public -export interface ElasticSansUpdateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams): Promise; - -// @public -export function listByResourceGroup(context: ElasticSanManagementContext, resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - -// @public -export function listBySubscription(context: ElasticSanManagementContext, options?: ElasticSansListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - -// @public -export function update(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): PollerLike, ElasticSan>; - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md deleted file mode 100644 index e521128deefb..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md +++ /dev/null @@ -1,28 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import type { Client } from '@azure-rest/core-client'; -import type { ClientOptions } from '@azure-rest/core-client'; -import type { TokenCredential } from '@azure/core-auth'; - -// @public -export function createElasticSanManagement(credential: TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams): ElasticSanManagementContext; - -// @public -export interface ElasticSanManagementContext extends Client { - apiVersion: string; - subscriptionId: string; -} - -// @public -export interface ElasticSanManagementOptionalParams extends ClientOptions { - apiVersion?: string; - cloudSetting?: AzureSupportedClouds; -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md deleted file mode 100644 index bfd5273d96a8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md +++ /dev/null @@ -1,19 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import type { Client } from '@azure-rest/core-client'; -import type { OperationOptions } from '@azure-rest/core-client'; - -// @public -export function list(context: ElasticSanManagementContext, options?: OperationsListOptionalParams): PagedAsyncIterableIterator; - -// @public -export interface OperationsListOptionalParams extends OperationOptions { -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md deleted file mode 100644 index 3df32b845e97..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md +++ /dev/null @@ -1,44 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import type { Client } from '@azure-rest/core-client'; -import type { OperationOptions } from '@azure-rest/core-client'; -import type { OperationState } from '@azure/core-lro'; -import type { PollerLike } from '@azure/core-lro'; - -// @public -export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): PollerLike, void>; - -// @public -export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): PollerLike, PrivateEndpointConnection>; - -// @public -export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; - -// @public -export function list(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; - -// @public -export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { -} - -// @public -export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md deleted file mode 100644 index 8d565e21cec0..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md +++ /dev/null @@ -1,19 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import type { Client } from '@azure-rest/core-client'; -import type { OperationOptions } from '@azure-rest/core-client'; - -// @public -export function listByElasticSan(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams): Promise; - -// @public -export interface PrivateLinkResourcesListByElasticSanOptionalParams extends OperationOptions { -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md deleted file mode 100644 index fae1f43efdd4..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md +++ /dev/null @@ -1,20 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import type { Client } from '@azure-rest/core-client'; -import type { OperationOptions } from '@azure-rest/core-client'; - -// @public -export function list(context: ElasticSanManagementContext, options?: SkusListOptionalParams): PagedAsyncIterableIterator; - -// @public -export interface SkusListOptionalParams extends OperationOptions { - filter?: string; -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md deleted file mode 100644 index 69b24af70294..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md +++ /dev/null @@ -1,52 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import type { Client } from '@azure-rest/core-client'; -import type { OperationOptions } from '@azure-rest/core-client'; -import type { OperationState } from '@azure/core-lro'; -import type { PollerLike } from '@azure/core-lro'; - -// @public -export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): PollerLike, void>; - -// @public -export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): PollerLike, VolumeGroup>; - -// @public -export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams): Promise; - -// @public -export function listByElasticSan(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams): PagedAsyncIterableIterator; - -// @public -export function update(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): PollerLike, VolumeGroup>; - -// @public -export interface VolumeGroupsCreateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface VolumeGroupsDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface VolumeGroupsGetOptionalParams extends OperationOptions { -} - -// @public -export interface VolumeGroupsListByElasticSanOptionalParams extends OperationOptions { -} - -// @public -export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md deleted file mode 100644 index e6f17b87a2f3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md +++ /dev/null @@ -1,45 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import type { Client } from '@azure-rest/core-client'; -import type { OperationOptions } from '@azure-rest/core-client'; -import type { OperationState } from '@azure/core-lro'; -import type { PollerLike } from '@azure/core-lro'; - -// @public -export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams): PollerLike, void>; - -// @public -export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams): PollerLike, Snapshot>; - -// @public -export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsGetOptionalParams): Promise; - -// @public -export function listByVolumeGroup(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeSnapshotsListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; - -// @public -export interface VolumeSnapshotsCreateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface VolumeSnapshotsDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface VolumeSnapshotsGetOptionalParams extends OperationOptions { -} - -// @public -export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends OperationOptions { - filter?: string; -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md deleted file mode 100644 index 9c4f4aaf4398..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md +++ /dev/null @@ -1,70 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import type { Client } from '@azure-rest/core-client'; -import type { OperationOptions } from '@azure-rest/core-client'; -import type { OperationState } from '@azure/core-lro'; -import type { PollerLike } from '@azure/core-lro'; - -// @public -export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): PollerLike, void>; - -// @public -export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): PollerLike, Volume>; - -// @public -export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; - -// @public -export function listByVolumeGroup(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; - -// @public -export function preBackup(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams): PollerLike, PreValidationResponse>; - -// @public -export function preRestore(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams): PollerLike, PreValidationResponse>; - -// @public -export function update(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): PollerLike, Volume>; - -// @public -export interface VolumesCreateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface VolumesDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; - xMsDeleteSnapshots?: XMsDeleteSnapshots; - xMsForceDelete?: XMsForceDelete; -} - -// @public -export interface VolumesGetOptionalParams extends OperationOptions { -} - -// @public -export interface VolumesListByVolumeGroupOptionalParams extends OperationOptions { -} - -// @public -export interface VolumesPreBackupOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface VolumesPreRestoreOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface VolumesUpdateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md deleted file mode 100644 index 106fea2202b8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md +++ /dev/null @@ -1,530 +0,0 @@ -## API Report File for "@azure/arm-elasticsan" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -// @public -export type Action = string; - -// @public -export type ActionType = string; - -// @public -export type AutoScalePolicyEnforcement = string; - -// @public -export interface AutoScaleProperties { - scaleUpProperties?: ScaleUpProperties; -} - -// @public -export type CreatedByType = string; - -// @public -export interface DiskSnapshotList { - diskSnapshotIds: string[]; -} - -// @public -export interface ElasticSan extends TrackedResource { - properties: ElasticSanProperties; -} - -// @public -export interface ElasticSanProperties { - autoScaleProperties?: AutoScaleProperties; - availabilityZones?: string[]; - baseSizeTiB: number; - extendedCapacitySizeTiB: number; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - readonly provisioningState?: ProvisioningStates; - publicNetworkAccess?: PublicNetworkAccess; - sku: Sku; - readonly totalIops?: number; - readonly totalMBps?: number; - readonly totalSizeTiB?: number; - readonly totalVolumeSizeGiB?: number; - readonly volumeGroupCount?: number; -} - -// @public -export interface ElasticSanUpdate { - properties?: ElasticSanUpdateProperties; - tags?: Record; -} - -// @public -export interface ElasticSanUpdateProperties { - autoScaleProperties?: AutoScaleProperties; - baseSizeTiB?: number; - extendedCapacitySizeTiB?: number; - publicNetworkAccess?: PublicNetworkAccess; -} - -// @public -export interface EncryptionIdentity { - encryptionUserAssignedIdentity?: string; -} - -// @public -export interface EncryptionProperties { - encryptionIdentity?: EncryptionIdentity; - keyVaultProperties?: KeyVaultProperties; -} - -// @public -export type EncryptionType = string; - -// @public -export interface ErrorAdditionalInfo { - readonly info?: any; - readonly type?: string; -} - -// @public -export interface ErrorDetail { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetail[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorResponse { - error?: ErrorDetail; -} - -// @public -export interface Identity { - readonly principalId?: string; - readonly tenantId?: string; - type: IdentityType; - userAssignedIdentities?: Record; -} - -// @public -export type IdentityType = string; - -// @public -export interface IscsiTargetInfo { - readonly provisioningState?: ProvisioningStates; - status?: OperationalStatus; - readonly targetIqn?: string; - readonly targetPortalHostname?: string; - readonly targetPortalPort?: number; -} - -// @public -export interface KeyVaultProperties { - readonly currentVersionedKeyExpirationTimestamp?: Date; - readonly currentVersionedKeyIdentifier?: string; - keyName?: string; - keyVaultUri?: string; - keyVersion?: string; - readonly lastKeyRotationTimestamp?: Date; -} - -// @public -export enum KnownAction { - Allow = "Allow" -} - -// @public -export enum KnownActionType { - Internal = "Internal" -} - -// @public -export enum KnownAutoScalePolicyEnforcement { - Disabled = "Disabled", - Enabled = "Enabled", - None = "None" -} - -// @public -export enum KnownCreatedByType { - Application = "Application", - Key = "Key", - ManagedIdentity = "ManagedIdentity", - User = "User" -} - -// @public -export enum KnownEncryptionType { - EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", - EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" -} - -// @public -export enum KnownIdentityType { - None = "None", - SystemAssigned = "SystemAssigned", - UserAssigned = "UserAssigned" -} - -// @public -export enum KnownOperationalStatus { - Healthy = "Healthy", - Invalid = "Invalid", - Running = "Running", - Stopped = "Stopped", - StoppedDeallocated = "Stopped (deallocated)", - Unhealthy = "Unhealthy", - Unknown = "Unknown", - Updating = "Updating" -} - -// @public -export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" -} - -// @public -export enum KnownPrivateEndpointServiceConnectionStatus { - Approved = "Approved", - Failed = "Failed", - Pending = "Pending", - Rejected = "Rejected" -} - -// @public -export enum KnownProvisioningStates { - Canceled = "Canceled", - Creating = "Creating", - Deleted = "Deleted", - Deleting = "Deleting", - Failed = "Failed", - Invalid = "Invalid", - Pending = "Pending", - Restoring = "Restoring", - Succeeded = "Succeeded", - Updating = "Updating" -} - -// @public -export enum KnownPublicNetworkAccess { - Disabled = "Disabled", - Enabled = "Enabled" -} - -// @public -export enum KnownSkuName { - PremiumLRS = "Premium_LRS", - PremiumZRS = "Premium_ZRS" -} - -// @public -export enum KnownSkuTier { - Premium = "Premium" -} - -// @public -export enum KnownStorageTargetType { - Iscsi = "Iscsi", - None = "None" -} - -// @public -export enum KnownVersions { - V20250901 = "2025-09-01" -} - -// @public -export enum KnownVolumeCreateOption { - Disk = "Disk", - DiskRestorePoint = "DiskRestorePoint", - DiskSnapshot = "DiskSnapshot", - None = "None", - VolumeSnapshot = "VolumeSnapshot" -} - -// @public -export enum KnownXMsDeleteSnapshots { - False = "false", - True = "true" -} - -// @public -export enum KnownXMsForceDelete { - False = "false", - True = "true" -} - -// @public -export interface ManagedByInfo { - resourceId?: string; -} - -// @public -export interface NetworkRuleSet { - virtualNetworkRules?: VirtualNetworkRule[]; -} - -// @public -export interface Operation { - readonly actionType?: ActionType; - display?: OperationDisplay; - readonly isDataAction?: boolean; - readonly name?: string; - readonly origin?: Origin; -} - -// @public -export type OperationalStatus = string; - -// @public -export interface OperationDisplay { - readonly description?: string; - readonly operation?: string; - readonly provider?: string; - readonly resource?: string; -} - -// @public -export type Origin = string; - -// @public -export interface PreValidationResponse { - validationStatus?: string; -} - -// @public -export interface PrivateEndpoint { - readonly id?: string; -} - -// @public -export interface PrivateEndpointConnection extends ProxyResource { - properties: PrivateEndpointConnectionProperties; -} - -// @public -export interface PrivateEndpointConnectionProperties { - groupIds?: string[]; - privateEndpoint?: PrivateEndpoint; - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; - readonly provisioningState?: ProvisioningStates; -} - -// @public -export type PrivateEndpointServiceConnectionStatus = string; - -// @public -export interface PrivateLinkResource extends Resource { - properties?: PrivateLinkResourceProperties; -} - -// @public -export interface PrivateLinkResourceListResult { - readonly nextLink?: string; - value: PrivateLinkResource[]; -} - -// @public -export interface PrivateLinkResourceProperties { - readonly groupId?: string; - readonly requiredMembers?: string[]; - requiredZoneNames?: string[]; -} - -// @public -export interface PrivateLinkServiceConnectionState { - actionsRequired?: string; - description?: string; - status?: PrivateEndpointServiceConnectionStatus; -} - -// @public -export type ProvisioningStates = string; - -// @public -export interface ProxyResource extends Resource { -} - -// @public -export type PublicNetworkAccess = string; - -// @public -export interface Resource { - readonly id?: string; - readonly name?: string; - readonly systemData?: SystemData; - readonly type?: string; -} - -// @public -export interface ScaleUpProperties { - autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; - capacityUnitScaleUpLimitTiB?: number; - increaseCapacityUnitByTiB?: number; - unusedSizeTiB?: number; -} - -// @public -export interface Sku { - name: SkuName; - tier?: SkuTier; -} - -// @public -export interface SKUCapability { - readonly name?: string; - readonly value?: string; -} - -// @public -export interface SkuInformation { - readonly capabilities?: SKUCapability[]; - readonly locationInfo?: SkuLocationInfo[]; - readonly locations?: string[]; - name: SkuName; - readonly resourceType?: string; - tier?: SkuTier; -} - -// @public -export interface SkuLocationInfo { - readonly location?: string; - readonly zones?: string[]; -} - -// @public -export type SkuName = string; - -// @public -export type SkuTier = string; - -// @public -export interface Snapshot extends ProxyResource { - properties: SnapshotProperties; -} - -// @public -export interface SnapshotCreationData { - sourceId: string; -} - -// @public -export interface SnapshotProperties { - creationData: SnapshotCreationData; - readonly provisioningState?: ProvisioningStates; - readonly sourceVolumeSizeGiB?: number; - readonly volumeName?: string; -} - -// @public -export interface SourceCreationData { - createSource?: VolumeCreateOption; - sourceId?: string; -} - -// @public -export type StorageTargetType = string; - -// @public -export interface SystemData { - createdAt?: Date; - createdBy?: string; - createdByType?: CreatedByType; - lastModifiedAt?: Date; - lastModifiedBy?: string; - lastModifiedByType?: CreatedByType; -} - -// @public -export interface TrackedResource extends Resource { - location: string; - tags?: Record; -} - -// @public -export interface UserAssignedIdentity { - readonly clientId?: string; - readonly principalId?: string; -} - -// @public -export interface VirtualNetworkRule { - action?: Action; - virtualNetworkResourceId: string; -} - -// @public -export interface Volume extends ProxyResource { - properties: VolumeProperties; -} - -// @public -export type VolumeCreateOption = string; - -// @public -export interface VolumeGroup extends ProxyResource { - identity?: Identity; - properties?: VolumeGroupProperties; -} - -// @public -export interface VolumeGroupProperties { - encryption?: EncryptionType; - encryptionProperties?: EncryptionProperties; - enforceDataIntegrityCheckForIscsi?: boolean; - networkAcls?: NetworkRuleSet; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - protocolType?: StorageTargetType; - readonly provisioningState?: ProvisioningStates; -} - -// @public -export interface VolumeGroupUpdate { - identity?: Identity; - properties?: VolumeGroupUpdateProperties; -} - -// @public -export interface VolumeGroupUpdateProperties { - encryption?: EncryptionType; - encryptionProperties?: EncryptionProperties; - enforceDataIntegrityCheckForIscsi?: boolean; - networkAcls?: NetworkRuleSet; - protocolType?: StorageTargetType; -} - -// @public -export interface VolumeNameList { - volumeNames: string[]; -} - -// @public -export interface VolumeProperties { - creationData?: SourceCreationData; - managedBy?: ManagedByInfo; - readonly provisioningState?: ProvisioningStates; - sizeGiB: number; - readonly storageTarget?: IscsiTargetInfo; - readonly volumeId?: string; -} - -// @public -export interface VolumeUpdate { - properties?: VolumeUpdateProperties; -} - -// @public -export interface VolumeUpdateProperties { - managedBy?: ManagedByInfo; - sizeGiB?: number; -} - -// @public -export type XMsDeleteSnapshots = string; - -// @public -export type XMsForceDelete = string; - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md index ed31421d116c..0de14ac1cc25 100644 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md @@ -4,14 +4,11 @@ ```ts -import type { AbortSignalLike } from '@azure/abort-controller'; -import type { ClientOptions } from '@azure-rest/core-client'; -import type { OperationOptions } from '@azure-rest/core-client'; +import type * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; import type { OperationState } from '@azure/core-lro'; -import type { PathUncheckedResponse } from '@azure-rest/core-client'; -import type { Pipeline } from '@azure/core-rest-pipeline'; -import type { PollerLike } from '@azure/core-lro'; -import type { TokenCredential } from '@azure/core-auth'; +import type { PagedAsyncIterableIterator } from '@azure/core-paging'; +import type { SimplePollerLike } from '@azure/core-lro'; // @public export type Action = string; @@ -27,21 +24,6 @@ export interface AutoScaleProperties { scaleUpProperties?: ScaleUpProperties; } -// @public -export enum AzureClouds { - AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", - AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", - AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" -} - -// @public -export type AzureSupportedClouds = `${AzureClouds}`; - -// @public -export type ContinuablePage = TPage & { - continuationToken?: string; -}; - // @public export type CreatedByType = string; @@ -55,24 +37,44 @@ export interface ElasticSan extends TrackedResource { properties: ElasticSanProperties; } -// @public (undocumented) -export class ElasticSanManagement { - constructor(credential: TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams); - readonly elasticSans: ElasticSansOperations; - readonly operations: OperationsOperations; - readonly pipeline: Pipeline; - readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; - readonly privateLinkResources: PrivateLinkResourcesOperations; - readonly skus: SkusOperations; - readonly volumeGroups: VolumeGroupsOperations; - readonly volumes: VolumesOperations; - readonly volumeSnapshots: VolumeSnapshotsOperations; +// @public +export interface ElasticSanList { + nextLink?: string; + value: ElasticSan[]; } -// @public -export interface ElasticSanManagementOptionalParams extends ClientOptions { +// @public (undocumented) +export class ElasticSanManagement extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + elasticSans: ElasticSans; + // (undocumented) + operations: Operations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + skus: Skus; + // (undocumented) + subscriptionId: string; + // (undocumented) + volumeGroups: VolumeGroups; + // (undocumented) + volumes: Volumes; + // (undocumented) + volumeSnapshots: VolumeSnapshots; +} + +// @public +export interface ElasticSanManagementOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; apiVersion?: string; - cloudSetting?: AzureSupportedClouds; + endpoint?: string; } // @public @@ -93,46 +95,101 @@ export interface ElasticSanProperties { } // @public -export interface ElasticSansCreateOptionalParams extends OperationOptions { +export interface ElasticSans { + beginCreate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise, ElasticSansCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise, ElasticSansUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise; + get(resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ElasticSansListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ElasticSansCreateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface ElasticSansCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface ElasticSansDeleteOptionalParams extends OperationOptions { +export type ElasticSansCreateResponse = ElasticSan; + +// @public +export interface ElasticSansDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface ElasticSansDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface ElasticSansGetOptionalParams extends OperationOptions { +export interface ElasticSansGetOptionalParams extends coreClient.OperationOptions { } // @public -export interface ElasticSansListByResourceGroupOptionalParams extends OperationOptions { +export type ElasticSansGetResponse = ElasticSan; + +// @public +export interface ElasticSansListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ElasticSansListByResourceGroupNextResponse = ElasticSanList; + +// @public +export interface ElasticSansListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ElasticSansListByResourceGroupResponse = ElasticSanList; + +// @public +export interface ElasticSansListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface ElasticSansListBySubscriptionOptionalParams extends OperationOptions { +export type ElasticSansListBySubscriptionNextResponse = ElasticSanList; + +// @public +export interface ElasticSansListBySubscriptionOptionalParams extends coreClient.OperationOptions { } // @public -export interface ElasticSansOperations { - create: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams) => PollerLike, ElasticSan>; - delete: (resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams) => PollerLike, void>; - get: (resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams) => Promise; - listByResourceGroup: (resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; - listBySubscription: (options?: ElasticSansListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; - update: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams) => PollerLike, ElasticSan>; +export type ElasticSansListBySubscriptionResponse = ElasticSanList; + +// @public +export interface ElasticSansUpdateHeaders { + location?: string; + retryAfter?: number; } // @public -export interface ElasticSansUpdateOptionalParams extends OperationOptions { +export interface ElasticSansUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type ElasticSansUpdateResponse = ElasticSan; + // @public export interface ElasticSanUpdate { properties?: ElasticSanUpdateProperties; - tags?: Record; + tags?: { + [propertyName: string]: string; + }; } // @public @@ -159,7 +216,7 @@ export type EncryptionType = string; // @public export interface ErrorAdditionalInfo { - readonly info?: any; + readonly info?: Record; readonly type?: string; } @@ -177,12 +234,17 @@ export interface ErrorResponse { error?: ErrorDetail; } +// @public +export function getContinuationToken(page: unknown): string | undefined; + // @public export interface Identity { readonly principalId?: string; readonly tenantId?: string; type: IdentityType; - userAssignedIdentities?: Record; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; } // @public @@ -309,11 +371,6 @@ export enum KnownStorageTargetType { None = "None" } -// @public -export enum KnownVersions { - V20250901 = "2025-09-01" -} - // @public export enum KnownVolumeCreateOption { Disk = "Disk", @@ -366,29 +423,33 @@ export interface OperationDisplay { } // @public -export interface OperationsListOptionalParams extends OperationOptions { +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; } // @public -export interface OperationsOperations { - list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } // @public -export type Origin = string; +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} // @public -export interface PagedAsyncIterableIterator { - [Symbol.asyncIterator](): PagedAsyncIterableIterator; - byPage: (settings?: TPageSettings) => AsyncIterableIterator>; - next(): Promise>; -} +export type OperationsListNextResponse = OperationListResult; // @public -export interface PageSettings { - continuationToken?: string; +export interface OperationsListOptionalParams extends coreClient.OperationOptions { } +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + // @public export interface PreValidationResponse { validationStatus?: string; @@ -404,6 +465,12 @@ export interface PrivateEndpointConnection extends ProxyResource { properties: PrivateEndpointConnectionProperties; } +// @public +export interface PrivateEndpointConnectionListResult { + nextLink?: string; + value: PrivateEndpointConnection[]; +} + // @public export interface PrivateEndpointConnectionProperties { groupIds?: string[]; @@ -413,31 +480,63 @@ export interface PrivateEndpointConnectionProperties { } // @public -export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { +export interface PrivateEndpointConnections { + beginCreate(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise, PrivateEndpointConnectionsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + list(resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsCreateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface PrivateEndpointConnectionsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { +export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { } // @public -export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface PrivateEndpointConnectionsOperations { - create: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams) => PollerLike, PrivateEndpointConnection>; - delete: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams) => PollerLike, void>; - get: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams) => Promise; - list: (resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams) => PagedAsyncIterableIterator; +export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { } +// @public +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; + // @public export type PrivateEndpointServiceConnectionStatus = string; @@ -460,14 +559,17 @@ export interface PrivateLinkResourceProperties { } // @public -export interface PrivateLinkResourcesListByElasticSanOptionalParams extends OperationOptions { +export interface PrivateLinkResources { + listByElasticSan(resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams): Promise; } // @public -export interface PrivateLinkResourcesOperations { - listByElasticSan: (resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams) => Promise; +export interface PrivateLinkResourcesListByElasticSanOptionalParams extends coreClient.OperationOptions { } +// @public +export type PrivateLinkResourcesListByElasticSanResponse = PrivateLinkResourceListResult; + // @public export interface PrivateLinkServiceConnectionState { actionsRequired?: string; @@ -493,16 +595,6 @@ export interface Resource { readonly type?: string; } -// @public -export function restorePoller(client: ElasticSanManagement, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; - -// @public (undocumented) -export interface RestorePollerOptions extends OperationOptions { - abortSignal?: AbortSignalLike; - processResponseBody?: (result: TResponse) => Promise; - updateIntervalInMs?: number; -} - // @public export interface ScaleUpProperties { autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; @@ -533,6 +625,12 @@ export interface SkuInformation { tier?: SkuTier; } +// @public +export interface SkuInformationList { + nextLink?: string; + readonly value: SkuInformation[]; +} + // @public export interface SkuLocationInfo { readonly location?: string; @@ -543,15 +641,25 @@ export interface SkuLocationInfo { export type SkuName = string; // @public -export interface SkusListOptionalParams extends OperationOptions { - filter?: string; +export interface Skus { + list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SkusListNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface SkusOperations { - list: (options?: SkusListOptionalParams) => PagedAsyncIterableIterator; +export type SkusListNextResponse = SkuInformationList; + +// @public +export interface SkusListOptionalParams extends coreClient.OperationOptions { + filter?: string; } +// @public +export type SkusListResponse = SkuInformationList; + // @public export type SkuTier = string; @@ -565,6 +673,12 @@ export interface SnapshotCreationData { sourceId: string; } +// @public +export interface SnapshotList { + nextLink?: string; + value: Snapshot[]; +} + // @public export interface SnapshotProperties { creationData: SnapshotCreationData; @@ -595,7 +709,9 @@ export interface SystemData { // @public export interface TrackedResource extends Resource { location: string; - tags?: Record; + tags?: { + [propertyName: string]: string; + }; } // @public @@ -624,6 +740,12 @@ export interface VolumeGroup extends ProxyResource { properties?: VolumeGroupProperties; } +// @public +export interface VolumeGroupList { + nextLink?: string; + value: VolumeGroup[]; +} + // @public export interface VolumeGroupProperties { encryption?: EncryptionType; @@ -636,37 +758,80 @@ export interface VolumeGroupProperties { } // @public -export interface VolumeGroupsCreateOptionalParams extends OperationOptions { +export interface VolumeGroups { + beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise, VolumeGroupsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise, VolumeGroupsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise; + get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams): Promise; + listByElasticSan(resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VolumeGroupsCreateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface VolumeGroupsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VolumeGroupsDeleteOptionalParams extends OperationOptions { +export type VolumeGroupsCreateResponse = VolumeGroup; + +// @public +export interface VolumeGroupsDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface VolumeGroupsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VolumeGroupsGetOptionalParams extends OperationOptions { +export interface VolumeGroupsGetOptionalParams extends coreClient.OperationOptions { } // @public -export interface VolumeGroupsListByElasticSanOptionalParams extends OperationOptions { +export type VolumeGroupsGetResponse = VolumeGroup; + +// @public +export interface VolumeGroupsListByElasticSanNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface VolumeGroupsOperations { - create: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams) => PollerLike, VolumeGroup>; - delete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams) => PollerLike, void>; - get: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams) => Promise; - listByElasticSan: (resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams) => PagedAsyncIterableIterator; - update: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams) => PollerLike, VolumeGroup>; +export type VolumeGroupsListByElasticSanNextResponse = VolumeGroupList; + +// @public +export interface VolumeGroupsListByElasticSanOptionalParams extends coreClient.OperationOptions { } // @public -export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { +export type VolumeGroupsListByElasticSanResponse = VolumeGroupList; + +// @public +export interface VolumeGroupsUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface VolumeGroupsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type VolumeGroupsUpdateResponse = VolumeGroup; + // @public export interface VolumeGroupUpdate { identity?: Identity; @@ -682,6 +847,12 @@ export interface VolumeGroupUpdateProperties { protocolType?: StorageTargetType; } +// @public +export interface VolumeList { + nextLink?: string; + value: Volume[]; +} + // @public export interface VolumeNameList { volumeNames: string[]; @@ -698,78 +869,175 @@ export interface VolumeProperties { } // @public -export interface VolumesCreateOptionalParams extends OperationOptions { +export interface Volumes { + beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise, VolumesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise; + beginPreBackup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams): Promise, VolumesPreBackupResponse>>; + beginPreBackupAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams): Promise; + beginPreRestore(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams): Promise, VolumesPreRestoreResponse>>; + beginPreRestoreAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams): Promise; + beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise, VolumesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise; + get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; + listByVolumeGroup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VolumesCreateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface VolumesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VolumesDeleteOptionalParams extends OperationOptions { +export type VolumesCreateResponse = Volume; + +// @public +export interface VolumesDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; xMsDeleteSnapshots?: XMsDeleteSnapshots; xMsForceDelete?: XMsForceDelete; } // @public -export interface VolumesGetOptionalParams extends OperationOptions { +export interface VolumesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesGetResponse = Volume; + +// @public +export interface VolumesListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListByVolumeGroupNextResponse = VolumeList; + +// @public +export interface VolumesListByVolumeGroupOptionalParams extends coreClient.OperationOptions { } // @public -export interface VolumesListByVolumeGroupOptionalParams extends OperationOptions { +export type VolumesListByVolumeGroupResponse = VolumeList; + +// @public +export interface VolumeSnapshots { + beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams): Promise, VolumeSnapshotsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams): Promise; + get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsGetOptionalParams): Promise; + listByVolumeGroup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeSnapshotsListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; } // @public -export interface VolumeSnapshotsCreateOptionalParams extends OperationOptions { +export interface VolumeSnapshotsCreateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface VolumeSnapshotsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VolumeSnapshotsDeleteOptionalParams extends OperationOptions { +export type VolumeSnapshotsCreateResponse = Snapshot; + +// @public +export interface VolumeSnapshotsDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface VolumeSnapshotsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VolumeSnapshotsGetOptionalParams extends OperationOptions { +export interface VolumeSnapshotsGetOptionalParams extends coreClient.OperationOptions { } // @public -export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends OperationOptions { - filter?: string; +export type VolumeSnapshotsGetResponse = Snapshot; + +// @public +export interface VolumeSnapshotsListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface VolumeSnapshotsOperations { - create: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams) => PollerLike, Snapshot>; - delete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams) => PollerLike, void>; - get: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsGetOptionalParams) => Promise; - listByVolumeGroup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeSnapshotsListByVolumeGroupOptionalParams) => PagedAsyncIterableIterator; +export type VolumeSnapshotsListByVolumeGroupNextResponse = SnapshotList; + +// @public +export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface VolumesOperations { - create: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams) => PollerLike, Volume>; - delete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams) => PollerLike, void>; - get: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams) => Promise; - listByVolumeGroup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams) => PagedAsyncIterableIterator; - preBackup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams) => PollerLike, PreValidationResponse>; - preRestore: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams) => PollerLike, PreValidationResponse>; - update: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams) => PollerLike, Volume>; +export type VolumeSnapshotsListByVolumeGroupResponse = SnapshotList; + +// @public +export interface VolumesPreBackupHeaders { + location?: string; + retryAfter?: number; } // @public -export interface VolumesPreBackupOptionalParams extends OperationOptions { +export interface VolumesPreBackupOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VolumesPreRestoreOptionalParams extends OperationOptions { +export type VolumesPreBackupResponse = PreValidationResponse; + +// @public +export interface VolumesPreRestoreHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface VolumesPreRestoreOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VolumesUpdateOptionalParams extends OperationOptions { +export type VolumesPreRestoreResponse = PreValidationResponse; + +// @public +export interface VolumesUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface VolumesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type VolumesUpdateResponse = Volume; + // @public export interface VolumeUpdate { properties?: VolumeUpdateProperties; diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts index 1c7a449b10be..8d1d57edc110 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts @@ -1,20 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { ElasticSan} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to create ElasticSan. + * This sample demonstrates how to Create ElasticSan. * - * @summary create ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json + * @summary Create ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json */ async function elasticSansCreateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters: ElasticSan = { location: "France Central", properties: { autoScaleProperties: { @@ -32,28 +36,44 @@ async function elasticSansCreateMaximumSetGen(): Promise { sku: { name: "Premium_LRS", tier: "Premium" }, }, tags: { key9316: "ihndtieqibtob" }, - }); + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginCreateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); console.log(result); } /** - * This sample demonstrates how to create ElasticSan. + * This sample demonstrates how to Create ElasticSan. * - * @summary create ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Create_MinimumSet_Gen.json + * @summary Create ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MinimumSet_Gen.json */ async function elasticSansCreateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters: ElasticSan = { location: "France Central", properties: { baseSizeTiB: 15, extendedCapacitySizeTiB: 27, sku: { name: "Premium_LRS" }, }, - }); + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginCreateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts index 9bcc04f5edfd..6681034a19fd 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts @@ -3,31 +3,48 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to delete a Elastic San. + * This sample demonstrates how to Delete a Elastic San. * - * @summary delete a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json + * @summary Delete a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json */ async function elasticSansDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.elasticSans.delete("resourcegroupname", "elasticsanname"); + const result = await client.elasticSans.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + ); + console.log(result); } /** - * This sample demonstrates how to delete a Elastic San. + * This sample demonstrates how to Delete a Elastic San. * - * @summary delete a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MinimumSet_Gen.json + * @summary Delete a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MinimumSet_Gen.json */ async function elasticSansDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.elasticSans.delete("resourcegroupname", "elasticsanname"); + const result = await client.elasticSans.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + ); + console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts index e80a93aa8f0e..5503e5b2811a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts @@ -3,32 +3,47 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to get a ElasticSan. + * This sample demonstrates how to Get a ElasticSan. * - * @summary get a ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json + * @summary Get a ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json */ async function elasticSansGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + const result = await client.elasticSans.get( + resourceGroupName, + elasticSanName, + ); console.log(result); } /** - * This sample demonstrates how to get a ElasticSan. + * This sample demonstrates how to Get a ElasticSan. * - * @summary get a ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Get_MinimumSet_Gen.json + * @summary Get a ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MinimumSet_Gen.json */ async function elasticSansGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + const result = await client.elasticSans.get( + resourceGroupName, + elasticSanName, + ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts index a2ac1576753a..5a364acd441f 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts @@ -3,40 +3,49 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * This sample demonstrates how to Gets a list of ElasticSan in a resource group. * - * @summary gets a list of ElasticSan in a resource group. - * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * @summary Gets a list of ElasticSan in a resource group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ async function elasticSansListByResourceGroupMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + for await (const item of client.elasticSans.listByResourceGroup( + resourceGroupName, + )) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * This sample demonstrates how to Gets a list of ElasticSan in a resource group. * - * @summary gets a list of ElasticSan in a resource group. - * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * @summary Gets a list of ElasticSan in a resource group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ async function elasticSansListByResourceGroupMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + for await (const item of client.elasticSans.listByResourceGroup( + resourceGroupName, + )) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts index 1fc752343bbf..fc5c6843145c 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts @@ -3,40 +3,41 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to gets a list of ElasticSans in a subscription + * This sample demonstrates how to Gets a list of ElasticSans in a subscription * - * @summary gets a list of ElasticSans in a subscription - * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * @summary Gets a list of ElasticSans in a subscription + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ async function elasticSansListBySubscriptionMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to gets a list of ElasticSans in a subscription + * This sample demonstrates how to Gets a list of ElasticSans in a subscription * - * @summary gets a list of ElasticSans in a subscription - * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * @summary Gets a list of ElasticSans in a subscription + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ async function elasticSansListBySubscriptionMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts index 084de695151d..8a3bcaf08103 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts @@ -1,20 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { ElasticSanUpdate} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to update a Elastic San. + * This sample demonstrates how to Update a Elastic San. * - * @summary update a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json + * @summary Update a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json */ async function elasticSansUpdateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters: ElasticSanUpdate = { properties: { autoScaleProperties: { scaleUpProperties: { @@ -29,21 +33,37 @@ async function elasticSansUpdateMaximumSetGen(): Promise { publicNetworkAccess: "Enabled", }, tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }); + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); console.log(result); } /** - * This sample demonstrates how to update a Elastic San. + * This sample demonstrates how to Update a Elastic San. * - * @summary update a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Update_MinimumSet_Gen.json + * @summary Update a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MinimumSet_Gen.json */ async function elasticSansUpdateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters: ElasticSanUpdate = {}; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", {}); + const result = await client.elasticSans.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts index 61d0c64318ce..a63cdbdf87e8 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts @@ -3,40 +3,43 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to list the operations for the provider + * This sample demonstrates how to List the operations for the provider * - * @summary list the operations for the provider - * x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json + * @summary List the operations for the provider + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json */ async function operationsListMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list the operations for the provider + * This sample demonstrates how to List the operations for the provider * - * @summary list the operations for the provider - * x-ms-original-file: 2025-09-01/Operations_List_MinimumSet_Gen.json + * @summary List the operations for the provider + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MinimumSet_Gen.json */ async function operationsListMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts index 6fd03552435e..2d3cee1e4b30 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts @@ -1,53 +1,72 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import type { + PrivateEndpointConnection} from "@azure/arm-elasticsan"; +import { + ElasticSanManagement, +} from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San * - * @summary update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json + * @summary Update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json */ async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.create( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const parameters: PrivateEndpointConnection = { + properties: { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", }, }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginCreateAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, ); console.log(result); } /** - * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San * - * @summary update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MinimumSet_Gen.json + * @summary Update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json */ async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const parameters: PrivateEndpointConnection = { + properties: { privateLinkServiceConnectionState: {} }, + }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.create( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - { properties: { privateLinkServiceConnectionState: {} } }, + const result = await client.privateEndpointConnections.beginCreateAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts index abc29f16677e..12ae9b5b7739 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -3,39 +3,52 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San * - * @summary deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + * @summary Deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json */ async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.privateEndpointConnections.delete( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, ); + console.log(result); } /** - * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San * - * @summary deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + * @summary Deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json */ async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.privateEndpointConnections.delete( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, ); + console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts index f7fea37d0372..dc0fd963828d 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts @@ -3,39 +3,50 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San * - * @summary gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json + * @summary Gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json */ async function privateEndpointConnectionsGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateEndpointConnections.get( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, ); console.log(result); } /** - * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San * - * @summary gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MinimumSet_Gen.json + * @summary Gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json */ async function privateEndpointConnectionsGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateEndpointConnections.get( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts index 3616a6035b66..c7ae9c013252 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts @@ -3,46 +3,53 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. * - * @summary list all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json + * @summary List all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json */ async function privateEndpointConnectionsListMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. * - * @summary list all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MinimumSet_Gen.json + * @summary List all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json */ async function privateEndpointConnectionsListMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts index 233d5378e795..bb565b6098bc 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts @@ -3,37 +3,46 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. * - * @summary gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + * @summary Gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json */ async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateLinkResources.listByElasticSan( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, ); console.log(result); } /** - * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. * - * @summary gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + * @summary Gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json */ async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateLinkResources.listByElasticSan( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts index f70a88942fed..afb9587eac91 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts @@ -1,42 +1,49 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import type { + SkusListOptionalParams} from "@azure/arm-elasticsan"; +import { + ElasticSanManagement, +} from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to list all the available Skus in the region and information related to them + * This sample demonstrates how to List all the available Skus in the region and information related to them * - * @summary list all the available Skus in the region and information related to them - * x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json + * @summary List all the available Skus in the region and information related to them + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json */ async function skusListMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const filter = "obwwdrkq"; + const options: SkusListOptionalParams = { filter }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.skus.list({ filter: "obwwdrkq" })) { + for await (const item of client.skus.list(options)) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list all the available Skus in the region and information related to them + * This sample demonstrates how to List all the available Skus in the region and information related to them * - * @summary list all the available Skus in the region and information related to them - * x-ms-original-file: 2025-09-01/Skus_List_MinimumSet_Gen.json + * @summary List all the available Skus in the region and information related to them + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MinimumSet_Gen.json */ async function skusListMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.skus.list()) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts index 4e691081e428..2fcb48e9acbe 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts @@ -1,63 +1,77 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { VolumeGroup} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to create a Volume Group. + * This sample demonstrates how to Create a Volume Group. * - * @summary create a Volume Group. - * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json + * @summary Create a Volume Group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json */ async function volumeGroupsCreateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "vgbeephfgecgg", - }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeGroup = { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", }, - protocolType: "Iscsi", }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [ + { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, + ], + }, + protocolType: "Iscsi", }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, ); console.log(result); } /** - * This sample demonstrates how to create a Volume Group. + * This sample demonstrates how to Create a Volume Group. * - * @summary create a Volume Group. - * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MinimumSet_Gen.json + * @summary Create a Volume Group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MinimumSet_Gen.json */ async function volumeGroupsCreateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeGroup = {}; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - {}, + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts index ac965081580a..0fe6183e9fc9 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts @@ -3,31 +3,52 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to delete an VolumeGroup. + * This sample demonstrates how to Delete an VolumeGroup. * - * @summary delete an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json + * @summary Delete an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json */ async function volumeGroupsDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); + const result = await client.volumeGroups.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + ); + console.log(result); } /** - * This sample demonstrates how to delete an VolumeGroup. + * This sample demonstrates how to Delete an VolumeGroup. * - * @summary delete an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MinimumSet_Gen.json + * @summary Delete an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json */ async function volumeGroupsDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); + const result = await client.volumeGroups.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + ); + console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts index a128c689a18d..655d34fc4f2d 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts @@ -3,39 +3,50 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to get an VolumeGroups. + * This sample demonstrates how to Get an VolumeGroups. * - * @summary get an VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json + * @summary Get an VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json */ async function volumeGroupsGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeGroups.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", + resourceGroupName, + elasticSanName, + volumeGroupName, ); console.log(result); } /** - * This sample demonstrates how to get an VolumeGroups. + * This sample demonstrates how to Get an VolumeGroups. * - * @summary get an VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MinimumSet_Gen.json + * @summary Get an VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MinimumSet_Gen.json */ async function volumeGroupsGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeGroups.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", + resourceGroupName, + elasticSanName, + volumeGroupName, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts index 380a5aa9623f..61e3533f75b4 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts @@ -3,46 +3,53 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to list VolumeGroups. + * This sample demonstrates how to List VolumeGroups. * - * @summary list VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + * @summary List VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json */ async function volumeGroupsListByElasticSanMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list VolumeGroups. + * This sample demonstrates how to List VolumeGroups. * - * @summary list VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + * @summary List VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json */ async function volumeGroupsListByElasticSanMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts index c5238105f486..c735a5945d65 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts @@ -1,63 +1,77 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { VolumeGroupUpdate} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to update an VolumeGroup. + * This sample demonstrates how to Update an VolumeGroup. * - * @summary update an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json + * @summary Update an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json */ async function volumeGroupsUpdateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "vgbeephfgecgg", - }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeGroupUpdate = { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", }, - protocolType: "Iscsi", }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [ + { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, + ], + }, + protocolType: "Iscsi", }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, ); console.log(result); } /** - * This sample demonstrates how to update an VolumeGroup. + * This sample demonstrates how to Update an VolumeGroup. * - * @summary update an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MinimumSet_Gen.json + * @summary Update an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MinimumSet_Gen.json */ async function volumeGroupsUpdateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeGroupUpdate = {}; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - {}, + const result = await client.volumeGroups.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts index 35de4b6c63f4..03ec9c6ba4aa 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts @@ -1,59 +1,75 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { Snapshot} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to create a Volume Snapshot. + * This sample demonstrates how to Create a Volume Snapshot. * - * @summary create a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json + * @summary Create a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json */ async function volumeSnapshotsCreateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const parameters: Snapshot = { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", }, }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, ); console.log(result); } /** - * This sample demonstrates how to create a Volume Snapshot. + * This sample demonstrates how to Create a Volume Snapshot. * - * @summary create a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MinimumSet_Gen.json + * @summary Create a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json */ async function volumeSnapshotsCreateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const parameters: Snapshot = { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", }, }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts index e8db98290e6c..35566fcd9a85 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts @@ -3,41 +3,56 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to delete a Volume Snapshot. + * This sample demonstrates how to Delete a Volume Snapshot. * - * @summary delete a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json + * @summary Delete a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json */ async function volumeSnapshotsDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeSnapshots.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", + const result = await client.volumeSnapshots.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, ); + console.log(result); } /** - * This sample demonstrates how to delete a Volume Snapshot. + * This sample demonstrates how to Delete a Volume Snapshot. * - * @summary delete a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MinimumSet_Gen.json + * @summary Delete a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json */ async function volumeSnapshotsDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeSnapshots.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", + const result = await client.volumeSnapshots.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, ); + console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts index 7f78d243e440..b167b69380ab 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts @@ -3,41 +3,54 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to get a Volume Snapshot. + * This sample demonstrates how to Get a Volume Snapshot. * - * @summary get a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json + * @summary Get a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json */ async function volumeSnapshotsGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeSnapshots.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, ); console.log(result); } /** - * This sample demonstrates how to get a Volume Snapshot. + * This sample demonstrates how to Get a Volume Snapshot. * - * @summary get a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MinimumSet_Gen.json + * @summary Get a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json */ async function volumeSnapshotsGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeSnapshots.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts index 1e5259e46a94..dc6d85afba1b 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts @@ -1,51 +1,66 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import type { + VolumeSnapshotsListByVolumeGroupOptionalParams} from "@azure/arm-elasticsan"; +import { + ElasticSanManagement, +} from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter * - * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json */ async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const filter = "volumeName eq "; + const options: VolumeSnapshotsListByVolumeGroupOptionalParams = { filter }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeSnapshots.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { filter: "volumeName eq " }, + resourceGroupName, + elasticSanName, + volumeGroupName, + options, )) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter * - * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json */ async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeSnapshots.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", + resourceGroupName, + elasticSanName, + volumeGroupName, )) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts index df22ebd67cee..9d12c0efc67a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts @@ -1,51 +1,67 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { Volume} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to create a Volume. + * This sample demonstrates how to Create a Volume. * - * @summary create a Volume. - * x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json + * @summary Create a Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json */ async function volumesCreateMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters: Volume = { + properties: { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, + }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { - properties: { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, - }, - }, + const result = await client.volumes.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, ); console.log(result); } /** - * This sample demonstrates how to create a Volume. + * This sample demonstrates how to Create a Volume. * - * @summary create a Volume. - * x-ms-original-file: 2025-09-01/Volumes_Create_MinimumSet_Gen.json + * @summary Create a Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MinimumSet_Gen.json */ async function volumesCreateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters: Volume = { properties: { sizeGiB: 9 } }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { properties: { sizeGiB: 9 } }, + const result = await client.volumes.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts index 39b9e7aa96bf..24a92fd1bdff 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts @@ -1,44 +1,69 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import type { + VolumesDeleteOptionalParams} from "@azure/arm-elasticsan"; +import { + ElasticSanManagement, +} from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to delete an Volume. + * This sample demonstrates how to Delete an Volume. * - * @summary delete an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json + * @summary Delete an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json */ async function volumesDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const xMsDeleteSnapshots = "true"; + const xMsForceDelete = "true"; + const options: VolumesDeleteOptionalParams = { + xMsDeleteSnapshots, + xMsForceDelete, + }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumes.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { xMsDeleteSnapshots: "true", xMsForceDelete: "true" }, + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, ); + console.log(result); } /** - * This sample demonstrates how to delete an Volume. + * This sample demonstrates how to Delete an Volume. * - * @summary delete an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Delete_MinimumSet_Gen.json + * @summary Delete an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MinimumSet_Gen.json */ async function volumesDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumes.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, ); + console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts index 3a086869b011..1ba5db7bc799 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts @@ -3,41 +3,54 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to get an Volume. + * This sample demonstrates how to Get an Volume. * - * @summary get an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json + * @summary Get an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json */ async function volumesGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumes.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, ); console.log(result); } /** - * This sample demonstrates how to get an Volume. + * This sample demonstrates how to Get an Volume. * - * @summary get an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Get_MinimumSet_Gen.json + * @summary Get an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MinimumSet_Gen.json */ async function volumesGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumes.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts index a0050c15050a..e7779b4d358b 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts @@ -3,48 +3,57 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to list Volumes in a VolumeGroup. + * This sample demonstrates how to List Volumes in a VolumeGroup. * - * @summary list Volumes in a VolumeGroup. - * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + * @summary List Volumes in a VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json */ async function volumesListByVolumeGroupMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumes.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", + resourceGroupName, + elasticSanName, + volumeGroupName, )) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list Volumes in a VolumeGroup. + * This sample demonstrates how to List Volumes in a VolumeGroup. * - * @summary list Volumes in a VolumeGroup. - * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + * @summary List Volumes in a VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json */ async function volumesListByVolumeGroupMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumes.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", + resourceGroupName, + elasticSanName, + volumeGroupName, )) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts index b75df801c2bf..12056f7be2d7 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts @@ -1,24 +1,32 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { VolumeNameList} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to validate whether a disk snapshot backup can be taken for list of volumes. + * This sample demonstrates how to Validate whether a disk snapshot backup can be taken for list of volumes. * - * @summary validate whether a disk snapshot backup can be taken for list of volumes. - * x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json + * @summary Validate whether a disk snapshot backup can be taken for list of volumes. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json */ async function volumeGroupsPreBackupMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeNameList = { volumeNames: ["volumename"] }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.preBackup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { volumeNames: ["volumename"] }, + const result = await client.volumes.beginPreBackupAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts index 1ab7276bf849..a023e0e9880c 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts @@ -1,28 +1,36 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { DiskSnapshotList} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * This sample demonstrates how to Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. * - * @summary validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json + * @summary Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json */ async function volumeGroupsPreRestoreMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: DiskSnapshotList = { + diskSnapshotIds: [ + "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", + ], + }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.preRestore( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { - diskSnapshotIds: [ - "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", - ], - }, + const result = await client.volumes.beginPreRestoreAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts index 7142de252f04..84ef112f4c45 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts @@ -1,50 +1,66 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { VolumeUpdate} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to update an Volume. + * This sample demonstrates how to Update an Volume. * - * @summary update an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json + * @summary Update an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json */ async function volumesUpdateMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters: VolumeUpdate = { + properties: { + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 7, + }, + }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { - properties: { - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 7, - }, - }, + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, ); console.log(result); } /** - * This sample demonstrates how to update an Volume. + * This sample demonstrates how to Update an Volume. * - * @summary update an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Update_MinimumSet_Gen.json + * @summary Update an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MinimumSet_Gen.json */ async function volumesUpdateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters: VolumeUpdate = {}; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - {}, + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md new file mode 100644 index 000000000000..463e9d96d3c3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md @@ -0,0 +1,106 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [elasticSansCreateSample.js][elasticsanscreatesample] | Create ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json | +| [elasticSansDeleteSample.js][elasticsansdeletesample] | Delete a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json | +| [elasticSansGetSample.js][elasticsansgetsample] | Get a ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json | +| [elasticSansListByResourceGroupSample.js][elasticsanslistbyresourcegroupsample] | Gets a list of ElasticSan in a resource group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | +| [elasticSansListBySubscriptionSample.js][elasticsanslistbysubscriptionsample] | Gets a list of ElasticSans in a subscription x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json | +| [elasticSansUpdateSample.js][elasticsansupdatesample] | Update a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json | +| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json | +| [privateEndpointConnectionsCreateSample.js][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json | +| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | List all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json | +| [privateLinkResourcesListByElasticSanSample.js][privatelinkresourceslistbyelasticsansample] | Gets the private link resources that need to be created for a elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | +| [skusListSample.js][skuslistsample] | List all the available Skus in the region and information related to them x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json | +| [volumeGroupsCreateSample.js][volumegroupscreatesample] | Create a Volume Group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json | +| [volumeGroupsDeleteSample.js][volumegroupsdeletesample] | Delete an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json | +| [volumeGroupsGetSample.js][volumegroupsgetsample] | Get an VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json | +| [volumeGroupsListByElasticSanSample.js][volumegroupslistbyelasticsansample] | List VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | +| [volumeGroupsUpdateSample.js][volumegroupsupdatesample] | Update an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json | +| [volumeSnapshotsCreateSample.js][volumesnapshotscreatesample] | Create a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json | +| [volumeSnapshotsDeleteSample.js][volumesnapshotsdeletesample] | Delete a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json | +| [volumeSnapshotsGetSample.js][volumesnapshotsgetsample] | Get a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json | +| [volumeSnapshotsListByVolumeGroupSample.js][volumesnapshotslistbyvolumegroupsample] | List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesCreateSample.js][volumescreatesample] | Create a Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json | +| [volumesDeleteSample.js][volumesdeletesample] | Delete an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json | +| [volumesGetSample.js][volumesgetsample] | Get an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json | +| [volumesListByVolumeGroupSample.js][volumeslistbyvolumegroupsample] | List Volumes in a VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesPreBackupSample.js][volumesprebackupsample] | Validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json | +| [volumesPreRestoreSample.js][volumesprerestoresample] | Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json | +| [volumesUpdateSample.js][volumesupdatesample] | Update an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node elasticSansCreateSample.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 +cross-env ELASTICSANS_SUBSCRIPTION_ID="" ELASTICSANS_RESOURCE_GROUP="" node elasticSansCreateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js +[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js +[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js +[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js +[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js +[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js +[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js +[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js +[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js +[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js +[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js +[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js +[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js +[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js +[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js +[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js +[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js +[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js similarity index 52% rename from sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js index 8546fcc60505..aa0935d3eec3 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js @@ -3,18 +3,19 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); /** - * This sample demonstrates how to create ElasticSan. + * This sample demonstrates how to Create ElasticSan. * - * @summary create ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json + * @summary Create ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json */ async function elasticSansCreateMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters = { location: "France Central", properties: { autoScaleProperties: { @@ -32,28 +33,42 @@ async function elasticSansCreateMaximumSetGen() { sku: { name: "Premium_LRS", tier: "Premium" }, }, tags: { key9316: "ihndtieqibtob" }, - }); + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginCreateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); console.log(result); } /** - * This sample demonstrates how to create ElasticSan. + * This sample demonstrates how to Create ElasticSan. * - * @summary create ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Create_MinimumSet_Gen.json + * @summary Create ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MinimumSet_Gen.json */ async function elasticSansCreateMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters = { location: "France Central", properties: { baseSizeTiB: 15, extendedCapacitySizeTiB: 27, sku: { name: "Premium_LRS" }, }, - }); + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginCreateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js new file mode 100644 index 000000000000..670515632fa2 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Delete a Elastic San. + * + * @summary Delete a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json + */ +async function elasticSansDeleteMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginDeleteAndWait(resourceGroupName, elasticSanName); + console.log(result); +} + +/** + * This sample demonstrates how to Delete a Elastic San. + * + * @summary Delete a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MinimumSet_Gen.json + */ +async function elasticSansDeleteMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginDeleteAndWait(resourceGroupName, elasticSanName); + console.log(result); +} + +async function main() { + await elasticSansDeleteMaximumSetGen(); + await elasticSansDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js new file mode 100644 index 000000000000..68ec551a32a5 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Get a ElasticSan. + * + * @summary Get a ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json + */ +async function elasticSansGetMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get(resourceGroupName, elasticSanName); + console.log(result); +} + +/** + * This sample demonstrates how to Get a ElasticSan. + * + * @summary Get a ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MinimumSet_Gen.json + */ +async function elasticSansGetMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get(resourceGroupName, elasticSanName); + console.log(result); +} + +async function main() { + await elasticSansGetMaximumSetGen(); + await elasticSansGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js similarity index 51% rename from sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js index 43425daa3ffd..63ffe4c5ae87 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js @@ -3,40 +3,41 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); /** - * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * This sample demonstrates how to Gets a list of ElasticSan in a resource group. * - * @summary gets a list of ElasticSan in a resource group. - * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * @summary Gets a list of ElasticSan in a resource group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ async function elasticSansListByResourceGroupMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + for await (const item of client.elasticSans.listByResourceGroup(resourceGroupName)) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * This sample demonstrates how to Gets a list of ElasticSan in a resource group. * - * @summary gets a list of ElasticSan in a resource group. - * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * @summary Gets a list of ElasticSan in a resource group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ async function elasticSansListByResourceGroupMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + for await (const item of client.elasticSans.listByResourceGroup(resourceGroupName)) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js similarity index 58% rename from sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js index fbd12a16fea1..b6b179c1b874 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js @@ -3,40 +3,39 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); /** - * This sample demonstrates how to gets a list of ElasticSans in a subscription + * This sample demonstrates how to Gets a list of ElasticSans in a subscription * - * @summary gets a list of ElasticSans in a subscription - * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * @summary Gets a list of ElasticSans in a subscription + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ async function elasticSansListBySubscriptionMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to gets a list of ElasticSans in a subscription + * This sample demonstrates how to Gets a list of ElasticSans in a subscription * - * @summary gets a list of ElasticSans in a subscription - * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * @summary Gets a list of ElasticSans in a subscription + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ async function elasticSansListBySubscriptionMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js new file mode 100644 index 000000000000..15c59d13a901 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Update a Elastic San. + * + * @summary Update a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json + */ +async function elasticSansUpdateMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters = { + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", + }, + tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Update a Elastic San. + * + * @summary Update a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MinimumSet_Gen.json + */ +async function elasticSansUpdateMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); + console.log(result); +} + +async function main() { + await elasticSansUpdateMaximumSetGen(); + await elasticSansUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js similarity index 55% rename from sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js index 6f3cf9abc31f..ed7119d6a520 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js @@ -3,40 +3,41 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); /** - * This sample demonstrates how to list the operations for the provider + * This sample demonstrates how to List the operations for the provider * - * @summary list the operations for the provider - * x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json + * @summary List the operations for the provider + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json */ async function operationsListMaximumSetGen() { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list the operations for the provider + * This sample demonstrates how to List the operations for the provider * - * @summary list the operations for the provider - * x-ms-original-file: 2025-09-01/Operations_List_MinimumSet_Gen.json + * @summary List the operations for the provider + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MinimumSet_Gen.json */ async function operationsListMinimumSetGen() { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/package.json b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/package.json similarity index 87% rename from sdk/elasticsans/arm-elasticsan/samples/v2/javascript/package.json rename to sdk/elasticsans/arm-elasticsan/samples/v1/javascript/package.json index 666539d4ef7b..8e272a763190 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/package.json +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-elasticsan-js", "private": true, "version": "1.0.0", - "description": "@azure/arm-elasticsan client library samples for JavaScript", + "description": " client library samples for JavaScript", "engines": { "node": ">=20.0.0" }, @@ -14,10 +14,10 @@ "keywords": [ "node", "azure", - "cloud", "typescript", "browser", - "isomorphic" + "isomorphic", + "cloud" ], "author": "Microsoft Corporation", "license": "MIT", diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js new file mode 100644 index 000000000000..c9b88a2a69aa --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San + * + * @summary Update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const parameters = { + properties: { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginCreateAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San + * + * @summary Update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const parameters = { + properties: { privateLinkServiceConnectionState: {} }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginCreateAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + ); + console.log(result); +} + +async function main() { + await privateEndpointConnectionsCreateMaximumSetGen(); + await privateEndpointConnectionsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js new file mode 100644 index 000000000000..f740d4f75656 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San + * + * @summary Deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San + * + * @summary Deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + await privateEndpointConnectionsDeleteMaximumSetGen(); + await privateEndpointConnectionsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..6f53594b189a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San + * + * @summary Gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsGetMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San + * + * @summary Gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsGetMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main() { + await privateEndpointConnectionsGetMaximumSetGen(); + await privateEndpointConnectionsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js similarity index 50% rename from sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js index 00aeb2a50d1b..0bfca1b4ea7f 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js @@ -3,46 +3,49 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); /** - * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. * - * @summary list all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json + * @summary List all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json */ async function privateEndpointConnectionsListMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. * - * @summary list all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MinimumSet_Gen.json + * @summary List all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json */ async function privateEndpointConnectionsListMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js new file mode 100644 index 000000000000..f44120a88437 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. + * + * @summary Gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + resourceGroupName, + elasticSanName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. + * + * @summary Gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + resourceGroupName, + elasticSanName, + ); + console.log(result); +} + +async function main() { + await privateLinkResourcesListByElasticSanMaximumSetGen(); + await privateLinkResourcesListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/sample.env b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/sample.env similarity index 100% rename from sdk/elasticsans/arm-elasticsan/samples/v2/javascript/sample.env rename to sdk/elasticsans/arm-elasticsan/samples/v1/javascript/sample.env diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js similarity index 54% rename from sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js index ee66ec740044..2def731db728 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js @@ -3,40 +3,41 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); /** - * This sample demonstrates how to list all the available Skus in the region and information related to them + * This sample demonstrates how to List all the available Skus in the region and information related to them * - * @summary list all the available Skus in the region and information related to them - * x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json + * @summary List all the available Skus in the region and information related to them + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json */ async function skusListMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const filter = "obwwdrkq"; + const options = { filter }; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.skus.list({ filter: "obwwdrkq" })) { + for await (const item of client.skus.list(options)) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list all the available Skus in the region and information related to them + * This sample demonstrates how to List all the available Skus in the region and information related to them * - * @summary list all the available Skus in the region and information related to them - * x-ms-original-file: 2025-09-01/Skus_List_MinimumSet_Gen.json + * @summary List all the available Skus in the region and information related to them + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MinimumSet_Gen.json */ async function skusListMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.skus.list()) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js new file mode 100644 index 000000000000..d4568e26282b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Create a Volume Group. + * + * @summary Create a Volume Group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json + */ +async function volumeGroupsCreateMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters = { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create a Volume Group. + * + * @summary Create a Volume Group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MinimumSet_Gen.json + */ +async function volumeGroupsCreateMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +async function main() { + await volumeGroupsCreateMaximumSetGen(); + await volumeGroupsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js new file mode 100644 index 000000000000..146156a77359 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Delete an VolumeGroup. + * + * @summary Delete an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json + */ +async function volumeGroupsDeleteMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Delete an VolumeGroup. + * + * @summary Delete an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json + */ +async function volumeGroupsDeleteMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + ); + console.log(result); +} + +async function main() { + await volumeGroupsDeleteMaximumSetGen(); + await volumeGroupsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js new file mode 100644 index 000000000000..a69bd4048f60 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Get an VolumeGroups. + * + * @summary Get an VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json + */ +async function volumeGroupsGetMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get(resourceGroupName, elasticSanName, volumeGroupName); + console.log(result); +} + +/** + * This sample demonstrates how to Get an VolumeGroups. + * + * @summary Get an VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MinimumSet_Gen.json + */ +async function volumeGroupsGetMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get(resourceGroupName, elasticSanName, volumeGroupName); + console.log(result); +} + +async function main() { + await volumeGroupsGetMaximumSetGen(); + await volumeGroupsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js new file mode 100644 index 000000000000..5b0dd14c47f8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to List VolumeGroups. + * + * @summary List VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + */ +async function volumeGroupsListByElasticSanMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeGroups.listByElasticSan( + resourceGroupName, + elasticSanName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to List VolumeGroups. + * + * @summary List VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + */ +async function volumeGroupsListByElasticSanMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeGroups.listByElasticSan( + resourceGroupName, + elasticSanName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + await volumeGroupsListByElasticSanMaximumSetGen(); + await volumeGroupsListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js new file mode 100644 index 000000000000..666cc672b360 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Update an VolumeGroup. + * + * @summary Update an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json + */ +async function volumeGroupsUpdateMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters = { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Update an VolumeGroup. + * + * @summary Update an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MinimumSet_Gen.json + */ +async function volumeGroupsUpdateMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +async function main() { + await volumeGroupsUpdateMaximumSetGen(); + await volumeGroupsUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js new file mode 100644 index 000000000000..4f8eea37369e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Create a Volume Snapshot. + * + * @summary Create a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json + */ +async function volumeSnapshotsCreateMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const parameters = { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create a Volume Snapshot. + * + * @summary Create a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json + */ +async function volumeSnapshotsCreateMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const parameters = { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + ); + console.log(result); +} + +async function main() { + await volumeSnapshotsCreateMaximumSetGen(); + await volumeSnapshotsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js new file mode 100644 index 000000000000..861a87c71235 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Delete a Volume Snapshot. + * + * @summary Delete a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json + */ +async function volumeSnapshotsDeleteMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Delete a Volume Snapshot. + * + * @summary Delete a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json + */ +async function volumeSnapshotsDeleteMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + ); + console.log(result); +} + +async function main() { + await volumeSnapshotsDeleteMaximumSetGen(); + await volumeSnapshotsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js new file mode 100644 index 000000000000..ed0a7892f76b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Get a Volume Snapshot. + * + * @summary Get a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json + */ +async function volumeSnapshotsGetMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get a Volume Snapshot. + * + * @summary Get a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json + */ +async function volumeSnapshotsGetMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + ); + console.log(result); +} + +async function main() { + await volumeSnapshotsGetMaximumSetGen(); + await volumeSnapshotsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js new file mode 100644 index 000000000000..04127b1e42c7 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const filter = "volumeName eq "; + const options = { filter }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + await volumeSnapshotsListByVolumeGroupMaximumSetGen(); + await volumeSnapshotsListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js new file mode 100644 index 000000000000..99fe8b6654bf --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Create a Volume. + * + * @summary Create a Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json + */ +async function volumesCreateMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters = { + properties: { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create a Volume. + * + * @summary Create a Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MinimumSet_Gen.json + */ +async function volumesCreateMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters = { properties: { sizeGiB: 9 } }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + ); + console.log(result); +} + +async function main() { + await volumesCreateMaximumSetGen(); + await volumesCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js new file mode 100644 index 000000000000..a6c5a8223f98 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Delete an Volume. + * + * @summary Delete an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json + */ +async function volumesDeleteMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const xMsDeleteSnapshots = "true"; + const xMsForceDelete = "true"; + const options = { + xMsDeleteSnapshots, + xMsForceDelete, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Delete an Volume. + * + * @summary Delete an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MinimumSet_Gen.json + */ +async function volumesDeleteMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + ); + console.log(result); +} + +async function main() { + await volumesDeleteMaximumSetGen(); + await volumesDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js new file mode 100644 index 000000000000..cdff05c35d0c --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Get an Volume. + * + * @summary Get an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json + */ +async function volumesGetMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get an Volume. + * + * @summary Get an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MinimumSet_Gen.json + */ +async function volumesGetMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + ); + console.log(result); +} + +async function main() { + await volumesGetMaximumSetGen(); + await volumesGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js new file mode 100644 index 000000000000..65ff4c1ed00a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to List Volumes in a VolumeGroup. + * + * @summary List Volumes in a VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumesListByVolumeGroupMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to List Volumes in a VolumeGroup. + * + * @summary List Volumes in a VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumesListByVolumeGroupMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + await volumesListByVolumeGroupMaximumSetGen(); + await volumesListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js new file mode 100644 index 000000000000..9889084764b6 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Validate whether a disk snapshot backup can be taken for list of volumes. + * + * @summary Validate whether a disk snapshot backup can be taken for list of volumes. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json + */ +async function volumeGroupsPreBackupMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters = { volumeNames: ["volumename"] }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginPreBackupAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +async function main() { + await volumeGroupsPreBackupMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js new file mode 100644 index 000000000000..3ec38c7616a8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * + * @summary Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json + */ +async function volumeGroupsPreRestoreMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters = { + diskSnapshotIds: [ + "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginPreRestoreAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +async function main() { + await volumeGroupsPreRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js new file mode 100644 index 000000000000..0f3e53515072 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Update an Volume. + * + * @summary Update an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json + */ +async function volumesUpdateMaximumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters = { + properties: { + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 7, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Update an Volume. + * + * @summary Update an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MinimumSet_Gen.json + */ +async function volumesUpdateMinimumSetGen() { + const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + ); + console.log(result); +} + +async function main() { + await volumesUpdateMaximumSetGen(); + await volumesUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md new file mode 100644 index 000000000000..f5c2a9c60244 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md @@ -0,0 +1,119 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [elasticSansCreateSample.ts][elasticsanscreatesample] | Create ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json | +| [elasticSansDeleteSample.ts][elasticsansdeletesample] | Delete a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json | +| [elasticSansGetSample.ts][elasticsansgetsample] | Get a ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json | +| [elasticSansListByResourceGroupSample.ts][elasticsanslistbyresourcegroupsample] | Gets a list of ElasticSan in a resource group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | +| [elasticSansListBySubscriptionSample.ts][elasticsanslistbysubscriptionsample] | Gets a list of ElasticSans in a subscription x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json | +| [elasticSansUpdateSample.ts][elasticsansupdatesample] | Update a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json | +| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json | +| [privateEndpointConnectionsCreateSample.ts][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json | +| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | List all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json | +| [privateLinkResourcesListByElasticSanSample.ts][privatelinkresourceslistbyelasticsansample] | Gets the private link resources that need to be created for a elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | +| [skusListSample.ts][skuslistsample] | List all the available Skus in the region and information related to them x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json | +| [volumeGroupsCreateSample.ts][volumegroupscreatesample] | Create a Volume Group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json | +| [volumeGroupsDeleteSample.ts][volumegroupsdeletesample] | Delete an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json | +| [volumeGroupsGetSample.ts][volumegroupsgetsample] | Get an VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json | +| [volumeGroupsListByElasticSanSample.ts][volumegroupslistbyelasticsansample] | List VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | +| [volumeGroupsUpdateSample.ts][volumegroupsupdatesample] | Update an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json | +| [volumeSnapshotsCreateSample.ts][volumesnapshotscreatesample] | Create a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json | +| [volumeSnapshotsDeleteSample.ts][volumesnapshotsdeletesample] | Delete a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json | +| [volumeSnapshotsGetSample.ts][volumesnapshotsgetsample] | Get a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json | +| [volumeSnapshotsListByVolumeGroupSample.ts][volumesnapshotslistbyvolumegroupsample] | List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesCreateSample.ts][volumescreatesample] | Create a Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json | +| [volumesDeleteSample.ts][volumesdeletesample] | Delete an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json | +| [volumesGetSample.ts][volumesgetsample] | Get an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json | +| [volumesListByVolumeGroupSample.ts][volumeslistbyvolumegroupsample] | List Volumes in a VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesPreBackupSample.ts][volumesprebackupsample] | Validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json | +| [volumesPreRestoreSample.ts][volumesprerestoresample] | Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json | +| [volumesUpdateSample.ts][volumesupdatesample] | Update an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/elasticSansCreateSample.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 +cross-env ELASTICSANS_SUBSCRIPTION_ID="" ELASTICSANS_RESOURCE_GROUP="" node dist/elasticSansCreateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts +[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts +[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts +[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts +[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts +[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts +[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts +[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts +[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts +[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts +[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts +[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts +[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts +[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts +[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts +[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts +[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts +[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/package.json b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/package.json similarity index 89% rename from sdk/elasticsans/arm-elasticsan/samples/v2/typescript/package.json rename to sdk/elasticsans/arm-elasticsan/samples/v1/typescript/package.json index d7dd3a2f35cb..b19dc273f2c6 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/package.json +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-elasticsan-ts", "private": true, "version": "1.0.0", - "description": "@azure/arm-elasticsan client library samples for TypeScript", + "description": " client library samples for TypeScript", "engines": { "node": ">=20.0.0" }, @@ -18,10 +18,10 @@ "keywords": [ "node", "azure", - "cloud", "typescript", "browser", - "isomorphic" + "isomorphic", + "cloud" ], "author": "Microsoft Corporation", "license": "MIT", diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/sample.env b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/sample.env similarity index 100% rename from sdk/elasticsans/arm-elasticsan/samples/v2/typescript/sample.env rename to sdk/elasticsans/arm-elasticsan/samples/v1/typescript/sample.env diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts similarity index 51% rename from sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts index 1c7a449b10be..8d1d57edc110 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts @@ -1,20 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import type { ElasticSan} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to create ElasticSan. + * This sample demonstrates how to Create ElasticSan. * - * @summary create ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json + * @summary Create ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json */ async function elasticSansCreateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters: ElasticSan = { location: "France Central", properties: { autoScaleProperties: { @@ -32,28 +36,44 @@ async function elasticSansCreateMaximumSetGen(): Promise { sku: { name: "Premium_LRS", tier: "Premium" }, }, tags: { key9316: "ihndtieqibtob" }, - }); + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginCreateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); console.log(result); } /** - * This sample demonstrates how to create ElasticSan. + * This sample demonstrates how to Create ElasticSan. * - * @summary create ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Create_MinimumSet_Gen.json + * @summary Create ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MinimumSet_Gen.json */ async function elasticSansCreateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters: ElasticSan = { location: "France Central", properties: { baseSizeTiB: 15, extendedCapacitySizeTiB: 27, sku: { name: "Premium_LRS" }, }, - }); + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginCreateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts new file mode 100644 index 000000000000..6681034a19fd --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Delete a Elastic San. + * + * @summary Delete a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json + */ +async function elasticSansDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Delete a Elastic San. + * + * @summary Delete a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MinimumSet_Gen.json + */ +async function elasticSansDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + ); + console.log(result); +} + +async function main(): Promise { + await elasticSansDeleteMaximumSetGen(); + await elasticSansDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts new file mode 100644 index 000000000000..5503e5b2811a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get a ElasticSan. + * + * @summary Get a ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json + */ +async function elasticSansGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get( + resourceGroupName, + elasticSanName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get a ElasticSan. + * + * @summary Get a ElasticSan. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MinimumSet_Gen.json + */ +async function elasticSansGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get( + resourceGroupName, + elasticSanName, + ); + console.log(result); +} + +async function main(): Promise { + await elasticSansGetMaximumSetGen(); + await elasticSansGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts similarity index 51% rename from sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts index a2ac1576753a..5a364acd441f 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts @@ -3,40 +3,49 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * This sample demonstrates how to Gets a list of ElasticSan in a resource group. * - * @summary gets a list of ElasticSan in a resource group. - * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * @summary Gets a list of ElasticSan in a resource group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ async function elasticSansListByResourceGroupMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + for await (const item of client.elasticSans.listByResourceGroup( + resourceGroupName, + )) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to gets a list of ElasticSan in a resource group. + * This sample demonstrates how to Gets a list of ElasticSan in a resource group. * - * @summary gets a list of ElasticSan in a resource group. - * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * @summary Gets a list of ElasticSan in a resource group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ async function elasticSansListByResourceGroupMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { + for await (const item of client.elasticSans.listByResourceGroup( + resourceGroupName, + )) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts similarity index 58% rename from sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts index 1fc752343bbf..fc5c6843145c 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts @@ -3,40 +3,41 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to gets a list of ElasticSans in a subscription + * This sample demonstrates how to Gets a list of ElasticSans in a subscription * - * @summary gets a list of ElasticSans in a subscription - * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * @summary Gets a list of ElasticSans in a subscription + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ async function elasticSansListBySubscriptionMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to gets a list of ElasticSans in a subscription + * This sample demonstrates how to Gets a list of ElasticSans in a subscription * - * @summary gets a list of ElasticSans in a subscription - * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * @summary Gets a list of ElasticSans in a subscription + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ async function elasticSansListBySubscriptionMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts new file mode 100644 index 000000000000..8a3bcaf08103 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanUpdate} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Update a Elastic San. + * + * @summary Update a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json + */ +async function elasticSansUpdateMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters: ElasticSanUpdate = { + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", + }, + tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Update a Elastic San. + * + * @summary Update a Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MinimumSet_Gen.json + */ +async function elasticSansUpdateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const parameters: ElasticSanUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + parameters, + ); + console.log(result); +} + +async function main(): Promise { + await elasticSansUpdateMaximumSetGen(); + await elasticSansUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts similarity index 56% rename from sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts index 61d0c64318ce..a63cdbdf87e8 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts @@ -3,40 +3,43 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to list the operations for the provider + * This sample demonstrates how to List the operations for the provider * - * @summary list the operations for the provider - * x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json + * @summary List the operations for the provider + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json */ async function operationsListMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list the operations for the provider + * This sample demonstrates how to List the operations for the provider * - * @summary list the operations for the provider - * x-ms-original-file: 2025-09-01/Operations_List_MinimumSet_Gen.json + * @summary List the operations for the provider + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MinimumSet_Gen.json */ async function operationsListMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts new file mode 100644 index 000000000000..2d3cee1e4b30 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + PrivateEndpointConnection} from "@azure/arm-elasticsan"; +import { + ElasticSanManagement, +} from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San + * + * @summary Update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const parameters: PrivateEndpointConnection = { + properties: { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginCreateAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San + * + * @summary Update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const parameters: PrivateEndpointConnection = { + properties: { privateLinkServiceConnectionState: {} }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginCreateAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + ); + console.log(result); +} + +async function main(): Promise { + await privateEndpointConnectionsCreateMaximumSetGen(); + await privateEndpointConnectionsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..12ae9b5b7739 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San + * + * @summary Deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San + * + * @summary Deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main(): Promise { + await privateEndpointConnectionsDeleteMaximumSetGen(); + await privateEndpointConnectionsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..dc0fd963828d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San + * + * @summary Gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San + * + * @summary Gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const privateEndpointConnectionName = "privateendpointconnectionname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + ); + console.log(result); +} + +async function main(): Promise { + await privateEndpointConnectionsGetMaximumSetGen(); + await privateEndpointConnectionsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts similarity index 51% rename from sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts index 3616a6035b66..c7ae9c013252 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts @@ -3,46 +3,53 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. * - * @summary list all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json + * @summary List all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json */ async function privateEndpointConnectionsListMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. * - * @summary list all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MinimumSet_Gen.json + * @summary List all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json */ async function privateEndpointConnectionsListMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts new file mode 100644 index 000000000000..bb565b6098bc --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. + * + * @summary Gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + resourceGroupName, + elasticSanName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. + * + * @summary Gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + resourceGroupName, + elasticSanName, + ); + console.log(result); +} + +async function main(): Promise { + await privateLinkResourcesListByElasticSanMaximumSetGen(); + await privateLinkResourcesListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts new file mode 100644 index 000000000000..afb9587eac91 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + SkusListOptionalParams} from "@azure/arm-elasticsan"; +import { + ElasticSanManagement, +} from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List all the available Skus in the region and information related to them + * + * @summary List all the available Skus in the region and information related to them + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json + */ +async function skusListMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const filter = "obwwdrkq"; + const options: SkusListOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.skus.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to List all the available Skus in the region and information related to them + * + * @summary List all the available Skus in the region and information related to them + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MinimumSet_Gen.json + */ +async function skusListMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.skus.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main(): Promise { + await skusListMaximumSetGen(); + await skusListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts new file mode 100644 index 000000000000..2fcb48e9acbe --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { VolumeGroup} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Create a Volume Group. + * + * @summary Create a Volume Group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json + */ +async function volumeGroupsCreateMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeGroup = { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [ + { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, + ], + }, + protocolType: "Iscsi", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create a Volume Group. + * + * @summary Create a Volume Group. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MinimumSet_Gen.json + */ +async function volumeGroupsCreateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeGroup = {}; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsCreateMaximumSetGen(); + await volumeGroupsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts new file mode 100644 index 000000000000..0fe6183e9fc9 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Delete an VolumeGroup. + * + * @summary Delete an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json + */ +async function volumeGroupsDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Delete an VolumeGroup. + * + * @summary Delete an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json + */ +async function volumeGroupsDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsDeleteMaximumSetGen(); + await volumeGroupsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts new file mode 100644 index 000000000000..655d34fc4f2d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get an VolumeGroups. + * + * @summary Get an VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json + */ +async function volumeGroupsGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get an VolumeGroups. + * + * @summary Get an VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MinimumSet_Gen.json + */ +async function volumeGroupsGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsGetMaximumSetGen(); + await volumeGroupsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts similarity index 50% rename from sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts index 380a5aa9623f..61e3533f75b4 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts @@ -3,46 +3,53 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; /** - * This sample demonstrates how to list VolumeGroups. + * This sample demonstrates how to List VolumeGroups. * - * @summary list VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + * @summary List VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json */ async function volumeGroupsListByElasticSanMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } /** - * This sample demonstrates how to list VolumeGroups. + * This sample demonstrates how to List VolumeGroups. * - * @summary list VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + * @summary List VolumeGroups. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json */ async function volumeGroupsListByElasticSanMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - "resourcegroupname", - "elasticsanname", + resourceGroupName, + elasticSanName, )) { resArray.push(item); } - console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts new file mode 100644 index 000000000000..c735a5945d65 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { VolumeGroupUpdate} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Update an VolumeGroup. + * + * @summary Update an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json + */ +async function volumeGroupsUpdateMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeGroupUpdate = { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [ + { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, + ], + }, + protocolType: "Iscsi", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Update an VolumeGroup. + * + * @summary Update an VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MinimumSet_Gen.json + */ +async function volumeGroupsUpdateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeGroupUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsUpdateMaximumSetGen(); + await volumeGroupsUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts new file mode 100644 index 000000000000..03ec9c6ba4aa --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { Snapshot} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Create a Volume Snapshot. + * + * @summary Create a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json + */ +async function volumeSnapshotsCreateMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const parameters: Snapshot = { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create a Volume Snapshot. + * + * @summary Create a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json + */ +async function volumeSnapshotsCreateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const parameters: Snapshot = { + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + ); + console.log(result); +} + +async function main(): Promise { + await volumeSnapshotsCreateMaximumSetGen(); + await volumeSnapshotsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts new file mode 100644 index 000000000000..35566fcd9a85 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Delete a Volume Snapshot. + * + * @summary Delete a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json + */ +async function volumeSnapshotsDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Delete a Volume Snapshot. + * + * @summary Delete a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json + */ +async function volumeSnapshotsDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + ); + console.log(result); +} + +async function main(): Promise { + await volumeSnapshotsDeleteMaximumSetGen(); + await volumeSnapshotsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts new file mode 100644 index 000000000000..b167b69380ab --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get a Volume Snapshot. + * + * @summary Get a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json + */ +async function volumeSnapshotsGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get a Volume Snapshot. + * + * @summary Get a Volume Snapshot. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json + */ +async function volumeSnapshotsGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const snapshotName = "snapshotname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + ); + console.log(result); +} + +async function main(): Promise { + await volumeSnapshotsGetMaximumSetGen(); + await volumeSnapshotsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts new file mode 100644 index 000000000000..dc6d85afba1b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + VolumeSnapshotsListByVolumeGroupOptionalParams} from "@azure/arm-elasticsan"; +import { + ElasticSanManagement, +} from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const filter = "volumeName eq "; + const options: VolumeSnapshotsListByVolumeGroupOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main(): Promise { + await volumeSnapshotsListByVolumeGroupMaximumSetGen(); + await volumeSnapshotsListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts new file mode 100644 index 000000000000..9d12c0efc67a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { Volume} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Create a Volume. + * + * @summary Create a Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json + */ +async function volumesCreateMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters: Volume = { + properties: { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create a Volume. + * + * @summary Create a Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MinimumSet_Gen.json + */ +async function volumesCreateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters: Volume = { properties: { sizeGiB: 9 } }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginCreateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + ); + console.log(result); +} + +async function main(): Promise { + await volumesCreateMaximumSetGen(); + await volumesCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts new file mode 100644 index 000000000000..24a92fd1bdff --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + VolumesDeleteOptionalParams} from "@azure/arm-elasticsan"; +import { + ElasticSanManagement, +} from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Delete an Volume. + * + * @summary Delete an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json + */ +async function volumesDeleteMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const xMsDeleteSnapshots = "true"; + const xMsForceDelete = "true"; + const options: VolumesDeleteOptionalParams = { + xMsDeleteSnapshots, + xMsForceDelete, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Delete an Volume. + * + * @summary Delete an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MinimumSet_Gen.json + */ +async function volumesDeleteMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + ); + console.log(result); +} + +async function main(): Promise { + await volumesDeleteMaximumSetGen(); + await volumesDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts new file mode 100644 index 000000000000..1ba5db7bc799 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get an Volume. + * + * @summary Get an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json + */ +async function volumesGetMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get an Volume. + * + * @summary Get an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MinimumSet_Gen.json + */ +async function volumesGetMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + ); + console.log(result); +} + +async function main(): Promise { + await volumesGetMaximumSetGen(); + await volumesGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts new file mode 100644 index 000000000000..e7779b4d358b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List Volumes in a VolumeGroup. + * + * @summary List Volumes in a VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumesListByVolumeGroupMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to List Volumes in a VolumeGroup. + * + * @summary List Volumes in a VolumeGroup. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumesListByVolumeGroupMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main(): Promise { + await volumesListByVolumeGroupMaximumSetGen(); + await volumesListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts new file mode 100644 index 000000000000..12056f7be2d7 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { VolumeNameList} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Validate whether a disk snapshot backup can be taken for list of volumes. + * + * @summary Validate whether a disk snapshot backup can be taken for list of volumes. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json + */ +async function volumeGroupsPreBackupMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: VolumeNameList = { volumeNames: ["volumename"] }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginPreBackupAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsPreBackupMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts new file mode 100644 index 000000000000..a023e0e9880c --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DiskSnapshotList} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * + * @summary Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json + */ +async function volumeGroupsPreRestoreMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const parameters: DiskSnapshotList = { + diskSnapshotIds: [ + "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginPreRestoreAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsPreRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts new file mode 100644 index 000000000000..84ef112f4c45 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { VolumeUpdate} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Update an Volume. + * + * @summary Update an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json + */ +async function volumesUpdateMaximumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters: VolumeUpdate = { + properties: { + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 7, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Update an Volume. + * + * @summary Update an Volume. + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MinimumSet_Gen.json + */ +async function volumesUpdateMinimumSetGen(): Promise { + const subscriptionId = + process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; + const resourceGroupName = + process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; + const elasticSanName = "elasticsanname"; + const volumeGroupName = "volumegroupname"; + const volumeName = "volumename"; + const parameters: VolumeUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.beginUpdateAndWait( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + ); + console.log(result); +} + +async function main(): Promise { + await volumesUpdateMaximumSetGen(); + await volumesUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/tsconfig.json b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/tsconfig.json similarity index 100% rename from sdk/elasticsans/arm-elasticsan/samples/v2/typescript/tsconfig.json rename to sdk/elasticsans/arm-elasticsan/samples/v1/typescript/tsconfig.json diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md deleted file mode 100644 index cf625441dc6f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# @azure/arm-elasticsan client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for @azure/arm-elasticsan in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [elasticSansCreateSample.js][elasticsanscreatesample] | create ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json | -| [elasticSansDeleteSample.js][elasticsansdeletesample] | delete a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json | -| [elasticSansGetSample.js][elasticsansgetsample] | get a ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json | -| [elasticSansListByResourceGroupSample.js][elasticsanslistbyresourcegroupsample] | gets a list of ElasticSan in a resource group. x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | -| [elasticSansListBySubscriptionSample.js][elasticsanslistbysubscriptionsample] | gets a list of ElasticSans in a subscription x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json | -| [elasticSansUpdateSample.js][elasticsansupdatesample] | update a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json | -| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json | -| [privateEndpointConnectionsCreateSample.js][privateendpointconnectionscreatesample] | update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json | -| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | list all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json | -| [privateLinkResourcesListByElasticSanSample.js][privatelinkresourceslistbyelasticsansample] | gets the private link resources that need to be created for a elastic San. x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | -| [skusListSample.js][skuslistsample] | list all the available Skus in the region and information related to them x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json | -| [volumeGroupsCreateSample.js][volumegroupscreatesample] | create a Volume Group. x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json | -| [volumeGroupsDeleteSample.js][volumegroupsdeletesample] | delete an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json | -| [volumeGroupsGetSample.js][volumegroupsgetsample] | get an VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json | -| [volumeGroupsListByElasticSanSample.js][volumegroupslistbyelasticsansample] | list VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | -| [volumeGroupsUpdateSample.js][volumegroupsupdatesample] | update an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json | -| [volumeSnapshotsCreateSample.js][volumesnapshotscreatesample] | create a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json | -| [volumeSnapshotsDeleteSample.js][volumesnapshotsdeletesample] | delete a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json | -| [volumeSnapshotsGetSample.js][volumesnapshotsgetsample] | get a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json | -| [volumeSnapshotsListByVolumeGroupSample.js][volumesnapshotslistbyvolumegroupsample] | list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesCreateSample.js][volumescreatesample] | create a Volume. x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json | -| [volumesDeleteSample.js][volumesdeletesample] | delete an Volume. x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json | -| [volumesGetSample.js][volumesgetsample] | get an Volume. x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json | -| [volumesListByVolumeGroupSample.js][volumeslistbyvolumegroupsample] | list Volumes in a VolumeGroup. x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesPreBackupSample.js][volumesprebackupsample] | validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json | -| [volumesPreRestoreSample.js][volumesprerestoresample] | validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json | -| [volumesUpdateSample.js][volumesupdatesample] | update an Volume. x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node elasticSansCreateSample.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 -node elasticSansCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js -[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js -[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js -[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js -[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js -[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js -[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js -[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js -[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js -[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js -[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js -[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js -[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js -[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js -[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js -[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js -[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js -[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js -[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js -[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js -[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js -[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js -[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js -[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js deleted file mode 100644 index d36487a88c75..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete a Elastic San. - * - * @summary delete a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json - */ -async function elasticSansDeleteMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.elasticSans.delete("resourcegroupname", "elasticsanname"); -} - -/** - * This sample demonstrates how to delete a Elastic San. - * - * @summary delete a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MinimumSet_Gen.json - */ -async function elasticSansDeleteMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.elasticSans.delete("resourcegroupname", "elasticsanname"); -} - -async function main() { - await elasticSansDeleteMaximumSetGen(); - await elasticSansDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js deleted file mode 100644 index 0c66343632cb..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a ElasticSan. - * - * @summary get a ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json - */ -async function elasticSansGetMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); - console.log(result); -} - -/** - * This sample demonstrates how to get a ElasticSan. - * - * @summary get a ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Get_MinimumSet_Gen.json - */ -async function elasticSansGetMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); - console.log(result); -} - -async function main() { - await elasticSansGetMaximumSetGen(); - await elasticSansGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js deleted file mode 100644 index 4ada1c52889d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to update a Elastic San. - * - * @summary update a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json - */ -async function elasticSansUpdateMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", - }, - tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }); - console.log(result); -} - -/** - * This sample demonstrates how to update a Elastic San. - * - * @summary update a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Update_MinimumSet_Gen.json - */ -async function elasticSansUpdateMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", {}); - console.log(result); -} - -async function main() { - await elasticSansUpdateMaximumSetGen(); - await elasticSansUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js deleted file mode 100644 index 01924887ee54..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San - * - * @summary update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.create( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San - * - * @summary update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.create( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - { properties: { privateLinkServiceConnectionState: {} } }, - ); - console.log(result); -} - -async function main() { - await privateEndpointConnectionsCreateMaximumSetGen(); - await privateEndpointConnectionsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js deleted file mode 100644 index 140151618cc1..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San - * - * @summary deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.privateEndpointConnections.delete( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - ); -} - -/** - * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San - * - * @summary deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.privateEndpointConnections.delete( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - ); -} - -async function main() { - await privateEndpointConnectionsDeleteMaximumSetGen(); - await privateEndpointConnectionsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js deleted file mode 100644 index 229aff5a10c3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San - * - * @summary gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsGetMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - ); - console.log(result); -} - -/** - * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San - * - * @summary gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsGetMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - ); - console.log(result); -} - -async function main() { - await privateEndpointConnectionsGetMaximumSetGen(); - await privateEndpointConnectionsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js deleted file mode 100644 index da29e9a59320..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. - * - * @summary gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - "resourcegroupname", - "elasticsanname", - ); - console.log(result); -} - -/** - * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. - * - * @summary gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - "resourcegroupname", - "elasticsanname", - ); - console.log(result); -} - -async function main() { - await privateLinkResourcesListByElasticSanMaximumSetGen(); - await privateLinkResourcesListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js deleted file mode 100644 index ebafbdfa3694..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a Volume Group. - * - * @summary create a Volume Group. - * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json - */ -async function volumeGroupsCreateMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "vgbeephfgecgg", - }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to create a Volume Group. - * - * @summary create a Volume Group. - * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MinimumSet_Gen.json - */ -async function volumeGroupsCreateMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - {}, - ); - console.log(result); -} - -async function main() { - await volumeGroupsCreateMaximumSetGen(); - await volumeGroupsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js deleted file mode 100644 index d621f38ce0b2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete an VolumeGroup. - * - * @summary delete an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json - */ -async function volumeGroupsDeleteMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); -} - -/** - * This sample demonstrates how to delete an VolumeGroup. - * - * @summary delete an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MinimumSet_Gen.json - */ -async function volumeGroupsDeleteMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); -} - -async function main() { - await volumeGroupsDeleteMaximumSetGen(); - await volumeGroupsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js deleted file mode 100644 index d3ef3cb3ce45..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get an VolumeGroups. - * - * @summary get an VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json - */ -async function volumeGroupsGetMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - ); - console.log(result); -} - -/** - * This sample demonstrates how to get an VolumeGroups. - * - * @summary get an VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MinimumSet_Gen.json - */ -async function volumeGroupsGetMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - ); - console.log(result); -} - -async function main() { - await volumeGroupsGetMaximumSetGen(); - await volumeGroupsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js deleted file mode 100644 index 631796fbda96..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list VolumeGroups. - * - * @summary list VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeGroups.listByElasticSan( - "resourcegroupname", - "elasticsanname", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -/** - * This sample demonstrates how to list VolumeGroups. - * - * @summary list VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeGroups.listByElasticSan( - "resourcegroupname", - "elasticsanname", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - await volumeGroupsListByElasticSanMaximumSetGen(); - await volumeGroupsListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js deleted file mode 100644 index dc661bdb46f5..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to update an VolumeGroup. - * - * @summary update an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json - */ -async function volumeGroupsUpdateMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "vgbeephfgecgg", - }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to update an VolumeGroup. - * - * @summary update an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MinimumSet_Gen.json - */ -async function volumeGroupsUpdateMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - {}, - ); - console.log(result); -} - -async function main() { - await volumeGroupsUpdateMaximumSetGen(); - await volumeGroupsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js deleted file mode 100644 index fd3b55af627f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a Volume Snapshot. - * - * @summary create a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json - */ -async function volumeSnapshotsCreateMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to create a Volume Snapshot. - * - * @summary create a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MinimumSet_Gen.json - */ -async function volumeSnapshotsCreateMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }, - ); - console.log(result); -} - -async function main() { - await volumeSnapshotsCreateMaximumSetGen(); - await volumeSnapshotsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js deleted file mode 100644 index 82bc0741abfc..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete a Volume Snapshot. - * - * @summary delete a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json - */ -async function volumeSnapshotsDeleteMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeSnapshots.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - ); -} - -/** - * This sample demonstrates how to delete a Volume Snapshot. - * - * @summary delete a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MinimumSet_Gen.json - */ -async function volumeSnapshotsDeleteMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeSnapshots.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - ); -} - -async function main() { - await volumeSnapshotsDeleteMaximumSetGen(); - await volumeSnapshotsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js deleted file mode 100644 index 7271fd913ba7..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a Volume Snapshot. - * - * @summary get a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json - */ -async function volumeSnapshotsGetMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - ); - console.log(result); -} - -/** - * This sample demonstrates how to get a Volume Snapshot. - * - * @summary get a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MinimumSet_Gen.json - */ -async function volumeSnapshotsGetMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - ); - console.log(result); -} - -async function main() { - await volumeSnapshotsGetMaximumSetGen(); - await volumeSnapshotsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js deleted file mode 100644 index 4b891d95a2c5..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { filter: "volumeName eq " }, - )) { - resArray.push(item); - } - - console.log(resArray); -} - -/** - * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - await volumeSnapshotsListByVolumeGroupMaximumSetGen(); - await volumeSnapshotsListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js deleted file mode 100644 index 7122c688916f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a Volume. - * - * @summary create a Volume. - * x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json - */ -async function volumesCreateMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { - properties: { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to create a Volume. - * - * @summary create a Volume. - * x-ms-original-file: 2025-09-01/Volumes_Create_MinimumSet_Gen.json - */ -async function volumesCreateMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { properties: { sizeGiB: 9 } }, - ); - console.log(result); -} - -async function main() { - await volumesCreateMaximumSetGen(); - await volumesCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js deleted file mode 100644 index c8e310e3895a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete an Volume. - * - * @summary delete an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json - */ -async function volumesDeleteMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumes.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { xMsDeleteSnapshots: "true", xMsForceDelete: "true" }, - ); -} - -/** - * This sample demonstrates how to delete an Volume. - * - * @summary delete an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Delete_MinimumSet_Gen.json - */ -async function volumesDeleteMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumes.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - ); -} - -async function main() { - await volumesDeleteMaximumSetGen(); - await volumesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js deleted file mode 100644 index 8987e9ec5d3e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get an Volume. - * - * @summary get an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json - */ -async function volumesGetMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - ); - console.log(result); -} - -/** - * This sample demonstrates how to get an Volume. - * - * @summary get an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Get_MinimumSet_Gen.json - */ -async function volumesGetMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - ); - console.log(result); -} - -async function main() { - await volumesGetMaximumSetGen(); - await volumesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js deleted file mode 100644 index 00e72f6c8cbe..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list Volumes in a VolumeGroup. - * - * @summary list Volumes in a VolumeGroup. - * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumesListByVolumeGroupMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -/** - * This sample demonstrates how to list Volumes in a VolumeGroup. - * - * @summary list Volumes in a VolumeGroup. - * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumesListByVolumeGroupMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - await volumesListByVolumeGroupMaximumSetGen(); - await volumesListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js deleted file mode 100644 index ddb7ebd7b6e3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to validate whether a disk snapshot backup can be taken for list of volumes. - * - * @summary validate whether a disk snapshot backup can be taken for list of volumes. - * x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json - */ -async function volumeGroupsPreBackupMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.preBackup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { volumeNames: ["volumename"] }, - ); - console.log(result); -} - -async function main() { - await volumeGroupsPreBackupMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js deleted file mode 100644 index 4aacd52202f7..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * - * @summary validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json - */ -async function volumeGroupsPreRestoreMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.preRestore( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { - diskSnapshotIds: [ - "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", - ], - }, - ); - console.log(result); -} - -async function main() { - await volumeGroupsPreRestoreMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js deleted file mode 100644 index af4209331362..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to update an Volume. - * - * @summary update an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json - */ -async function volumesUpdateMaximumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { - properties: { - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 7, - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to update an Volume. - * - * @summary update an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Update_MinimumSet_Gen.json - */ -async function volumesUpdateMinimumSetGen() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - {}, - ); - console.log(result); -} - -async function main() { - await volumesUpdateMaximumSetGen(); - await volumesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md deleted file mode 100644 index 86f4280f52cc..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# @azure/arm-elasticsan client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for @azure/arm-elasticsan in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [elasticSansCreateSample.ts][elasticsanscreatesample] | create ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json | -| [elasticSansDeleteSample.ts][elasticsansdeletesample] | delete a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json | -| [elasticSansGetSample.ts][elasticsansgetsample] | get a ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json | -| [elasticSansListByResourceGroupSample.ts][elasticsanslistbyresourcegroupsample] | gets a list of ElasticSan in a resource group. x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | -| [elasticSansListBySubscriptionSample.ts][elasticsanslistbysubscriptionsample] | gets a list of ElasticSans in a subscription x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json | -| [elasticSansUpdateSample.ts][elasticsansupdatesample] | update a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json | -| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json | -| [privateEndpointConnectionsCreateSample.ts][privateendpointconnectionscreatesample] | update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json | -| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | list all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json | -| [privateLinkResourcesListByElasticSanSample.ts][privatelinkresourceslistbyelasticsansample] | gets the private link resources that need to be created for a elastic San. x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | -| [skusListSample.ts][skuslistsample] | list all the available Skus in the region and information related to them x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json | -| [volumeGroupsCreateSample.ts][volumegroupscreatesample] | create a Volume Group. x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json | -| [volumeGroupsDeleteSample.ts][volumegroupsdeletesample] | delete an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json | -| [volumeGroupsGetSample.ts][volumegroupsgetsample] | get an VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json | -| [volumeGroupsListByElasticSanSample.ts][volumegroupslistbyelasticsansample] | list VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | -| [volumeGroupsUpdateSample.ts][volumegroupsupdatesample] | update an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json | -| [volumeSnapshotsCreateSample.ts][volumesnapshotscreatesample] | create a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json | -| [volumeSnapshotsDeleteSample.ts][volumesnapshotsdeletesample] | delete a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json | -| [volumeSnapshotsGetSample.ts][volumesnapshotsgetsample] | get a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json | -| [volumeSnapshotsListByVolumeGroupSample.ts][volumesnapshotslistbyvolumegroupsample] | list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesCreateSample.ts][volumescreatesample] | create a Volume. x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json | -| [volumesDeleteSample.ts][volumesdeletesample] | delete an Volume. x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json | -| [volumesGetSample.ts][volumesgetsample] | get an Volume. x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json | -| [volumesListByVolumeGroupSample.ts][volumeslistbyvolumegroupsample] | list Volumes in a VolumeGroup. x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesPreBackupSample.ts][volumesprebackupsample] | validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json | -| [volumesPreRestoreSample.ts][volumesprerestoresample] | validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json | -| [volumesUpdateSample.ts][volumesupdatesample] | update an Volume. x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/elasticSansCreateSample.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 -node dist/elasticSansCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts -[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts -[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts -[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts -[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts -[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts -[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts -[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts -[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts -[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts -[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts -[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts -[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts -[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts -[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts -[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts -[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts -[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts -[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts -[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts -[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts -[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts -[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts -[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts deleted file mode 100644 index 9bcc04f5edfd..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a Elastic San. - * - * @summary delete a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json - */ -async function elasticSansDeleteMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.elasticSans.delete("resourcegroupname", "elasticsanname"); -} - -/** - * This sample demonstrates how to delete a Elastic San. - * - * @summary delete a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MinimumSet_Gen.json - */ -async function elasticSansDeleteMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.elasticSans.delete("resourcegroupname", "elasticsanname"); -} - -async function main(): Promise { - await elasticSansDeleteMaximumSetGen(); - await elasticSansDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts deleted file mode 100644 index e80a93aa8f0e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a ElasticSan. - * - * @summary get a ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json - */ -async function elasticSansGetMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); - console.log(result); -} - -/** - * This sample demonstrates how to get a ElasticSan. - * - * @summary get a ElasticSan. - * x-ms-original-file: 2025-09-01/ElasticSans_Get_MinimumSet_Gen.json - */ -async function elasticSansGetMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); - console.log(result); -} - -async function main(): Promise { - await elasticSansGetMaximumSetGen(); - await elasticSansGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts deleted file mode 100644 index 084de695151d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a Elastic San. - * - * @summary update a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json - */ -async function elasticSansUpdateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", - }, - tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }); - console.log(result); -} - -/** - * This sample demonstrates how to update a Elastic San. - * - * @summary update a Elastic San. - * x-ms-original-file: 2025-09-01/ElasticSans_Update_MinimumSet_Gen.json - */ -async function elasticSansUpdateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", {}); - console.log(result); -} - -async function main(): Promise { - await elasticSansUpdateMaximumSetGen(); - await elasticSansUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts deleted file mode 100644 index 6fd03552435e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San - * - * @summary update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.create( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San - * - * @summary update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.create( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - { properties: { privateLinkServiceConnectionState: {} } }, - ); - console.log(result); -} - -async function main(): Promise { - await privateEndpointConnectionsCreateMaximumSetGen(); - await privateEndpointConnectionsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index abc29f16677e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San - * - * @summary deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.privateEndpointConnections.delete( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - ); -} - -/** - * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San - * - * @summary deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.privateEndpointConnections.delete( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - ); -} - -async function main(): Promise { - await privateEndpointConnectionsDeleteMaximumSetGen(); - await privateEndpointConnectionsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index f7fea37d0372..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San - * - * @summary gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsGetMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - ); - console.log(result); -} - -/** - * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San - * - * @summary gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsGetMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - "resourcegroupname", - "elasticsanname", - "privateendpointconnectionname", - ); - console.log(result); -} - -async function main(): Promise { - await privateEndpointConnectionsGetMaximumSetGen(); - await privateEndpointConnectionsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts deleted file mode 100644 index 233d5378e795..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. - * - * @summary gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - "resourcegroupname", - "elasticsanname", - ); - console.log(result); -} - -/** - * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. - * - * @summary gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - "resourcegroupname", - "elasticsanname", - ); - console.log(result); -} - -async function main(): Promise { - await privateLinkResourcesListByElasticSanMaximumSetGen(); - await privateLinkResourcesListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts deleted file mode 100644 index f70a88942fed..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list all the available Skus in the region and information related to them - * - * @summary list all the available Skus in the region and information related to them - * x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json - */ -async function skusListMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.skus.list({ filter: "obwwdrkq" })) { - resArray.push(item); - } - - console.log(resArray); -} - -/** - * This sample demonstrates how to list all the available Skus in the region and information related to them - * - * @summary list all the available Skus in the region and information related to them - * x-ms-original-file: 2025-09-01/Skus_List_MinimumSet_Gen.json - */ -async function skusListMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.skus.list()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await skusListMaximumSetGen(); - await skusListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts deleted file mode 100644 index 4e691081e428..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a Volume Group. - * - * @summary create a Volume Group. - * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json - */ -async function volumeGroupsCreateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "vgbeephfgecgg", - }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to create a Volume Group. - * - * @summary create a Volume Group. - * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MinimumSet_Gen.json - */ -async function volumeGroupsCreateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - {}, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsCreateMaximumSetGen(); - await volumeGroupsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts deleted file mode 100644 index ac965081580a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete an VolumeGroup. - * - * @summary delete an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json - */ -async function volumeGroupsDeleteMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); -} - -/** - * This sample demonstrates how to delete an VolumeGroup. - * - * @summary delete an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MinimumSet_Gen.json - */ -async function volumeGroupsDeleteMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); -} - -async function main(): Promise { - await volumeGroupsDeleteMaximumSetGen(); - await volumeGroupsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts deleted file mode 100644 index a128c689a18d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get an VolumeGroups. - * - * @summary get an VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json - */ -async function volumeGroupsGetMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - ); - console.log(result); -} - -/** - * This sample demonstrates how to get an VolumeGroups. - * - * @summary get an VolumeGroups. - * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MinimumSet_Gen.json - */ -async function volumeGroupsGetMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsGetMaximumSetGen(); - await volumeGroupsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts deleted file mode 100644 index c5238105f486..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update an VolumeGroup. - * - * @summary update an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json - */ -async function volumeGroupsUpdateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { - encryptionUserAssignedIdentity: "vgbeephfgecgg", - }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to update an VolumeGroup. - * - * @summary update an VolumeGroup. - * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MinimumSet_Gen.json - */ -async function volumeGroupsUpdateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - {}, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsUpdateMaximumSetGen(); - await volumeGroupsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts deleted file mode 100644 index 35de4b6c63f4..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a Volume Snapshot. - * - * @summary create a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json - */ -async function volumeSnapshotsCreateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to create a Volume Snapshot. - * - * @summary create a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MinimumSet_Gen.json - */ -async function volumeSnapshotsCreateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await volumeSnapshotsCreateMaximumSetGen(); - await volumeSnapshotsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts deleted file mode 100644 index e8db98290e6c..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a Volume Snapshot. - * - * @summary delete a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json - */ -async function volumeSnapshotsDeleteMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeSnapshots.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - ); -} - -/** - * This sample demonstrates how to delete a Volume Snapshot. - * - * @summary delete a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MinimumSet_Gen.json - */ -async function volumeSnapshotsDeleteMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumeSnapshots.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - ); -} - -async function main(): Promise { - await volumeSnapshotsDeleteMaximumSetGen(); - await volumeSnapshotsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts deleted file mode 100644 index 7f78d243e440..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a Volume Snapshot. - * - * @summary get a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json - */ -async function volumeSnapshotsGetMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - ); - console.log(result); -} - -/** - * This sample demonstrates how to get a Volume Snapshot. - * - * @summary get a Volume Snapshot. - * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MinimumSet_Gen.json - */ -async function volumeSnapshotsGetMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "snapshotname", - ); - console.log(result); -} - -async function main(): Promise { - await volumeSnapshotsGetMaximumSetGen(); - await volumeSnapshotsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts deleted file mode 100644 index 1e5259e46a94..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { filter: "volumeName eq " }, - )) { - resArray.push(item); - } - - console.log(resArray); -} - -/** - * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await volumeSnapshotsListByVolumeGroupMaximumSetGen(); - await volumeSnapshotsListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts deleted file mode 100644 index df22ebd67cee..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a Volume. - * - * @summary create a Volume. - * x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json - */ -async function volumesCreateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { - properties: { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to create a Volume. - * - * @summary create a Volume. - * x-ms-original-file: 2025-09-01/Volumes_Create_MinimumSet_Gen.json - */ -async function volumesCreateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.create( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { properties: { sizeGiB: 9 } }, - ); - console.log(result); -} - -async function main(): Promise { - await volumesCreateMaximumSetGen(); - await volumesCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts deleted file mode 100644 index 39b9e7aa96bf..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete an Volume. - * - * @summary delete an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json - */ -async function volumesDeleteMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumes.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { xMsDeleteSnapshots: "true", xMsForceDelete: "true" }, - ); -} - -/** - * This sample demonstrates how to delete an Volume. - * - * @summary delete an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Delete_MinimumSet_Gen.json - */ -async function volumesDeleteMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - await client.volumes.delete( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - ); -} - -async function main(): Promise { - await volumesDeleteMaximumSetGen(); - await volumesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts deleted file mode 100644 index 3a086869b011..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get an Volume. - * - * @summary get an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json - */ -async function volumesGetMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - ); - console.log(result); -} - -/** - * This sample demonstrates how to get an Volume. - * - * @summary get an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Get_MinimumSet_Gen.json - */ -async function volumesGetMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - ); - console.log(result); -} - -async function main(): Promise { - await volumesGetMaximumSetGen(); - await volumesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts deleted file mode 100644 index a0050c15050a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list Volumes in a VolumeGroup. - * - * @summary list Volumes in a VolumeGroup. - * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumesListByVolumeGroupMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -/** - * This sample demonstrates how to list Volumes in a VolumeGroup. - * - * @summary list Volumes in a VolumeGroup. - * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumesListByVolumeGroupMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await volumesListByVolumeGroupMaximumSetGen(); - await volumesListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts deleted file mode 100644 index b75df801c2bf..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to validate whether a disk snapshot backup can be taken for list of volumes. - * - * @summary validate whether a disk snapshot backup can be taken for list of volumes. - * x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json - */ -async function volumeGroupsPreBackupMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.preBackup( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { volumeNames: ["volumename"] }, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsPreBackupMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts deleted file mode 100644 index 1ab7276bf849..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * - * @summary validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json - */ -async function volumeGroupsPreRestoreMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.preRestore( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - { - diskSnapshotIds: [ - "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", - ], - }, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsPreRestoreMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts deleted file mode 100644 index 7142de252f04..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update an Volume. - * - * @summary update an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json - */ -async function volumesUpdateMaximumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - { - properties: { - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 7, - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to update an Volume. - * - * @summary update an Volume. - * x-ms-original-file: 2025-09-01/Volumes_Update_MinimumSet_Gen.json - */ -async function volumesUpdateMinimumSetGen(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subscriptionid"; - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.update( - "resourcegroupname", - "elasticsanname", - "volumegroupname", - "volumename", - {}, - ); - console.log(result); -} - -async function main(): Promise { - await volumesUpdateMaximumSetGen(); - await volumesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts deleted file mode 100644 index 36ecf17053b9..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { logger } from "../logger.js"; -import { KnownVersions } from "../models/models.js"; -import type { AzureSupportedClouds } from "../static-helpers/cloudSettingHelpers.js"; -import { getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; -import type { Client, ClientOptions } from "@azure-rest/core-client"; -import { getClient } from "@azure-rest/core-client"; -import type { TokenCredential } from "@azure/core-auth"; - -/** (missing-service-description) Add service description */ -export interface ElasticSanManagementContext extends Client { - /** The API version to use for this operation. */ - /** Known values of {@link KnownVersions} that the service accepts. */ - apiVersion: string; - /** The ID of the target subscription. The value must be an UUID. */ - subscriptionId: string; -} - -/** Optional parameters for the client. */ -export interface ElasticSanManagementOptionalParams extends ClientOptions { - /** The API version to use for this operation. */ - /** Known values of {@link KnownVersions} that the service accepts. */ - apiVersion?: string; - /** Specifies the Azure cloud environment for the client. */ - cloudSetting?: AzureSupportedClouds; -} - -/** (missing-service-description) Add service description */ -export function createElasticSanManagement( - credential: TokenCredential, - subscriptionId: string, - options: ElasticSanManagementOptionalParams = {}, -): ElasticSanManagementContext { - const endpointUrl = - options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; - const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; - const userAgentInfo = `azsdk-js-arm-elasticsan/1.0.0-beta.1`; - const userAgentPrefix = prefixFromOptions - ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` - : `azsdk-js-api ${userAgentInfo}`; - const { apiVersion: _, ...updatedOptions } = { - ...options, - userAgentOptions: { userAgentPrefix }, - loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, - credentials: { - scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], - }, - }; - const clientContext = getClient(endpointUrl, credential, updatedOptions); - clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); - const apiVersion = options.apiVersion ?? "2025-09-01"; - clientContext.pipeline.addPolicy({ - name: "ClientApiVersionPolicy", - sendRequest: (req, next) => { - // Use the apiVersion defined in request url directly - // Append one if there is no apiVersion and we have one at client options - const url = new URL(req.url); - if (!url.searchParams.get("api-version")) { - req.url = `${req.url}${ - Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" - }api-version=${apiVersion}`; - } - - return next(req); - }, - }); - return { - ...clientContext, - apiVersion, - subscriptionId, - } as ElasticSanManagementContext; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts deleted file mode 100644 index 4638e024014e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { - listBySubscription, - listByResourceGroup, - $delete, - update, - create, - get, -} from "./operations.js"; -export { - ElasticSansListBySubscriptionOptionalParams, - ElasticSansListByResourceGroupOptionalParams, - ElasticSansDeleteOptionalParams, - ElasticSansUpdateOptionalParams, - ElasticSansCreateOptionalParams, - ElasticSansGetOptionalParams, -} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts deleted file mode 100644 index 29aef0562568..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext as Client } from "../index.js"; -import type { ElasticSan, ElasticSanUpdate, _ElasticSanList } from "../../models/models.js"; -import { - errorResponseDeserializer, - elasticSanSerializer, - elasticSanDeserializer, - elasticSanUpdateSerializer, - _elasticSanListDeserializer, -} from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; -import type { - ElasticSansListBySubscriptionOptionalParams, - ElasticSansListByResourceGroupOptionalParams, - ElasticSansDeleteOptionalParams, - ElasticSansUpdateOptionalParams, - ElasticSansCreateOptionalParams, - ElasticSansGetOptionalParams, -} from "./options.js"; -import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -export function _listBySubscriptionSend( - context: Client, - options: ElasticSansListBySubscriptionOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _listBySubscriptionDeserialize( - result: PathUncheckedResponse, -): Promise<_ElasticSanList> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return _elasticSanListDeserializer(result.body); -} - -/** Gets a list of ElasticSans in a subscription */ -export function listBySubscription( - context: Client, - options: ElasticSansListBySubscriptionOptionalParams = { requestOptions: {} }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _listBySubscriptionSend(context, options), - _listBySubscriptionDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _listByResourceGroupSend( - context: Client, - resourceGroupName: string, - options: ElasticSansListByResourceGroupOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _listByResourceGroupDeserialize( - result: PathUncheckedResponse, -): Promise<_ElasticSanList> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return _elasticSanListDeserializer(result.body); -} - -/** Gets a list of ElasticSan in a resource group. */ -export function listByResourceGroup( - context: Client, - resourceGroupName: string, - options: ElasticSansListByResourceGroupOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _listByResourceGroupSend(context, resourceGroupName, options), - _listByResourceGroupDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _$deleteSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: ElasticSansDeleteOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "202", "204"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return; -} - -/** Delete a Elastic San. */ -/** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ -export function $delete( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: ElasticSansDeleteOptionalParams = { requestOptions: {} }, -): PollerLike, void> { - return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => _$deleteSend(context, resourceGroupName, elasticSanName, options), - resourceLocationConfig: "location", - }) as PollerLike, void>; -} - -export function _updateSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options: ElasticSansUpdateOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).patch({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: elasticSanUpdateSerializer(parameters), - }); -} - -export async function _updateDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "202"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return elasticSanDeserializer(result.body); -} - -/** Update a Elastic San. */ -export function update( - context: Client, - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options: ElasticSansUpdateOptionalParams = { requestOptions: {} }, -): PollerLike, ElasticSan> { - return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _updateSend(context, resourceGroupName, elasticSanName, parameters, options), - resourceLocationConfig: "location", - }) as PollerLike, ElasticSan>; -} - -export function _createSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options: ElasticSansCreateOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).put({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: elasticSanSerializer(parameters), - }); -} - -export async function _createDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "201", "202"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return elasticSanDeserializer(result.body); -} - -/** Create ElasticSan. */ -export function create( - context: Client, - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options: ElasticSansCreateOptionalParams = { requestOptions: {} }, -): PollerLike, ElasticSan> { - return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _createSend(context, resourceGroupName, elasticSanName, parameters, options), - resourceLocationConfig: "location", - }) as PollerLike, ElasticSan>; -} - -export function _getSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: ElasticSansGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _getDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return elasticSanDeserializer(result.body); -} - -/** Get a ElasticSan. */ -export async function get( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: ElasticSansGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _getSend(context, resourceGroupName, elasticSanName, options); - return _getDeserialize(result); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts deleted file mode 100644 index 1f22eab99e21..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { OperationOptions } from "@azure-rest/core-client"; - -/** Optional parameters. */ -export interface ElasticSansListBySubscriptionOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface ElasticSansListByResourceGroupOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface ElasticSansDeleteOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface ElasticSansUpdateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface ElasticSansCreateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface ElasticSansGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/index.ts deleted file mode 100644 index b78c2b276cec..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { - createElasticSanManagement, - ElasticSanManagementContext, - ElasticSanManagementOptionalParams, -} from "./elasticSanManagementContext.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts deleted file mode 100644 index 24a804d14fcf..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { list } from "./operations.js"; -export { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts deleted file mode 100644 index 1127cae6935c..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext as Client } from "../index.js"; -import type { _OperationListResult, Operation } from "../../models/models.js"; -import { - _operationListResultDeserializer, - errorResponseDeserializer, -} from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; -import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; -import type { OperationsListOptionalParams } from "./options.js"; -import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; - -export function _listSend( - context: Client, - options: OperationsListOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/providers/Microsoft.ElasticSan/operations{?api%2Dversion}", - { - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _listDeserialize( - result: PathUncheckedResponse, -): Promise<_OperationListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return _operationListResultDeserializer(result.body); -} - -/** List the operations for the provider */ -export function list( - context: Client, - options: OperationsListOptionalParams = { requestOptions: {} }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _listSend(context, options), - _listDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts deleted file mode 100644 index b9a3fd9758a3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { OperationOptions } from "@azure-rest/core-client"; - -/** Optional parameters. */ -export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts deleted file mode 100644 index c7afff4982ae..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { list, $delete, create, get } from "./operations.js"; -export { - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsDeleteOptionalParams, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsGetOptionalParams, -} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts deleted file mode 100644 index cb822d102194..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext as Client } from "../index.js"; -import type { - PrivateEndpointConnection, - _PrivateEndpointConnectionListResult, -} from "../../models/models.js"; -import { - errorResponseDeserializer, - privateEndpointConnectionSerializer, - privateEndpointConnectionDeserializer, - _privateEndpointConnectionListResultDeserializer, -} from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; -import type { - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsDeleteOptionalParams, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsGetOptionalParams, -} from "./options.js"; -import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -export function _listSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: PrivateEndpointConnectionsListOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _listDeserialize( - result: PathUncheckedResponse, -): Promise<_PrivateEndpointConnectionListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return _privateEndpointConnectionListResultDeserializer(result.body); -} - -/** List all Private Endpoint Connections associated with the Elastic San. */ -export function list( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: PrivateEndpointConnectionsListOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _listSend(context, resourceGroupName, elasticSanName, options), - _listDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _$deleteSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options: PrivateEndpointConnectionsDeleteOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - privateEndpointConnectionName: privateEndpointConnectionName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "202", "204"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return; -} - -/** Deletes the specified private endpoint connection associated with the Elastic San */ -/** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ -export function $delete( - context: Client, - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options: PrivateEndpointConnectionsDeleteOptionalParams = { - requestOptions: {}, - }, -): PollerLike, void> { - return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _$deleteSend( - context, - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, void>; -} - -export function _createSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options: PrivateEndpointConnectionsCreateOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - privateEndpointConnectionName: privateEndpointConnectionName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).put({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: privateEndpointConnectionSerializer(parameters), - }); -} - -export async function _createDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "201", "202"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return privateEndpointConnectionDeserializer(result.body); -} - -/** Update the state of specified private endpoint connection associated with the Elastic San */ -export function create( - context: Client, - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options: PrivateEndpointConnectionsCreateOptionalParams = { - requestOptions: {}, - }, -): PollerLike, PrivateEndpointConnection> { - return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _createSend( - context, - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, PrivateEndpointConnection>; -} - -export function _getSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - privateEndpointConnectionName: privateEndpointConnectionName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _getDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return privateEndpointConnectionDeserializer(result.body); -} - -/** Gets the specified private endpoint connection associated with the Elastic San */ -export async function get( - context: Client, - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _getSend( - context, - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - options, - ); - return _getDeserialize(result); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts deleted file mode 100644 index 689834e08f57..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { OperationOptions } from "@azure-rest/core-client"; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts deleted file mode 100644 index d5c988e5a1b6..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { listByElasticSan } from "./operations.js"; -export { PrivateLinkResourcesListByElasticSanOptionalParams } from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts deleted file mode 100644 index 27b7e4c52c60..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext as Client } from "../index.js"; -import type { PrivateLinkResourceListResult } from "../../models/models.js"; -import { - errorResponseDeserializer, - privateLinkResourceListResultDeserializer, -} from "../../models/models.js"; -import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; -import type { PrivateLinkResourcesListByElasticSanOptionalParams } from "./options.js"; -import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; - -export function _listByElasticSanSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: PrivateLinkResourcesListByElasticSanOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _listByElasticSanDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return privateLinkResourceListResultDeserializer(result.body); -} - -/** Gets the private link resources that need to be created for a elastic San. */ -export async function listByElasticSan( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: PrivateLinkResourcesListByElasticSanOptionalParams = { - requestOptions: {}, - }, -): Promise { - const result = await _listByElasticSanSend(context, resourceGroupName, elasticSanName, options); - return _listByElasticSanDeserialize(result); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts deleted file mode 100644 index 9db7ac557807..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { OperationOptions } from "@azure-rest/core-client"; - -/** Optional parameters. */ -export interface PrivateLinkResourcesListByElasticSanOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts deleted file mode 100644 index b8728b770497..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { list } from "./operations.js"; -export { SkusListOptionalParams } from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts deleted file mode 100644 index d375cbdba4bd..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext as Client } from "../index.js"; -import type { _SkuInformationList, SkuInformation } from "../../models/models.js"; -import { errorResponseDeserializer, _skuInformationListDeserializer } from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; -import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; -import type { SkusListOptionalParams } from "./options.js"; -import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; - -export function _listSend( - context: Client, - options: SkusListOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus{?api%2Dversion,%24filter}", - { - subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, - "%24filter": options?.filter, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _listDeserialize( - result: PathUncheckedResponse, -): Promise<_SkuInformationList> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return _skuInformationListDeserializer(result.body); -} - -/** List all the available Skus in the region and information related to them */ -export function list( - context: Client, - options: SkusListOptionalParams = { requestOptions: {} }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _listSend(context, options), - _listDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts deleted file mode 100644 index b2213de33fc1..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { OperationOptions } from "@azure-rest/core-client"; - -/** Optional parameters. */ -export interface SkusListOptionalParams extends OperationOptions { - /** Specify $filter='location eq ' to filter on location. */ - filter?: string; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts deleted file mode 100644 index 4ddfa1645112..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { listByElasticSan, $delete, update, create, get } from "./operations.js"; -export { - VolumeGroupsListByElasticSanOptionalParams, - VolumeGroupsDeleteOptionalParams, - VolumeGroupsUpdateOptionalParams, - VolumeGroupsCreateOptionalParams, - VolumeGroupsGetOptionalParams, -} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts deleted file mode 100644 index 910353a23969..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext as Client } from "../index.js"; -import type { VolumeGroup, VolumeGroupUpdate, _VolumeGroupList } from "../../models/models.js"; -import { - errorResponseDeserializer, - volumeGroupSerializer, - volumeGroupDeserializer, - volumeGroupUpdateSerializer, - _volumeGroupListDeserializer, -} from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; -import type { - VolumeGroupsListByElasticSanOptionalParams, - VolumeGroupsDeleteOptionalParams, - VolumeGroupsUpdateOptionalParams, - VolumeGroupsCreateOptionalParams, - VolumeGroupsGetOptionalParams, -} from "./options.js"; -import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -export function _listByElasticSanSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: VolumeGroupsListByElasticSanOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _listByElasticSanDeserialize( - result: PathUncheckedResponse, -): Promise<_VolumeGroupList> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return _volumeGroupListDeserializer(result.body); -} - -/** List VolumeGroups. */ -export function listByElasticSan( - context: Client, - resourceGroupName: string, - elasticSanName: string, - options: VolumeGroupsListByElasticSanOptionalParams = { requestOptions: {} }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _listByElasticSanSend(context, resourceGroupName, elasticSanName, options), - _listByElasticSanDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _$deleteSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options: VolumeGroupsDeleteOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "202", "204"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return; -} - -/** Delete an VolumeGroup. */ -/** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ -export function $delete( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options: VolumeGroupsDeleteOptionalParams = { requestOptions: {} }, -): PollerLike, void> { - return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _$deleteSend(context, resourceGroupName, elasticSanName, volumeGroupName, options), - resourceLocationConfig: "location", - }) as PollerLike, void>; -} - -export function _updateSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options: VolumeGroupsUpdateOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).patch({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: volumeGroupUpdateSerializer(parameters), - }); -} - -export async function _updateDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "202"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return volumeGroupDeserializer(result.body); -} - -/** Update an VolumeGroup. */ -export function update( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options: VolumeGroupsUpdateOptionalParams = { requestOptions: {} }, -): PollerLike, VolumeGroup> { - return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _updateSend(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), - resourceLocationConfig: "location", - }) as PollerLike, VolumeGroup>; -} - -export function _createSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options: VolumeGroupsCreateOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).put({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: volumeGroupSerializer(parameters), - }); -} - -export async function _createDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "201", "202"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return volumeGroupDeserializer(result.body); -} - -/** Create a Volume Group. */ -export function create( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options: VolumeGroupsCreateOptionalParams = { requestOptions: {} }, -): PollerLike, VolumeGroup> { - return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _createSend(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), - resourceLocationConfig: "location", - }) as PollerLike, VolumeGroup>; -} - -export function _getSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options: VolumeGroupsGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _getDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return volumeGroupDeserializer(result.body); -} - -/** Get an VolumeGroups. */ -export async function get( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options: VolumeGroupsGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _getSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - ); - return _getDeserialize(result); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts deleted file mode 100644 index 12d120a9c455..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { OperationOptions } from "@azure-rest/core-client"; - -/** Optional parameters. */ -export interface VolumeGroupsListByElasticSanOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface VolumeGroupsDeleteOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface VolumeGroupsCreateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface VolumeGroupsGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts deleted file mode 100644 index eb2b6e895b40..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { listByVolumeGroup, $delete, create, get } from "./operations.js"; -export { - VolumeSnapshotsListByVolumeGroupOptionalParams, - VolumeSnapshotsDeleteOptionalParams, - VolumeSnapshotsCreateOptionalParams, - VolumeSnapshotsGetOptionalParams, -} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts deleted file mode 100644 index 405e6ac1c7f2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext as Client } from "../index.js"; -import type { Snapshot, _SnapshotList } from "../../models/models.js"; -import { - errorResponseDeserializer, - snapshotSerializer, - snapshotDeserializer, - _snapshotListDeserializer, -} from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; -import type { - VolumeSnapshotsListByVolumeGroupOptionalParams, - VolumeSnapshotsDeleteOptionalParams, - VolumeSnapshotsCreateOptionalParams, - VolumeSnapshotsGetOptionalParams, -} from "./options.js"; -import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -export function _listByVolumeGroupSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options: VolumeSnapshotsListByVolumeGroupOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots{?api%2Dversion,%24filter}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - "api%2Dversion": context.apiVersion, - "%24filter": options?.filter, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _listByVolumeGroupDeserialize( - result: PathUncheckedResponse, -): Promise<_SnapshotList> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return _snapshotListDeserializer(result.body); -} - -/** List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter */ -export function listByVolumeGroup( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options: VolumeSnapshotsListByVolumeGroupOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => - _listByVolumeGroupSend(context, resourceGroupName, elasticSanName, volumeGroupName, options), - _listByVolumeGroupDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _$deleteSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options: VolumeSnapshotsDeleteOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - snapshotName: snapshotName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "202", "204"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return; -} - -/** Delete a Volume Snapshot. */ -/** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ -export function $delete( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options: VolumeSnapshotsDeleteOptionalParams = { requestOptions: {} }, -): PollerLike, void> { - return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _$deleteSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, void>; -} - -export function _createSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options: VolumeSnapshotsCreateOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - snapshotName: snapshotName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).put({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: snapshotSerializer(parameters), - }); -} - -export async function _createDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "201", "202"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return snapshotDeserializer(result.body); -} - -/** Create a Volume Snapshot. */ -export function create( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options: VolumeSnapshotsCreateOptionalParams = { requestOptions: {} }, -): PollerLike, Snapshot> { - return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _createSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, Snapshot>; -} - -export function _getSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options: VolumeSnapshotsGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - snapshotName: snapshotName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _getDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return snapshotDeserializer(result.body); -} - -/** Get a Volume Snapshot. */ -export async function get( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options: VolumeSnapshotsGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _getSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - options, - ); - return _getDeserialize(result); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts deleted file mode 100644 index cc3e99fd0dd9..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { OperationOptions } from "@azure-rest/core-client"; - -/** Optional parameters. */ -export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends OperationOptions { - /** Specify $filter='volumeName eq ' to filter on volume. */ - filter?: string; -} - -/** Optional parameters. */ -export interface VolumeSnapshotsDeleteOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface VolumeSnapshotsCreateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface VolumeSnapshotsGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts deleted file mode 100644 index 5240bc680a08..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { - preRestore, - preBackup, - listByVolumeGroup, - $delete, - update, - create, - get, -} from "./operations.js"; -export { - VolumesPreRestoreOptionalParams, - VolumesPreBackupOptionalParams, - VolumesListByVolumeGroupOptionalParams, - VolumesDeleteOptionalParams, - VolumesUpdateOptionalParams, - VolumesCreateOptionalParams, - VolumesGetOptionalParams, -} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts deleted file mode 100644 index f7a379bdfe6e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts +++ /dev/null @@ -1,521 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext as Client } from "../index.js"; -import type { - Volume, - VolumeUpdate, - _VolumeList, - VolumeNameList, - PreValidationResponse, - DiskSnapshotList, -} from "../../models/models.js"; -import { - errorResponseDeserializer, - volumeSerializer, - volumeDeserializer, - volumeUpdateSerializer, - _volumeListDeserializer, - volumeNameListSerializer, - preValidationResponseDeserializer, - diskSnapshotListSerializer, -} from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; -import type { - VolumesPreRestoreOptionalParams, - VolumesPreBackupOptionalParams, - VolumesListByVolumeGroupOptionalParams, - VolumesDeleteOptionalParams, - VolumesUpdateOptionalParams, - VolumesCreateOptionalParams, - VolumesGetOptionalParams, -} from "./options.js"; -import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -export function _preRestoreSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options: VolumesPreRestoreOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).post({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: diskSnapshotListSerializer(parameters), - }); -} - -export async function _preRestoreDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["202", "200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return preValidationResponseDeserializer(result.body); -} - -/** Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. */ -export function preRestore( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options: VolumesPreRestoreOptionalParams = { requestOptions: {} }, -): PollerLike, PreValidationResponse> { - return getLongRunningPoller(context, _preRestoreDeserialize, ["202", "200"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _preRestoreSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, PreValidationResponse>; -} - -export function _preBackupSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options: VolumesPreBackupOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).post({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: volumeNameListSerializer(parameters), - }); -} - -export async function _preBackupDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["202", "200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return preValidationResponseDeserializer(result.body); -} - -/** Validate whether a disk snapshot backup can be taken for list of volumes. */ -export function preBackup( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options: VolumesPreBackupOptionalParams = { requestOptions: {} }, -): PollerLike, PreValidationResponse> { - return getLongRunningPoller(context, _preBackupDeserialize, ["202", "200"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _preBackupSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, PreValidationResponse>; -} - -export function _listByVolumeGroupSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options: VolumesListByVolumeGroupOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _listByVolumeGroupDeserialize( - result: PathUncheckedResponse, -): Promise<_VolumeList> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return _volumeListDeserializer(result.body); -} - -/** List Volumes in a VolumeGroup. */ -export function listByVolumeGroup( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options: VolumesListByVolumeGroupOptionalParams = { requestOptions: {} }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => - _listByVolumeGroupSend(context, resourceGroupName, elasticSanName, volumeGroupName, options), - _listByVolumeGroupDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _$deleteSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options: VolumesDeleteOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - volumeName: volumeName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).delete({ - ...operationOptionsToRequestParameters(options), - headers: { - ...(options?.xMsDeleteSnapshots !== undefined - ? { "x-ms-delete-snapshots": options?.xMsDeleteSnapshots } - : {}), - ...(options?.xMsForceDelete !== undefined - ? { "x-ms-force-delete": options?.xMsForceDelete } - : {}), - ...options.requestOptions?.headers, - }, - }); -} - -export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "202", "204"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return; -} - -/** Delete an Volume. */ -/** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ -export function $delete( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options: VolumesDeleteOptionalParams = { requestOptions: {} }, -): PollerLike, void> { - return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _$deleteSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, void>; -} - -export function _updateSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options: VolumesUpdateOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - volumeName: volumeName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).patch({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: volumeUpdateSerializer(parameters), - }); -} - -export async function _updateDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "202"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return volumeDeserializer(result.body); -} - -/** Update an Volume. */ -export function update( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options: VolumesUpdateOptionalParams = { requestOptions: {} }, -): PollerLike, Volume> { - return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _updateSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, Volume>; -} - -export function _createSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options: VolumesCreateOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - volumeName: volumeName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).put({ - ...operationOptionsToRequestParameters(options), - contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - body: volumeSerializer(parameters), - }); -} - -export async function _createDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "201", "202"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return volumeDeserializer(result.body); -} - -/** Create a Volume. */ -export function create( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options: VolumesCreateOptionalParams = { requestOptions: {} }, -): PollerLike, Volume> { - return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _createSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, Volume>; -} - -export function _getSend( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options: VolumesGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - const path = expandUrlTemplate( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", - { - subscriptionId: context.subscriptionId, - resourceGroupName: resourceGroupName, - elasticSanName: elasticSanName, - volumeGroupName: volumeGroupName, - volumeName: volumeName, - "api%2Dversion": context.apiVersion, - }, - { - allowReserved: options?.requestOptions?.skipUrlEncoding, - }, - ); - return context.path(path).get({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); -} - -export async function _getDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - const error = createRestError(result); - error.details = errorResponseDeserializer(result.body); - throw error; - } - - return volumeDeserializer(result.body); -} - -/** Get an Volume. */ -export async function get( - context: Client, - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options: VolumesGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _getSend( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - return _getDeserialize(result); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts deleted file mode 100644 index df5e283bb7c8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { XMsDeleteSnapshots, XMsForceDelete } from "../../models/models.js"; -import type { OperationOptions } from "@azure-rest/core-client"; - -/** Optional parameters. */ -export interface VolumesPreRestoreOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface VolumesPreBackupOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface VolumesListByVolumeGroupOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface VolumesDeleteOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** Optional, used to delete snapshots under volume. Allowed value are only true or false. Default value is false. */ - xMsDeleteSnapshots?: XMsDeleteSnapshots; - /** Optional, used to delete volume if active sessions present. Allowed value are only true or false. Default value is false. */ - xMsForceDelete?: XMsForceDelete; -} - -/** Optional parameters. */ -export interface VolumesUpdateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface VolumesCreateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface VolumesGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts deleted file mode 100644 index 9b0789c3dc5c..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; -import { - listBySubscription, - listByResourceGroup, - $delete, - update, - create, - get, -} from "../../api/elasticSans/operations.js"; -import type { - ElasticSansListBySubscriptionOptionalParams, - ElasticSansListByResourceGroupOptionalParams, - ElasticSansDeleteOptionalParams, - ElasticSansUpdateOptionalParams, - ElasticSansCreateOptionalParams, - ElasticSansGetOptionalParams, -} from "../../api/elasticSans/options.js"; -import type { ElasticSan, ElasticSanUpdate } from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -/** Interface representing a ElasticSans operations. */ -export interface ElasticSansOperations { - /** Gets a list of ElasticSans in a subscription */ - listBySubscription: ( - options?: ElasticSansListBySubscriptionOptionalParams, - ) => PagedAsyncIterableIterator; - /** Gets a list of ElasticSan in a resource group. */ - listByResourceGroup: ( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ) => PagedAsyncIterableIterator; - /** Delete a Elastic San. */ - /** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ - delete: ( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ) => PollerLike, void>; - /** Update a Elastic San. */ - update: ( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ) => PollerLike, ElasticSan>; - /** Create ElasticSan. */ - create: ( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ) => PollerLike, ElasticSan>; - /** Get a ElasticSan. */ - get: ( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansGetOptionalParams, - ) => Promise; -} - -function _getElasticSans(context: ElasticSanManagementContext) { - return { - listBySubscription: (options?: ElasticSansListBySubscriptionOptionalParams) => - listBySubscription(context, options), - listByResourceGroup: ( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ) => listByResourceGroup(context, resourceGroupName, options), - delete: ( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ) => $delete(context, resourceGroupName, elasticSanName, options), - update: ( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ) => update(context, resourceGroupName, elasticSanName, parameters, options), - create: ( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ) => create(context, resourceGroupName, elasticSanName, parameters, options), - get: ( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansGetOptionalParams, - ) => get(context, resourceGroupName, elasticSanName, options), - }; -} - -export function _getElasticSansOperations( - context: ElasticSanManagementContext, -): ElasticSansOperations { - return { - ..._getElasticSans(context), - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/index.ts deleted file mode 100644 index 9fe4a49d838b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/classic/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export { ElasticSansOperations } from "./elasticSans/index.js"; -export { OperationsOperations } from "./operations/index.js"; -export { PrivateEndpointConnectionsOperations } from "./privateEndpointConnections/index.js"; -export { PrivateLinkResourcesOperations } from "./privateLinkResources/index.js"; -export { SkusOperations } from "./skus/index.js"; -export { VolumeGroupsOperations } from "./volumeGroups/index.js"; -export { VolumesOperations } from "./volumes/index.js"; -export { VolumeSnapshotsOperations } from "./volumeSnapshots/index.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts deleted file mode 100644 index af7a1bdd4416..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; -import { list } from "../../api/operations/operations.js"; -import type { OperationsListOptionalParams } from "../../api/operations/options.js"; -import type { Operation } from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; - -/** Interface representing a Operations operations. */ -export interface OperationsOperations { - /** List the operations for the provider */ - list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; -} - -function _getOperations(context: ElasticSanManagementContext) { - return { - list: (options?: OperationsListOptionalParams) => list(context, options), - }; -} - -export function _getOperationsOperations( - context: ElasticSanManagementContext, -): OperationsOperations { - return { - ..._getOperations(context), - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts deleted file mode 100644 index cefdcf7e9a67..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; -import { list, $delete, create, get } from "../../api/privateEndpointConnections/operations.js"; -import type { - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsDeleteOptionalParams, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsGetOptionalParams, -} from "../../api/privateEndpointConnections/options.js"; -import type { PrivateEndpointConnection } from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -/** Interface representing a PrivateEndpointConnections operations. */ -export interface PrivateEndpointConnectionsOperations { - /** List all Private Endpoint Connections associated with the Elastic San. */ - list: ( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ) => PagedAsyncIterableIterator; - /** Deletes the specified private endpoint connection associated with the Elastic San */ - /** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ - delete: ( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ) => PollerLike, void>; - /** Update the state of specified private endpoint connection associated with the Elastic San */ - create: ( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ) => PollerLike, PrivateEndpointConnection>; - /** Gets the specified private endpoint connection associated with the Elastic San */ - get: ( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ) => Promise; -} - -function _getPrivateEndpointConnections(context: ElasticSanManagementContext) { - return { - list: ( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ) => list(context, resourceGroupName, elasticSanName, options), - delete: ( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ) => - $delete(context, resourceGroupName, elasticSanName, privateEndpointConnectionName, options), - create: ( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ) => - create( - context, - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - options, - ), - get: ( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ) => get(context, resourceGroupName, elasticSanName, privateEndpointConnectionName, options), - }; -} - -export function _getPrivateEndpointConnectionsOperations( - context: ElasticSanManagementContext, -): PrivateEndpointConnectionsOperations { - return { - ..._getPrivateEndpointConnections(context), - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts deleted file mode 100644 index 8387dbc9c878..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; -import { listByElasticSan } from "../../api/privateLinkResources/operations.js"; -import type { PrivateLinkResourcesListByElasticSanOptionalParams } from "../../api/privateLinkResources/options.js"; -import type { PrivateLinkResourceListResult } from "../../models/models.js"; - -/** Interface representing a PrivateLinkResources operations. */ -export interface PrivateLinkResourcesOperations { - /** Gets the private link resources that need to be created for a elastic San. */ - listByElasticSan: ( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateLinkResourcesListByElasticSanOptionalParams, - ) => Promise; -} - -function _getPrivateLinkResources(context: ElasticSanManagementContext) { - return { - listByElasticSan: ( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateLinkResourcesListByElasticSanOptionalParams, - ) => listByElasticSan(context, resourceGroupName, elasticSanName, options), - }; -} - -export function _getPrivateLinkResourcesOperations( - context: ElasticSanManagementContext, -): PrivateLinkResourcesOperations { - return { - ..._getPrivateLinkResources(context), - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts deleted file mode 100644 index 8796ec7e12b8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; -import { list } from "../../api/skus/operations.js"; -import type { SkusListOptionalParams } from "../../api/skus/options.js"; -import type { SkuInformation } from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; - -/** Interface representing a Skus operations. */ -export interface SkusOperations { - /** List all the available Skus in the region and information related to them */ - list: (options?: SkusListOptionalParams) => PagedAsyncIterableIterator; -} - -function _getSkus(context: ElasticSanManagementContext) { - return { - list: (options?: SkusListOptionalParams) => list(context, options), - }; -} - -export function _getSkusOperations(context: ElasticSanManagementContext): SkusOperations { - return { - ..._getSkus(context), - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts deleted file mode 100644 index c4880caf0c29..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; -import { - listByElasticSan, - $delete, - update, - create, - get, -} from "../../api/volumeGroups/operations.js"; -import type { - VolumeGroupsListByElasticSanOptionalParams, - VolumeGroupsDeleteOptionalParams, - VolumeGroupsUpdateOptionalParams, - VolumeGroupsCreateOptionalParams, - VolumeGroupsGetOptionalParams, -} from "../../api/volumeGroups/options.js"; -import type { VolumeGroup, VolumeGroupUpdate } from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -/** Interface representing a VolumeGroups operations. */ -export interface VolumeGroupsOperations { - /** List VolumeGroups. */ - listByElasticSan: ( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ) => PagedAsyncIterableIterator; - /** Delete an VolumeGroup. */ - /** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ - delete: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ) => PollerLike, void>; - /** Update an VolumeGroup. */ - update: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ) => PollerLike, VolumeGroup>; - /** Create a Volume Group. */ - create: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ) => PollerLike, VolumeGroup>; - /** Get an VolumeGroups. */ - get: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsGetOptionalParams, - ) => Promise; -} - -function _getVolumeGroups(context: ElasticSanManagementContext) { - return { - listByElasticSan: ( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ) => listByElasticSan(context, resourceGroupName, elasticSanName, options), - delete: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ) => $delete(context, resourceGroupName, elasticSanName, volumeGroupName, options), - update: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ) => update(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), - create: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ) => create(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), - get: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsGetOptionalParams, - ) => get(context, resourceGroupName, elasticSanName, volumeGroupName, options), - }; -} - -export function _getVolumeGroupsOperations( - context: ElasticSanManagementContext, -): VolumeGroupsOperations { - return { - ..._getVolumeGroups(context), - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts deleted file mode 100644 index 955835d91e56..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; -import { listByVolumeGroup, $delete, create, get } from "../../api/volumeSnapshots/operations.js"; -import type { - VolumeSnapshotsListByVolumeGroupOptionalParams, - VolumeSnapshotsDeleteOptionalParams, - VolumeSnapshotsCreateOptionalParams, - VolumeSnapshotsGetOptionalParams, -} from "../../api/volumeSnapshots/options.js"; -import type { Snapshot } from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -/** Interface representing a VolumeSnapshots operations. */ -export interface VolumeSnapshotsOperations { - /** List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter */ - listByVolumeGroup: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ) => PagedAsyncIterableIterator; - /** Delete a Volume Snapshot. */ - /** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ - delete: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ) => PollerLike, void>; - /** Create a Volume Snapshot. */ - create: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ) => PollerLike, Snapshot>; - /** Get a Volume Snapshot. */ - get: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsGetOptionalParams, - ) => Promise; -} - -function _getVolumeSnapshots(context: ElasticSanManagementContext) { - return { - listByVolumeGroup: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ) => listByVolumeGroup(context, resourceGroupName, elasticSanName, volumeGroupName, options), - delete: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ) => - $delete(context, resourceGroupName, elasticSanName, volumeGroupName, snapshotName, options), - create: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ) => - create( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - options, - ), - get: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsGetOptionalParams, - ) => get(context, resourceGroupName, elasticSanName, volumeGroupName, snapshotName, options), - }; -} - -export function _getVolumeSnapshotsOperations( - context: ElasticSanManagementContext, -): VolumeSnapshotsOperations { - return { - ..._getVolumeSnapshots(context), - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts deleted file mode 100644 index 04cb5aae383e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; -import { - preRestore, - preBackup, - listByVolumeGroup, - $delete, - update, - create, - get, -} from "../../api/volumes/operations.js"; -import type { - VolumesPreRestoreOptionalParams, - VolumesPreBackupOptionalParams, - VolumesListByVolumeGroupOptionalParams, - VolumesDeleteOptionalParams, - VolumesUpdateOptionalParams, - VolumesCreateOptionalParams, - VolumesGetOptionalParams, -} from "../../api/volumes/options.js"; -import type { - Volume, - VolumeUpdate, - VolumeNameList, - PreValidationResponse, - DiskSnapshotList, -} from "../../models/models.js"; -import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import type { PollerLike, OperationState } from "@azure/core-lro"; - -/** Interface representing a Volumes operations. */ -export interface VolumesOperations { - /** Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. */ - preRestore: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ) => PollerLike, PreValidationResponse>; - /** Validate whether a disk snapshot backup can be taken for list of volumes. */ - preBackup: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ) => PollerLike, PreValidationResponse>; - /** List Volumes in a VolumeGroup. */ - listByVolumeGroup: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ) => PagedAsyncIterableIterator; - /** Delete an Volume. */ - /** - * @fixme delete is a reserved word that cannot be used as an operation name. - * Please add @clientName("clientName") or @clientName("", "javascript") - * to the operation to override the generated name. - */ - delete: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ) => PollerLike, void>; - /** Update an Volume. */ - update: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ) => PollerLike, Volume>; - /** Create a Volume. */ - create: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ) => PollerLike, Volume>; - /** Get an Volume. */ - get: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesGetOptionalParams, - ) => Promise; -} - -function _getVolumes(context: ElasticSanManagementContext) { - return { - preRestore: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ) => - preRestore(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), - preBackup: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ) => - preBackup(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), - listByVolumeGroup: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ) => listByVolumeGroup(context, resourceGroupName, elasticSanName, volumeGroupName, options), - delete: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ) => $delete(context, resourceGroupName, elasticSanName, volumeGroupName, volumeName, options), - update: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ) => - update( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - ), - create: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ) => - create( - context, - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - ), - get: ( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesGetOptionalParams, - ) => get(context, resourceGroupName, elasticSanName, volumeGroupName, volumeName, options), - }; -} - -export function _getVolumesOperations(context: ElasticSanManagementContext): VolumesOperations { - return { - ..._getVolumes(context), - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts index b235466430a8..505273f79c92 100644 --- a/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts +++ b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts @@ -1,76 +1,160 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - ElasticSanManagementContext, - ElasticSanManagementOptionalParams, -} from "./api/index.js"; -import { createElasticSanManagement } from "./api/index.js"; -import type { ElasticSansOperations } from "./classic/elasticSans/index.js"; -import { _getElasticSansOperations } from "./classic/elasticSans/index.js"; -import type { OperationsOperations } from "./classic/operations/index.js"; -import { _getOperationsOperations } from "./classic/operations/index.js"; -import type { PrivateEndpointConnectionsOperations } from "./classic/privateEndpointConnections/index.js"; -import { _getPrivateEndpointConnectionsOperations } from "./classic/privateEndpointConnections/index.js"; -import type { PrivateLinkResourcesOperations } from "./classic/privateLinkResources/index.js"; -import { _getPrivateLinkResourcesOperations } from "./classic/privateLinkResources/index.js"; -import type { SkusOperations } from "./classic/skus/index.js"; -import { _getSkusOperations } from "./classic/skus/index.js"; -import type { VolumeGroupsOperations } from "./classic/volumeGroups/index.js"; -import { _getVolumeGroupsOperations } from "./classic/volumeGroups/index.js"; -import type { VolumeSnapshotsOperations } from "./classic/volumeSnapshots/index.js"; -import { _getVolumeSnapshotsOperations } from "./classic/volumeSnapshots/index.js"; -import type { VolumesOperations } from "./classic/volumes/index.js"; -import { _getVolumesOperations } from "./classic/volumes/index.js"; -import type { TokenCredential } from "@azure/core-auth"; -import type { Pipeline } from "@azure/core-rest-pipeline"; +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. -export { ElasticSanManagementOptionalParams } from "./api/elasticSanManagementContext.js"; +import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import type { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; +import type * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + ElasticSansImpl, + SkusImpl, + PrivateEndpointConnectionsImpl, + PrivateLinkResourcesImpl, + VolumeGroupsImpl, + VolumesImpl, + VolumeSnapshotsImpl, +} from "./operations/index.js"; +import type { + Operations, + ElasticSans, + Skus, + PrivateEndpointConnections, + PrivateLinkResources, + VolumeGroups, + Volumes, + VolumeSnapshots, +} from "./operationsInterfaces/index.js"; +import type { ElasticSanManagementOptionalParams } from "./models/index.js"; -export class ElasticSanManagement { - private _client: ElasticSanManagementContext; - /** The pipeline used by this client to make requests */ - public readonly pipeline: Pipeline; +export class ElasticSanManagement extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; - /** (missing-service-description) Add service description */ + /** + * Initializes a new instance of the ElasticSanManagement class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ constructor( - credential: TokenCredential, + credentials: coreAuth.TokenCredential, subscriptionId: string, - options: ElasticSanManagementOptionalParams = {}, + options?: ElasticSanManagementOptionalParams, ) { - const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; - const userAgentPrefix = prefixFromOptions - ? `${prefixFromOptions} azsdk-js-client` - : `azsdk-js-client`; - this._client = createElasticSanManagement(credential, subscriptionId, { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ElasticSanManagementOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials, + }; + + const packageDetails = `azsdk-js-arm-elasticsan/1.2.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, ...options, - userAgentOptions: { userAgentPrefix }, - }); - this.pipeline = this._client.pipeline; - this.skus = _getSkusOperations(this._client); - this.volumeSnapshots = _getVolumeSnapshotsOperations(this._client); - this.privateLinkResources = _getPrivateLinkResourcesOperations(this._client); - this.volumeGroups = _getVolumeGroupsOperations(this._client); - this.volumes = _getVolumesOperations(this._client); - this.privateEndpointConnections = _getPrivateEndpointConnectionsOperations(this._client); - this.elasticSans = _getElasticSansOperations(this._client); - this.operations = _getOperationsOperations(this._client); + userAgentOptions: { + userAgentPrefix, + }, + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com", + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + }, + }), + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2025-09-01"; + this.operations = new OperationsImpl(this); + this.elasticSans = new ElasticSansImpl(this); + this.skus = new SkusImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.volumeGroups = new VolumeGroupsImpl(this); + this.volumes = new VolumesImpl(this); + this.volumeSnapshots = new VolumeSnapshotsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); } - /** The operation groups for skus */ - public readonly skus: SkusOperations; - /** The operation groups for volumeSnapshots */ - public readonly volumeSnapshots: VolumeSnapshotsOperations; - /** The operation groups for privateLinkResources */ - public readonly privateLinkResources: PrivateLinkResourcesOperations; - /** The operation groups for volumeGroups */ - public readonly volumeGroups: VolumeGroupsOperations; - /** The operation groups for volumes */ - public readonly volumes: VolumesOperations; - /** The operation groups for privateEndpointConnections */ - public readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; - /** The operation groups for elasticSans */ - public readonly elasticSans: ElasticSansOperations; - /** The operation groups for operations */ - public readonly operations: OperationsOperations; + operations: Operations; + elasticSans: ElasticSans; + skus: Skus; + privateEndpointConnections: PrivateEndpointConnections; + privateLinkResources: PrivateLinkResources; + volumeGroups: VolumeGroups; + volumes: Volumes; + volumeSnapshots: VolumeSnapshots; } diff --git a/sdk/elasticsans/arm-elasticsan/src/index.ts b/sdk/elasticsans/arm-elasticsan/src/index.ts index 670685d0cf3a..1cf65868b3c6 100644 --- a/sdk/elasticsans/arm-elasticsan/src/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/index.ts @@ -1,151 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { AzureClouds, AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; -import { - PageSettings, - ContinuablePage, - PagedAsyncIterableIterator, -} from "./static-helpers/pagingHelpers.js"; +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +/// +export { getContinuationToken } from "./pagingHelper.js"; +export * from "./models/index.js"; export { ElasticSanManagement } from "./elasticSanManagement.js"; -export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; -export { - Operation, - OperationDisplay, - KnownOrigin, - Origin, - KnownActionType, - ActionType, - ErrorResponse, - ErrorDetail, - ErrorAdditionalInfo, - ElasticSan, - ElasticSanProperties, - Sku, - KnownSkuName, - SkuName, - KnownSkuTier, - SkuTier, - KnownProvisioningStates, - ProvisioningStates, - PrivateEndpointConnection, - PrivateEndpointConnectionProperties, - PrivateEndpoint, - PrivateLinkServiceConnectionState, - KnownPrivateEndpointServiceConnectionStatus, - PrivateEndpointServiceConnectionStatus, - KnownPublicNetworkAccess, - PublicNetworkAccess, - AutoScaleProperties, - ScaleUpProperties, - KnownAutoScalePolicyEnforcement, - AutoScalePolicyEnforcement, - ProxyResource, - Resource, - SystemData, - KnownCreatedByType, - CreatedByType, - TrackedResource, - ElasticSanUpdate, - ElasticSanUpdateProperties, - Volume, - VolumeProperties, - SourceCreationData, - KnownVolumeCreateOption, - VolumeCreateOption, - IscsiTargetInfo, - KnownOperationalStatus, - OperationalStatus, - ManagedByInfo, - VolumeUpdate, - VolumeUpdateProperties, - VolumeNameList, - PreValidationResponse, - DiskSnapshotList, - VolumeGroup, - Identity, - KnownIdentityType, - IdentityType, - UserAssignedIdentity, - VolumeGroupProperties, - KnownStorageTargetType, - StorageTargetType, - KnownEncryptionType, - EncryptionType, - EncryptionProperties, - KeyVaultProperties, - EncryptionIdentity, - NetworkRuleSet, - VirtualNetworkRule, - KnownAction, - Action, - VolumeGroupUpdate, - VolumeGroupUpdateProperties, - PrivateLinkResourceListResult, - PrivateLinkResource, - PrivateLinkResourceProperties, - Snapshot, - SnapshotProperties, - SnapshotCreationData, - SkuInformation, - SkuLocationInfo, - SKUCapability, - KnownXMsDeleteSnapshots, - XMsDeleteSnapshots, - KnownXMsForceDelete, - XMsForceDelete, - KnownVersions, -} from "./models/index.js"; -export { ElasticSanManagementOptionalParams } from "./api/index.js"; -export { - ElasticSansListBySubscriptionOptionalParams, - ElasticSansListByResourceGroupOptionalParams, - ElasticSansDeleteOptionalParams, - ElasticSansUpdateOptionalParams, - ElasticSansCreateOptionalParams, - ElasticSansGetOptionalParams, -} from "./api/elasticSans/index.js"; -export { OperationsListOptionalParams } from "./api/operations/index.js"; -export { - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsDeleteOptionalParams, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsGetOptionalParams, -} from "./api/privateEndpointConnections/index.js"; -export { PrivateLinkResourcesListByElasticSanOptionalParams } from "./api/privateLinkResources/index.js"; -export { SkusListOptionalParams } from "./api/skus/index.js"; -export { - VolumeGroupsListByElasticSanOptionalParams, - VolumeGroupsDeleteOptionalParams, - VolumeGroupsUpdateOptionalParams, - VolumeGroupsCreateOptionalParams, - VolumeGroupsGetOptionalParams, -} from "./api/volumeGroups/index.js"; -export { - VolumesPreRestoreOptionalParams, - VolumesPreBackupOptionalParams, - VolumesListByVolumeGroupOptionalParams, - VolumesDeleteOptionalParams, - VolumesUpdateOptionalParams, - VolumesCreateOptionalParams, - VolumesGetOptionalParams, -} from "./api/volumes/index.js"; -export { - VolumeSnapshotsListByVolumeGroupOptionalParams, - VolumeSnapshotsDeleteOptionalParams, - VolumeSnapshotsCreateOptionalParams, - VolumeSnapshotsGetOptionalParams, -} from "./api/volumeSnapshots/index.js"; -export { - ElasticSansOperations, - OperationsOperations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - SkusOperations, - VolumeGroupsOperations, - VolumesOperations, - VolumeSnapshotsOperations, -} from "./classic/index.js"; -export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; -export { AzureClouds, AzureSupportedClouds }; +export * from "./operationsInterfaces/index.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/logger.ts b/sdk/elasticsans/arm-elasticsan/src/logger.ts deleted file mode 100644 index cc7e3e30af65..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/logger.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { createClientLogger } from "@azure/logger"; -export const logger = createClientLogger("arm-elasticsan"); diff --git a/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts b/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts new file mode 100644 index 000000000000..064aab0f7c7f --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import type { AbortSignalLike } from "@azure/abort-controller"; +import type { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/models/index.ts b/sdk/elasticsans/arm-elasticsan/src/models/index.ts index c96145b6e392..5928c18d03fa 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/index.ts @@ -1,90 +1,1529 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -export { - Operation, - OperationDisplay, - KnownOrigin, - Origin, - KnownActionType, - ActionType, - ErrorResponse, - ErrorDetail, - ErrorAdditionalInfo, - ElasticSan, - ElasticSanProperties, - Sku, - KnownSkuName, - SkuName, - KnownSkuTier, - SkuTier, - KnownProvisioningStates, - ProvisioningStates, - PrivateEndpointConnection, - PrivateEndpointConnectionProperties, - PrivateEndpoint, - PrivateLinkServiceConnectionState, - KnownPrivateEndpointServiceConnectionStatus, - PrivateEndpointServiceConnectionStatus, - KnownPublicNetworkAccess, - PublicNetworkAccess, - AutoScaleProperties, - ScaleUpProperties, - KnownAutoScalePolicyEnforcement, - AutoScalePolicyEnforcement, - ProxyResource, - Resource, - SystemData, - KnownCreatedByType, - CreatedByType, - TrackedResource, - ElasticSanUpdate, - ElasticSanUpdateProperties, - Volume, - VolumeProperties, - SourceCreationData, - KnownVolumeCreateOption, - VolumeCreateOption, - IscsiTargetInfo, - KnownOperationalStatus, - OperationalStatus, - ManagedByInfo, - VolumeUpdate, - VolumeUpdateProperties, - VolumeNameList, - PreValidationResponse, - DiskSnapshotList, - VolumeGroup, - Identity, - KnownIdentityType, - IdentityType, - UserAssignedIdentity, - VolumeGroupProperties, - KnownStorageTargetType, - StorageTargetType, - KnownEncryptionType, - EncryptionType, - EncryptionProperties, - KeyVaultProperties, - EncryptionIdentity, - NetworkRuleSet, - VirtualNetworkRule, - KnownAction, - Action, - VolumeGroupUpdate, - VolumeGroupUpdateProperties, - PrivateLinkResourceListResult, - PrivateLinkResource, - PrivateLinkResourceProperties, - Snapshot, - SnapshotProperties, - SnapshotCreationData, - SkuInformation, - SkuLocationInfo, - SKUCapability, - KnownXMsDeleteSnapshots, - XMsDeleteSnapshots, - KnownXMsForceDelete, - XMsForceDelete, - KnownVersions, -} from "./models.js"; +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import type * as coreClient from "@azure/core-client"; + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** List of Elastic Sans */ +export interface ElasticSanList { + /** The ElasticSan items on this page */ + value: ElasticSan[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Elastic San response properties. */ +export interface ElasticSanProperties { + /** resource sku */ + sku: Sku; + /** Logical zone for Elastic San resource; example: ["1"]. */ + availabilityZones?: string[]; + /** + * State of the operation on the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB: number; + /** + * Total size of the provisioned Volumes in GiB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalVolumeSizeGiB?: number; + /** + * Total number of volume groups in this Elastic San appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly volumeGroupCount?: number; + /** + * Total Provisioned IOPS of the Elastic San appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalIops?: number; + /** + * Total Provisioned MBps Elastic San appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalMBps?: number; + /** + * Total size of the Elastic San appliance in TB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalSizeTiB?: number; + /** + * The list of Private Endpoint Connections. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Auto Scale Properties for Elastic San Appliance. */ + autoScaleProperties?: AutoScaleProperties; +} + +/** The SKU name. Required for account creation; optional for update. */ +export interface Sku { + /** The sku name. */ + name: SkuName; + /** The sku tier. */ + tier?: SkuTier; +} + +/** Response for PrivateEndpoint connection properties */ +export interface PrivateEndpointConnectionProperties { + /** + * Provisioning State of Private Endpoint connection resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; + /** Private Endpoint resource */ + privateEndpoint?: PrivateEndpoint; + /** Private Link Service Connection State. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** List of resources private endpoint is mapped */ + groupIds?: string[]; +} + +/** Response for PrivateEndpoint */ +export interface PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; +} + +/** Response for Private Link Service Connection state */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** The auto scale settings on Elastic San Appliance. */ +export interface AutoScaleProperties { + /** Scale up settings on Elastic San Appliance. */ + scaleUpProperties?: ScaleUpProperties; +} + +/** Scale up properties on Elastic San Appliance. */ +export interface ScaleUpProperties { + /** Unused size on Elastic San appliance in TiB. */ + unusedSizeTiB?: number; + /** Unit to increase Capacity Unit on Elastic San appliance in TiB. */ + increaseCapacityUnitByTiB?: number; + /** Maximum scale up size on Elastic San appliance in TiB. */ + capacityUnitScaleUpLimitTiB?: number; + /** Enable or Disable scale up setting on Elastic San Appliance. */ + autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; +} + +/** List of SKU Information objects */ +export interface SkuInformationList { + /** + * The SkuInformation items on this page + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value: SkuInformation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** ElasticSAN SKU and its properties */ +export interface SkuInformation { + /** Sku Name */ + name: SkuName; + /** Sku Tier */ + tier?: SkuTier; + /** + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceType?: string; + /** + * The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly locations?: string[]; + /** + * Availability of the SKU for the location/zone + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly locationInfo?: SkuLocationInfo[]; + /** + * The capability information in the specified SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capabilities?: SKUCapability[]; +} + +/** The location info. */ +export interface SkuLocationInfo { + /** + * The location. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly location?: string; + /** + * The zones. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly zones?: string[]; +} + +/** The capability information in the specified SKU. */ +export interface SKUCapability { + /** + * The name of capability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * A string value to indicate states of given capability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: string; +} + +/** Response for ElasticSan update request. */ +export interface ElasticSanUpdate { + /** Properties of ElasticSan. */ + properties?: ElasticSanUpdateProperties; + /** Update tags */ + tags?: { [propertyName: string]: string }; +} + +/** Elastic San update properties. */ +export interface ElasticSanUpdateProperties { + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB?: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB?: number; + /** Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Auto Scale Properties for Elastic San Appliance. */ + autoScaleProperties?: AutoScaleProperties; +} + +/** The response of a PrivateEndpointConnection list operation. */ +export interface PrivateEndpointConnectionListResult { + /** The PrivateEndpointConnection items on this page */ + value: PrivateEndpointConnection[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value: PrivateLinkResource[]; + /** + * URI to fetch the next section of the paginated response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourceProperties { + /** + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +/** List of Volume Groups */ +export interface VolumeGroupList { + /** The VolumeGroup items on this page */ + value: VolumeGroup[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Identity for the resource. */ +export interface Identity { + /** + * The principal ID of resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. */ + type: IdentityType; + /** Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this volume group. The key is the ARM resource identifier of the identity. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** UserAssignedIdentity for the resource. */ +export interface UserAssignedIdentity { + /** + * The principal ID of the identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + +/** VolumeGroup response properties. */ +export interface VolumeGroupProperties { + /** + * State of the operation on the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** Encryption Properties describing Key Vault and Identity information */ + encryptionProperties?: EncryptionProperties; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; + /** + * The list of Private Endpoint Connections. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** A boolean indicating whether or not Data Integrity Check is enabled */ + enforceDataIntegrityCheckForIscsi?: boolean; +} + +/** The encryption settings on the volume group. */ +export interface EncryptionProperties { + /** Properties provided by key vault. */ + keyVaultProperties?: KeyVaultProperties; + /** The identity to be used with service-side encryption at rest. */ + encryptionIdentity?: EncryptionIdentity; +} + +/** Properties of key vault. */ +export interface KeyVaultProperties { + /** The name of KeyVault key. */ + keyName?: string; + /** The version of KeyVault key. */ + keyVersion?: string; + /** The Uri of KeyVault. */ + keyVaultUri?: string; + /** + * The object identifier of the current versioned Key Vault Key in use. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentVersionedKeyIdentifier?: string; + /** + * Timestamp of last rotation of the Key Vault Key. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastKeyRotationTimestamp?: Date; + /** + * This is a read only property that represents the expiration time of the current version of the customer managed key used for encryption. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentVersionedKeyExpirationTimestamp?: Date; +} + +/** Encryption identity for the volume group. */ +export interface EncryptionIdentity { + /** Resource identifier of the UserAssigned identity to be associated with server-side encryption on the volume group. */ + encryptionUserAssignedIdentity?: string; +} + +/** A set of rules governing the network accessibility. */ +export interface NetworkRuleSet { + /** The list of virtual network rules. */ + virtualNetworkRules?: VirtualNetworkRule[]; +} + +/** Virtual Network rule. */ +export interface VirtualNetworkRule { + /** Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. */ + virtualNetworkResourceId: string; + /** The action of virtual network rule. */ + action?: Action; +} + +/** Volume Group request. */ +export interface VolumeGroupUpdate { + /** The identity of the resource. */ + identity?: Identity; + /** Properties of VolumeGroup. */ + properties?: VolumeGroupUpdateProperties; +} + +/** VolumeGroup response properties. */ +export interface VolumeGroupUpdateProperties { + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** Encryption Properties describing Key Vault and Identity information */ + encryptionProperties?: EncryptionProperties; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; + /** A boolean indicating whether or not Data Integrity Check is enabled */ + enforceDataIntegrityCheckForIscsi?: boolean; +} + +/** object to hold array of volume names */ +export interface VolumeNameList { + /** array of volume names */ + volumeNames: string[]; +} + +/** response object for pre validation api */ +export interface PreValidationResponse { + /** a status value indicating success or failure of validation */ + validationStatus?: string; +} + +/** object to hold array of Disk Snapshot ARM IDs */ +export interface DiskSnapshotList { + /** array of DiskSnapshot ARM IDs */ + diskSnapshotIds: string[]; +} + +/** List of Snapshots */ +export interface SnapshotList { + /** The Snapshot items on this page */ + value: Snapshot[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Properties for Snapshot. */ +export interface SnapshotProperties { + /** Data used when creating a volume snapshot. */ + creationData: SnapshotCreationData; + /** + * State of the operation on the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; + /** + * Size of Source Volume + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sourceVolumeSizeGiB?: number; + /** + * Source Volume Name of a snapshot + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly volumeName?: string; +} + +/** Data used when creating a volume snapshot. */ +export interface SnapshotCreationData { + /** Fully qualified resource ID of the volume. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" */ + sourceId: string; +} + +/** List of Volumes */ +export interface VolumeList { + /** The Volume items on this page */ + value: Volume[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Volume response properties. */ +export interface VolumeProperties { + /** + * Unique Id of the volume in GUID format + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly volumeId?: string; + /** State of the operation on the resource. */ + creationData?: SourceCreationData; + /** Volume size. */ + sizeGiB: number; + /** + * Storage target information + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly storageTarget?: IscsiTargetInfo; + /** Parent resource information. */ + managedBy?: ManagedByInfo; + /** + * State of the operation on the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; +} + +/** Data source used when creating the volume. */ +export interface SourceCreationData { + /** This enumerates the possible sources of a volume creation. */ + createSource?: VolumeCreateOption; + /** Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ + sourceId?: string; +} + +/** Iscsi target information */ +export interface IscsiTargetInfo { + /** + * iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetIqn?: string; + /** + * iSCSI Target Portal Host Name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetPortalHostname?: string; + /** + * iSCSI Target Portal Port + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetPortalPort?: number; + /** + * State of the operation on the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; + /** Operational status of the iSCSI Target. */ + status?: OperationalStatus; +} + +/** Parent resource information. */ +export interface ManagedByInfo { + /** Resource ID of the resource managing the volume, this is a restricted field and can only be set for internal use. */ + resourceId?: string; +} + +/** Response for Volume request. */ +export interface VolumeUpdate { + /** Properties of Volume. */ + properties?: VolumeUpdateProperties; +} + +/** Volume response properties. */ +export interface VolumeUpdateProperties { + /** Volume size. */ + sizeGiB?: number; + /** Parent resource information. */ + managedBy?: ManagedByInfo; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** A private link resource */ +export interface PrivateLinkResource extends Resource { + /** Resource properties. */ + properties?: PrivateLinkResourceProperties; +} + +/** Response for PrivateEndpoint Connection object */ +export interface PrivateEndpointConnection extends ProxyResource { + /** Private Endpoint Connection Properties. */ + properties: PrivateEndpointConnectionProperties; +} + +/** Response for Volume Group request. */ +export interface VolumeGroup extends ProxyResource { + /** The identity of the resource. */ + identity?: Identity; + /** Properties of VolumeGroup. */ + properties?: VolumeGroupProperties; +} + +/** Response for Volume Snapshot request. */ +export interface Snapshot extends ProxyResource { + /** Properties of Volume Snapshot. */ + properties: SnapshotProperties; +} + +/** Response for Volume request. */ +export interface Volume extends ProxyResource { + /** Properties of Volume. */ + properties: VolumeProperties; +} + +/** Response for ElasticSan request. */ +export interface ElasticSan extends TrackedResource { + /** Properties of ElasticSan. */ + properties: ElasticSanProperties; +} + +/** Defines headers for ElasticSans_create operation. */ +export interface ElasticSansCreateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for ElasticSans_update operation. */ +export interface ElasticSansUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for ElasticSans_delete operation. */ +export interface ElasticSansDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for PrivateEndpointConnections_create operation. */ +export interface PrivateEndpointConnectionsCreateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for PrivateEndpointConnections_delete operation. */ +export interface PrivateEndpointConnectionsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VolumeGroups_create operation. */ +export interface VolumeGroupsCreateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VolumeGroups_update operation. */ +export interface VolumeGroupsUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VolumeGroups_delete operation. */ +export interface VolumeGroupsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Volumes_preBackup operation. */ +export interface VolumesPreBackupHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Volumes_preRestore operation. */ +export interface VolumesPreRestoreHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Volumes_create operation. */ +export interface VolumesCreateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Volumes_update operation. */ +export interface VolumesUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Volumes_delete operation. */ +export interface VolumesDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VolumeSnapshots_create operation. */ +export interface VolumeSnapshotsCreateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VolumeSnapshots_delete operation. */ +export interface VolumeSnapshotsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system", +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal", +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + /** Premium locally redundant storage */ + PremiumLRS = "Premium_LRS", + /** Premium zone redundant storage */ + PremiumZRS = "Premium_ZRS", +} + +/** + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Premium_LRS**: Premium locally redundant storage \ + * **Premium_ZRS**: Premium zone redundant storage + */ +export type SkuName = string; + +/** Known values of {@link SkuTier} that the service accepts. */ +export enum KnownSkuTier { + /** Premium Tier */ + Premium = "Premium", +} + +/** + * Defines values for SkuTier. \ + * {@link KnownSkuTier} can be used interchangeably with SkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Premium**: Premium Tier + */ +export type SkuTier = string; + +/** Known values of {@link ProvisioningStates} that the service accepts. */ +export enum KnownProvisioningStates { + /** Invalid */ + Invalid = "Invalid", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Pending */ + Pending = "Pending", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", + /** Deleted */ + Deleted = "Deleted", + /** Restoring */ + Restoring = "Restoring", +} + +/** + * Defines values for ProvisioningStates. \ + * {@link KnownProvisioningStates} can be used interchangeably with ProvisioningStates, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Pending** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Deleted** \ + * **Restoring** + */ +export type ProvisioningStates = string; + +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Failed */ + Failed = "Failed", + /** Rejected */ + Rejected = "Rejected", +} + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Failed** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type PublicNetworkAccess = string; + +/** Known values of {@link AutoScalePolicyEnforcement} that the service accepts. */ +export enum KnownAutoScalePolicyEnforcement { + /** None */ + None = "None", + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * Defines values for AutoScalePolicyEnforcement. \ + * {@link KnownAutoScalePolicyEnforcement} can be used interchangeably with AutoScalePolicyEnforcement, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Enabled** \ + * **Disabled** + */ +export type AutoScalePolicyEnforcement = string; + +/** Known values of {@link IdentityType} that the service accepts. */ +export enum KnownIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", +} + +/** + * Defines values for IdentityType. \ + * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** + */ +export type IdentityType = string; + +/** Known values of {@link StorageTargetType} that the service accepts. */ +export enum KnownStorageTargetType { + /** Iscsi */ + Iscsi = "Iscsi", + /** None */ + None = "None", +} + +/** + * Defines values for StorageTargetType. \ + * {@link KnownStorageTargetType} can be used interchangeably with StorageTargetType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Iscsi** \ + * **None** + */ +export type StorageTargetType = string; + +/** Known values of {@link EncryptionType} that the service accepts. */ +export enum KnownEncryptionType { + /** Volume is encrypted at rest with Platform managed key. It is the default encryption type. */ + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", + /** Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ + EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", +} + +/** + * Defines values for EncryptionType. \ + * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptionAtRestWithPlatformKey**: Volume is encrypted at rest with Platform managed key. It is the default encryption type. \ + * **EncryptionAtRestWithCustomerManagedKey**: Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. + */ +export type EncryptionType = string; + +/** Known values of {@link Action} that the service accepts. */ +export enum KnownAction { + /** Allow */ + Allow = "Allow", +} + +/** + * Defines values for Action. \ + * {@link KnownAction} can be used interchangeably with Action, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** + */ +export type Action = string; + +/** Known values of {@link VolumeCreateOption} that the service accepts. */ +export enum KnownVolumeCreateOption { + /** None */ + None = "None", + /** VolumeSnapshot */ + VolumeSnapshot = "VolumeSnapshot", + /** DiskSnapshot */ + DiskSnapshot = "DiskSnapshot", + /** Disk */ + Disk = "Disk", + /** DiskRestorePoint */ + DiskRestorePoint = "DiskRestorePoint", +} + +/** + * Defines values for VolumeCreateOption. \ + * {@link KnownVolumeCreateOption} can be used interchangeably with VolumeCreateOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **VolumeSnapshot** \ + * **DiskSnapshot** \ + * **Disk** \ + * **DiskRestorePoint** + */ +export type VolumeCreateOption = string; + +/** Known values of {@link OperationalStatus} that the service accepts. */ +export enum KnownOperationalStatus { + /** Invalid */ + Invalid = "Invalid", + /** Unknown */ + Unknown = "Unknown", + /** Healthy */ + Healthy = "Healthy", + /** Unhealthy */ + Unhealthy = "Unhealthy", + /** Updating */ + Updating = "Updating", + /** Running */ + Running = "Running", + /** Stopped */ + Stopped = "Stopped", + /** StoppedDeallocated */ + StoppedDeallocated = "Stopped (deallocated)", +} + +/** + * Defines values for OperationalStatus. \ + * {@link KnownOperationalStatus} can be used interchangeably with OperationalStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Unknown** \ + * **Healthy** \ + * **Unhealthy** \ + * **Updating** \ + * **Running** \ + * **Stopped** \ + * **Stopped (deallocated)** + */ +export type OperationalStatus = string; + +/** Known values of {@link XMsDeleteSnapshots} that the service accepts. */ +export enum KnownXMsDeleteSnapshots { + /** True */ + True = "true", + /** False */ + False = "false", +} + +/** + * Defines values for XMsDeleteSnapshots. \ + * {@link KnownXMsDeleteSnapshots} can be used interchangeably with XMsDeleteSnapshots, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type XMsDeleteSnapshots = string; + +/** Known values of {@link XMsForceDelete} that the service accepts. */ +export enum KnownXMsForceDelete { + /** True */ + True = "true", + /** False */ + False = "false", +} + +/** + * Defines values for XMsForceDelete. \ + * {@link KnownXMsForceDelete} can be used interchangeably with XMsForceDelete, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type XMsForceDelete = string; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface ElasticSansListBySubscriptionOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type ElasticSansListBySubscriptionResponse = ElasticSanList; + +/** Optional parameters. */ +export interface ElasticSansListByResourceGroupOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ElasticSansListByResourceGroupResponse = ElasticSanList; + +/** Optional parameters. */ +export interface ElasticSansGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ElasticSansGetResponse = ElasticSan; + +/** Optional parameters. */ +export interface ElasticSansCreateOptionalParams 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 ElasticSansCreateResponse = ElasticSan; + +/** Optional parameters. */ +export interface ElasticSansUpdateOptionalParams 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 ElasticSansUpdateResponse = ElasticSan; + +/** Optional parameters. */ +export interface ElasticSansDeleteOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ElasticSansListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ElasticSansListBySubscriptionNextResponse = ElasticSanList; + +/** Optional parameters. */ +export interface ElasticSansListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ElasticSansListByResourceGroupNextResponse = ElasticSanList; + +/** Optional parameters. */ +export interface SkusListOptionalParams extends coreClient.OperationOptions { + /** Specify $filter='location eq ' to filter on location. */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type SkusListResponse = SkuInformationList; + +/** Optional parameters. */ +export interface SkusListNextOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SkusListNextResponse = SkuInformationList; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOptionalParams + 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 PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByElasticSanOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByElasticSan operation. */ +export type PrivateLinkResourcesListByElasticSanResponse = PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface VolumeGroupsListByElasticSanOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listByElasticSan operation. */ +export type VolumeGroupsListByElasticSanResponse = VolumeGroupList; + +/** Optional parameters. */ +export interface VolumeGroupsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VolumeGroupsGetResponse = VolumeGroup; + +/** Optional parameters. */ +export interface VolumeGroupsCreateOptionalParams 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 VolumeGroupsCreateResponse = VolumeGroup; + +/** Optional parameters. */ +export interface VolumeGroupsUpdateOptionalParams 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 VolumeGroupsUpdateResponse = VolumeGroup; + +/** Optional parameters. */ +export interface VolumeGroupsDeleteOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface VolumeGroupsListByElasticSanNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByElasticSanNext operation. */ +export type VolumeGroupsListByElasticSanNextResponse = VolumeGroupList; + +/** Optional parameters. */ +export interface VolumesPreBackupOptionalParams 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 preBackup operation. */ +export type VolumesPreBackupResponse = PreValidationResponse; + +/** Optional parameters. */ +export interface VolumesPreRestoreOptionalParams 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 preRestore operation. */ +export type VolumesPreRestoreResponse = PreValidationResponse; + +/** Optional parameters. */ +export interface VolumesListByVolumeGroupOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listByVolumeGroup operation. */ +export type VolumesListByVolumeGroupResponse = VolumeList; + +/** Optional parameters. */ +export interface VolumesGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VolumesGetResponse = Volume; + +/** Optional parameters. */ +export interface VolumesCreateOptionalParams 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 VolumesCreateResponse = Volume; + +/** Optional parameters. */ +export interface VolumesUpdateOptionalParams 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 VolumesUpdateResponse = Volume; + +/** Optional parameters. */ +export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { + /** Optional, used to delete snapshots under volume. Allowed value are only true or false. Default value is false. */ + xMsDeleteSnapshots?: XMsDeleteSnapshots; + /** Optional, used to delete volume if active sessions present. Allowed value are only true or false. Default value is false. */ + xMsForceDelete?: XMsForceDelete; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface VolumesListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listByVolumeGroupNext operation. */ +export type VolumesListByVolumeGroupNextResponse = VolumeList; + +/** Optional parameters. */ +export interface VolumeSnapshotsListByVolumeGroupOptionalParams + extends coreClient.OperationOptions { + /** Specify $filter='volumeName eq ' to filter on volume. */ + filter?: string; +} + +/** Contains response data for the listByVolumeGroup operation. */ +export type VolumeSnapshotsListByVolumeGroupResponse = SnapshotList; + +/** Optional parameters. */ +export interface VolumeSnapshotsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VolumeSnapshotsGetResponse = Snapshot; + +/** Optional parameters. */ +export interface VolumeSnapshotsCreateOptionalParams 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 VolumeSnapshotsCreateResponse = Snapshot; + +/** Optional parameters. */ +export interface VolumeSnapshotsDeleteOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface VolumeSnapshotsListByVolumeGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVolumeGroupNext operation. */ +export type VolumeSnapshotsListByVolumeGroupNextResponse = SnapshotList; + +/** Optional parameters. */ +export interface ElasticSanManagementOptionalParams extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts new file mode 100644 index 000000000000..6f00feed2b46 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts @@ -0,0 +1,2024 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type * as coreClient from "@azure/core-client"; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean", + }, + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay", + }, + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String", + }, + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String", + }, + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String", + }, + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, + }, + }, + }, +}; + +export const ElasticSanList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ElasticSan", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ElasticSanProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanProperties", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + availabilityZones: { + serializedName: "availabilityZones", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + baseSizeTiB: { + serializedName: "baseSizeTiB", + required: true, + type: { + name: "Number", + }, + }, + extendedCapacitySizeTiB: { + serializedName: "extendedCapacitySizeTiB", + required: true, + type: { + name: "Number", + }, + }, + totalVolumeSizeGiB: { + serializedName: "totalVolumeSizeGiB", + readOnly: true, + type: { + name: "Number", + }, + }, + volumeGroupCount: { + serializedName: "volumeGroupCount", + readOnly: true, + type: { + name: "Number", + }, + }, + totalIops: { + serializedName: "totalIops", + readOnly: true, + type: { + name: "Number", + }, + }, + totalMBps: { + serializedName: "totalMBps", + readOnly: true, + type: { + name: "Number", + }, + }, + totalSizeTiB: { + serializedName: "totalSizeTiB", + readOnly: true, + type: { + name: "Number", + }, + }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + }, + }, + }, + }, + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + type: { + name: "String", + }, + }, + autoScaleProperties: { + serializedName: "autoScaleProperties", + type: { + name: "Composite", + className: "AutoScaleProperties", + }, + }, + }, + }, +}; + +export const Sku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + tier: { + serializedName: "tier", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + privateEndpoint: { + serializedName: "privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint", + }, + }, + privateLinkServiceConnectionState: { + serializedName: "privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + }, + }, + groupIds: { + serializedName: "groupIds", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + type: { + name: "String", + }, + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + }, + }, +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const AutoScaleProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoScaleProperties", + modelProperties: { + scaleUpProperties: { + serializedName: "scaleUpProperties", + type: { + name: "Composite", + className: "ScaleUpProperties", + }, + }, + }, + }, +}; + +export const ScaleUpProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScaleUpProperties", + modelProperties: { + unusedSizeTiB: { + serializedName: "unusedSizeTiB", + type: { + name: "Number", + }, + }, + increaseCapacityUnitByTiB: { + serializedName: "increaseCapacityUnitByTiB", + type: { + name: "Number", + }, + }, + capacityUnitScaleUpLimitTiB: { + serializedName: "capacityUnitScaleUpLimitTiB", + type: { + name: "Number", + }, + }, + autoScalePolicyEnforcement: { + serializedName: "autoScalePolicyEnforcement", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SkuInformationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuInformationList", + modelProperties: { + value: { + serializedName: "value", + required: true, + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuInformation", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SkuInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuInformation", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + tier: { + serializedName: "tier", + type: { + name: "String", + }, + }, + resourceType: { + serializedName: "resourceType", + readOnly: true, + type: { + name: "String", + }, + }, + locations: { + serializedName: "locations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + locationInfo: { + serializedName: "locationInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuLocationInfo", + }, + }, + }, + }, + capabilities: { + serializedName: "capabilities", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SKUCapability", + }, + }, + }, + }, + }, + }, +}; + +export const SkuLocationInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuLocationInfo", + modelProperties: { + location: { + serializedName: "location", + readOnly: true, + type: { + name: "String", + }, + }, + zones: { + serializedName: "zones", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const SKUCapability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SKUCapability", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ElasticSanUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanUpdate", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ElasticSanUpdateProperties", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const ElasticSanUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanUpdateProperties", + modelProperties: { + baseSizeTiB: { + serializedName: "baseSizeTiB", + type: { + name: "Number", + }, + }, + extendedCapacitySizeTiB: { + serializedName: "extendedCapacitySizeTiB", + type: { + name: "Number", + }, + }, + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + type: { + name: "String", + }, + }, + autoScaleProperties: { + serializedName: "autoScaleProperties", + type: { + name: "Composite", + className: "AutoScaleProperties", + }, + }, + }, + }, +}; + +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceProperties", + modelProperties: { + groupId: { + serializedName: "groupId", + readOnly: true, + type: { + name: "String", + }, + }, + requiredMembers: { + serializedName: "requiredMembers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + requiredZoneNames: { + serializedName: "requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const VolumeGroupList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VolumeGroup", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Identity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String", + }, + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String", + }, + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" }, + }, + }, + }, + }, + }, +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String", + }, + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const VolumeGroupProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + protocolType: { + serializedName: "protocolType", + type: { + name: "String", + }, + }, + encryption: { + serializedName: "encryption", + type: { + name: "String", + }, + }, + encryptionProperties: { + serializedName: "encryptionProperties", + type: { + name: "Composite", + className: "EncryptionProperties", + }, + }, + networkAcls: { + serializedName: "networkAcls", + type: { + name: "Composite", + className: "NetworkRuleSet", + }, + }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + }, + }, + }, + }, + enforceDataIntegrityCheckForIscsi: { + serializedName: "enforceDataIntegrityCheckForIscsi", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const EncryptionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EncryptionProperties", + modelProperties: { + keyVaultProperties: { + serializedName: "keyVaultProperties", + type: { + name: "Composite", + className: "KeyVaultProperties", + }, + }, + encryptionIdentity: { + serializedName: "identity", + type: { + name: "Composite", + className: "EncryptionIdentity", + }, + }, + }, + }, +}; + +export const KeyVaultProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyVaultProperties", + modelProperties: { + keyName: { + serializedName: "keyName", + type: { + name: "String", + }, + }, + keyVersion: { + serializedName: "keyVersion", + type: { + name: "String", + }, + }, + keyVaultUri: { + serializedName: "keyVaultUri", + type: { + name: "String", + }, + }, + currentVersionedKeyIdentifier: { + serializedName: "currentVersionedKeyIdentifier", + readOnly: true, + type: { + name: "String", + }, + }, + lastKeyRotationTimestamp: { + serializedName: "lastKeyRotationTimestamp", + readOnly: true, + type: { + name: "DateTime", + }, + }, + currentVersionedKeyExpirationTimestamp: { + serializedName: "currentVersionedKeyExpirationTimestamp", + readOnly: true, + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const EncryptionIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EncryptionIdentity", + modelProperties: { + encryptionUserAssignedIdentity: { + serializedName: "userAssignedIdentity", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const NetworkRuleSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkRuleSet", + modelProperties: { + virtualNetworkRules: { + serializedName: "virtualNetworkRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetworkRule", + }, + }, + }, + }, + }, + }, +}; + +export const VirtualNetworkRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworkRule", + modelProperties: { + virtualNetworkResourceId: { + serializedName: "id", + required: true, + type: { + name: "String", + }, + }, + action: { + defaultValue: "Allow", + serializedName: "action", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const VolumeGroupUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupUpdate", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "VolumeGroupUpdateProperties", + }, + }, + }, + }, +}; + +export const VolumeGroupUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupUpdateProperties", + modelProperties: { + protocolType: { + serializedName: "protocolType", + type: { + name: "String", + }, + }, + encryption: { + serializedName: "encryption", + type: { + name: "String", + }, + }, + encryptionProperties: { + serializedName: "encryptionProperties", + type: { + name: "Composite", + className: "EncryptionProperties", + }, + }, + networkAcls: { + serializedName: "networkAcls", + type: { + name: "Composite", + className: "NetworkRuleSet", + }, + }, + enforceDataIntegrityCheckForIscsi: { + serializedName: "enforceDataIntegrityCheckForIscsi", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const VolumeNameList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeNameList", + modelProperties: { + volumeNames: { + serializedName: "volumeNames", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const PreValidationResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PreValidationResponse", + modelProperties: { + validationStatus: { + serializedName: "validationStatus", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskSnapshotList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskSnapshotList", + modelProperties: { + diskSnapshotIds: { + serializedName: "diskSnapshotIds", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const SnapshotList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Snapshot", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SnapshotProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotProperties", + modelProperties: { + creationData: { + serializedName: "creationData", + type: { + name: "Composite", + className: "SnapshotCreationData", + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + sourceVolumeSizeGiB: { + serializedName: "sourceVolumeSizeGiB", + readOnly: true, + type: { + name: "Number", + }, + }, + volumeName: { + serializedName: "volumeName", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SnapshotCreationData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotCreationData", + modelProperties: { + sourceId: { + serializedName: "sourceId", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const VolumeList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Volume", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const VolumeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeProperties", + modelProperties: { + volumeId: { + serializedName: "volumeId", + readOnly: true, + type: { + name: "String", + }, + }, + creationData: { + serializedName: "creationData", + type: { + name: "Composite", + className: "SourceCreationData", + }, + }, + sizeGiB: { + serializedName: "sizeGiB", + required: true, + type: { + name: "Number", + }, + }, + storageTarget: { + serializedName: "storageTarget", + type: { + name: "Composite", + className: "IscsiTargetInfo", + }, + }, + managedBy: { + serializedName: "managedBy", + type: { + name: "Composite", + className: "ManagedByInfo", + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SourceCreationData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SourceCreationData", + modelProperties: { + createSource: { + serializedName: "createSource", + type: { + name: "String", + }, + }, + sourceId: { + serializedName: "sourceId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const IscsiTargetInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IscsiTargetInfo", + modelProperties: { + targetIqn: { + serializedName: "targetIqn", + readOnly: true, + type: { + name: "String", + }, + }, + targetPortalHostname: { + serializedName: "targetPortalHostname", + readOnly: true, + type: { + name: "String", + }, + }, + targetPortalPort: { + serializedName: "targetPortalPort", + readOnly: true, + type: { + name: "Number", + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ManagedByInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedByInfo", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const VolumeUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeUpdate", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "VolumeUpdateProperties", + }, + }, + }, + }, +}; + +export const VolumeUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeUpdateProperties", + modelProperties: { + sizeGiB: { + serializedName: "sizeGiB", + type: { + name: "Number", + }, + }, + managedBy: { + serializedName: "managedBy", + type: { + name: "Composite", + className: "ManagedByInfo", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...Resource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateLinkResourceProperties", + }, + }, + }, + }, +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties", + }, + }, + }, + }, +}; + +export const VolumeGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroup", + modelProperties: { + ...ProxyResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "VolumeGroupProperties", + }, + }, + }, + }, +}; + +export const Snapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Snapshot", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "SnapshotProperties", + }, + }, + }, + }, +}; + +export const Volume: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Volume", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "VolumeProperties", + }, + }, + }, + }, +}; + +export const ElasticSan: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSan", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ElasticSanProperties", + }, + }, + }, + }, +}; + +export const ElasticSansCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSansCreateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ElasticSansUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSansUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ElasticSansDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSansDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const PrivateEndpointConnectionsCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionsCreateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumeGroupsCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupsCreateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumeGroupsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumeGroupsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumesPreBackupHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesPreBackupHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumesPreRestoreHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesPreRestoreHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumesCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesCreateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumeSnapshotsCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeSnapshotsCreateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VolumeSnapshotsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeSnapshotsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/models/models.ts b/sdk/elasticsans/arm-elasticsan/src/models/models.ts deleted file mode 100644 index 5d6e51ea44e8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/models/models.ts +++ /dev/null @@ -1,1830 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface _OperationListResult { - /** The Operation items on this page */ - value: Operation[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _operationListResultDeserializer(item: any): _OperationListResult { - return { - value: operationArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function operationArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return operationDeserializer(item); - }); -} - -/** Details of a REST API operation, returned from the Resource Provider Operations API */ -export interface Operation { - /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ - readonly name?: string; - /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ - display?: OperationDisplay; - /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ - readonly origin?: Origin; - /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - readonly actionType?: ActionType; -} - -export function operationDeserializer(item: any): Operation { - return { - name: item["name"], - isDataAction: item["isDataAction"], - display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), - origin: item["origin"], - actionType: item["actionType"], - }; -} - -/** Localized display information for and operation. */ -export interface OperationDisplay { - /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ - readonly provider?: string; - /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ - readonly resource?: string; - /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ - readonly operation?: string; - /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ - readonly description?: string; -} - -export function operationDisplayDeserializer(item: any): OperationDisplay { - return { - provider: item["provider"], - resource: item["resource"], - operation: item["operation"], - description: item["description"], - }; -} - -/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ -export enum KnownOrigin { - /** Indicates the operation is initiated by a user. */ - User = "user", - /** Indicates the operation is initiated by a system. */ - System = "system", - /** Indicates the operation is initiated by a user or system. */ - UserSystem = "user,system", -} - -/** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user**: Indicates the operation is initiated by a user. \ - * **system**: Indicates the operation is initiated by a system. \ - * **user,system**: Indicates the operation is initiated by a user or system. - */ -export type Origin = string; - -/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ -export enum KnownActionType { - /** Actions are for internal-only APIs. */ - Internal = "Internal", -} - -/** - * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ - * {@link KnownActionType} can be used interchangeably with ActionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Internal**: Actions are for internal-only APIs. - */ -export type ActionType = string; - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -export function errorResponseDeserializer(item: any): ErrorResponse { - return { - error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), - }; -} - -/** The error detail. */ -export interface ErrorDetail { - /** The error code. */ - readonly code?: string; - /** The error message. */ - readonly message?: string; - /** The error target. */ - readonly target?: string; - /** The error details. */ - readonly details?: ErrorDetail[]; - /** The error additional info. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -export function errorDetailDeserializer(item: any): ErrorDetail { - return { - code: item["code"], - message: item["message"], - target: item["target"], - details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), - additionalInfo: !item["additionalInfo"] - ? item["additionalInfo"] - : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), - }; -} - -export function errorDetailArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return errorDetailDeserializer(item); - }); -} - -export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return errorAdditionalInfoDeserializer(item); - }); -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** The additional info type. */ - readonly type?: string; - /** The additional info. */ - readonly info?: any; -} - -export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { - return { - type: item["type"], - info: item["info"], - }; -} - -/** Response for ElasticSan request. */ -export interface ElasticSan extends TrackedResource { - /** Properties of ElasticSan. */ - properties: ElasticSanProperties; -} - -export function elasticSanSerializer(item: ElasticSan): any { - return { - tags: item["tags"], - location: item["location"], - properties: elasticSanPropertiesSerializer(item["properties"]), - }; -} - -export function elasticSanDeserializer(item: any): ElasticSan { - return { - tags: item["tags"], - location: item["location"], - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: elasticSanPropertiesDeserializer(item["properties"]), - }; -} - -/** Elastic San response properties. */ -export interface ElasticSanProperties { - /** resource sku */ - sku: Sku; - /** Logical zone for Elastic San resource; example: ["1"]. */ - availabilityZones?: string[]; - /** State of the operation on the resource. */ - readonly provisioningState?: ProvisioningStates; - /** Base size of the Elastic San appliance in TiB. */ - baseSizeTiB: number; - /** Extended size of the Elastic San appliance in TiB. */ - extendedCapacitySizeTiB: number; - /** Total size of the provisioned Volumes in GiB. */ - readonly totalVolumeSizeGiB?: number; - /** Total number of volume groups in this Elastic San appliance. */ - readonly volumeGroupCount?: number; - /** Total Provisioned IOPS of the Elastic San appliance. */ - readonly totalIops?: number; - /** Total Provisioned MBps Elastic San appliance. */ - readonly totalMBps?: number; - /** Total size of the Elastic San appliance in TB. */ - readonly totalSizeTiB?: number; - /** The list of Private Endpoint Connections. */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Auto Scale Properties for Elastic San Appliance. */ - autoScaleProperties?: AutoScaleProperties; -} - -export function elasticSanPropertiesSerializer(item: ElasticSanProperties): any { - return { - sku: skuSerializer(item["sku"]), - availabilityZones: !item["availabilityZones"] - ? item["availabilityZones"] - : item["availabilityZones"].map((p: any) => { - return p; - }), - baseSizeTiB: item["baseSizeTiB"], - extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], - publicNetworkAccess: item["publicNetworkAccess"], - autoScaleProperties: !item["autoScaleProperties"] - ? item["autoScaleProperties"] - : autoScalePropertiesSerializer(item["autoScaleProperties"]), - }; -} - -export function elasticSanPropertiesDeserializer(item: any): ElasticSanProperties { - return { - sku: skuDeserializer(item["sku"]), - availabilityZones: !item["availabilityZones"] - ? item["availabilityZones"] - : item["availabilityZones"].map((p: any) => { - return p; - }), - provisioningState: item["provisioningState"], - baseSizeTiB: item["baseSizeTiB"], - extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], - totalVolumeSizeGiB: item["totalVolumeSizeGiB"], - volumeGroupCount: item["volumeGroupCount"], - totalIops: item["totalIops"], - totalMBps: item["totalMBps"], - totalSizeTiB: item["totalSizeTiB"], - privateEndpointConnections: !item["privateEndpointConnections"] - ? item["privateEndpointConnections"] - : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), - publicNetworkAccess: item["publicNetworkAccess"], - autoScaleProperties: !item["autoScaleProperties"] - ? item["autoScaleProperties"] - : autoScalePropertiesDeserializer(item["autoScaleProperties"]), - }; -} - -/** The SKU name. Required for account creation; optional for update. */ -export interface Sku { - /** The sku name. */ - name: SkuName; - /** The sku tier. */ - tier?: SkuTier; -} - -export function skuSerializer(item: Sku): any { - return { name: item["name"], tier: item["tier"] }; -} - -export function skuDeserializer(item: any): Sku { - return { - name: item["name"], - tier: item["tier"], - }; -} - -/** The sku name. */ -export enum KnownSkuName { - /** Premium locally redundant storage */ - PremiumLRS = "Premium_LRS", - /** Premium zone redundant storage */ - PremiumZRS = "Premium_ZRS", -} - -/** - * The sku name. \ - * {@link KnownSkuName} can be used interchangeably with SkuName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Premium_LRS**: Premium locally redundant storage \ - * **Premium_ZRS**: Premium zone redundant storage - */ -export type SkuName = string; - -/** The sku tier. */ -export enum KnownSkuTier { - /** Premium Tier */ - Premium = "Premium", -} - -/** - * The sku tier. \ - * {@link KnownSkuTier} can be used interchangeably with SkuTier, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Premium**: Premium Tier - */ -export type SkuTier = string; - -/** Provisioning state of the iSCSI Target. */ -export enum KnownProvisioningStates { - /** Invalid */ - Invalid = "Invalid", - /** Succeeded */ - Succeeded = "Succeeded", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled", - /** Pending */ - Pending = "Pending", - /** Creating */ - Creating = "Creating", - /** Updating */ - Updating = "Updating", - /** Deleting */ - Deleting = "Deleting", - /** Deleted */ - Deleted = "Deleted", - /** Restoring */ - Restoring = "Restoring", -} - -/** - * Provisioning state of the iSCSI Target. \ - * {@link KnownProvisioningStates} can be used interchangeably with ProvisioningStates, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invalid** \ - * **Succeeded** \ - * **Failed** \ - * **Canceled** \ - * **Pending** \ - * **Creating** \ - * **Updating** \ - * **Deleting** \ - * **Deleted** \ - * **Restoring** - */ -export type ProvisioningStates = string; - -export function privateEndpointConnectionArraySerializer( - result: Array, -): any[] { - return result.map((item) => { - return privateEndpointConnectionSerializer(item); - }); -} - -export function privateEndpointConnectionArrayDeserializer( - result: Array, -): any[] { - return result.map((item) => { - return privateEndpointConnectionDeserializer(item); - }); -} - -/** Response for PrivateEndpoint Connection object */ -export interface PrivateEndpointConnection extends ProxyResource { - /** Private Endpoint Connection Properties. */ - properties: PrivateEndpointConnectionProperties; -} - -export function privateEndpointConnectionSerializer(item: PrivateEndpointConnection): any { - return { - properties: privateEndpointConnectionPropertiesSerializer(item["properties"]), - }; -} - -export function privateEndpointConnectionDeserializer(item: any): PrivateEndpointConnection { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: privateEndpointConnectionPropertiesDeserializer(item["properties"]), - }; -} - -/** Response for PrivateEndpoint connection properties */ -export interface PrivateEndpointConnectionProperties { - /** Provisioning State of Private Endpoint connection resource */ - readonly provisioningState?: ProvisioningStates; - /** Private Endpoint resource */ - privateEndpoint?: PrivateEndpoint; - /** Private Link Service Connection State. */ - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; - /** List of resources private endpoint is mapped */ - groupIds?: string[]; -} - -export function privateEndpointConnectionPropertiesSerializer( - item: PrivateEndpointConnectionProperties, -): any { - return { - privateEndpoint: !item["privateEndpoint"] - ? item["privateEndpoint"] - : privateEndpointSerializer(item["privateEndpoint"]), - privateLinkServiceConnectionState: privateLinkServiceConnectionStateSerializer( - item["privateLinkServiceConnectionState"], - ), - groupIds: !item["groupIds"] - ? item["groupIds"] - : item["groupIds"].map((p: any) => { - return p; - }), - }; -} - -export function privateEndpointConnectionPropertiesDeserializer( - item: any, -): PrivateEndpointConnectionProperties { - return { - provisioningState: item["provisioningState"], - privateEndpoint: !item["privateEndpoint"] - ? item["privateEndpoint"] - : privateEndpointDeserializer(item["privateEndpoint"]), - privateLinkServiceConnectionState: privateLinkServiceConnectionStateDeserializer( - item["privateLinkServiceConnectionState"], - ), - groupIds: !item["groupIds"] - ? item["groupIds"] - : item["groupIds"].map((p: any) => { - return p; - }), - }; -} - -/** Response for PrivateEndpoint */ -export interface PrivateEndpoint { - /** The ARM identifier for Private Endpoint */ - readonly id?: string; -} - -export function privateEndpointSerializer(item: PrivateEndpoint): any { - return item; -} - -export function privateEndpointDeserializer(item: any): PrivateEndpoint { - return { - id: item["id"], - }; -} - -/** Response for Private Link Service Connection state */ -export interface PrivateLinkServiceConnectionState { - /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - status?: PrivateEndpointServiceConnectionStatus; - /** The reason for approval/rejection of the connection. */ - description?: string; - /** A message indicating if changes on the service provider require any updates on the consumer. */ - actionsRequired?: string; -} - -export function privateLinkServiceConnectionStateSerializer( - item: PrivateLinkServiceConnectionState, -): any { - return { - status: item["status"], - description: item["description"], - actionsRequired: item["actionsRequired"], - }; -} - -export function privateLinkServiceConnectionStateDeserializer( - item: any, -): PrivateLinkServiceConnectionState { - return { - status: item["status"], - description: item["description"], - actionsRequired: item["actionsRequired"], - }; -} - -/** The private endpoint connection status. */ -export enum KnownPrivateEndpointServiceConnectionStatus { - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Failed */ - Failed = "Failed", - /** Rejected */ - Rejected = "Rejected", -} - -/** - * The private endpoint connection status. \ - * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Pending** \ - * **Approved** \ - * **Failed** \ - * **Rejected** - */ -export type PrivateEndpointServiceConnectionStatus = string; - -/** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ -export enum KnownPublicNetworkAccess { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. \ - * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** - */ -export type PublicNetworkAccess = string; - -/** The auto scale settings on Elastic San Appliance. */ -export interface AutoScaleProperties { - /** Scale up settings on Elastic San Appliance. */ - scaleUpProperties?: ScaleUpProperties; -} - -export function autoScalePropertiesSerializer(item: AutoScaleProperties): any { - return { - scaleUpProperties: !item["scaleUpProperties"] - ? item["scaleUpProperties"] - : scaleUpPropertiesSerializer(item["scaleUpProperties"]), - }; -} - -export function autoScalePropertiesDeserializer(item: any): AutoScaleProperties { - return { - scaleUpProperties: !item["scaleUpProperties"] - ? item["scaleUpProperties"] - : scaleUpPropertiesDeserializer(item["scaleUpProperties"]), - }; -} - -/** Scale up properties on Elastic San Appliance. */ -export interface ScaleUpProperties { - /** Unused size on Elastic San appliance in TiB. */ - unusedSizeTiB?: number; - /** Unit to increase Capacity Unit on Elastic San appliance in TiB. */ - increaseCapacityUnitByTiB?: number; - /** Maximum scale up size on Elastic San appliance in TiB. */ - capacityUnitScaleUpLimitTiB?: number; - /** Enable or Disable scale up setting on Elastic San Appliance. */ - autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; -} - -export function scaleUpPropertiesSerializer(item: ScaleUpProperties): any { - return { - unusedSizeTiB: item["unusedSizeTiB"], - increaseCapacityUnitByTiB: item["increaseCapacityUnitByTiB"], - capacityUnitScaleUpLimitTiB: item["capacityUnitScaleUpLimitTiB"], - autoScalePolicyEnforcement: item["autoScalePolicyEnforcement"], - }; -} - -export function scaleUpPropertiesDeserializer(item: any): ScaleUpProperties { - return { - unusedSizeTiB: item["unusedSizeTiB"], - increaseCapacityUnitByTiB: item["increaseCapacityUnitByTiB"], - capacityUnitScaleUpLimitTiB: item["capacityUnitScaleUpLimitTiB"], - autoScalePolicyEnforcement: item["autoScalePolicyEnforcement"], - }; -} - -/** Enable or Disable scale up setting on Elastic San Appliance. */ -export enum KnownAutoScalePolicyEnforcement { - /** None */ - None = "None", - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Enable or Disable scale up setting on Elastic San Appliance. \ - * {@link KnownAutoScalePolicyEnforcement} can be used interchangeably with AutoScalePolicyEnforcement, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **Enabled** \ - * **Disabled** - */ -export type AutoScalePolicyEnforcement = string; - -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - -export function proxyResourceSerializer(item: ProxyResource): any { - return item; -} - -export function proxyResourceDeserializer(item: any): ProxyResource { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - }; -} - -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { - /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ - readonly id?: string; - /** The name of the resource */ - readonly name?: string; - /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ - readonly type?: string; - /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - readonly systemData?: SystemData; -} - -export function resourceSerializer(item: Resource): any { - return item; -} - -export function resourceDeserializer(item: any): Resource { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - }; -} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - -export function systemDataDeserializer(item: any): SystemData { - return { - createdBy: item["createdBy"], - createdByType: item["createdByType"], - createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), - lastModifiedBy: item["lastModifiedBy"], - lastModifiedByType: item["lastModifiedByType"], - lastModifiedAt: !item["lastModifiedAt"] - ? item["lastModifiedAt"] - : new Date(item["lastModifiedAt"]), - }; -} - -/** The kind of entity that created the resource. */ -export enum KnownCreatedByType { - /** The entity was created by a user. */ - User = "User", - /** The entity was created by an application. */ - Application = "Application", - /** The entity was created by a managed identity. */ - ManagedIdentity = "ManagedIdentity", - /** The entity was created by a key. */ - Key = "Key", -} - -/** - * The kind of entity that created the resource. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User**: The entity was created by a user. \ - * **Application**: The entity was created by an application. \ - * **ManagedIdentity**: The entity was created by a managed identity. \ - * **Key**: The entity was created by a key. - */ -export type CreatedByType = string; - -/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends Resource { - /** Resource tags. */ - tags?: Record; - /** The geo-location where the resource lives */ - location: string; -} - -export function trackedResourceSerializer(item: TrackedResource): any { - return { tags: item["tags"], location: item["location"] }; -} - -export function trackedResourceDeserializer(item: any): TrackedResource { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - tags: item["tags"], - location: item["location"], - }; -} - -/** Response for ElasticSan update request. */ -export interface ElasticSanUpdate { - /** Properties of ElasticSan. */ - properties?: ElasticSanUpdateProperties; - /** Update tags */ - tags?: Record; -} - -export function elasticSanUpdateSerializer(item: ElasticSanUpdate): any { - return { - properties: !item["properties"] - ? item["properties"] - : elasticSanUpdatePropertiesSerializer(item["properties"]), - tags: item["tags"], - }; -} - -/** Elastic San update properties. */ -export interface ElasticSanUpdateProperties { - /** Base size of the Elastic San appliance in TiB. */ - baseSizeTiB?: number; - /** Extended size of the Elastic San appliance in TiB. */ - extendedCapacitySizeTiB?: number; - /** Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Auto Scale Properties for Elastic San Appliance. */ - autoScaleProperties?: AutoScaleProperties; -} - -export function elasticSanUpdatePropertiesSerializer(item: ElasticSanUpdateProperties): any { - return { - baseSizeTiB: item["baseSizeTiB"], - extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], - publicNetworkAccess: item["publicNetworkAccess"], - autoScaleProperties: !item["autoScaleProperties"] - ? item["autoScaleProperties"] - : autoScalePropertiesSerializer(item["autoScaleProperties"]), - }; -} - -/** List of Elastic Sans */ -export interface _ElasticSanList { - /** The ElasticSan items on this page */ - value: ElasticSan[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _elasticSanListDeserializer(item: any): _ElasticSanList { - return { - value: elasticSanArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function elasticSanArraySerializer(result: Array): any[] { - return result.map((item) => { - return elasticSanSerializer(item); - }); -} - -export function elasticSanArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return elasticSanDeserializer(item); - }); -} - -/** The response of a PrivateEndpointConnection list operation. */ -export interface _PrivateEndpointConnectionListResult { - /** The PrivateEndpointConnection items on this page */ - value: PrivateEndpointConnection[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _privateEndpointConnectionListResultDeserializer( - item: any, -): _PrivateEndpointConnectionListResult { - return { - value: privateEndpointConnectionArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -/** Response for Volume request. */ -export interface Volume extends ProxyResource { - /** Properties of Volume. */ - properties: VolumeProperties; -} - -export function volumeSerializer(item: Volume): any { - return { properties: volumePropertiesSerializer(item["properties"]) }; -} - -export function volumeDeserializer(item: any): Volume { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: volumePropertiesDeserializer(item["properties"]), - }; -} - -/** Volume response properties. */ -export interface VolumeProperties { - /** Unique Id of the volume in GUID format */ - readonly volumeId?: string; - /** State of the operation on the resource. */ - creationData?: SourceCreationData; - /** Volume size. */ - sizeGiB: number; - /** Storage target information */ - readonly storageTarget?: IscsiTargetInfo; - /** Parent resource information. */ - managedBy?: ManagedByInfo; - /** State of the operation on the resource. */ - readonly provisioningState?: ProvisioningStates; -} - -export function volumePropertiesSerializer(item: VolumeProperties): any { - return { - creationData: !item["creationData"] - ? item["creationData"] - : sourceCreationDataSerializer(item["creationData"]), - sizeGiB: item["sizeGiB"], - managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), - }; -} - -export function volumePropertiesDeserializer(item: any): VolumeProperties { - return { - volumeId: item["volumeId"], - creationData: !item["creationData"] - ? item["creationData"] - : sourceCreationDataDeserializer(item["creationData"]), - sizeGiB: item["sizeGiB"], - storageTarget: !item["storageTarget"] - ? item["storageTarget"] - : iscsiTargetInfoDeserializer(item["storageTarget"]), - managedBy: !item["managedBy"] - ? item["managedBy"] - : managedByInfoDeserializer(item["managedBy"]), - provisioningState: item["provisioningState"], - }; -} - -/** Data source used when creating the volume. */ -export interface SourceCreationData { - /** This enumerates the possible sources of a volume creation. */ - createSource?: VolumeCreateOption; - /** Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ - sourceId?: string; -} - -export function sourceCreationDataSerializer(item: SourceCreationData): any { - return { createSource: item["createSource"], sourceId: item["sourceId"] }; -} - -export function sourceCreationDataDeserializer(item: any): SourceCreationData { - return { - createSource: item["createSource"], - sourceId: item["sourceId"], - }; -} - -/** This enumerates the possible sources of a volume creation. */ -export enum KnownVolumeCreateOption { - /** None */ - None = "None", - /** VolumeSnapshot */ - VolumeSnapshot = "VolumeSnapshot", - /** DiskSnapshot */ - DiskSnapshot = "DiskSnapshot", - /** Disk */ - Disk = "Disk", - /** DiskRestorePoint */ - DiskRestorePoint = "DiskRestorePoint", -} - -/** - * This enumerates the possible sources of a volume creation. \ - * {@link KnownVolumeCreateOption} can be used interchangeably with VolumeCreateOption, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **VolumeSnapshot** \ - * **DiskSnapshot** \ - * **Disk** \ - * **DiskRestorePoint** - */ -export type VolumeCreateOption = string; - -/** Iscsi target information */ -export interface IscsiTargetInfo { - /** iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". */ - readonly targetIqn?: string; - /** iSCSI Target Portal Host Name */ - readonly targetPortalHostname?: string; - /** iSCSI Target Portal Port */ - readonly targetPortalPort?: number; - /** State of the operation on the resource. */ - readonly provisioningState?: ProvisioningStates; - /** Operational status of the iSCSI Target. */ - status?: OperationalStatus; -} - -export function iscsiTargetInfoDeserializer(item: any): IscsiTargetInfo { - return { - targetIqn: item["targetIqn"], - targetPortalHostname: item["targetPortalHostname"], - targetPortalPort: item["targetPortalPort"], - provisioningState: item["provisioningState"], - status: item["status"], - }; -} - -/** Operational status of the resource. */ -export enum KnownOperationalStatus { - /** Invalid */ - Invalid = "Invalid", - /** Unknown */ - Unknown = "Unknown", - /** Healthy */ - Healthy = "Healthy", - /** Unhealthy */ - Unhealthy = "Unhealthy", - /** Updating */ - Updating = "Updating", - /** Running */ - Running = "Running", - /** Stopped */ - Stopped = "Stopped", - /** Stopped (deallocated) */ - StoppedDeallocated = "Stopped (deallocated)", -} - -/** - * Operational status of the resource. \ - * {@link KnownOperationalStatus} can be used interchangeably with OperationalStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invalid** \ - * **Unknown** \ - * **Healthy** \ - * **Unhealthy** \ - * **Updating** \ - * **Running** \ - * **Stopped** \ - * **Stopped (deallocated)** - */ -export type OperationalStatus = string; - -/** Parent resource information. */ -export interface ManagedByInfo { - /** Resource ID of the resource managing the volume, this is a restricted field and can only be set for internal use. */ - resourceId?: string; -} - -export function managedByInfoSerializer(item: ManagedByInfo): any { - return { resourceId: item["resourceId"] }; -} - -export function managedByInfoDeserializer(item: any): ManagedByInfo { - return { - resourceId: item["resourceId"], - }; -} - -/** Response for Volume request. */ -export interface VolumeUpdate { - /** Properties of Volume. */ - properties?: VolumeUpdateProperties; -} - -export function volumeUpdateSerializer(item: VolumeUpdate): any { - return { - properties: !item["properties"] - ? item["properties"] - : volumeUpdatePropertiesSerializer(item["properties"]), - }; -} - -/** Volume response properties. */ -export interface VolumeUpdateProperties { - /** Volume size. */ - sizeGiB?: number; - /** Parent resource information. */ - managedBy?: ManagedByInfo; -} - -export function volumeUpdatePropertiesSerializer(item: VolumeUpdateProperties): any { - return { - sizeGiB: item["sizeGiB"], - managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), - }; -} - -/** List of Volumes */ -export interface _VolumeList { - /** The Volume items on this page */ - value: Volume[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _volumeListDeserializer(item: any): _VolumeList { - return { - value: volumeArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function volumeArraySerializer(result: Array): any[] { - return result.map((item) => { - return volumeSerializer(item); - }); -} - -export function volumeArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return volumeDeserializer(item); - }); -} - -/** object to hold array of volume names */ -export interface VolumeNameList { - /** array of volume names */ - volumeNames: string[]; -} - -export function volumeNameListSerializer(item: VolumeNameList): any { - return { - volumeNames: item["volumeNames"].map((p: any) => { - return p; - }), - }; -} - -/** response object for pre validation api */ -export interface PreValidationResponse { - /** a status value indicating success or failure of validation */ - validationStatus?: string; -} - -export function preValidationResponseDeserializer(item: any): PreValidationResponse { - return { - validationStatus: item["validationStatus"], - }; -} - -/** object to hold array of Disk Snapshot ARM IDs */ -export interface DiskSnapshotList { - /** array of DiskSnapshot ARM IDs */ - diskSnapshotIds: string[]; -} - -export function diskSnapshotListSerializer(item: DiskSnapshotList): any { - return { - diskSnapshotIds: item["diskSnapshotIds"].map((p: any) => { - return p; - }), - }; -} - -/** Response for Volume Group request. */ -export interface VolumeGroup extends ProxyResource { - /** The identity of the resource. */ - identity?: Identity; - /** Properties of VolumeGroup. */ - properties?: VolumeGroupProperties; -} - -export function volumeGroupSerializer(item: VolumeGroup): any { - return { - identity: !item["identity"] ? item["identity"] : identitySerializer(item["identity"]), - properties: !item["properties"] - ? item["properties"] - : volumeGroupPropertiesSerializer(item["properties"]), - }; -} - -export function volumeGroupDeserializer(item: any): VolumeGroup { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - identity: !item["identity"] ? item["identity"] : identityDeserializer(item["identity"]), - properties: !item["properties"] - ? item["properties"] - : volumeGroupPropertiesDeserializer(item["properties"]), - }; -} - -/** Identity for the resource. */ -export interface Identity { - /** The principal ID of resource identity. */ - readonly principalId?: string; - /** The tenant ID of resource. */ - readonly tenantId?: string; - /** The identity type. */ - type: IdentityType; - /** Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this volume group. The key is the ARM resource identifier of the identity. */ - userAssignedIdentities?: Record; -} - -export function identitySerializer(item: Identity): any { - return { - type: item["type"], - userAssignedIdentities: !item["userAssignedIdentities"] - ? item["userAssignedIdentities"] - : userAssignedIdentityRecordSerializer(item["userAssignedIdentities"]), - }; -} - -export function identityDeserializer(item: any): Identity { - return { - principalId: item["principalId"], - tenantId: item["tenantId"], - type: item["type"], - userAssignedIdentities: !item["userAssignedIdentities"] - ? item["userAssignedIdentities"] - : userAssignedIdentityRecordDeserializer(item["userAssignedIdentities"]), - }; -} - -/** The identity type. */ -export enum KnownIdentityType { - /** None */ - None = "None", - /** SystemAssigned */ - SystemAssigned = "SystemAssigned", - /** UserAssigned */ - UserAssigned = "UserAssigned", -} - -/** - * The identity type. \ - * {@link KnownIdentityType} can be used interchangeably with IdentityType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **SystemAssigned** \ - * **UserAssigned** - */ -export type IdentityType = string; - -export function userAssignedIdentityRecordSerializer( - item: Record, -): Record { - const result: Record = {}; - Object.keys(item).map((key) => { - result[key] = !item[key] ? item[key] : userAssignedIdentitySerializer(item[key]); - }); - return result; -} - -export function userAssignedIdentityRecordDeserializer( - item: Record, -): Record { - const result: Record = {}; - Object.keys(item).map((key) => { - result[key] = !item[key] ? item[key] : userAssignedIdentityDeserializer(item[key]); - }); - return result; -} - -/** UserAssignedIdentity for the resource. */ -export interface UserAssignedIdentity { - /** The principal ID of the identity. */ - readonly principalId?: string; - /** The client ID of the identity. */ - readonly clientId?: string; -} - -export function userAssignedIdentitySerializer(item: UserAssignedIdentity): any { - return item; -} - -export function userAssignedIdentityDeserializer(item: any): UserAssignedIdentity { - return { - principalId: item["principalId"], - clientId: item["clientId"], - }; -} - -/** VolumeGroup response properties. */ -export interface VolumeGroupProperties { - /** State of the operation on the resource. */ - readonly provisioningState?: ProvisioningStates; - /** Type of storage target */ - protocolType?: StorageTargetType; - /** Type of encryption */ - encryption?: EncryptionType; - /** Encryption Properties describing Key Vault and Identity information */ - encryptionProperties?: EncryptionProperties; - /** A collection of rules governing the accessibility from specific network locations. */ - networkAcls?: NetworkRuleSet; - /** The list of Private Endpoint Connections. */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** A boolean indicating whether or not Data Integrity Check is enabled */ - enforceDataIntegrityCheckForIscsi?: boolean; -} - -export function volumeGroupPropertiesSerializer(item: VolumeGroupProperties): any { - return { - protocolType: item["protocolType"], - encryption: item["encryption"], - encryptionProperties: !item["encryptionProperties"] - ? item["encryptionProperties"] - : encryptionPropertiesSerializer(item["encryptionProperties"]), - networkAcls: !item["networkAcls"] - ? item["networkAcls"] - : networkRuleSetSerializer(item["networkAcls"]), - enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], - }; -} - -export function volumeGroupPropertiesDeserializer(item: any): VolumeGroupProperties { - return { - provisioningState: item["provisioningState"], - protocolType: item["protocolType"], - encryption: item["encryption"], - encryptionProperties: !item["encryptionProperties"] - ? item["encryptionProperties"] - : encryptionPropertiesDeserializer(item["encryptionProperties"]), - networkAcls: !item["networkAcls"] - ? item["networkAcls"] - : networkRuleSetDeserializer(item["networkAcls"]), - privateEndpointConnections: !item["privateEndpointConnections"] - ? item["privateEndpointConnections"] - : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), - enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], - }; -} - -/** Storage Target type. */ -export enum KnownStorageTargetType { - /** Iscsi */ - Iscsi = "Iscsi", - /** None */ - None = "None", -} - -/** - * Storage Target type. \ - * {@link KnownStorageTargetType} can be used interchangeably with StorageTargetType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Iscsi** \ - * **None** - */ -export type StorageTargetType = string; - -/** The type of key used to encrypt the data of the disk. */ -export enum KnownEncryptionType { - /** Volume is encrypted at rest with Platform managed key. It is the default encryption type. */ - EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", - /** Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ - EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", -} - -/** - * The type of key used to encrypt the data of the disk. \ - * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EncryptionAtRestWithPlatformKey**: Volume is encrypted at rest with Platform managed key. It is the default encryption type. \ - * **EncryptionAtRestWithCustomerManagedKey**: Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. - */ -export type EncryptionType = string; - -/** The encryption settings on the volume group. */ -export interface EncryptionProperties { - /** Properties provided by key vault. */ - keyVaultProperties?: KeyVaultProperties; - /** The identity to be used with service-side encryption at rest. */ - encryptionIdentity?: EncryptionIdentity; -} - -export function encryptionPropertiesSerializer(item: EncryptionProperties): any { - return { - keyVaultProperties: !item["keyVaultProperties"] - ? item["keyVaultProperties"] - : keyVaultPropertiesSerializer(item["keyVaultProperties"]), - identity: !item["encryptionIdentity"] - ? item["encryptionIdentity"] - : encryptionIdentitySerializer(item["encryptionIdentity"]), - }; -} - -export function encryptionPropertiesDeserializer(item: any): EncryptionProperties { - return { - keyVaultProperties: !item["keyVaultProperties"] - ? item["keyVaultProperties"] - : keyVaultPropertiesDeserializer(item["keyVaultProperties"]), - encryptionIdentity: !item["identity"] - ? item["identity"] - : encryptionIdentityDeserializer(item["identity"]), - }; -} - -/** Properties of key vault. */ -export interface KeyVaultProperties { - /** The name of KeyVault key. */ - keyName?: string; - /** The version of KeyVault key. */ - keyVersion?: string; - /** The Uri of KeyVault. */ - keyVaultUri?: string; - /** The object identifier of the current versioned Key Vault Key in use. */ - readonly currentVersionedKeyIdentifier?: string; - /** Timestamp of last rotation of the Key Vault Key. */ - readonly lastKeyRotationTimestamp?: Date; - /** This is a read only property that represents the expiration time of the current version of the customer managed key used for encryption. */ - readonly currentVersionedKeyExpirationTimestamp?: Date; -} - -export function keyVaultPropertiesSerializer(item: KeyVaultProperties): any { - return { - keyName: item["keyName"], - keyVersion: item["keyVersion"], - keyVaultUri: item["keyVaultUri"], - }; -} - -export function keyVaultPropertiesDeserializer(item: any): KeyVaultProperties { - return { - keyName: item["keyName"], - keyVersion: item["keyVersion"], - keyVaultUri: item["keyVaultUri"], - currentVersionedKeyIdentifier: item["currentVersionedKeyIdentifier"], - lastKeyRotationTimestamp: !item["lastKeyRotationTimestamp"] - ? item["lastKeyRotationTimestamp"] - : new Date(item["lastKeyRotationTimestamp"]), - currentVersionedKeyExpirationTimestamp: !item["currentVersionedKeyExpirationTimestamp"] - ? item["currentVersionedKeyExpirationTimestamp"] - : new Date(item["currentVersionedKeyExpirationTimestamp"]), - }; -} - -/** Encryption identity for the volume group. */ -export interface EncryptionIdentity { - /** Resource identifier of the UserAssigned identity to be associated with server-side encryption on the volume group. */ - encryptionUserAssignedIdentity?: string; -} - -export function encryptionIdentitySerializer(item: EncryptionIdentity): any { - return { userAssignedIdentity: item["encryptionUserAssignedIdentity"] }; -} - -export function encryptionIdentityDeserializer(item: any): EncryptionIdentity { - return { - encryptionUserAssignedIdentity: item["userAssignedIdentity"], - }; -} - -/** A set of rules governing the network accessibility. */ -export interface NetworkRuleSet { - /** The list of virtual network rules. */ - virtualNetworkRules?: VirtualNetworkRule[]; -} - -export function networkRuleSetSerializer(item: NetworkRuleSet): any { - return { - virtualNetworkRules: !item["virtualNetworkRules"] - ? item["virtualNetworkRules"] - : virtualNetworkRuleArraySerializer(item["virtualNetworkRules"]), - }; -} - -export function networkRuleSetDeserializer(item: any): NetworkRuleSet { - return { - virtualNetworkRules: !item["virtualNetworkRules"] - ? item["virtualNetworkRules"] - : virtualNetworkRuleArrayDeserializer(item["virtualNetworkRules"]), - }; -} - -export function virtualNetworkRuleArraySerializer(result: Array): any[] { - return result.map((item) => { - return virtualNetworkRuleSerializer(item); - }); -} - -export function virtualNetworkRuleArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return virtualNetworkRuleDeserializer(item); - }); -} - -/** Virtual Network rule. */ -export interface VirtualNetworkRule { - /** Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. */ - virtualNetworkResourceId: string; - /** The action of virtual network rule. */ - action?: Action; -} - -export function virtualNetworkRuleSerializer(item: VirtualNetworkRule): any { - return { id: item["virtualNetworkResourceId"], action: item["action"] }; -} - -export function virtualNetworkRuleDeserializer(item: any): VirtualNetworkRule { - return { - virtualNetworkResourceId: item["id"], - action: item["action"], - }; -} - -/** The action of virtual network rule. */ -export enum KnownAction { - /** Allow */ - Allow = "Allow", -} - -/** - * The action of virtual network rule. \ - * {@link KnownAction} can be used interchangeably with Action, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Allow** - */ -export type Action = string; - -/** Volume Group request. */ -export interface VolumeGroupUpdate { - /** The identity of the resource. */ - identity?: Identity; - /** Properties of VolumeGroup. */ - properties?: VolumeGroupUpdateProperties; -} - -export function volumeGroupUpdateSerializer(item: VolumeGroupUpdate): any { - return { - identity: !item["identity"] ? item["identity"] : identitySerializer(item["identity"]), - properties: !item["properties"] - ? item["properties"] - : volumeGroupUpdatePropertiesSerializer(item["properties"]), - }; -} - -/** VolumeGroup response properties. */ -export interface VolumeGroupUpdateProperties { - /** Type of storage target */ - protocolType?: StorageTargetType; - /** Type of encryption */ - encryption?: EncryptionType; - /** Encryption Properties describing Key Vault and Identity information */ - encryptionProperties?: EncryptionProperties; - /** A collection of rules governing the accessibility from specific network locations. */ - networkAcls?: NetworkRuleSet; - /** A boolean indicating whether or not Data Integrity Check is enabled */ - enforceDataIntegrityCheckForIscsi?: boolean; -} - -export function volumeGroupUpdatePropertiesSerializer(item: VolumeGroupUpdateProperties): any { - return { - protocolType: item["protocolType"], - encryption: item["encryption"], - encryptionProperties: !item["encryptionProperties"] - ? item["encryptionProperties"] - : encryptionPropertiesSerializer(item["encryptionProperties"]), - networkAcls: !item["networkAcls"] - ? item["networkAcls"] - : networkRuleSetSerializer(item["networkAcls"]), - enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], - }; -} - -/** List of Volume Groups */ -export interface _VolumeGroupList { - /** The VolumeGroup items on this page */ - value: VolumeGroup[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _volumeGroupListDeserializer(item: any): _VolumeGroupList { - return { - value: volumeGroupArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function volumeGroupArraySerializer(result: Array): any[] { - return result.map((item) => { - return volumeGroupSerializer(item); - }); -} - -export function volumeGroupArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return volumeGroupDeserializer(item); - }); -} - -/** A list of private link resources */ -export interface PrivateLinkResourceListResult { - /** Array of private link resources */ - value: PrivateLinkResource[]; - /** URI to fetch the next section of the paginated response. */ - readonly nextLink?: string; -} - -export function privateLinkResourceListResultDeserializer( - item: any, -): PrivateLinkResourceListResult { - return { - value: privateLinkResourceArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function privateLinkResourceArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return privateLinkResourceDeserializer(item); - }); -} - -/** A private link resource */ -export interface PrivateLinkResource extends Resource { - /** Resource properties. */ - properties?: PrivateLinkResourceProperties; -} - -export function privateLinkResourceDeserializer(item: any): PrivateLinkResource { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: !item["properties"] - ? item["properties"] - : privateLinkResourcePropertiesDeserializer(item["properties"]), - }; -} - -/** Properties of a private link resource. */ -export interface PrivateLinkResourceProperties { - /** The private link resource group id. */ - readonly groupId?: string; - /** The private link resource required member names. */ - readonly requiredMembers?: string[]; - /** The private link resource Private link DNS zone name. */ - requiredZoneNames?: string[]; -} - -export function privateLinkResourcePropertiesDeserializer( - item: any, -): PrivateLinkResourceProperties { - return { - groupId: item["groupId"], - requiredMembers: !item["requiredMembers"] - ? item["requiredMembers"] - : item["requiredMembers"].map((p: any) => { - return p; - }), - requiredZoneNames: !item["requiredZoneNames"] - ? item["requiredZoneNames"] - : item["requiredZoneNames"].map((p: any) => { - return p; - }), - }; -} - -/** Response for Volume Snapshot request. */ -export interface Snapshot extends ProxyResource { - /** Properties of Volume Snapshot. */ - properties: SnapshotProperties; -} - -export function snapshotSerializer(item: Snapshot): any { - return { properties: snapshotPropertiesSerializer(item["properties"]) }; -} - -export function snapshotDeserializer(item: any): Snapshot { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: snapshotPropertiesDeserializer(item["properties"]), - }; -} - -/** Properties for Snapshot. */ -export interface SnapshotProperties { - /** Data used when creating a volume snapshot. */ - creationData: SnapshotCreationData; - /** State of the operation on the resource. */ - readonly provisioningState?: ProvisioningStates; - /** Size of Source Volume */ - readonly sourceVolumeSizeGiB?: number; - /** Source Volume Name of a snapshot */ - readonly volumeName?: string; -} - -export function snapshotPropertiesSerializer(item: SnapshotProperties): any { - return { creationData: snapshotCreationDataSerializer(item["creationData"]) }; -} - -export function snapshotPropertiesDeserializer(item: any): SnapshotProperties { - return { - creationData: snapshotCreationDataDeserializer(item["creationData"]), - provisioningState: item["provisioningState"], - sourceVolumeSizeGiB: item["sourceVolumeSizeGiB"], - volumeName: item["volumeName"], - }; -} - -/** Data used when creating a volume snapshot. */ -export interface SnapshotCreationData { - /** Fully qualified resource ID of the volume. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" */ - sourceId: string; -} - -export function snapshotCreationDataSerializer(item: SnapshotCreationData): any { - return { sourceId: item["sourceId"] }; -} - -export function snapshotCreationDataDeserializer(item: any): SnapshotCreationData { - return { - sourceId: item["sourceId"], - }; -} - -/** List of Snapshots */ -export interface _SnapshotList { - /** The Snapshot items on this page */ - value: Snapshot[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _snapshotListDeserializer(item: any): _SnapshotList { - return { - value: snapshotArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function snapshotArraySerializer(result: Array): any[] { - return result.map((item) => { - return snapshotSerializer(item); - }); -} - -export function snapshotArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return snapshotDeserializer(item); - }); -} - -/** List of SKU Information objects */ -export interface _SkuInformationList { - /** The SkuInformation items on this page */ - readonly value: SkuInformation[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _skuInformationListDeserializer(item: any): _SkuInformationList { - return { - value: skuInformationArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function skuInformationArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return skuInformationDeserializer(item); - }); -} - -/** ElasticSAN SKU and its properties */ -export interface SkuInformation { - /** Sku Name */ - name: SkuName; - /** Sku Tier */ - tier?: SkuTier; - /** The type of the resource. */ - readonly resourceType?: string; - /** The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). */ - readonly locations?: string[]; - /** Availability of the SKU for the location/zone */ - readonly locationInfo?: SkuLocationInfo[]; - /** The capability information in the specified SKU. */ - readonly capabilities?: SKUCapability[]; -} - -export function skuInformationDeserializer(item: any): SkuInformation { - return { - name: item["name"], - tier: item["tier"], - resourceType: item["resourceType"], - locations: !item["locations"] - ? item["locations"] - : item["locations"].map((p: any) => { - return p; - }), - locationInfo: !item["locationInfo"] - ? item["locationInfo"] - : skuLocationInfoArrayDeserializer(item["locationInfo"]), - capabilities: !item["capabilities"] - ? item["capabilities"] - : skuCapabilityArrayDeserializer(item["capabilities"]), - }; -} - -export function skuLocationInfoArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return skuLocationInfoDeserializer(item); - }); -} - -/** The location info. */ -export interface SkuLocationInfo { - /** The location. */ - readonly location?: string; - /** The zones. */ - readonly zones?: string[]; -} - -export function skuLocationInfoDeserializer(item: any): SkuLocationInfo { - return { - location: item["location"], - zones: !item["zones"] - ? item["zones"] - : item["zones"].map((p: any) => { - return p; - }), - }; -} - -export function skuCapabilityArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return skuCapabilityDeserializer(item); - }); -} - -/** The capability information in the specified SKU. */ -export interface SKUCapability { - /** The name of capability. */ - readonly name?: string; - /** A string value to indicate states of given capability. */ - readonly value?: string; -} - -export function skuCapabilityDeserializer(item: any): SKUCapability { - return { - name: item["name"], - value: item["value"], - }; -} - -/** Known values of {@link x-ms-delete-snapshots} that the service accepts. */ -export enum KnownXMsDeleteSnapshots { - /** true */ - True = "true", - /** false */ - False = "false", -} - -/** Type of XMsDeleteSnapshots */ -export type XMsDeleteSnapshots = string; - -/** Known values of {@link x-ms-force-delete} that the service accepts. */ -export enum KnownXMsForceDelete { - /** true */ - True = "true", - /** false */ - False = "false", -} - -/** Type of XMsForceDelete */ -export type XMsForceDelete = string; - -/** The available API versions. */ -export enum KnownVersions { - /** The 2025-09-01 stable API version. */ - V20250901 = "2025-09-01", -} diff --git a/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts new file mode 100644 index 000000000000..423bc1b7fbc2 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { + OperationParameter, + OperationURLParameter, + OperationQueryParameter, +} from "@azure/core-client"; +import { + ElasticSan as ElasticSanMapper, + ElasticSanUpdate as ElasticSanUpdateMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + VolumeGroup as VolumeGroupMapper, + VolumeGroupUpdate as VolumeGroupUpdateMapper, + VolumeNameList as VolumeNameListMapper, + DiskSnapshotList as DiskSnapshotListMapper, + Volume as VolumeMapper, + VolumeUpdate as VolumeUpdateMapper, + Snapshot as SnapshotMapper, +} from "../models/mappers.js"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String", + }, + }, +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2025-09-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String", + }, + }, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1, + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const elasticSanName: OperationURLParameter = { + parameterPath: "elasticSanName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"), + MaxLength: 24, + MinLength: 3, + }, + serializedName: "elasticSanName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: ElasticSanMapper, +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: ElasticSanUpdateMapper, +}; + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String", + }, + }, +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + serializedName: "privateEndpointConnectionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: PrivateEndpointConnectionMapper, +}; + +export const volumeGroupName: OperationURLParameter = { + parameterPath: "volumeGroupName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"), + MaxLength: 63, + MinLength: 3, + }, + serializedName: "volumeGroupName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeGroupMapper, +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeGroupUpdateMapper, +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeNameListMapper, +}; + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: DiskSnapshotListMapper, +}; + +export const volumeName: OperationURLParameter = { + parameterPath: "volumeName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-z0-9]+(-[a-z0-9A-Z]+)*$"), + MaxLength: 63, + MinLength: 3, + }, + serializedName: "volumeName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const parameters7: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeMapper, +}; + +export const parameters8: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeUpdateMapper, +}; + +export const xMsDeleteSnapshots: OperationParameter = { + parameterPath: ["options", "xMsDeleteSnapshots"], + mapper: { + serializedName: "x-ms-delete-snapshots", + type: { + name: "String", + }, + }, +}; + +export const xMsForceDelete: OperationParameter = { + parameterPath: ["options", "xMsForceDelete"], + mapper: { + serializedName: "x-ms-force-delete", + type: { + name: "String", + }, + }, +}; + +export const snapshotName: OperationURLParameter = { + parameterPath: "snapshotName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-z0-9]+(?:[._-][a-z0-9]+)*$"), + MaxLength: 80, + MinLength: 1, + }, + serializedName: "snapshotName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const parameters9: OperationParameter = { + parameterPath: "parameters", + mapper: SnapshotMapper, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts new file mode 100644 index 000000000000..3b5414d40904 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts @@ -0,0 +1,661 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { ElasticSans } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ElasticSanManagement } from "../elasticSanManagement.js"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + ElasticSan, + ElasticSansListBySubscriptionNextOptionalParams, + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListBySubscriptionResponse, + ElasticSansListByResourceGroupNextOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansListByResourceGroupResponse, + ElasticSansGetOptionalParams, + ElasticSansGetResponse, + ElasticSansCreateOptionalParams, + ElasticSansCreateResponse, + ElasticSanUpdate, + ElasticSansUpdateOptionalParams, + ElasticSansUpdateResponse, + ElasticSansDeleteOptionalParams, + ElasticSansListBySubscriptionNextResponse, + ElasticSansListByResourceGroupNextResponse, +} from "../models/index.js"; + +/// +/** Class containing ElasticSans operations. */ +export class ElasticSansImpl implements ElasticSans { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class ElasticSans class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * Gets a list of ElasticSans in a subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: ElasticSansListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + }, + }; + } + + private async *listBySubscriptionPagingPage( + options?: ElasticSansListBySubscriptionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ElasticSansListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: ElasticSansListBySubscriptionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of ElasticSan in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ElasticSansListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { + yield* page; + } + } + + /** + * Gets a list of ElasticSans in a subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: ElasticSansListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec); + } + + /** + * Gets a list of ElasticSan in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Get a ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, options }, + getOperationSpec, + ); + } + + /** + * Create ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ): Promise< + SimplePollerLike, ElasticSansCreateResponse> + > { + 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, elasticSanName, parameters, options }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + ElasticSansCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Create ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ): Promise { + const poller = await this.beginCreate(resourceGroupName, elasticSanName, parameters, options); + return poller.pollUntilDone(); + } + + /** + * Update a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ): Promise< + SimplePollerLike, ElasticSansUpdateResponse> + > { + 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, elasticSanName, parameters, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + ElasticSansUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate(resourceGroupName, elasticSanName, parameters, options); + return poller.pollUntilDone(); + } + + /** + * Delete a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ): Promise, void>> { + 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, elasticSanName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete(resourceGroupName, elasticSanName, options); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: ElasticSansListBySubscriptionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ElasticSansListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSanList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSanList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSan, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ElasticSan, + }, + 201: { + bodyMapper: Mappers.ElasticSan, + }, + 202: { + bodyMapper: Mappers.ElasticSan, + }, + 204: { + bodyMapper: Mappers.ElasticSan, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ElasticSan, + }, + 201: { + bodyMapper: Mappers.ElasticSan, + }, + 202: { + bodyMapper: Mappers.ElasticSan, + }, + 204: { + bodyMapper: Mappers.ElasticSan, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSanList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSanList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/operations/index.ts new file mode 100644 index 000000000000..b291dba769e0 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/index.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +export * from "./operations.js"; +export * from "./elasticSans.js"; +export * from "./skus.js"; +export * from "./privateEndpointConnections.js"; +export * from "./privateLinkResources.js"; +export * from "./volumeGroups.js"; +export * from "./volumes.js"; +export * from "./volumeSnapshots.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts b/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts new file mode 100644 index 000000000000..124a98e1a5be --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { Operations } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ElasticSanManagement } from "../elasticSanManagement.js"; +import type { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse, +} from "../models/index.js"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List the operations for the provider + * @param options The options parameters. + */ + public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List the operations for the provider + * @param options The options parameters. + */ + private _list(options?: OperationsListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ElasticSan/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..e1023a63f686 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { PrivateEndpointConnections } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ElasticSanManagement } from "../elasticSanManagement.js"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + PrivateEndpointConnection, + PrivateEndpointConnectionsListNextOptionalParams, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsListResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsCreateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsListNextResponse, +} from "../models/index.js"; + +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, elasticSanName, 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(resourceGroupName, elasticSanName, options, settings); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PrivateEndpointConnectionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, elasticSanName, options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(resourceGroupName, elasticSanName, continuationToken, options); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(resourceGroupName, elasticSanName, options)) { + yield* page; + } + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, options }, + listOperationSpec, + ); + } + + /** + * Gets the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options, + }, + getOperationSpec, + ); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval object. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionsCreateResponse + > + > { + 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, + elasticSanName, + privateEndpointConnectionName, + parameters, + options, + }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval object. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ): Promise, void>> { + 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, + elasticSanName, + privateEndpointConnectionName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + elasticSanName: string, + nextLink: string, + options?: PrivateEndpointConnectionsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.privateEndpointConnectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.privateEndpointConnectionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.privateEndpointConnectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts b/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..0c2a0b3f04da --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PrivateLinkResources } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ElasticSanManagement } from "../elasticSanManagement.js"; +import type { + PrivateLinkResourcesListByElasticSanOptionalParams, + PrivateLinkResourcesListByElasticSanResponse, +} from "../models/index.js"; + +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * Gets the private link resources that need to be created for a elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateLinkResourcesListByElasticSanOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, options }, + listByElasticSanOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByElasticSanOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts b/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts new file mode 100644 index 000000000000..fe9b1b9f314b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { Skus } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ElasticSanManagement } from "../elasticSanManagement.js"; +import type { + SkuInformation, + SkusListNextOptionalParams, + SkusListOptionalParams, + SkusListResponse, + SkusListNextResponse, +} from "../models/index.js"; + +/// +/** Class containing Skus operations. */ +export class SkusImpl implements Skus { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class Skus class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List all the available Skus in the region and information related to them + * @param options The options parameters. + */ + public list(options?: SkusListOptionalParams): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: SkusListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: SkusListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: SkusListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List all the available Skus in the region and information related to them + * @param options The options parameters. + */ + private _list(options?: SkusListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: SkusListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SkuInformationList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SkuInformationList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts new file mode 100644 index 000000000000..47c892c406ac --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts @@ -0,0 +1,622 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { VolumeGroups } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ElasticSanManagement } from "../elasticSanManagement.js"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + VolumeGroup, + VolumeGroupsListByElasticSanNextOptionalParams, + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsListByElasticSanResponse, + VolumeGroupsGetOptionalParams, + VolumeGroupsGetResponse, + VolumeGroupsCreateOptionalParams, + VolumeGroupsCreateResponse, + VolumeGroupUpdate, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsUpdateResponse, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsListByElasticSanNextResponse, +} from "../models/index.js"; + +/// +/** Class containing VolumeGroups operations. */ +export class VolumeGroupsImpl implements VolumeGroups { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class VolumeGroups class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + public listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByElasticSanPagingAll(resourceGroupName, elasticSanName, 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.listByElasticSanPagingPage( + resourceGroupName, + elasticSanName, + options, + settings, + ); + }, + }; + } + + private async *listByElasticSanPagingPage( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: VolumeGroupsListByElasticSanResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByElasticSan(resourceGroupName, elasticSanName, options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByElasticSanNext( + resourceGroupName, + elasticSanName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByElasticSanPagingAll( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByElasticSanPagingPage( + resourceGroupName, + elasticSanName, + options, + )) { + yield* page; + } + } + + /** + * List VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + private _listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, options }, + listByElasticSanOperationSpec, + ); + } + + /** + * Get an VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, volumeGroupName, options }, + getOperationSpec, + ); + } + + /** + * Create a Volume Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ): Promise< + SimplePollerLike, VolumeGroupsCreateResponse> + > { + 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, + elasticSanName, + volumeGroupName, + parameters, + options, + }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + VolumeGroupsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Create a Volume Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ): Promise< + SimplePollerLike, VolumeGroupsUpdateResponse> + > { + 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, + elasticSanName, + volumeGroupName, + parameters, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + VolumeGroupsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ): Promise, void>> { + 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, elasticSanName, volumeGroupName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListByElasticSanNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param nextLink The nextLink from the previous successful call to the ListByElasticSan method. + * @param options The options parameters. + */ + private _listByElasticSanNext( + resourceGroupName: string, + elasticSanName: string, + nextLink: string, + options?: VolumeGroupsListByElasticSanNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, nextLink, options }, + listByElasticSanNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByElasticSanOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroupList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroup, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroup, + }, + 201: { + bodyMapper: Mappers.VolumeGroup, + }, + 202: { + bodyMapper: Mappers.VolumeGroup, + }, + 204: { + bodyMapper: Mappers.VolumeGroup, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroup, + }, + 201: { + bodyMapper: Mappers.VolumeGroup, + }, + 202: { + bodyMapper: Mappers.VolumeGroup, + }, + 204: { + bodyMapper: Mappers.VolumeGroup, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByElasticSanNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroupList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts new file mode 100644 index 000000000000..7046274eb97a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { VolumeSnapshots } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ElasticSanManagement } from "../elasticSanManagement.js"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + Snapshot, + VolumeSnapshotsListByVolumeGroupNextOptionalParams, + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsListByVolumeGroupResponse, + VolumeSnapshotsGetOptionalParams, + VolumeSnapshotsGetResponse, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsCreateResponse, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsListByVolumeGroupNextResponse, +} from "../models/index.js"; + +/// +/** Class containing VolumeSnapshots operations. */ +export class VolumeSnapshotsImpl implements VolumeSnapshots { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class VolumeSnapshots class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + public listByVolumeGroup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeSnapshotsListByVolumeGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByVolumeGroupPagingAll( + resourceGroupName, + elasticSanName, + volumeGroupName, + 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.listByVolumeGroupPagingPage( + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByVolumeGroupPagingPage( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeSnapshotsListByVolumeGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: VolumeSnapshotsListByVolumeGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + ); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByVolumeGroupNext( + resourceGroupName, + elasticSanName, + volumeGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByVolumeGroupPagingAll( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeSnapshotsListByVolumeGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByVolumeGroupPagingPage( + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + )) { + yield* page; + } + } + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + private _listByVolumeGroup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeSnapshotsListByVolumeGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, volumeGroupName, options }, + listByVolumeGroupOperationSpec, + ); + } + + /** + * Get a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + options, + }, + getOperationSpec, + ); + } + + /** + * Create a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot object. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ): Promise< + SimplePollerLike, VolumeSnapshotsCreateResponse> + > { + 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, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + options, + }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + VolumeSnapshotsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Create a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot object. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ): Promise, void>> { + 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, + elasticSanName, + volumeGroupName, + snapshotName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListByVolumeGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param nextLink The nextLink from the previous successful call to the ListByVolumeGroup method. + * @param options The options parameters. + */ + private _listByVolumeGroupNext( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + nextLink: string, + options?: VolumeSnapshotsListByVolumeGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, volumeGroupName, nextLink, options }, + listByVolumeGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByVolumeGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SnapshotList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Snapshot, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.snapshotName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Snapshot, + }, + 201: { + bodyMapper: Mappers.Snapshot, + }, + 202: { + bodyMapper: Mappers.Snapshot, + }, + 204: { + bodyMapper: Mappers.Snapshot, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.snapshotName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.snapshotName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SnapshotList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts new file mode 100644 index 000000000000..27f4afeadd19 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts @@ -0,0 +1,956 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { Volumes } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ElasticSanManagement } from "../elasticSanManagement.js"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + Volume, + VolumesListByVolumeGroupNextOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesListByVolumeGroupResponse, + VolumeNameList, + VolumesPreBackupOptionalParams, + VolumesPreBackupResponse, + DiskSnapshotList, + VolumesPreRestoreOptionalParams, + VolumesPreRestoreResponse, + VolumesGetOptionalParams, + VolumesGetResponse, + VolumesCreateOptionalParams, + VolumesCreateResponse, + VolumeUpdate, + VolumesUpdateOptionalParams, + VolumesUpdateResponse, + VolumesDeleteOptionalParams, + VolumesListByVolumeGroupNextResponse, +} from "../models/index.js"; + +/// +/** Class containing Volumes operations. */ +export class VolumesImpl implements Volumes { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class Volumes class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List Volumes in a VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + public listByVolumeGroup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByVolumeGroupPagingAll( + resourceGroupName, + elasticSanName, + volumeGroupName, + 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.listByVolumeGroupPagingPage( + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByVolumeGroupPagingPage( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: VolumesListByVolumeGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + ); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByVolumeGroupNext( + resourceGroupName, + elasticSanName, + volumeGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByVolumeGroupPagingAll( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByVolumeGroupPagingPage( + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + )) { + yield* page; + } + } + + /** + * Validate whether a disk snapshot backup can be taken for list of volumes. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Name List (currently only one volume name in the list is supported. Server + * would return error if list is bigger) + * @param options The options parameters. + */ + async beginPreBackup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ): Promise, VolumesPreBackupResponse>> { + 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, + elasticSanName, + volumeGroupName, + parameters, + options, + }, + spec: preBackupOperationSpec, + }); + const poller = await createHttpPoller< + VolumesPreBackupResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Validate whether a disk snapshot backup can be taken for list of volumes. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Name List (currently only one volume name in the list is supported. Server + * would return error if list is bigger) + * @param options The options parameters. + */ + async beginPreBackupAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ): Promise { + const poller = await this.beginPreBackup( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and + * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if + * list is bigger) + * @param options The options parameters. + */ + async beginPreRestore( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ): Promise< + SimplePollerLike, VolumesPreRestoreResponse> + > { + 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, + elasticSanName, + volumeGroupName, + parameters, + options, + }, + spec: preRestoreOperationSpec, + }); + const poller = await createHttpPoller< + VolumesPreRestoreResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and + * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if + * list is bigger) + * @param options The options parameters. + */ + async beginPreRestoreAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ): Promise { + const poller = await this.beginPreRestore( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * List Volumes in a VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + private _listByVolumeGroup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, volumeGroupName, options }, + listByVolumeGroupOperationSpec, + ); + } + + /** + * Get an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + }, + getOperationSpec, + ); + } + + /** + * Create a Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ): Promise, VolumesCreateResponse>> { + 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, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + VolumesCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Create a Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ): Promise, VolumesUpdateResponse>> { + 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, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + VolumesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ): Promise, void>> { + 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, + elasticSanName, + volumeGroupName, + volumeName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListByVolumeGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param nextLink The nextLink from the previous successful call to the ListByVolumeGroup method. + * @param options The options parameters. + */ + private _listByVolumeGroupNext( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + nextLink: string, + options?: VolumesListByVolumeGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, volumeGroupName, nextLink, options }, + listByVolumeGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const preBackupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PreValidationResponse, + }, + 201: { + bodyMapper: Mappers.PreValidationResponse, + }, + 202: { + bodyMapper: Mappers.PreValidationResponse, + }, + 204: { + bodyMapper: Mappers.PreValidationResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const preRestoreOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PreValidationResponse, + }, + 201: { + bodyMapper: Mappers.PreValidationResponse, + }, + 202: { + bodyMapper: Mappers.PreValidationResponse, + }, + 204: { + bodyMapper: Mappers.PreValidationResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByVolumeGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Volume, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.volumeName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Volume, + }, + 201: { + bodyMapper: Mappers.Volume, + }, + 202: { + bodyMapper: Mappers.Volume, + }, + 204: { + bodyMapper: Mappers.Volume, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.volumeName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Volume, + }, + 201: { + bodyMapper: Mappers.Volume, + }, + 202: { + bodyMapper: Mappers.Volume, + }, + 204: { + bodyMapper: Mappers.Volume, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.volumeName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.volumeName, + ], + headerParameters: [Parameters.accept, Parameters.xMsDeleteSnapshots, Parameters.xMsForceDelete], + serializer, +}; +const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts new file mode 100644 index 000000000000..a7c93f537527 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + ElasticSan, + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansGetOptionalParams, + ElasticSansGetResponse, + ElasticSansCreateOptionalParams, + ElasticSansCreateResponse, + ElasticSanUpdate, + ElasticSansUpdateOptionalParams, + ElasticSansUpdateResponse, + ElasticSansDeleteOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a ElasticSans. */ +export interface ElasticSans { + /** + * Gets a list of ElasticSans in a subscription + * @param options The options parameters. + */ + listBySubscription( + options?: ElasticSansListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a list of ElasticSan in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansGetOptionalParams, + ): Promise; + /** + * Create ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ): Promise< + SimplePollerLike, ElasticSansCreateResponse> + >; + /** + * Create ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ): Promise; + /** + * Update a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ): Promise< + SimplePollerLike, ElasticSansUpdateResponse> + >; + /** + * Update a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ): Promise; + /** + * Delete a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ): Promise, void>>; + /** + * Delete a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..b291dba769e0 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +export * from "./operations.js"; +export * from "./elasticSans.js"; +export * from "./skus.js"; +export * from "./privateEndpointConnections.js"; +export * from "./privateLinkResources.js"; +export * from "./volumeGroups.js"; +export * from "./volumes.js"; +export * from "./volumeSnapshots.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..58533294df40 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { Operation, OperationsListOptionalParams } from "../models/index.js"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List the operations for the provider + * @param options The options parameters. + */ + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..75512df709b3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + PrivateEndpointConnection, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsCreateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * List all Private Endpoint Connections associated with the Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ): Promise; + /** + * Update the state of specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionsCreateResponse + > + >; + /** + * Update the state of specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ): Promise; + /** + * Deletes the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ): Promise, void>>; + /** + * Deletes the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..cd151bcafdb1 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { + PrivateLinkResourcesListByElasticSanOptionalParams, + PrivateLinkResourcesListByElasticSanResponse, +} from "../models/index.js"; + +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateLinkResourcesListByElasticSanOptionalParams, + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts new file mode 100644 index 000000000000..a21495848a84 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SkuInformation, SkusListOptionalParams } from "../models/index.js"; + +/// +/** Interface representing a Skus. */ +export interface Skus { + /** + * List all the available Skus in the region and information related to them + * @param options The options parameters. + */ + list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts new file mode 100644 index 000000000000..9afddd92b868 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + VolumeGroup, + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsGetOptionalParams, + VolumeGroupsGetResponse, + VolumeGroupsCreateOptionalParams, + VolumeGroupsCreateResponse, + VolumeGroupUpdate, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsUpdateResponse, + VolumeGroupsDeleteOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a VolumeGroups. */ +export interface VolumeGroups { + /** + * List VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get an VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsGetOptionalParams, + ): Promise; + /** + * Create a Volume Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ): Promise< + SimplePollerLike, VolumeGroupsCreateResponse> + >; + /** + * Create a Volume Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ): Promise; + /** + * Update an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ): Promise< + SimplePollerLike, VolumeGroupsUpdateResponse> + >; + /** + * Update an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ): Promise; + /** + * Delete an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ): Promise, void>>; + /** + * Delete an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts new file mode 100644 index 000000000000..986d89a2e356 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + Snapshot, + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsGetOptionalParams, + VolumeSnapshotsGetResponse, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsCreateResponse, + VolumeSnapshotsDeleteOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a VolumeSnapshots. */ +export interface VolumeSnapshots { + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + listByVolumeGroup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeSnapshotsListByVolumeGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsGetOptionalParams, + ): Promise; + /** + * Create a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ): Promise< + SimplePollerLike, VolumeSnapshotsCreateResponse> + >; + /** + * Create a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ): Promise; + /** + * Delete a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ): Promise, void>>; + /** + * Delete a Volume Snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param snapshotName The name of the volume snapshot within the given volume group. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts new file mode 100644 index 000000000000..6961bf365ebf --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + Volume, + VolumesListByVolumeGroupOptionalParams, + VolumeNameList, + VolumesPreBackupOptionalParams, + VolumesPreBackupResponse, + DiskSnapshotList, + VolumesPreRestoreOptionalParams, + VolumesPreRestoreResponse, + VolumesGetOptionalParams, + VolumesGetResponse, + VolumesCreateOptionalParams, + VolumesCreateResponse, + VolumeUpdate, + VolumesUpdateOptionalParams, + VolumesUpdateResponse, + VolumesDeleteOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a Volumes. */ +export interface Volumes { + /** + * List Volumes in a VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + listByVolumeGroup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Validate whether a disk snapshot backup can be taken for list of volumes. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Name List (currently only one volume name in the list is supported. Server + * would return error if list is bigger) + * @param options The options parameters. + */ + beginPreBackup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ): Promise, VolumesPreBackupResponse>>; + /** + * Validate whether a disk snapshot backup can be taken for list of volumes. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Name List (currently only one volume name in the list is supported. Server + * would return error if list is bigger) + * @param options The options parameters. + */ + beginPreBackupAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ): Promise; + /** + * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and + * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if + * list is bigger) + * @param options The options parameters. + */ + beginPreRestore( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ): Promise< + SimplePollerLike, VolumesPreRestoreResponse> + >; + /** + * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and + * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if + * list is bigger) + * @param options The options parameters. + */ + beginPreRestoreAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ): Promise; + /** + * Get an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams, + ): Promise; + /** + * Create a Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ): Promise, VolumesCreateResponse>>; + /** + * Create a Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ): Promise; + /** + * Update an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ): Promise, VolumesUpdateResponse>>; + /** + * Update an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ): Promise; + /** + * Delete an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ): Promise, void>>; + /** + * Delete an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts b/sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts new file mode 100644 index 000000000000..f64c4c8390ed --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts deleted file mode 100644 index ff29eed1fe2d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanManagement } from "./elasticSanManagement.js"; -import { _$deleteDeserialize, _createDeserialize } from "./api/volumeSnapshots/operations.js"; -import { - _$deleteDeserialize as _$deleteDeserializeVolumeGroups, - _updateDeserialize, - _createDeserialize as _createDeserializeVolumeGroups, -} from "./api/volumeGroups/operations.js"; -import { - _preRestoreDeserialize, - _preBackupDeserialize, - _$deleteDeserialize as _$deleteDeserializeVolumes, - _updateDeserialize as _updateDeserializeVolumes, - _createDeserialize as _createDeserializeVolumes, -} from "./api/volumes/operations.js"; -import { - _$deleteDeserialize as _$deleteDeserializePrivateEndpointConnections, - _createDeserialize as _createDeserializePrivateEndpointConnections, -} from "./api/privateEndpointConnections/operations.js"; -import { - _$deleteDeserialize as _$deleteDeserializeElasticSans, - _updateDeserialize as _updateDeserializeElasticSans, - _createDeserialize as _createDeserializeElasticSans, -} from "./api/elasticSans/operations.js"; -import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; -import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; -import type { AbortSignalLike } from "@azure/abort-controller"; -import type { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro"; -import { deserializeState } from "@azure/core-lro"; - -export interface RestorePollerOptions< - TResult, - TResponse extends PathUncheckedResponse = PathUncheckedResponse, -> extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** - * The signal which can be used to abort requests. - */ - abortSignal?: AbortSignalLike; - /** Deserialization function for raw response body */ - processResponseBody?: (result: TResponse) => Promise; -} - -/** - * Creates a poller from the serialized state of another poller. This can be - * useful when you want to create pollers on a different host or a poller - * needs to be constructed after the original one is not in scope. - */ -export function restorePoller( - client: ElasticSanManagement, - serializedState: string, - sourceOperation: (...args: any[]) => PollerLike, TResult>, - options?: RestorePollerOptions, -): PollerLike, TResult> { - const pollerConfig = deserializeState(serializedState).config; - const { initialRequestUrl, requestMethod, metadata } = pollerConfig; - if (!initialRequestUrl || !requestMethod) { - throw new Error( - `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, - ); - } - const resourceLocationConfig = metadata?.["resourceLocationConfig"] as - | ResourceLocationConfig - | undefined; - const { deserializer, expectedStatuses = [] } = - getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; - const deserializeHelper = options?.processResponseBody ?? deserializer; - if (!deserializeHelper) { - throw new Error( - `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, - ); - } - return getLongRunningPoller( - (client as any)["_client"] ?? client, - deserializeHelper as (result: TResponse) => Promise, - expectedStatuses, - { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - resourceLocationConfig, - restoreFrom: serializedState, - initialRequestUrl, - }, - ); -} - -interface DeserializationHelper { - // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type - deserializer: Function; - expectedStatuses: string[]; -} - -const deserializeMap: Record = { - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}": - { - deserializer: _$deleteDeserialize, - expectedStatuses: ["200", "202", "204"], - }, - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}": - { - deserializer: _createDeserialize, - expectedStatuses: ["200", "201", "202"], - }, - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}": - { - deserializer: _$deleteDeserializeVolumeGroups, - expectedStatuses: ["200", "202", "204"], - }, - "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}": - { deserializer: _updateDeserialize, expectedStatuses: ["200", "202"] }, - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}": - { - deserializer: _createDeserializeVolumeGroups, - expectedStatuses: ["200", "201", "202"], - }, - "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore": - { deserializer: _preRestoreDeserialize, expectedStatuses: ["202", "200"] }, - "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup": - { deserializer: _preBackupDeserialize, expectedStatuses: ["202", "200"] }, - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}": - { - deserializer: _$deleteDeserializeVolumes, - expectedStatuses: ["200", "202", "204"], - }, - "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}": - { - deserializer: _updateDeserializeVolumes, - expectedStatuses: ["200", "202"], - }, - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}": - { - deserializer: _createDeserializeVolumes, - expectedStatuses: ["200", "201", "202"], - }, - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}": - { - deserializer: _$deleteDeserializePrivateEndpointConnections, - expectedStatuses: ["200", "202", "204"], - }, - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}": - { - deserializer: _createDeserializePrivateEndpointConnections, - expectedStatuses: ["200", "201", "202"], - }, - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}": - { - deserializer: _$deleteDeserializeElasticSans, - expectedStatuses: ["200", "202", "204"], - }, - "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}": - { - deserializer: _updateDeserializeElasticSans, - expectedStatuses: ["200", "202"], - }, - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}": - { - deserializer: _createDeserializeElasticSans, - expectedStatuses: ["200", "201", "202"], - }, -}; - -function getDeserializationHelper( - urlStr: string, - method: string, -): DeserializationHelper | undefined { - const path = new URL(urlStr).pathname; - const pathParts = path.split("/"); - - // Traverse list to match the longest candidate - // matchedLen: the length of candidate path - // matchedValue: the matched status code array - let matchedLen = -1, - matchedValue: DeserializationHelper | undefined; - - // Iterate the responseMap to find a match - for (const [key, value] of Object.entries(deserializeMap)) { - // Extracting the path from the map key which is in format - // GET /path/foo - if (!key.startsWith(method)) { - continue; - } - const candidatePath = getPathFromMapKey(key); - // Get each part of the url path - const candidateParts = candidatePath.split("/"); - - // track if we have found a match to return the values found. - let found = true; - for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { - if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { - const start = candidateParts[i]!.indexOf("}") + 1, - end = candidateParts[i]?.length; - // If the current part of the candidate is a "template" part - // Try to use the suffix of pattern to match the path - // {guid} ==> $ - // {guid}:export ==> :export$ - const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( - pathParts[j] || "", - ); - - if (!isMatched) { - found = false; - break; - } - continue; - } - - // If the candidate part is not a template and - // the parts don't match mark the candidate as not found - // to move on with the next candidate path. - if (candidateParts[i] !== pathParts[j]) { - found = false; - break; - } - } - - // We finished evaluating the current candidate parts - // Update the matched value if and only if we found the longer pattern - if (found && candidatePath.length > matchedLen) { - matchedLen = candidatePath.length; - matchedValue = value; - } - } - - return matchedValue; -} - -function getPathFromMapKey(mapKey: string): string { - const pathStart = mapKey.indexOf("/"); - return mapKey.slice(pathStart); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts deleted file mode 100644 index 613112c6e397..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * An enum to describe Azure Cloud environments. - * @enum {string} - */ -export enum AzureClouds { - /** Azure public cloud, which is the default cloud for Azure SDKs. */ - AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", - /** Azure China cloud */ - AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", - /** Azure US government cloud */ - AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", -} - -/** The supported values for cloud setting as a string literal type */ -export type AzureSupportedClouds = `${AzureClouds}`; - -/** - * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. - * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. - * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. - * @throws {Error} Throws an error if an unknown cloud setting is provided. - */ -export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { - if (cloudSetting === undefined) { - return undefined; - } - const cloudEndpoints: Record = { - AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", - AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", - AZURE_PUBLIC_CLOUD: "https://management.azure.com/", - }; - if (cloudSetting in cloudEndpoints) { - return cloudEndpoints[cloudSetting]; - } else { - throw new Error( - `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, - ); - } -} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts deleted file mode 100644 index 11248b3804e4..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError } from "@azure-rest/core-client"; -import { RestError } from "@azure/core-rest-pipeline"; - -/** - * Options for the byPage method - */ -export interface PageSettings { - /** - * A reference to a specific page to start iterating from. - */ - continuationToken?: string; -} - -/** - * An interface that describes a page of results. - */ -export type ContinuablePage = TPage & { - /** - * The token that keeps track of where to continue the iterator - */ - continuationToken?: string; -}; - -/** - * An interface that allows async iterable iteration both to completion and by page. - */ -export interface PagedAsyncIterableIterator< - TElement, - TPage = TElement[], - TPageSettings extends PageSettings = PageSettings, -> { - /** - * The next method, part of the iteration protocol - */ - next(): Promise>; - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator](): PagedAsyncIterableIterator; - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings?: TPageSettings) => AsyncIterableIterator>; -} - -/** - * An interface that describes how to communicate with the service. - */ -export interface PagedResult< - TElement, - TPage = TElement[], - TPageSettings extends PageSettings = PageSettings, -> { - /** - * Link to the first page of results. - */ - firstPageLink?: string; - /** - * A method that returns a page of results. - */ - getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; - /** - * a function to implement the `byPage` method on the paged async iterator. - */ - byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; - - /** - * A function to extract elements from a page. - */ - toElements?: (page: TPage) => TElement[]; -} - -/** - * Options for the paging helper - */ -export interface BuildPagedAsyncIteratorOptions { - itemName?: string; - nextLinkName?: string; -} - -/** - * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator - */ -export function buildPagedAsyncIterator< - TElement, - TPage = TElement[], - TPageSettings extends PageSettings = PageSettings, - TResponse extends PathUncheckedResponse = PathUncheckedResponse, ->( - client: Client, - getInitialResponse: () => PromiseLike, - processResponseBody: (result: TResponse) => PromiseLike, - expectedStatuses: string[], - options: BuildPagedAsyncIteratorOptions = {}, -): PagedAsyncIterableIterator { - const itemName = options.itemName ?? "value"; - const nextLinkName = options.nextLinkName ?? "nextLink"; - const pagedResult: PagedResult = { - getPage: async (pageLink?: string) => { - const result = - pageLink === undefined - ? await getInitialResponse() - : await client.pathUnchecked(pageLink).get(); - checkPagingRequest(result, expectedStatuses); - const results = await processResponseBody(result as TResponse); - const nextLink = getNextLink(results, nextLinkName); - const values = getElements(results, itemName) as TPage; - return { - page: values, - nextPageLink: nextLink, - }; - }, - byPage: (settings?: TPageSettings) => { - const { continuationToken } = settings ?? {}; - return getPageAsyncIterator(pagedResult, { - pageLink: continuationToken, - }); - }, - }; - return getPagedAsyncIterator(pagedResult); -} - -/** - * returns an async iterator that iterates over results. It also has a `byPage` - * method that returns pages of items at once. - * - * @param pagedResult - an object that specifies how to get pages. - * @returns a paged async iterator that iterates over results. - */ - -function getPagedAsyncIterator< - TElement, - TPage = TElement[], - TPageSettings extends PageSettings = PageSettings, ->( - pagedResult: PagedResult, -): PagedAsyncIterableIterator { - const iter = getItemAsyncIterator(pagedResult); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: - pagedResult?.byPage ?? - ((settings?: TPageSettings) => { - const { continuationToken } = settings ?? {}; - return getPageAsyncIterator(pagedResult, { - pageLink: continuationToken, - }); - }), - }; -} - -async function* getItemAsyncIterator( - pagedResult: PagedResult, -): AsyncIterableIterator { - const pages = getPageAsyncIterator(pagedResult); - for await (const page of pages) { - yield* page as unknown as TElement[]; - } -} - -async function* getPageAsyncIterator( - pagedResult: PagedResult, - options: { - pageLink?: string; - } = {}, -): AsyncIterableIterator> { - const { pageLink } = options; - let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); - if (!response) { - return; - } - let result = response.page as ContinuablePage; - result.continuationToken = response.nextPageLink; - yield result; - while (response.nextPageLink) { - response = await pagedResult.getPage(response.nextPageLink); - if (!response) { - return; - } - result = response.page as ContinuablePage; - result.continuationToken = response.nextPageLink; - yield result; - } -} - -/** - * Gets for the value of nextLink in the body - */ -function getNextLink(body: unknown, nextLinkName?: string): string | undefined { - if (!nextLinkName) { - return undefined; - } - - const nextLink = (body as Record)[nextLinkName]; - - if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { - throw new RestError( - `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, - ); - } - - if (nextLink === null) { - return undefined; - } - - return nextLink; -} - -/** - * Gets the elements of the current request in the body. - */ -function getElements(body: unknown, itemName: string): T[] { - const value = (body as Record)[itemName] as T[]; - if (!Array.isArray(value)) { - throw new RestError( - `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, - ); - } - - return value ?? []; -} - -/** - * Checks if a request failed - */ -function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { - if (!expectedStatuses.includes(response.status)) { - throw createRestError( - `Pagination failed with unexpected statusCode ${response.status}`, - response, - ); - } -} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts deleted file mode 100644 index 63b3c201e5a8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - PollerLike, - OperationState, - ResourceLocationConfig, - RunningOperation, - OperationResponse, -} from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; - -import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError } from "@azure-rest/core-client"; -import type { AbortSignalLike } from "@azure/abort-controller"; - -export interface GetLongRunningPollerOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** - * The signal which can be used to abort requests. - */ - abortSignal?: AbortSignalLike; - /** - * The potential location of the result of the LRO if specified by the LRO extension in the swagger. - */ - resourceLocationConfig?: ResourceLocationConfig; - /** - * The original url of the LRO - * Should not be null when restoreFrom is set - */ - initialRequestUrl?: string; - /** - * A serialized poller which can be used to resume an existing paused Long-Running-Operation. - */ - restoreFrom?: string; - /** - * The function to get the initial response - */ - getInitialResponse?: () => PromiseLike; -} -export function getLongRunningPoller( - client: Client, - processResponseBody: (result: TResponse) => Promise, - expectedStatuses: string[], - options: GetLongRunningPollerOptions, -): PollerLike, TResult> { - const { restoreFrom, getInitialResponse } = options; - if (!restoreFrom && !getInitialResponse) { - throw new Error("Either restoreFrom or getInitialResponse must be specified"); - } - let initialResponse: TResponse | undefined = undefined; - const pollAbortController = new AbortController(); - const poller: RunningOperation = { - sendInitialRequest: async () => { - if (!getInitialResponse) { - throw new Error("getInitialResponse is required when initializing a new poller"); - } - initialResponse = await getInitialResponse(); - return getLroResponse(initialResponse, expectedStatuses); - }, - sendPollRequest: async ( - path: string, - pollOptions?: { - abortSignal?: AbortSignalLike; - }, - ) => { - // The poll request would both listen to the user provided abort signal and the poller's own abort signal - function abortListener(): void { - pollAbortController.abort(); - } - const abortSignal = pollAbortController.signal; - if (options.abortSignal?.aborted) { - pollAbortController.abort(); - } else if (pollOptions?.abortSignal?.aborted) { - pollAbortController.abort(); - } else if (!abortSignal.aborted) { - options.abortSignal?.addEventListener("abort", abortListener, { - once: true, - }); - pollOptions?.abortSignal?.addEventListener("abort", abortListener, { - once: true, - }); - } - let response; - try { - response = await client.pathUnchecked(path).get({ abortSignal }); - } finally { - options.abortSignal?.removeEventListener("abort", abortListener); - pollOptions?.abortSignal?.removeEventListener("abort", abortListener); - } - - return getLroResponse(response as TResponse, expectedStatuses); - }, - }; - return createHttpPoller(poller, { - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: options?.resourceLocationConfig, - restoreFrom: options?.restoreFrom, - processResult: (result: unknown) => { - return processResponseBody(result as TResponse); - }, - }); -} -/** - * Converts a Rest Client response to a response that the LRO implementation understands - * @param response - a rest client http response - * @param deserializeFn - deserialize function to convert Rest response to modular output - * @returns - An LRO response that the LRO implementation understands - */ -function getLroResponse( - response: TResponse, - expectedStatuses: string[], -): OperationResponse { - if (!expectedStatuses.includes(response.status)) { - throw createRestError(response); - } - - return { - flatResponse: response, - rawResponse: { - ...response, - statusCode: Number.parseInt(response.status), - body: response.body, - }, - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts deleted file mode 100644 index 657898dd38ff..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// --------------------- -// interfaces -// --------------------- -interface ValueOptions { - isFirst: boolean; // is first value in the expression - op?: string; // operator - varValue?: any; // variable value - varName?: string; // variable name - modifier?: string; // modifier e.g * - reserved?: boolean; // if true we'll keep reserved words with not encoding -} - -export interface UrlTemplateOptions { - // if set to true, reserved characters will not be encoded - allowReserved?: boolean; -} - -// --------------------- -// helpers -// --------------------- -function encodeComponent(val: string, reserved?: boolean, op?: string): string { - return (reserved ?? op === "+") || op === "#" - ? encodeReservedComponent(val) - : encodeRFC3986URIComponent(val); -} - -function encodeReservedComponent(str: string): string { - return str - .split(/(%[0-9A-Fa-f]{2})/g) - .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) - .join(""); -} - -function encodeRFC3986URIComponent(str: string): string { - return encodeURIComponent(str).replace( - /[!'()*]/g, - (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, - ); -} - -function isDefined(val: any): boolean { - return val !== undefined && val !== null; -} - -function getNamedAndIfEmpty(op?: string): [boolean, string] { - return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; -} - -function getFirstOrSep(op?: string, isFirst = false): string { - if (isFirst) { - return !op || op === "+" ? "" : op; - } else if (!op || op === "+" || op === "#") { - return ","; - } else if (op === "?") { - return "&"; - } else { - return op; - } -} - -function getExpandedValue(option: ValueOptions): string { - let isFirst = option.isFirst; - const { op, varName, varValue: value, reserved } = option; - const vals: string[] = []; - const [named, ifEmpty] = getNamedAndIfEmpty(op); - - if (Array.isArray(value)) { - for (const val of value.filter(isDefined)) { - // prepare the following parts: separator, varName, value - vals.push(`${getFirstOrSep(op, isFirst)}`); - if (named && varName) { - vals.push(`${encodeURIComponent(varName)}`); - if (val === "") { - vals.push(ifEmpty); - } else { - vals.push("="); - } - } - vals.push(encodeComponent(val, reserved, op)); - isFirst = false; - } - } else if (typeof value === "object") { - for (const key of Object.keys(value)) { - const val = value[key]; - if (!isDefined(val)) { - continue; - } - // prepare the following parts: separator, key, value - vals.push(`${getFirstOrSep(op, isFirst)}`); - if (key) { - vals.push(`${encodeURIComponent(key)}`); - if (named && val === "") { - vals.push(ifEmpty); - } else { - vals.push("="); - } - } - vals.push(encodeComponent(val, reserved, op)); - isFirst = false; - } - } - return vals.join(""); -} - -function getNonExpandedValue(option: ValueOptions): string | undefined { - const { op, varName, varValue: value, isFirst, reserved } = option; - const vals: string[] = []; - const first = getFirstOrSep(op, isFirst); - const [named, ifEmpty] = getNamedAndIfEmpty(op); - if (named && varName) { - vals.push(encodeComponent(varName, reserved, op)); - if (value === "") { - if (!ifEmpty) { - vals.push(ifEmpty); - } - return !vals.join("") ? undefined : `${first}${vals.join("")}`; - } - vals.push("="); - } - - const items = []; - if (Array.isArray(value)) { - for (const val of value.filter(isDefined)) { - items.push(encodeComponent(val, reserved, op)); - } - } else if (typeof value === "object") { - for (const key of Object.keys(value)) { - if (!isDefined(value[key])) { - continue; - } - items.push(encodeRFC3986URIComponent(key)); - items.push(encodeComponent(value[key], reserved, op)); - } - } - vals.push(items.join(",")); - return !vals.join(",") ? undefined : `${first}${vals.join("")}`; -} - -function getVarValue(option: ValueOptions): string | undefined { - const { op, varName, modifier, isFirst, reserved, varValue: value } = option; - - if (!isDefined(value)) { - return undefined; - } else if (["string", "number", "boolean"].includes(typeof value)) { - let val = value.toString(); - const [named, ifEmpty] = getNamedAndIfEmpty(op); - const vals: string[] = [getFirstOrSep(op, isFirst)]; - if (named && varName) { - // No need to encode varName considering it is already encoded - vals.push(varName); - if (val === "") { - vals.push(ifEmpty); - } else { - vals.push("="); - } - } - if (modifier && modifier !== "*") { - val = val.substring(0, parseInt(modifier, 10)); - } - vals.push(encodeComponent(val, reserved, op)); - return vals.join(""); - } else if (modifier === "*") { - return getExpandedValue(option); - } else { - return getNonExpandedValue(option); - } -} - -// --------------------------------------------------------------------------------------------------- -// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. -// --------------------------------------------------------------------------------------------------- -export function expandUrlTemplate( - template: string, - context: Record, - option?: UrlTemplateOptions, -): string { - return template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { - if (!expr) { - return encodeReservedComponent(text); - } - let op; - if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { - op = expr[0]; - expr = expr.slice(1); - } - const varList = expr.split(/,/g); - const result = []; - for (const varSpec of varList) { - const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); - if (!varMatch || !varMatch[1]) { - continue; - } - const varValue = getVarValue({ - isFirst: result.length === 0, - op, - varValue: context[varMatch[1]], - varName: varMatch[1], - modifier: varMatch[2] || varMatch[3], - reserved: option?.allowReserved, - }); - if (varValue) { - result.push(varValue); - } - } - return result.join(""); - }); -} diff --git a/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts b/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts index 411f19c69d70..77b37b2c9084 100644 --- a/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts +++ b/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts @@ -13,11 +13,11 @@ describe("snippets", () => { }); it("ReadmeSampleCreateClient_Browser", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); }); diff --git a/sdk/elasticsans/arm-elasticsan/tsconfig.test.json b/sdk/elasticsans/arm-elasticsan/tsconfig.test.json index 290ca214aebc..42798ad68913 100644 --- a/sdk/elasticsans/arm-elasticsan/tsconfig.test.json +++ b/sdk/elasticsans/arm-elasticsan/tsconfig.test.json @@ -1,3 +1,14 @@ { - "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] + "references": [ + { + "path": "./tsconfig.test.node.json" + }, + { + "path": "./tsconfig.browser.config.json" + } + ], + "compilerOptions": { + "composite": true + }, + "files": [] } diff --git a/sdk/elasticsans/arm-elasticsan/tsconfig.test.node.json b/sdk/elasticsans/arm-elasticsan/tsconfig.test.node.json new file mode 100644 index 000000000000..34e5a01aa104 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/tsconfig.test.node.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.test.node.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-elasticsan": ["./src/index.ts"], + "@azure/arm-elasticsan/*": ["./src/*"], + "$internal/*": ["./src/*"] + } + } +} diff --git a/sdk/elasticsans/arm-elasticsan/tsp-location.yaml b/sdk/elasticsans/arm-elasticsan/tsp-location.yaml deleted file mode 100644 index afa137486310..000000000000 --- a/sdk/elasticsans/arm-elasticsan/tsp-location.yaml +++ /dev/null @@ -1,4 +0,0 @@ -directory: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan -commit: c86c7e36fb15171a9967d9fdc47784f2e4202ca6 -repo: Azure/azure-rest-api-specs -additionalDirectories: From 87d8491285b2634e618a1fea271f4745da12abdd Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Sat, 14 Feb 2026 11:12:38 +0800 Subject: [PATCH 3/8] Update pnpm-lock.yaml --- pnpm-lock.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0eac56b91c57..20580b540972 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12402,7 +12402,7 @@ importers: specifier: catalog:internal version: 4.13.0 '@azure/logger': - specifier: ^1.1.4 + specifier: workspace:^ version: link:../../core/logger '@types/node': specifier: 'catalog:' @@ -12419,9 +12419,15 @@ importers: dotenv: specifier: catalog:testing version: 16.6.1 + eslint: + specifier: 'catalog:' + version: 9.39.2 playwright: specifier: catalog:testing version: 1.58.2 + prettier: + specifier: 'catalog:' + version: 3.8.1 rimraf: specifier: 'catalog:' version: 6.1.2 From a909d52bef37e0c57f9714950ecd43339f30ba03 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Sat, 14 Feb 2026 03:23:25 +0000 Subject: [PATCH 4/8] Configurations: 'specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/tspconfig.yaml', API Version: 2025-09-01, SDK Release Type: stable, and CommitSHA: '75ef537e80d5c4ea14adac72bd7e67114df06e8e' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5882303 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- pnpm-lock.yaml | 27 +- sdk/elasticsans/arm-elasticsan/CHANGELOG.md | 132 +- sdk/elasticsans/arm-elasticsan/README.md | 22 +- sdk/elasticsans/arm-elasticsan/_meta.json | 8 - .../arm-elasticsan/api-extractor.json | 4 +- .../arm-elasticsan/eslint.config.mjs | 14 + sdk/elasticsans/arm-elasticsan/metadata.json | 115 + sdk/elasticsans/arm-elasticsan/package.json | 349 ++- ...arm-elasticsan-api-elasticSans-node.api.md | 59 + .../review/arm-elasticsan-api-node.api.md | 28 + .../arm-elasticsan-api-operations-node.api.md | 19 + ...api-privateEndpointConnections-node.api.md | 44 + ...icsan-api-privateLinkResources-node.api.md | 19 + .../arm-elasticsan-api-skus-node.api.md | 20 + ...rm-elasticsan-api-volumeGroups-node.api.md | 52 + ...elasticsan-api-volumeSnapshots-node.api.md | 45 + .../arm-elasticsan-api-volumes-node.api.md | 70 + .../review/arm-elasticsan-models-node.api.md | 569 +++++ .../review/arm-elasticsan-node.api.md | 682 +++--- .../samples-dev/elasticSansCreateSample.ts | 82 +- .../samples-dev/elasticSansDeleteSample.ts | 37 +- .../samples-dev/elasticSansGetSample.ts | 35 +- .../elasticSansListByResourceGroupSample.ts | 33 +- .../elasticSansListBySubscriptionSample.ts | 21 +- .../samples-dev/elasticSansUpdateSample.ts | 66 +- .../samples-dev/operationsListSample.ts | 23 +- .../privateEndpointConnectionsCreateSample.ts | 63 +- .../privateEndpointConnectionsDeleteSample.ts | 45 +- .../privateEndpointConnectionsGetSample.ts | 39 +- .../privateEndpointConnectionsListSample.ts | 35 +- ...vateLinkResourcesListByElasticSanSample.ts | 33 +- .../samples-dev/skusListSample.ts | 31 +- .../samples-dev/volumeGroupsCreateSample.ts | 62 +- .../samples-dev/volumeGroupsDeleteSample.ts | 41 +- .../samples-dev/volumeGroupsGetSample.ts | 39 +- .../volumeGroupsListByElasticSanSample.ts | 35 +- .../samples-dev/volumeGroupsUpdateSample.ts | 62 +- .../volumeSnapshotsCreateSample.ts | 68 +- .../volumeSnapshotsDeleteSample.ts | 51 +- .../samples-dev/volumeSnapshotsGetSample.ts | 45 +- .../volumeSnapshotsListByVolumeGroupSample.ts | 51 +- .../samples-dev/volumesCreateSample.ts | 62 +- .../samples-dev/volumesDeleteSample.ts | 65 +- .../samples-dev/volumesGetSample.ts | 45 +- .../volumesListByVolumeGroupSample.ts | 41 +- .../samples-dev/volumesPreBackupSample.ts | 26 +- .../samples-dev/volumesPreRestoreSample.ts | 34 +- .../samples-dev/volumesUpdateSample.ts | 61 +- .../samples/v1/javascript/README.md | 106 - .../v1/javascript/elasticSansCreateSample.js | 80 - .../v1/javascript/elasticSansDeleteSample.js | 45 - .../v1/javascript/elasticSansGetSample.js | 45 - .../v1/javascript/elasticSansUpdateSample.js | 70 - .../privateEndpointConnectionsCreateSample.js | 71 - .../privateEndpointConnectionsDeleteSample.js | 55 - .../privateEndpointConnectionsGetSample.js | 55 - ...vateLinkResourcesListByElasticSanSample.js | 51 - .../v1/javascript/volumeGroupsCreateSample.js | 77 - .../v1/javascript/volumeGroupsDeleteSample.js | 55 - .../v1/javascript/volumeGroupsGetSample.js | 47 - .../volumeGroupsListByElasticSanSample.js | 57 - .../v1/javascript/volumeGroupsUpdateSample.js | 77 - .../javascript/volumeSnapshotsCreateSample.js | 77 - .../javascript/volumeSnapshotsDeleteSample.js | 59 - .../v1/javascript/volumeSnapshotsGetSample.js | 59 - .../volumeSnapshotsListByVolumeGroupSample.js | 64 - .../v1/javascript/volumesCreateSample.js | 69 - .../v1/javascript/volumesDeleteSample.js | 66 - .../samples/v1/javascript/volumesGetSample.js | 59 - .../volumesListByVolumeGroupSample.js | 61 - .../v1/javascript/volumesPreBackupSample.js | 35 - .../v1/javascript/volumesPreRestoreSample.js | 39 - .../v1/javascript/volumesUpdateSample.js | 68 - .../samples/v1/typescript/README.md | 119 - .../typescript/src/elasticSansCreateSample.ts | 85 - .../typescript/src/elasticSansDeleteSample.ts | 55 - .../v1/typescript/src/elasticSansGetSample.ts | 55 - .../typescript/src/elasticSansUpdateSample.ts | 75 - .../privateEndpointConnectionsCreateSample.ts | 79 - .../privateEndpointConnectionsDeleteSample.ts | 59 - .../privateEndpointConnectionsGetSample.ts | 59 - ...vateLinkResourcesListByElasticSanSample.ts | 55 - .../v1/typescript/src/skusListSample.ts | 55 - .../src/volumeGroupsCreateSample.ts | 84 - .../src/volumeGroupsDeleteSample.ts | 59 - .../typescript/src/volumeGroupsGetSample.ts | 59 - .../src/volumeGroupsUpdateSample.ts | 84 - .../src/volumeSnapshotsCreateSample.ts | 82 - .../src/volumeSnapshotsDeleteSample.ts | 63 - .../src/volumeSnapshotsGetSample.ts | 63 - .../volumeSnapshotsListByVolumeGroupSample.ts | 72 - .../v1/typescript/src/volumesCreateSample.ts | 74 - .../v1/typescript/src/volumesDeleteSample.ts | 74 - .../v1/typescript/src/volumesGetSample.ts | 63 - .../src/volumesListByVolumeGroupSample.ts | 65 - .../typescript/src/volumesPreBackupSample.ts | 38 - .../typescript/src/volumesPreRestoreSample.ts | 42 - .../v1/typescript/src/volumesUpdateSample.ts | 73 - .../samples/v2/javascript/README.md | 106 + .../v2/javascript/elasticSansCreateSample.js | 61 + .../v2/javascript/elasticSansDeleteSample.js | 38 + .../v2/javascript/elasticSansGetSample.js | 40 + .../elasticSansListByResourceGroupSample.js | 25 +- .../elasticSansListBySubscriptionSample.js | 19 +- .../v2/javascript/elasticSansUpdateSample.js | 53 + .../javascript/operationsListSample.js | 21 +- .../{v1 => v2}/javascript/package.json | 8 +- .../privateEndpointConnectionsCreateSample.js | 58 + .../privateEndpointConnectionsDeleteSample.js | 46 + .../privateEndpointConnectionsGetSample.js | 48 + .../privateEndpointConnectionsListSample.js | 31 +- ...vateLinkResourcesListByElasticSanSample.js | 46 + .../samples/{v1 => v2}/javascript/sample.env | 0 .../{v1 => v2}/javascript/skusListSample.js | 23 +- .../v2/javascript/volumeGroupsCreateSample.js | 66 + .../v2/javascript/volumeGroupsDeleteSample.js | 38 + .../v2/javascript/volumeGroupsGetSample.js | 48 + .../volumeGroupsListByElasticSanSample.js | 54 + .../v2/javascript/volumeGroupsUpdateSample.js | 66 + .../javascript/volumeSnapshotsCreateSample.js | 62 + .../javascript/volumeSnapshotsDeleteSample.js | 48 + .../v2/javascript/volumeSnapshotsGetSample.js | 50 + .../volumeSnapshotsListByVolumeGroupSample.js | 57 + .../v2/javascript/volumesCreateSample.js | 56 + .../v2/javascript/volumesDeleteSample.js | 49 + .../samples/v2/javascript/volumesGetSample.js | 50 + .../volumesListByVolumeGroupSample.js | 56 + .../v2/javascript/volumesPreBackupSample.js | 30 + .../v2/javascript/volumesPreRestoreSample.js | 34 + .../v2/javascript/volumesUpdateSample.js | 52 + .../samples/v2/typescript/README.md | 119 + .../{v1 => v2}/typescript/package.json | 8 +- .../samples/{v1 => v2}/typescript/sample.env | 0 .../typescript/src/elasticSansCreateSample.ts | 61 + .../typescript/src/elasticSansDeleteSample.ts | 38 + .../v2/typescript/src/elasticSansGetSample.ts | 40 + .../elasticSansListByResourceGroupSample.ts | 33 +- .../elasticSansListBySubscriptionSample.ts | 21 +- .../typescript/src/elasticSansUpdateSample.ts | 53 + .../typescript/src/operationsListSample.ts | 23 +- .../privateEndpointConnectionsCreateSample.ts | 58 + .../privateEndpointConnectionsDeleteSample.ts | 46 + .../privateEndpointConnectionsGetSample.ts | 48 + .../privateEndpointConnectionsListSample.ts | 35 +- ...vateLinkResourcesListByElasticSanSample.ts | 46 + .../v2/typescript/src/skusListSample.ts | 48 + .../src/volumeGroupsCreateSample.ts | 66 + .../src/volumeGroupsDeleteSample.ts | 38 + .../typescript/src/volumeGroupsGetSample.ts | 48 + .../src/volumeGroupsListByElasticSanSample.ts | 35 +- .../src/volumeGroupsUpdateSample.ts | 66 + .../src/volumeSnapshotsCreateSample.ts | 62 + .../src/volumeSnapshotsDeleteSample.ts | 48 + .../src/volumeSnapshotsGetSample.ts | 50 + .../volumeSnapshotsListByVolumeGroupSample.ts | 57 + .../v2/typescript/src/volumesCreateSample.ts | 56 + .../v2/typescript/src/volumesDeleteSample.ts | 49 + .../v2/typescript/src/volumesGetSample.ts | 50 + .../src/volumesListByVolumeGroupSample.ts | 56 + .../typescript/src/volumesPreBackupSample.ts | 30 + .../typescript/src/volumesPreRestoreSample.ts | 34 + .../v2/typescript/src/volumesUpdateSample.ts | 52 + .../{v1 => v2}/typescript/tsconfig.json | 0 .../src/api/elasticSanManagementContext.ts | 52 + .../src/api/elasticSans/index.ts | 19 + .../src/api/elasticSans/operations.ts | 335 +++ .../src/api/elasticSans/options.ts | 31 + .../arm-elasticsan/src/api/index.ts | 8 + .../src/api/operations/index.ts | 5 + .../src/api/operations/operations.ts | 61 + .../src/api/operations/options.ts | 7 + .../api/privateEndpointConnections/index.ts | 10 + .../privateEndpointConnections/operations.ts | 268 +++ .../api/privateEndpointConnections/options.ts | 22 + .../src/api/privateLinkResources/index.ts | 5 + .../api/privateLinkResources/operations.ts | 61 + .../src/api/privateLinkResources/options.ts | 7 + .../arm-elasticsan/src/api/skus/index.ts | 5 + .../arm-elasticsan/src/api/skus/operations.ts | 60 + .../arm-elasticsan/src/api/skus/options.ts | 10 + .../src/api/volumeGroups/index.ts | 11 + .../src/api/volumeGroups/operations.ts | 309 +++ .../src/api/volumeGroups/options.ts | 28 + .../src/api/volumeSnapshots/index.ts | 10 + .../src/api/volumeSnapshots/operations.ts | 278 +++ .../src/api/volumeSnapshots/options.ts | 25 + .../arm-elasticsan/src/api/volumes/index.ts | 21 + .../src/api/volumes/operations.ts | 508 ++++ .../arm-elasticsan/src/api/volumes/options.ts | 45 + .../src/classic/elasticSans/index.ts | 202 ++ .../arm-elasticsan/src/classic/index.ts | 11 + .../src/classic/operations/index.ts | 28 + .../privateEndpointConnections/index.ts | 195 ++ .../src/classic/privateLinkResources/index.ts | 35 + .../arm-elasticsan/src/classic/skus/index.ts | 26 + .../src/classic/volumeGroups/index.ts | 244 ++ .../src/classic/volumeSnapshots/index.ts | 214 ++ .../src/classic/volumes/index.ts | 442 ++++ .../src/elasticSanManagement.ts | 210 +- sdk/elasticsans/arm-elasticsan/src/index.ts | 153 +- sdk/elasticsans/arm-elasticsan/src/logger.ts | 5 + sdk/elasticsans/arm-elasticsan/src/lroImpl.ts | 34 - .../arm-elasticsan/src/models/index.ts | 1613 +------------ .../arm-elasticsan/src/models/mappers.ts | 2024 ---------------- .../arm-elasticsan/src/models/models.ts | 2133 +++++++++++++++++ .../arm-elasticsan/src/models/parameters.ts | 267 --- .../src/operations/elasticSans.ts | 661 ----- .../arm-elasticsan/src/operations/index.ts | 14 - .../src/operations/operations.ts | 140 -- .../operations/privateEndpointConnections.ts | 483 ---- .../src/operations/privateLinkResources.ts | 69 - .../arm-elasticsan/src/operations/skus.ts | 140 -- .../src/operations/volumeGroups.ts | 622 ----- .../src/operations/volumeSnapshots.ts | 535 ----- .../arm-elasticsan/src/operations/volumes.ts | 956 -------- .../src/operationsInterfaces/elasticSans.ts | 131 - .../src/operationsInterfaces/index.ts | 14 - .../src/operationsInterfaces/operations.ts | 18 - .../privateEndpointConnections.ts | 107 - .../privateLinkResources.ts | 25 - .../src/operationsInterfaces/skus.ts | 18 - .../src/operationsInterfaces/volumeGroups.ts | 139 -- .../operationsInterfaces/volumeSnapshots.ts | 116 - .../src/operationsInterfaces/volumes.ts | 225 -- .../arm-elasticsan/src/pagingHelper.ts | 34 - .../src/restorePollerHelpers.ts | 209 ++ .../src/static-helpers/cloudSettingHelpers.ts | 42 + .../src/static-helpers/pagingHelpers.ts | 270 +++ .../src/static-helpers/pollingHelpers.ts | 150 ++ .../serialization/check-prop-undefined.ts | 17 + .../src/static-helpers/simplePollerHelpers.ts | 119 + .../src/static-helpers/urlTemplate.ts | 227 ++ .../arm-elasticsan/test/snippets.spec.ts | 2 +- .../arm-elasticsan/tsp-location.yaml | 4 + 234 files changed, 12022 insertions(+), 13262 deletions(-) delete mode 100644 sdk/elasticsans/arm-elasticsan/_meta.json create mode 100644 sdk/elasticsans/arm-elasticsan/eslint.config.mjs create mode 100644 sdk/elasticsans/arm-elasticsan/metadata.json create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/javascript/elasticSansListByResourceGroupSample.js (51%) rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/javascript/elasticSansListBySubscriptionSample.js (58%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/javascript/operationsListSample.js (55%) rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/javascript/package.json (83%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/javascript/privateEndpointConnectionsListSample.js (50%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/javascript/sample.env (100%) rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/javascript/skusListSample.js (54%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/typescript/package.json (86%) rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/typescript/sample.env (100%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/typescript/src/elasticSansListByResourceGroupSample.ts (51%) rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/typescript/src/elasticSansListBySubscriptionSample.ts (58%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/typescript/src/operationsListSample.ts (56%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/typescript/src/privateEndpointConnectionsListSample.ts (51%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/typescript/src/volumeGroupsListByElasticSanSample.ts (50%) create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts create mode 100644 sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts rename sdk/elasticsans/arm-elasticsan/samples/{v1 => v2}/typescript/tsconfig.json (100%) create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/logger.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/lroImpl.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/models/mappers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/models/models.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/models/parameters.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/skus.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts delete mode 100644 sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/serialization/check-prop-undefined.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/simplePollerHelpers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts create mode 100644 sdk/elasticsans/arm-elasticsan/tsp-location.yaml diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 20580b540972..5b45fe78fb48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12364,24 +12364,27 @@ importers: sdk/elasticsans/arm-elasticsan: dependencies: + '@azure-rest/core-client': + specifier: ^2.3.1 + version: link:../../core/core-client-rest '@azure/abort-controller': specifier: ^2.1.2 version: link:../../core/abort-controller '@azure/core-auth': specifier: ^1.9.0 version: link:../../core/core-auth - '@azure/core-client': - specifier: ^1.9.3 - version: link:../../core/core-client '@azure/core-lro': - specifier: ^2.5.4 - version: 2.7.2 - '@azure/core-paging': - specifier: ^1.6.2 - version: link:../../core/core-paging + specifier: ^3.1.0 + version: link:../../core/core-lro '@azure/core-rest-pipeline': - specifier: ^1.19.1 + specifier: ^1.20.0 version: link:../../core/core-rest-pipeline + '@azure/core-util': + specifier: ^1.12.0 + version: link:../../core/core-util + '@azure/logger': + specifier: ^1.2.0 + version: link:../../core/logger tslib: specifier: ^2.8.1 version: 2.8.1 @@ -12398,12 +12401,12 @@ importers: '@azure/dev-tool': specifier: workspace:^ version: link:../../../common/tools/dev-tool + '@azure/eslint-plugin-azure-sdk': + specifier: workspace:^ + version: link:../../../common/tools/eslint-plugin-azure-sdk '@azure/identity': specifier: catalog:internal version: 4.13.0 - '@azure/logger': - specifier: workspace:^ - version: link:../../core/logger '@types/node': specifier: 'catalog:' version: 20.19.33 diff --git a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md index fd2858e0b738..94f84bda9423 100644 --- a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md +++ b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md @@ -1,46 +1,128 @@ # Release History -## 1.2.0 (2025-11-19) +## 2.0.0 (2026-02-14) ### Features Added - - Added operation Volumes.beginPreBackup - - Added operation Volumes.beginPreBackupAndWait - - Added operation Volumes.beginPreRestore - - Added operation Volumes.beginPreRestoreAndWait + - Added operation ElasticSansOperations.create + - Added operation ElasticSansOperations.delete + - Added operation ElasticSansOperations.update + - Added operation PrivateEndpointConnectionsOperations.create + - Added operation PrivateEndpointConnectionsOperations.delete + - Added operation VolumeGroupsOperations.create + - Added operation VolumeGroupsOperations.delete + - Added operation VolumeGroupsOperations.update + - Added operation VolumesOperations.beginPreBackup + - Added operation VolumesOperations.beginPreBackupAndWait + - Added operation VolumesOperations.beginPreRestore + - Added operation VolumesOperations.beginPreRestoreAndWait + - Added operation VolumesOperations.create + - Added operation VolumesOperations.delete + - Added operation VolumesOperations.preBackup + - Added operation VolumesOperations.preRestore + - Added operation VolumesOperations.update + - Added operation VolumeSnapshotsOperations.create + - Added operation VolumeSnapshotsOperations.delete - Added Interface AutoScaleProperties - Added Interface DiskSnapshotList - - Added Interface ElasticSansCreateHeaders + - Added Interface PagedAsyncIterableIterator + - Added Interface PageSettings - Added Interface PreValidationResponse - - Added Interface PrivateEndpointConnectionsCreateHeaders + - Added Interface RestorePollerOptions - Added Interface ScaleUpProperties - - Added Interface VolumeGroupsCreateHeaders + - Added Interface SimplePollerLike - Added Interface VolumeNameList - - Added Interface VolumesCreateHeaders - - Added Interface VolumeSnapshotsCreateHeaders - - Added Interface VolumesPreBackupHeaders - Added Interface VolumesPreBackupOptionalParams - - Added Interface VolumesPreRestoreHeaders - Added Interface VolumesPreRestoreOptionalParams + - Interface ElasticSan has a new optional parameter autoScaleProperties + - Interface ElasticSan has a new optional parameter availabilityZones + - Interface ElasticSan has a new optional parameter privateEndpointConnections + - Interface ElasticSan has a new optional parameter provisioningState + - Interface ElasticSan has a new optional parameter publicNetworkAccess + - Interface ElasticSan has a new optional parameter totalIops + - Interface ElasticSan has a new optional parameter totalMBps + - Interface ElasticSan has a new optional parameter totalSizeTiB + - Interface ElasticSan has a new optional parameter totalVolumeSizeGiB + - Interface ElasticSan has a new optional parameter volumeGroupCount - Interface ElasticSanProperties has a new optional parameter autoScaleProperties - - Interface ElasticSansDeleteHeaders has a new optional parameter retryAfter - - Interface ElasticSansUpdateHeaders has a new optional parameter retryAfter + - Interface ElasticSanUpdate has a new optional parameter autoScaleProperties + - Interface ElasticSanUpdate has a new optional parameter baseSizeTiB + - Interface ElasticSanUpdate has a new optional parameter extendedCapacitySizeTiB + - Interface ElasticSanUpdate has a new optional parameter publicNetworkAccess - Interface ElasticSanUpdateProperties has a new optional parameter autoScaleProperties - - Interface PrivateEndpointConnectionsDeleteHeaders has a new optional parameter retryAfter - - Interface VolumeGroupsDeleteHeaders has a new optional parameter retryAfter - - Interface VolumeGroupsUpdateHeaders has a new optional parameter retryAfter - - Interface VolumesDeleteHeaders has a new optional parameter retryAfter - - Interface VolumeSnapshotsDeleteHeaders has a new optional parameter retryAfter - - Interface VolumesUpdateHeaders has a new optional parameter retryAfter + - Interface PrivateEndpointConnection has a new optional parameter groupIds + - Interface PrivateEndpointConnection has a new optional parameter privateEndpoint + - Interface PrivateEndpointConnection has a new optional parameter provisioningState + - Interface PrivateLinkResource has a new optional parameter groupId + - Interface PrivateLinkResource has a new optional parameter requiredMembers + - Interface PrivateLinkResource has a new optional parameter requiredZoneNames + - Interface Snapshot has a new optional parameter provisioningState + - Interface Snapshot has a new optional parameter sourceVolumeSizeGiB + - Interface Snapshot has a new optional parameter volumeName + - Interface Volume has a new optional parameter creationData + - Interface Volume has a new optional parameter managedBy + - Interface Volume has a new optional parameter provisioningState + - Interface Volume has a new optional parameter storageTarget + - Interface Volume has a new optional parameter volumeId + - Interface VolumeGroup has a new optional parameter encryption + - Interface VolumeGroup has a new optional parameter encryptionProperties + - Interface VolumeGroup has a new optional parameter enforceDataIntegrityCheckForIscsi + - Interface VolumeGroup has a new optional parameter networkAcls + - Interface VolumeGroup has a new optional parameter privateEndpointConnections + - Interface VolumeGroup has a new optional parameter protocolType + - Interface VolumeGroup has a new optional parameter provisioningState + - Interface VolumeGroupUpdate has a new optional parameter encryption + - Interface VolumeGroupUpdate has a new optional parameter encryptionProperties + - Interface VolumeGroupUpdate has a new optional parameter enforceDataIntegrityCheckForIscsi + - Interface VolumeGroupUpdate has a new optional parameter networkAcls + - Interface VolumeGroupUpdate has a new optional parameter protocolType + - Interface VolumeUpdate has a new optional parameter managedBy + - Interface VolumeUpdate has a new optional parameter sizeGiB - Added Type Alias AutoScalePolicyEnforcement - - Added Type Alias OperationsListNextResponse - - Added Type Alias PrivateEndpointConnectionsListNextResponse - - Added Type Alias SkusListNextResponse - - Added Type Alias VolumesPreBackupResponse - - Added Type Alias VolumesPreRestoreResponse + - Added Type Alias AzureSupportedClouds + - Added Enum AzureClouds - Added Enum KnownAutoScalePolicyEnforcement + - Added Enum KnownVersions - Enum KnownProvisioningStates has a new value Deleted - Enum KnownProvisioningStates has a new value Restoring +### Breaking Changes + - Operation ElasticSans.beginCreate has a new signature + - Operation ElasticSans.beginCreateAndWait has a new signature + - Operation ElasticSans.beginUpdateAndWait has a new signature + - Operation ElasticSans.get has a new signature + - Operation PrivateEndpointConnections.beginCreate has a new signature + - Operation PrivateEndpointConnections.beginCreateAndWait has a new signature + - Operation PrivateEndpointConnections.get has a new signature + - Operation Volumes.beginCreate has a new signature + - Operation Volumes.beginCreateAndWait has a new signature + - Operation Volumes.beginUpdate has a new signature + - Operation Volumes.beginUpdateAndWait has a new signature + - Operation Volumes.get has a new signature + - Operation VolumeSnapshots.beginCreate has a new signature + - Operation VolumeSnapshots.beginCreateAndWait has a new signature + - Operation VolumeSnapshots.get has a new signature + - Removed Interface ElasticSanList + - Removed Interface SkuInformationList + - Removed Interface SnapshotList + - Removed Interface VolumeGroupList + - Removed Interface VolumeList + - Interface ElasticSan has a new required parameter baseSizeTiB + - Interface ElasticSan has a new required parameter extendedCapacitySizeTiB + - Interface ElasticSan has a new required parameter sku + - Interface PrivateEndpointConnection has a new required parameter privateLinkServiceConnectionState + - Interface Snapshot has a new required parameter creationData + - Interface Volume has a new required parameter sizeGiB + - Interface ElasticSan no longer has parameter properties + - Interface ElasticSanUpdate no longer has parameter properties + - Interface PrivateEndpointConnection no longer has parameter properties + - Interface PrivateLinkResource no longer has parameter properties + - Interface Snapshot no longer has parameter properties + - Interface Volume no longer has parameter properties + - Interface VolumeGroup no longer has parameter properties + - Interface VolumeGroupUpdate no longer has parameter properties + - Interface VolumeUpdate no longer has parameter properties + - Parameter value of interface PrivateLinkResourceListResult is now required + ## 1.2.0-beta.2 (2025-04-18) Compared with version 1.1.0 diff --git a/sdk/elasticsans/arm-elasticsan/README.md b/sdk/elasticsans/arm-elasticsan/README.md index 844e1ebfe13f..567c79ced9ee 100644 --- a/sdk/elasticsans/arm-elasticsan/README.md +++ b/sdk/elasticsans/arm-elasticsan/README.md @@ -2,12 +2,14 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ElasticSanManagement client. -(missing-service-description) Add service description +Elastic SAN is a fully integrated solution that simplifies deploying, scaling, managing, and configuring a storage area network (SAN). It also offers built-in cloud capabilities like high availability. Elastic SAN works with many types of compute resources, such as Azure Virtual Machines, Azure VMware Solution, and Azure Kubernetes Service. -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-elasticsan) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-elasticsan) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/samples) ## Getting started @@ -35,7 +37,7 @@ npm install @azure/arm-elasticsan To create a client object to access the Azure ElasticSanManagement API, you will need the `endpoint` of your Azure ElasticSanManagement resource and a `credential`. The Azure ElasticSanManagement client can use Azure Active Directory credentials to authenticate. You can find the endpoint for your Azure ElasticSanManagement resource in the [Azure Portal][azure_portal]. -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: @@ -63,14 +65,15 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); ``` + ### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). @@ -96,7 +99,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## Next steps -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/samples) directory for detailed examples on how to use this library. ## Contributing @@ -106,9 +109,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -[azure_cli]: https://learn.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity diff --git a/sdk/elasticsans/arm-elasticsan/_meta.json b/sdk/elasticsans/arm-elasticsan/_meta.json deleted file mode 100644 index 95f7cb24602f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "5476ceee2ed3364cdedec8e0d002d2e45389a8f0", - "readme": "specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/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=C:\\Users\\v-ziweichen.FAREAST\\Documents\\Git\\azure-sdk\\azure-sdk-for-js ..\\..\\azure-rest-api-specs\\specification\\elasticsan\\resource-manager\\Microsoft.ElasticSan\\ElasticSan\\readme.md --use=@autorest/typescript@6.0.51 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.14.8", - "use": "@autorest/typescript@6.0.51" -} diff --git a/sdk/elasticsans/arm-elasticsan/api-extractor.json b/sdk/elasticsans/arm-elasticsan/api-extractor.json index 16d81e2eb512..870d6d399477 100644 --- a/sdk/elasticsans/arm-elasticsan/api-extractor.json +++ b/sdk/elasticsans/arm-elasticsan/api-extractor.json @@ -1,3 +1 @@ -{ - "extends": "../../../api-extractor-base.json" -} +{ "extends": "../../../api-extractor-base.json" } diff --git a/sdk/elasticsans/arm-elasticsan/eslint.config.mjs b/sdk/elasticsans/arm-elasticsan/eslint.config.mjs new file mode 100644 index 000000000000..6d2f8a5914c3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, +]); diff --git a/sdk/elasticsans/arm-elasticsan/metadata.json b/sdk/elasticsans/arm-elasticsan/metadata.json new file mode 100644 index 000000000000..5deb2d01b43d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/metadata.json @@ -0,0 +1,115 @@ +{ + "apiVersion": "2025-09-01", + "emitterVersion": "0.49.0", + "crossLanguageDefinitions": { + "CrossLanguagePackageId": "Microsoft.ElasticSan", + "CrossLanguageDefinitionId": { + "@azure/arm-elasticsan!OperationListResult:interface": "Azure.ResourceManager.CommonTypes.OperationListResult", + "@azure/arm-elasticsan!Operation:interface": "Azure.ResourceManager.CommonTypes.Operation", + "@azure/arm-elasticsan!OperationDisplay:interface": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "@azure/arm-elasticsan!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "@azure/arm-elasticsan!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "@azure/arm-elasticsan!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "@azure/arm-elasticsan!ElasticSan:interface": "Microsoft.ElasticSan.ElasticSan", + "@azure/arm-elasticsan!ElasticSanProperties:interface": "Microsoft.ElasticSan.ElasticSanProperties", + "@azure/arm-elasticsan!Sku:interface": "Microsoft.ElasticSan.Sku", + "@azure/arm-elasticsan!PrivateEndpointConnection:interface": "Microsoft.ElasticSan.PrivateEndpointConnection", + "@azure/arm-elasticsan!PrivateEndpointConnectionProperties:interface": "Microsoft.ElasticSan.PrivateEndpointConnectionProperties", + "@azure/arm-elasticsan!PrivateEndpoint:interface": "Microsoft.ElasticSan.PrivateEndpoint", + "@azure/arm-elasticsan!PrivateLinkServiceConnectionState:interface": "Microsoft.ElasticSan.PrivateLinkServiceConnectionState", + "@azure/arm-elasticsan!ProxyResource:interface": "Azure.ResourceManager.CommonTypes.ProxyResource", + "@azure/arm-elasticsan!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", + "@azure/arm-elasticsan!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", + "@azure/arm-elasticsan!AutoScaleProperties:interface": "Microsoft.ElasticSan.AutoScaleProperties", + "@azure/arm-elasticsan!ScaleUpProperties:interface": "Microsoft.ElasticSan.ScaleUpProperties", + "@azure/arm-elasticsan!TrackedResource:interface": "Azure.ResourceManager.CommonTypes.TrackedResource", + "@azure/arm-elasticsan!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", + "@azure/arm-elasticsan!ElasticSanUpdate:interface": "Microsoft.ElasticSan.ElasticSanUpdate", + "@azure/arm-elasticsan!ElasticSanUpdateProperties:interface": "Microsoft.ElasticSan.ElasticSanUpdateProperties", + "@azure/arm-elasticsan!ElasticSanList:interface": "Microsoft.ElasticSan.ElasticSanList", + "@azure/arm-elasticsan!PrivateEndpointConnectionListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-elasticsan!Volume:interface": "Microsoft.ElasticSan.Volume", + "@azure/arm-elasticsan!VolumeProperties:interface": "Microsoft.ElasticSan.VolumeProperties", + "@azure/arm-elasticsan!SourceCreationData:interface": "Microsoft.ElasticSan.SourceCreationData", + "@azure/arm-elasticsan!IscsiTargetInfo:interface": "Microsoft.ElasticSan.IscsiTargetInfo", + "@azure/arm-elasticsan!ManagedByInfo:interface": "Microsoft.ElasticSan.ManagedByInfo", + "@azure/arm-elasticsan!VolumeUpdate:interface": "Microsoft.ElasticSan.VolumeUpdate", + "@azure/arm-elasticsan!VolumeUpdateProperties:interface": "Microsoft.ElasticSan.VolumeUpdateProperties", + "@azure/arm-elasticsan!VolumeList:interface": "Microsoft.ElasticSan.VolumeList", + "@azure/arm-elasticsan!VolumeNameList:interface": "Microsoft.ElasticSan.VolumeNameList", + "@azure/arm-elasticsan!PreValidationResponse:interface": "Microsoft.ElasticSan.PreValidationResponse", + "@azure/arm-elasticsan!DiskSnapshotList:interface": "Microsoft.ElasticSan.DiskSnapshotList", + "@azure/arm-elasticsan!VolumeGroup:interface": "Microsoft.ElasticSan.VolumeGroup", + "@azure/arm-elasticsan!Identity:interface": "Microsoft.ElasticSan.Identity", + "@azure/arm-elasticsan!UserAssignedIdentity:interface": "Microsoft.ElasticSan.UserAssignedIdentity", + "@azure/arm-elasticsan!VolumeGroupProperties:interface": "Microsoft.ElasticSan.VolumeGroupProperties", + "@azure/arm-elasticsan!EncryptionProperties:interface": "Microsoft.ElasticSan.EncryptionProperties", + "@azure/arm-elasticsan!KeyVaultProperties:interface": "Microsoft.ElasticSan.KeyVaultProperties", + "@azure/arm-elasticsan!EncryptionIdentity:interface": "Microsoft.ElasticSan.EncryptionIdentity", + "@azure/arm-elasticsan!NetworkRuleSet:interface": "Microsoft.ElasticSan.NetworkRuleSet", + "@azure/arm-elasticsan!VirtualNetworkRule:interface": "Microsoft.ElasticSan.VirtualNetworkRule", + "@azure/arm-elasticsan!VolumeGroupUpdate:interface": "Microsoft.ElasticSan.VolumeGroupUpdate", + "@azure/arm-elasticsan!VolumeGroupUpdateProperties:interface": "Microsoft.ElasticSan.VolumeGroupUpdateProperties", + "@azure/arm-elasticsan!VolumeGroupList:interface": "Microsoft.ElasticSan.VolumeGroupList", + "@azure/arm-elasticsan!PrivateLinkResourceListResult:interface": "Microsoft.ElasticSan.PrivateLinkResourceListResult", + "@azure/arm-elasticsan!PrivateLinkResource:interface": "Microsoft.ElasticSan.PrivateLinkResource", + "@azure/arm-elasticsan!PrivateLinkResourceProperties:interface": "Microsoft.ElasticSan.PrivateLinkResourceProperties", + "@azure/arm-elasticsan!Snapshot:interface": "Microsoft.ElasticSan.Snapshot", + "@azure/arm-elasticsan!SnapshotProperties:interface": "Microsoft.ElasticSan.SnapshotProperties", + "@azure/arm-elasticsan!SnapshotCreationData:interface": "Microsoft.ElasticSan.SnapshotCreationData", + "@azure/arm-elasticsan!SnapshotList:interface": "Microsoft.ElasticSan.SnapshotList", + "@azure/arm-elasticsan!SkuInformationList:interface": "Microsoft.ElasticSan.SkuInformationList", + "@azure/arm-elasticsan!SkuInformation:interface": "Microsoft.ElasticSan.SkuInformation", + "@azure/arm-elasticsan!SkuLocationInfo:interface": "Microsoft.ElasticSan.SkuLocationInfo", + "@azure/arm-elasticsan!SKUCapability:interface": "Microsoft.ElasticSan.SKUCapability", + "@azure/arm-elasticsan!KnownOrigin:enum": "Azure.ResourceManager.CommonTypes.Origin", + "@azure/arm-elasticsan!KnownActionType:enum": "Azure.ResourceManager.CommonTypes.ActionType", + "@azure/arm-elasticsan!KnownSkuName:enum": "Microsoft.ElasticSan.SkuName", + "@azure/arm-elasticsan!KnownSkuTier:enum": "Microsoft.ElasticSan.SkuTier", + "@azure/arm-elasticsan!KnownProvisioningStates:enum": "Microsoft.ElasticSan.ProvisioningStates", + "@azure/arm-elasticsan!KnownPrivateEndpointServiceConnectionStatus:enum": "Microsoft.ElasticSan.PrivateEndpointServiceConnectionStatus", + "@azure/arm-elasticsan!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", + "@azure/arm-elasticsan!KnownPublicNetworkAccess:enum": "Microsoft.ElasticSan.PublicNetworkAccess", + "@azure/arm-elasticsan!KnownAutoScalePolicyEnforcement:enum": "Microsoft.ElasticSan.AutoScalePolicyEnforcement", + "@azure/arm-elasticsan!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", + "@azure/arm-elasticsan!KnownVolumeCreateOption:enum": "Microsoft.ElasticSan.VolumeCreateOption", + "@azure/arm-elasticsan!KnownOperationalStatus:enum": "Microsoft.ElasticSan.OperationalStatus", + "@azure/arm-elasticsan!Knownx-ms-delete-snapshots:enum": "Microsoft.ElasticSan.x-ms-delete-snapshots", + "@azure/arm-elasticsan!Knownx-ms-force-delete:enum": "Microsoft.ElasticSan.x-ms-force-delete", + "@azure/arm-elasticsan!KnownIdentityType:enum": "Microsoft.ElasticSan.IdentityType", + "@azure/arm-elasticsan!KnownStorageTargetType:enum": "Microsoft.ElasticSan.StorageTargetType", + "@azure/arm-elasticsan!KnownEncryptionType:enum": "Microsoft.ElasticSan.EncryptionType", + "@azure/arm-elasticsan!KnownAction:enum": "Microsoft.ElasticSan.Action", + "@azure/arm-elasticsan!KnownVersions:enum": "Microsoft.ElasticSan.Versions", + "@azure/arm-elasticsan!SkusOperations#list:member": "Microsoft.ElasticSan.SkusOperationGroup.list", + "@azure/arm-elasticsan!VolumeSnapshotsOperations#listByVolumeGroup:member": "Microsoft.ElasticSan.Snapshots.listByVolumeGroup", + "@azure/arm-elasticsan!VolumeSnapshotsOperations#delete:member": "Microsoft.ElasticSan.Snapshots.delete", + "@azure/arm-elasticsan!VolumeSnapshotsOperations#create:member": "Microsoft.ElasticSan.Snapshots.create", + "@azure/arm-elasticsan!VolumeSnapshotsOperations#get:member": "Microsoft.ElasticSan.Snapshots.get", + "@azure/arm-elasticsan!PrivateLinkResourcesOperations#listByElasticSan:member": "Microsoft.ElasticSan.ElasticSans.listByElasticSan", + "@azure/arm-elasticsan!VolumeGroupsOperations#listByElasticSan:member": "Microsoft.ElasticSan.VolumeGroups.listByElasticSan", + "@azure/arm-elasticsan!VolumeGroupsOperations#delete:member": "Microsoft.ElasticSan.VolumeGroups.delete", + "@azure/arm-elasticsan!VolumeGroupsOperations#update:member": "Microsoft.ElasticSan.VolumeGroups.update", + "@azure/arm-elasticsan!VolumeGroupsOperations#create:member": "Microsoft.ElasticSan.VolumeGroups.create", + "@azure/arm-elasticsan!VolumeGroupsOperations#get:member": "Microsoft.ElasticSan.VolumeGroups.get", + "@azure/arm-elasticsan!VolumesOperations#preRestore:member": "Microsoft.ElasticSan.VolumeGroups.preRestore", + "@azure/arm-elasticsan!VolumesOperations#preBackup:member": "Microsoft.ElasticSan.VolumeGroups.preBackup", + "@azure/arm-elasticsan!VolumesOperations#listByVolumeGroup:member": "Microsoft.ElasticSan.Volumes.listByVolumeGroup", + "@azure/arm-elasticsan!VolumesOperations#delete:member": "Microsoft.ElasticSan.Volumes.delete", + "@azure/arm-elasticsan!VolumesOperations#update:member": "Microsoft.ElasticSan.Volumes.update", + "@azure/arm-elasticsan!VolumesOperations#create:member": "Microsoft.ElasticSan.Volumes.create", + "@azure/arm-elasticsan!VolumesOperations#get:member": "Microsoft.ElasticSan.Volumes.get", + "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#list:member": "Microsoft.ElasticSan.PrivateEndpointConnections.list", + "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#delete:member": "Microsoft.ElasticSan.PrivateEndpointConnections.delete", + "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#create:member": "Microsoft.ElasticSan.PrivateEndpointConnections.create", + "@azure/arm-elasticsan!PrivateEndpointConnectionsOperations#get:member": "Microsoft.ElasticSan.PrivateEndpointConnections.get", + "@azure/arm-elasticsan!ElasticSansOperations#listBySubscription:member": "Microsoft.ElasticSan.ElasticSans.listBySubscription", + "@azure/arm-elasticsan!ElasticSansOperations#listByResourceGroup:member": "Microsoft.ElasticSan.ElasticSans.listByResourceGroup", + "@azure/arm-elasticsan!ElasticSansOperations#delete:member": "Microsoft.ElasticSan.ElasticSans.delete", + "@azure/arm-elasticsan!ElasticSansOperations#update:member": "Microsoft.ElasticSan.ElasticSans.update", + "@azure/arm-elasticsan!ElasticSansOperations#create:member": "Microsoft.ElasticSan.ElasticSans.create", + "@azure/arm-elasticsan!ElasticSansOperations#get:member": "Microsoft.ElasticSan.ElasticSans.get", + "@azure/arm-elasticsan!OperationsOperations#list:member": "Azure.ResourceManager.Operations.list" + } + } +} diff --git a/sdk/elasticsans/arm-elasticsan/package.json b/sdk/elasticsans/arm-elasticsan/package.json index 9865c89648b3..70951cdd113a 100644 --- a/sdk/elasticsans/arm-elasticsan/package.json +++ b/sdk/elasticsans/arm-elasticsan/package.json @@ -1,110 +1,122 @@ { "name": "@azure/arm-elasticsan", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", + "version": "2.0.0", "description": "A generated SDK for ElasticSanManagement.", - "version": "1.2.0", "engines": { "node": ">=20.0.0" }, - "dependencies": { - "@azure/core-lro": "^2.5.4", - "@azure/abort-controller": "^2.1.2", - "@azure/core-paging": "^1.6.2", - "@azure/core-client": "^1.9.3", - "@azure/core-auth": "^1.9.0", - "@azure/core-rest-pipeline": "^1.19.1", - "tslib": "^2.8.1" + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/skus": "./src/api/skus/index.ts", + "./api/volumeSnapshots": "./src/api/volumeSnapshots/index.ts", + "./api/privateLinkResources": "./src/api/privateLinkResources/index.ts", + "./api/volumeGroups": "./src/api/volumeGroups/index.ts", + "./api/volumes": "./src/api/volumes/index.ts", + "./api/privateEndpointConnections": "./src/api/privateEndpointConnections/index.ts", + "./api/elasticSans": "./src/api/elasticSans/index.ts", + "./api/operations": "./src/api/operations/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false, + "project": "../../../tsconfig.src.build.json" }, + "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "keywords": [ "node", "azure", + "cloud", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", - "types": "./dist/commonjs/index.d.ts", - "type": "module", + "files": [ + "dist/", + "!dist/**/*.d.*ts.map", + "README.md", + "LICENSE" + ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/elasticSanManagementContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure/core-util": "^1.12.0", + "@azure-rest/core-client": "^2.3.1", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-lro": "^3.1.0", + "@azure/core-rest-pipeline": "^1.20.0", + "@azure/logger": "^1.2.0", + "tslib": "^2.8.1" + }, "devDependencies": { - "typescript": "catalog:", - "rimraf": "catalog:", - "dotenv": "catalog:testing", + "@azure-tools/test-credential": "workspace:^", + "@azure-tools/test-recorder": "workspace:^", + "@azure-tools/test-utils-vitest": "workspace:^", "@azure/dev-tool": "workspace:^", - "cross-env": "catalog:", - "eslint": "catalog:", - "prettier": "catalog:", "tshy": "catalog:", + "@azure/eslint-plugin-azure-sdk": "workspace:^", "@azure/identity": "catalog:internal", - "@azure/logger": "workspace:^", - "@azure-tools/test-recorder": "workspace:^", - "@azure-tools/test-credential": "workspace:^", - "@azure-tools/test-utils-vitest": "workspace:^", "@types/node": "catalog:", + "cross-env": "catalog:", + "eslint": "catalog:", + "prettier": "catalog:", + "rimraf": "catalog:", "@vitest/browser-playwright": "catalog:testing", "@vitest/coverage-istanbul": "catalog:testing", + "dotenv": "catalog:testing", "playwright": "catalog:testing", + "typescript": "catalog:", "vitest": "catalog:testing" }, - "repository": "github:Azure/azure-sdk-for-js", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "files": [ - "dist/", - "README.md", - "LICENSE" - ], "scripts": { - "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "rimraf review && dev-tool run extract-api", "pack": "pnpm pack 2>&1", - "extract-api": "dev-tool run extract-api", "lint": "echo skipped", - "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "lint:fix": "echo skipped", "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", - "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", - "execute:samples": "echo skipped", - "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", - "test": "npm run test:node && npm run test:browser", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "execute:samples": "dev-tool samples run samples-dev", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "test:browser": "dev-tool run build-test && dev-tool run test:vitest --browser", + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", "test:node": "dev-tool run test:vitest", - "test:browser": "echo skipped", - "update-snippets": "dev-tool run update-snippets", - "test:node:esm": "dev-tool run test:vitest --esm" - }, - "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/elasticSanManagement.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", - "tshy": { - "project": "../../../tsconfig.src.build.json", - "exports": { - "./package.json": "./package.json", - ".": "./src/index.ts" - }, - "dialects": [ - "esm", - "commonjs" - ], - "esmDialects": [ - "browser", - "react-native" - ], - "selfLink": false + "test:node:esm": "dev-tool run test:vitest --esm", + "test": "npm run test:node && npm run test:browser", + "update-snippets": "dev-tool run update-snippets" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan", "//sampleConfiguration": { - "productName": "", + "productName": "@azure/arm-elasticsan", "productSlugs": [ "azure" ], @@ -130,6 +142,189 @@ "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/skus": { + "browser": { + "types": "./dist/browser/api/skus/index.d.ts", + "default": "./dist/browser/api/skus/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/skus/index.d.ts", + "default": "./dist/react-native/api/skus/index.js" + }, + "import": { + "types": "./dist/esm/api/skus/index.d.ts", + "default": "./dist/esm/api/skus/index.js" + }, + "require": { + "types": "./dist/commonjs/api/skus/index.d.ts", + "default": "./dist/commonjs/api/skus/index.js" + } + }, + "./api/volumeSnapshots": { + "browser": { + "types": "./dist/browser/api/volumeSnapshots/index.d.ts", + "default": "./dist/browser/api/volumeSnapshots/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/volumeSnapshots/index.d.ts", + "default": "./dist/react-native/api/volumeSnapshots/index.js" + }, + "import": { + "types": "./dist/esm/api/volumeSnapshots/index.d.ts", + "default": "./dist/esm/api/volumeSnapshots/index.js" + }, + "require": { + "types": "./dist/commonjs/api/volumeSnapshots/index.d.ts", + "default": "./dist/commonjs/api/volumeSnapshots/index.js" + } + }, + "./api/privateLinkResources": { + "browser": { + "types": "./dist/browser/api/privateLinkResources/index.d.ts", + "default": "./dist/browser/api/privateLinkResources/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/privateLinkResources/index.d.ts", + "default": "./dist/react-native/api/privateLinkResources/index.js" + }, + "import": { + "types": "./dist/esm/api/privateLinkResources/index.d.ts", + "default": "./dist/esm/api/privateLinkResources/index.js" + }, + "require": { + "types": "./dist/commonjs/api/privateLinkResources/index.d.ts", + "default": "./dist/commonjs/api/privateLinkResources/index.js" + } + }, + "./api/volumeGroups": { + "browser": { + "types": "./dist/browser/api/volumeGroups/index.d.ts", + "default": "./dist/browser/api/volumeGroups/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/volumeGroups/index.d.ts", + "default": "./dist/react-native/api/volumeGroups/index.js" + }, + "import": { + "types": "./dist/esm/api/volumeGroups/index.d.ts", + "default": "./dist/esm/api/volumeGroups/index.js" + }, + "require": { + "types": "./dist/commonjs/api/volumeGroups/index.d.ts", + "default": "./dist/commonjs/api/volumeGroups/index.js" + } + }, + "./api/volumes": { + "browser": { + "types": "./dist/browser/api/volumes/index.d.ts", + "default": "./dist/browser/api/volumes/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/volumes/index.d.ts", + "default": "./dist/react-native/api/volumes/index.js" + }, + "import": { + "types": "./dist/esm/api/volumes/index.d.ts", + "default": "./dist/esm/api/volumes/index.js" + }, + "require": { + "types": "./dist/commonjs/api/volumes/index.d.ts", + "default": "./dist/commonjs/api/volumes/index.js" + } + }, + "./api/privateEndpointConnections": { + "browser": { + "types": "./dist/browser/api/privateEndpointConnections/index.d.ts", + "default": "./dist/browser/api/privateEndpointConnections/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/privateEndpointConnections/index.d.ts", + "default": "./dist/react-native/api/privateEndpointConnections/index.js" + }, + "import": { + "types": "./dist/esm/api/privateEndpointConnections/index.d.ts", + "default": "./dist/esm/api/privateEndpointConnections/index.js" + }, + "require": { + "types": "./dist/commonjs/api/privateEndpointConnections/index.d.ts", + "default": "./dist/commonjs/api/privateEndpointConnections/index.js" + } + }, + "./api/elasticSans": { + "browser": { + "types": "./dist/browser/api/elasticSans/index.d.ts", + "default": "./dist/browser/api/elasticSans/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/elasticSans/index.d.ts", + "default": "./dist/react-native/api/elasticSans/index.js" + }, + "import": { + "types": "./dist/esm/api/elasticSans/index.d.ts", + "default": "./dist/esm/api/elasticSans/index.js" + }, + "require": { + "types": "./dist/commonjs/api/elasticSans/index.d.ts", + "default": "./dist/commonjs/api/elasticSans/index.js" + } + }, + "./api/operations": { + "browser": { + "types": "./dist/browser/api/operations/index.d.ts", + "default": "./dist/browser/api/operations/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/operations/index.d.ts", + "default": "./dist/react-native/api/operations/index.js" + }, + "import": { + "types": "./dist/esm/api/operations/index.d.ts", + "default": "./dist/esm/api/operations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operations/index.d.ts", + "default": "./dist/commonjs/api/operations/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } } - } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" } diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md new file mode 100644 index 000000000000..89e5766dd1b5 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-elasticSans-node.api.md @@ -0,0 +1,59 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): PollerLike, ElasticSan>; + +// @public +export interface ElasticSansCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ElasticSansDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ElasticSansGetOptionalParams extends OperationOptions { +} + +// @public +export interface ElasticSansListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface ElasticSansListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface ElasticSansUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams): Promise; + +// @public +export function listByResourceGroup(context: ElasticSanManagementContext, resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listBySubscription(context: ElasticSanManagementContext, options?: ElasticSansListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function update(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): PollerLike, ElasticSan>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md new file mode 100644 index 000000000000..7efa046195b4 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-node.api.md @@ -0,0 +1,28 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { TokenCredential } from '@azure/core-auth'; + +// @public +export function createElasticSanManagement(credential: TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams): ElasticSanManagementContext; + +// @public +export interface ElasticSanManagementContext extends Client { + apiVersion?: string; + subscriptionId: string; +} + +// @public +export interface ElasticSanManagementOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md new file mode 100644 index 000000000000..bfd5273d96a8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-operations-node.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function list(context: ElasticSanManagementContext, options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md new file mode 100644 index 000000000000..3df32b845e97 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateEndpointConnections-node.api.md @@ -0,0 +1,44 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): PollerLike, PrivateEndpointConnection>; + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + +// @public +export function list(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md new file mode 100644 index 000000000000..8d565e21cec0 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-privateLinkResources-node.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function listByElasticSan(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams): Promise; + +// @public +export interface PrivateLinkResourcesListByElasticSanOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md new file mode 100644 index 000000000000..fae1f43efdd4 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-skus-node.api.md @@ -0,0 +1,20 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function list(context: ElasticSanManagementContext, options?: SkusListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface SkusListOptionalParams extends OperationOptions { + filter?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md new file mode 100644 index 000000000000..69b24af70294 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeGroups-node.api.md @@ -0,0 +1,52 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): PollerLike, VolumeGroup>; + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams): Promise; + +// @public +export function listByElasticSan(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams): PagedAsyncIterableIterator; + +// @public +export function update(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): PollerLike, VolumeGroup>; + +// @public +export interface VolumeGroupsCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumeGroupsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumeGroupsGetOptionalParams extends OperationOptions { +} + +// @public +export interface VolumeGroupsListByElasticSanOptionalParams extends OperationOptions { +} + +// @public +export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md new file mode 100644 index 000000000000..e6f17b87a2f3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumeSnapshots-node.api.md @@ -0,0 +1,45 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams): PollerLike, Snapshot>; + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsGetOptionalParams): Promise; + +// @public +export function listByVolumeGroup(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeSnapshotsListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface VolumeSnapshotsCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumeSnapshotsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumeSnapshotsGetOptionalParams extends OperationOptions { +} + +// @public +export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends OperationOptions { + filter?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md new file mode 100644 index 000000000000..9c4f4aaf4398 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-api-volumes-node.api.md @@ -0,0 +1,70 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): PollerLike, Volume>; + +// @public +export function get(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; + +// @public +export function listByVolumeGroup(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function preBackup(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams): PollerLike, PreValidationResponse>; + +// @public +export function preRestore(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams): PollerLike, PreValidationResponse>; + +// @public +export function update(context: ElasticSanManagementContext, resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): PollerLike, Volume>; + +// @public +export interface VolumesCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; + xMsDeleteSnapshots?: XMsDeleteSnapshots; + xMsForceDelete?: XMsForceDelete; +} + +// @public +export interface VolumesGetOptionalParams extends OperationOptions { +} + +// @public +export interface VolumesListByVolumeGroupOptionalParams extends OperationOptions { +} + +// @public +export interface VolumesPreBackupOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumesPreRestoreOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VolumesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md new file mode 100644 index 000000000000..70a7e1fc07a7 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md @@ -0,0 +1,569 @@ +## API Report File for "@azure/arm-elasticsan" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type Action = string; + +// @public +export type ActionType = string; + +// @public +export type AutoScalePolicyEnforcement = string; + +// @public +export interface AutoScaleProperties { + scaleUpProperties?: ScaleUpProperties; +} + +// @public +export type CreatedByType = string; + +// @public +export interface DiskSnapshotList { + diskSnapshotIds: string[]; +} + +// @public +export interface ElasticSan extends TrackedResource { + autoScaleProperties?: AutoScaleProperties; + availabilityZones?: string[]; + baseSizeTiB: number; + extendedCapacitySizeTiB: number; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningStates; + publicNetworkAccess?: PublicNetworkAccess; + sku: Sku; + readonly totalIops?: number; + readonly totalMBps?: number; + readonly totalSizeTiB?: number; + readonly totalVolumeSizeGiB?: number; + readonly volumeGroupCount?: number; +} + +// @public +export interface ElasticSanProperties { + autoScaleProperties?: AutoScaleProperties; + availabilityZones?: string[]; + baseSizeTiB: number; + extendedCapacitySizeTiB: number; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningStates; + publicNetworkAccess?: PublicNetworkAccess; + sku: Sku; + readonly totalIops?: number; + readonly totalMBps?: number; + readonly totalSizeTiB?: number; + readonly totalVolumeSizeGiB?: number; + readonly volumeGroupCount?: number; +} + +// @public +export interface ElasticSanUpdate { + autoScaleProperties?: AutoScaleProperties; + baseSizeTiB?: number; + extendedCapacitySizeTiB?: number; + publicNetworkAccess?: PublicNetworkAccess; + tags?: Record; +} + +// @public +export interface ElasticSanUpdateProperties { + autoScaleProperties?: AutoScaleProperties; + baseSizeTiB?: number; + extendedCapacitySizeTiB?: number; + publicNetworkAccess?: PublicNetworkAccess; +} + +// @public +export interface EncryptionIdentity { + encryptionUserAssignedIdentity?: string; +} + +// @public +export interface EncryptionProperties { + encryptionIdentity?: EncryptionIdentity; + keyVaultProperties?: KeyVaultProperties; +} + +// @public +export type EncryptionType = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: any; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type: IdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type IdentityType = string; + +// @public +export interface IscsiTargetInfo { + readonly provisioningState?: ProvisioningStates; + status?: OperationalStatus; + readonly targetIqn?: string; + readonly targetPortalHostname?: string; + readonly targetPortalPort?: number; +} + +// @public +export interface KeyVaultProperties { + readonly currentVersionedKeyExpirationTimestamp?: Date; + readonly currentVersionedKeyIdentifier?: string; + keyName?: string; + keyVaultUri?: string; + keyVersion?: string; + readonly lastKeyRotationTimestamp?: Date; +} + +// @public +export enum KnownAction { + Allow = "Allow" +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownAutoScalePolicyEnforcement { + Disabled = "Disabled", + Enabled = "Enabled", + None = "None" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownEncryptionType { + EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" +} + +// @public +export enum KnownIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownOperationalStatus { + Healthy = "Healthy", + Invalid = "Invalid", + Running = "Running", + Stopped = "Stopped", + StoppedDeallocated = "Stopped (deallocated)", + Unhealthy = "Unhealthy", + Unknown = "Unknown", + Updating = "Updating" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + Approved = "Approved", + Failed = "Failed", + Pending = "Pending", + Rejected = "Rejected" +} + +// @public +export enum KnownProvisioningStates { + Canceled = "Canceled", + Creating = "Creating", + Deleted = "Deleted", + Deleting = "Deleting", + Failed = "Failed", + Invalid = "Invalid", + Pending = "Pending", + Restoring = "Restoring", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownSkuName { + PremiumLRS = "Premium_LRS", + PremiumZRS = "Premium_ZRS" +} + +// @public +export enum KnownSkuTier { + Premium = "Premium" +} + +// @public +export enum KnownStorageTargetType { + Iscsi = "Iscsi", + None = "None" +} + +// @public +export enum KnownVersions { + V20250901 = "2025-09-01" +} + +// @public +export enum KnownVolumeCreateOption { + Disk = "Disk", + DiskRestorePoint = "DiskRestorePoint", + DiskSnapshot = "DiskSnapshot", + None = "None", + VolumeSnapshot = "VolumeSnapshot" +} + +// @public +export enum KnownXMsDeleteSnapshots { + False = "false", + True = "true" +} + +// @public +export enum KnownXMsForceDelete { + False = "false", + True = "true" +} + +// @public +export interface ManagedByInfo { + resourceId?: string; +} + +// @public +export interface NetworkRuleSet { + virtualNetworkRules?: VirtualNetworkRule[]; +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export type OperationalStatus = string; + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export type Origin = string; + +// @public +export interface PreValidationResponse { + validationStatus?: string; +} + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends ProxyResource { + groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: ProvisioningStates; +} + +// @public +export interface PrivateEndpointConnectionProperties { + groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: ProvisioningStates; +} + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export interface PrivateLinkResource extends Resource { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkResourceListResult { + readonly nextLink?: string; + value: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + +// @public +export type ProvisioningStates = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export type PublicNetworkAccess = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ScaleUpProperties { + autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; + capacityUnitScaleUpLimitTiB?: number; + increaseCapacityUnitByTiB?: number; + unusedSizeTiB?: number; +} + +// @public +export interface Sku { + name: SkuName; + tier?: SkuTier; +} + +// @public +export interface SKUCapability { + readonly name?: string; + readonly value?: string; +} + +// @public +export interface SkuInformation { + readonly capabilities?: SKUCapability[]; + readonly locationInfo?: SkuLocationInfo[]; + readonly locations?: string[]; + name: SkuName; + readonly resourceType?: string; + tier?: SkuTier; +} + +// @public +export interface SkuLocationInfo { + readonly location?: string; + readonly zones?: string[]; +} + +// @public +export type SkuName = string; + +// @public +export type SkuTier = string; + +// @public +export interface Snapshot extends ProxyResource { + creationData: SnapshotCreationData; + readonly provisioningState?: ProvisioningStates; + readonly sourceVolumeSizeGiB?: number; + readonly volumeName?: string; +} + +// @public +export interface SnapshotCreationData { + sourceId: string; +} + +// @public +export interface SnapshotProperties { + creationData: SnapshotCreationData; + readonly provisioningState?: ProvisioningStates; + readonly sourceVolumeSizeGiB?: number; + readonly volumeName?: string; +} + +// @public +export interface SourceCreationData { + createSource?: VolumeCreateOption; + sourceId?: string; +} + +// @public +export type StorageTargetType = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface VirtualNetworkRule { + action?: Action; + virtualNetworkResourceId: string; +} + +// @public +export interface Volume extends ProxyResource { + creationData?: SourceCreationData; + managedBy?: ManagedByInfo; + readonly provisioningState?: ProvisioningStates; + sizeGiB: number; + readonly storageTarget?: IscsiTargetInfo; + readonly volumeId?: string; +} + +// @public +export type VolumeCreateOption = string; + +// @public +export interface VolumeGroup extends ProxyResource { + encryption?: EncryptionType; + encryptionProperties?: EncryptionProperties; + enforceDataIntegrityCheckForIscsi?: boolean; + identity?: Identity; + networkAcls?: NetworkRuleSet; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + protocolType?: StorageTargetType; + readonly provisioningState?: ProvisioningStates; +} + +// @public +export interface VolumeGroupProperties { + encryption?: EncryptionType; + encryptionProperties?: EncryptionProperties; + enforceDataIntegrityCheckForIscsi?: boolean; + networkAcls?: NetworkRuleSet; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + protocolType?: StorageTargetType; + readonly provisioningState?: ProvisioningStates; +} + +// @public +export interface VolumeGroupUpdate { + encryption?: EncryptionType; + encryptionProperties?: EncryptionProperties; + enforceDataIntegrityCheckForIscsi?: boolean; + identity?: Identity; + networkAcls?: NetworkRuleSet; + protocolType?: StorageTargetType; +} + +// @public +export interface VolumeGroupUpdateProperties { + encryption?: EncryptionType; + encryptionProperties?: EncryptionProperties; + enforceDataIntegrityCheckForIscsi?: boolean; + networkAcls?: NetworkRuleSet; + protocolType?: StorageTargetType; +} + +// @public +export interface VolumeNameList { + volumeNames: string[]; +} + +// @public +export interface VolumeProperties { + creationData?: SourceCreationData; + managedBy?: ManagedByInfo; + readonly provisioningState?: ProvisioningStates; + sizeGiB: number; + readonly storageTarget?: IscsiTargetInfo; + readonly volumeId?: string; +} + +// @public +export interface VolumeUpdate { + managedBy?: ManagedByInfo; + sizeGiB?: number; +} + +// @public +export interface VolumeUpdateProperties { + managedBy?: ManagedByInfo; + sizeGiB?: number; +} + +// @public +export type XMsDeleteSnapshots = string; + +// @public +export type XMsForceDelete = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md index 0de14ac1cc25..bcfc1b695c9a 100644 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md @@ -4,11 +4,15 @@ ```ts -import type * as coreAuth from '@azure/core-auth'; -import * as coreClient from '@azure/core-client'; +import type { AbortSignalLike } from '@azure/abort-controller'; +import type { CancelOnProgress } from '@azure/core-lro'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; import type { OperationState } from '@azure/core-lro'; -import type { PagedAsyncIterableIterator } from '@azure/core-paging'; -import type { SimplePollerLike } from '@azure/core-lro'; +import type { PathUncheckedResponse } from '@azure-rest/core-client'; +import type { Pipeline } from '@azure/core-rest-pipeline'; +import type { PollerLike } from '@azure/core-lro'; +import type { TokenCredential } from '@azure/core-auth'; // @public export type Action = string; @@ -24,6 +28,21 @@ export interface AutoScaleProperties { scaleUpProperties?: ScaleUpProperties; } +// @public +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" +} + +// @public +export type AzureSupportedClouds = `${AzureClouds}`; + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + // @public export type CreatedByType = string; @@ -34,47 +53,39 @@ export interface DiskSnapshotList { // @public export interface ElasticSan extends TrackedResource { - properties: ElasticSanProperties; + autoScaleProperties?: AutoScaleProperties; + availabilityZones?: string[]; + baseSizeTiB: number; + extendedCapacitySizeTiB: number; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningStates; + publicNetworkAccess?: PublicNetworkAccess; + sku: Sku; + readonly totalIops?: number; + readonly totalMBps?: number; + readonly totalSizeTiB?: number; + readonly totalVolumeSizeGiB?: number; + readonly volumeGroupCount?: number; } -// @public -export interface ElasticSanList { - nextLink?: string; - value: ElasticSan[]; +// @public (undocumented) +export class ElasticSanManagement { + constructor(credential: TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams); + readonly elasticSans: ElasticSansOperations; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; + readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; + readonly privateLinkResources: PrivateLinkResourcesOperations; + readonly skus: SkusOperations; + readonly volumeGroups: VolumeGroupsOperations; + readonly volumes: VolumesOperations; + readonly volumeSnapshots: VolumeSnapshotsOperations; } -// @public (undocumented) -export class ElasticSanManagement extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams); - // (undocumented) - apiVersion: string; - // (undocumented) - elasticSans: ElasticSans; - // (undocumented) - operations: Operations; - // (undocumented) - privateEndpointConnections: PrivateEndpointConnections; - // (undocumented) - privateLinkResources: PrivateLinkResources; - // (undocumented) - skus: Skus; - // (undocumented) - subscriptionId: string; - // (undocumented) - volumeGroups: VolumeGroups; - // (undocumented) - volumes: Volumes; - // (undocumented) - volumeSnapshots: VolumeSnapshots; -} - -// @public -export interface ElasticSanManagementOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; +// @public +export interface ElasticSanManagementOptionalParams extends ClientOptions { apiVersion?: string; - endpoint?: string; + cloudSetting?: AzureSupportedClouds; } // @public @@ -95,101 +106,61 @@ export interface ElasticSanProperties { } // @public -export interface ElasticSans { - beginCreate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise, ElasticSansCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise, ElasticSansUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: ElasticSansListBySubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface ElasticSansCreateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface ElasticSansCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface ElasticSansCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type ElasticSansCreateResponse = ElasticSan; - -// @public -export interface ElasticSansDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface ElasticSansDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface ElasticSansDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface ElasticSansGetOptionalParams extends coreClient.OperationOptions { +export interface ElasticSansGetOptionalParams extends OperationOptions { } // @public -export type ElasticSansGetResponse = ElasticSan; - -// @public -export interface ElasticSansListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface ElasticSansListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type ElasticSansListByResourceGroupNextResponse = ElasticSanList; - -// @public -export interface ElasticSansListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface ElasticSansListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type ElasticSansListByResourceGroupResponse = ElasticSanList; - -// @public -export interface ElasticSansListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface ElasticSansOperations { + // @deprecated (undocumented) + beginCreate: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams) => Promise, ElasticSan>>; + // @deprecated (undocumented) + beginCreateAndWait: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams) => Promise, ElasticSan>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams) => Promise; + create: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams) => PollerLike, ElasticSan>; + delete: (resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: ElasticSansListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams) => PollerLike, ElasticSan>; } // @public -export type ElasticSansListBySubscriptionNextResponse = ElasticSanList; - -// @public -export interface ElasticSansListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ElasticSansListBySubscriptionResponse = ElasticSanList; - -// @public -export interface ElasticSansUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface ElasticSansUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface ElasticSansUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type ElasticSansUpdateResponse = ElasticSan; - // @public export interface ElasticSanUpdate { - properties?: ElasticSanUpdateProperties; - tags?: { - [propertyName: string]: string; - }; + autoScaleProperties?: AutoScaleProperties; + baseSizeTiB?: number; + extendedCapacitySizeTiB?: number; + publicNetworkAccess?: PublicNetworkAccess; + tags?: Record; } // @public @@ -216,7 +187,7 @@ export type EncryptionType = string; // @public export interface ErrorAdditionalInfo { - readonly info?: Record; + readonly info?: any; readonly type?: string; } @@ -234,17 +205,12 @@ export interface ErrorResponse { error?: ErrorDetail; } -// @public -export function getContinuationToken(page: unknown): string | undefined; - // @public export interface Identity { readonly principalId?: string; readonly tenantId?: string; type: IdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentity; - }; + userAssignedIdentities?: Record; } // @public @@ -371,6 +337,11 @@ export enum KnownStorageTargetType { None = "None" } +// @public +export enum KnownVersions { + V20250901 = "2025-09-01" +} + // @public export enum KnownVolumeCreateOption { Disk = "Disk", @@ -423,32 +394,28 @@ export interface OperationDisplay { } // @public -export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; -} - -// @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +export interface OperationsListOptionalParams extends OperationOptions { } // @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; } // @public -export type OperationsListNextResponse = OperationListResult; +export type Origin = string; // @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; } // @public -export type OperationsListResponse = OperationListResult; - -// @public -export type Origin = string; +export interface PageSettings { + continuationToken?: string; +} // @public export interface PreValidationResponse { @@ -462,13 +429,10 @@ export interface PrivateEndpoint { // @public export interface PrivateEndpointConnection extends ProxyResource { - properties: PrivateEndpointConnectionProperties; -} - -// @public -export interface PrivateEndpointConnectionListResult { - nextLink?: string; - value: PrivateEndpointConnection[]; + groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: ProvisioningStates; } // @public @@ -480,69 +444,47 @@ export interface PrivateEndpointConnectionProperties { } // @public -export interface PrivateEndpointConnections { - beginCreate(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise, PrivateEndpointConnectionsCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; - list(resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface PrivateEndpointConnectionsCreateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface PrivateEndpointConnectionsCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; - -// @public -export interface PrivateEndpointConnectionsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { } // @public -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; - -// @public -export interface PrivateEndpointConnectionsListNextOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { } // @public -export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult; - -// @public -export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsOperations { + // @deprecated (undocumented) + beginCreate: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams) => Promise, PrivateEndpointConnection>>; + // @deprecated (undocumented) + beginCreateAndWait: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams) => Promise; + create: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams) => PollerLike, PrivateEndpointConnection>; + delete: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams) => Promise; + list: (resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; - // @public export type PrivateEndpointServiceConnectionStatus = string; // @public export interface PrivateLinkResource extends Resource { - properties?: PrivateLinkResourceProperties; + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; } // @public @@ -559,17 +501,14 @@ export interface PrivateLinkResourceProperties { } // @public -export interface PrivateLinkResources { - listByElasticSan(resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams): Promise; +export interface PrivateLinkResourcesListByElasticSanOptionalParams extends OperationOptions { } // @public -export interface PrivateLinkResourcesListByElasticSanOptionalParams extends coreClient.OperationOptions { +export interface PrivateLinkResourcesOperations { + listByElasticSan: (resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams) => Promise; } -// @public -export type PrivateLinkResourcesListByElasticSanResponse = PrivateLinkResourceListResult; - // @public export interface PrivateLinkServiceConnectionState { actionsRequired?: string; @@ -595,6 +534,16 @@ export interface Resource { readonly type?: string; } +// @public +export function restorePoller(client: ElasticSanManagement, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + // @public export interface ScaleUpProperties { autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; @@ -603,6 +552,28 @@ export interface ScaleUpProperties { unusedSizeTiB?: number; } +// @public +export interface SimplePollerLike, TResult> { + getOperationState(): TState; + getResult(): TResult | undefined; + isDone(): boolean; + // @deprecated + isStopped(): boolean; + onProgress(callback: (state: TState) => void): CancelOnProgress; + poll(options?: { + abortSignal?: AbortSignalLike; + }): Promise; + pollUntilDone(pollOptions?: { + abortSignal?: AbortSignalLike; + }): Promise; + serialize(): Promise; + // @deprecated + stopPolling(): void; + submitted(): Promise; + // @deprecated + toString(): string; +} + // @public export interface Sku { name: SkuName; @@ -625,12 +596,6 @@ export interface SkuInformation { tier?: SkuTier; } -// @public -export interface SkuInformationList { - nextLink?: string; - readonly value: SkuInformation[]; -} - // @public export interface SkuLocationInfo { readonly location?: string; @@ -641,31 +606,24 @@ export interface SkuLocationInfo { export type SkuName = string; // @public -export interface Skus { - list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface SkusListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SkusListNextResponse = SkuInformationList; - -// @public -export interface SkusListOptionalParams extends coreClient.OperationOptions { +export interface SkusListOptionalParams extends OperationOptions { filter?: string; } // @public -export type SkusListResponse = SkuInformationList; +export interface SkusOperations { + list: (options?: SkusListOptionalParams) => PagedAsyncIterableIterator; +} // @public export type SkuTier = string; // @public export interface Snapshot extends ProxyResource { - properties: SnapshotProperties; + creationData: SnapshotCreationData; + readonly provisioningState?: ProvisioningStates; + readonly sourceVolumeSizeGiB?: number; + readonly volumeName?: string; } // @public @@ -673,12 +631,6 @@ export interface SnapshotCreationData { sourceId: string; } -// @public -export interface SnapshotList { - nextLink?: string; - value: Snapshot[]; -} - // @public export interface SnapshotProperties { creationData: SnapshotCreationData; @@ -709,9 +661,7 @@ export interface SystemData { // @public export interface TrackedResource extends Resource { location: string; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -728,7 +678,12 @@ export interface VirtualNetworkRule { // @public export interface Volume extends ProxyResource { - properties: VolumeProperties; + creationData?: SourceCreationData; + managedBy?: ManagedByInfo; + readonly provisioningState?: ProvisioningStates; + sizeGiB: number; + readonly storageTarget?: IscsiTargetInfo; + readonly volumeId?: string; } // @public @@ -736,14 +691,14 @@ export type VolumeCreateOption = string; // @public export interface VolumeGroup extends ProxyResource { + encryption?: EncryptionType; + encryptionProperties?: EncryptionProperties; + enforceDataIntegrityCheckForIscsi?: boolean; identity?: Identity; - properties?: VolumeGroupProperties; -} - -// @public -export interface VolumeGroupList { - nextLink?: string; - value: VolumeGroup[]; + networkAcls?: NetworkRuleSet; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + protocolType?: StorageTargetType; + readonly provisioningState?: ProvisioningStates; } // @public @@ -758,84 +713,57 @@ export interface VolumeGroupProperties { } // @public -export interface VolumeGroups { - beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise, VolumeGroupsCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise, VolumeGroupsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams): Promise; - listByElasticSan(resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VolumeGroupsCreateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumeGroupsCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeGroupsCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VolumeGroupsCreateResponse = VolumeGroup; - -// @public -export interface VolumeGroupsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumeGroupsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeGroupsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VolumeGroupsGetOptionalParams extends coreClient.OperationOptions { +export interface VolumeGroupsGetOptionalParams extends OperationOptions { } // @public -export type VolumeGroupsGetResponse = VolumeGroup; - -// @public -export interface VolumeGroupsListByElasticSanNextOptionalParams extends coreClient.OperationOptions { +export interface VolumeGroupsListByElasticSanOptionalParams extends OperationOptions { } // @public -export type VolumeGroupsListByElasticSanNextResponse = VolumeGroupList; - -// @public -export interface VolumeGroupsListByElasticSanOptionalParams extends coreClient.OperationOptions { +export interface VolumeGroupsOperations { + // @deprecated (undocumented) + beginCreate: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams) => Promise, VolumeGroup>>; + // @deprecated (undocumented) + beginCreateAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams) => Promise, VolumeGroup>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams) => Promise; + create: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams) => PollerLike, VolumeGroup>; + delete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams) => Promise; + listByElasticSan: (resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams) => PollerLike, VolumeGroup>; } // @public -export type VolumeGroupsListByElasticSanResponse = VolumeGroupList; - -// @public -export interface VolumeGroupsUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumeGroupsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VolumeGroupsUpdateResponse = VolumeGroup; - // @public export interface VolumeGroupUpdate { + encryption?: EncryptionType; + encryptionProperties?: EncryptionProperties; + enforceDataIntegrityCheckForIscsi?: boolean; identity?: Identity; - properties?: VolumeGroupUpdateProperties; + networkAcls?: NetworkRuleSet; + protocolType?: StorageTargetType; } // @public @@ -847,12 +775,6 @@ export interface VolumeGroupUpdateProperties { protocolType?: StorageTargetType; } -// @public -export interface VolumeList { - nextLink?: string; - value: Volume[]; -} - // @public export interface VolumeNameList { volumeNames: string[]; @@ -869,178 +791,110 @@ export interface VolumeProperties { } // @public -export interface Volumes { - beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise, VolumesCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise; - beginPreBackup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams): Promise, VolumesPreBackupResponse>>; - beginPreBackupAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams): Promise; - beginPreRestore(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams): Promise, VolumesPreRestoreResponse>>; - beginPreRestoreAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams): Promise; - beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise, VolumesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; - listByVolumeGroup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VolumesCreateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumesCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumesCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VolumesCreateResponse = Volume; - -// @public -export interface VolumesDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumesDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; xMsDeleteSnapshots?: XMsDeleteSnapshots; xMsForceDelete?: XMsForceDelete; } // @public -export interface VolumesGetOptionalParams extends coreClient.OperationOptions { +export interface VolumesGetOptionalParams extends OperationOptions { } // @public -export type VolumesGetResponse = Volume; - -// @public -export interface VolumesListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions { +export interface VolumesListByVolumeGroupOptionalParams extends OperationOptions { } // @public -export type VolumesListByVolumeGroupNextResponse = VolumeList; - -// @public -export interface VolumesListByVolumeGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VolumesListByVolumeGroupResponse = VolumeList; - -// @public -export interface VolumeSnapshots { - beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams): Promise, VolumeSnapshotsCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams): Promise; - get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsGetOptionalParams): Promise; - listByVolumeGroup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeSnapshotsListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VolumeSnapshotsCreateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumeSnapshotsCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeSnapshotsCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VolumeSnapshotsCreateResponse = Snapshot; - -// @public -export interface VolumeSnapshotsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumeSnapshotsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeSnapshotsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VolumeSnapshotsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VolumeSnapshotsGetResponse = Snapshot; - -// @public -export interface VolumeSnapshotsListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions { +export interface VolumeSnapshotsGetOptionalParams extends OperationOptions { } // @public -export type VolumeSnapshotsListByVolumeGroupNextResponse = SnapshotList; - -// @public -export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends coreClient.OperationOptions { +export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends OperationOptions { filter?: string; } // @public -export type VolumeSnapshotsListByVolumeGroupResponse = SnapshotList; - -// @public -export interface VolumesPreBackupHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumesPreBackupOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumeSnapshotsOperations { + // @deprecated (undocumented) + beginCreate: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams) => Promise, Snapshot>>; + // @deprecated (undocumented) + beginCreateAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams) => Promise; + create: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, parameters: Snapshot, options?: VolumeSnapshotsCreateOptionalParams) => PollerLike, Snapshot>; + delete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, snapshotName: string, options?: VolumeSnapshotsGetOptionalParams) => Promise; + listByVolumeGroup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeSnapshotsListByVolumeGroupOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface VolumesOperations { + // @deprecated (undocumented) + beginCreate: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams) => Promise, Volume>>; + // @deprecated (undocumented) + beginCreateAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginPreBackup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams) => Promise, PreValidationResponse>>; + // @deprecated (undocumented) + beginPreBackupAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams) => Promise; + // @deprecated (undocumented) + beginPreRestore: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams) => Promise, PreValidationResponse>>; + // @deprecated (undocumented) + beginPreRestoreAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams) => Promise, Volume>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams) => Promise; + create: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams) => PollerLike, Volume>; + delete: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams) => Promise; + listByVolumeGroup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams) => PagedAsyncIterableIterator; + preBackup: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeNameList, options?: VolumesPreBackupOptionalParams) => PollerLike, PreValidationResponse>; + preRestore: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: DiskSnapshotList, options?: VolumesPreRestoreOptionalParams) => PollerLike, PreValidationResponse>; + update: (resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams) => PollerLike, Volume>; +} + +// @public +export interface VolumesPreBackupOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VolumesPreBackupResponse = PreValidationResponse; - -// @public -export interface VolumesPreRestoreHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumesPreRestoreOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumesPreRestoreOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VolumesPreRestoreResponse = PreValidationResponse; - -// @public -export interface VolumesUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VolumesUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VolumesUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VolumesUpdateResponse = Volume; - // @public export interface VolumeUpdate { - properties?: VolumeUpdateProperties; + managedBy?: ManagedByInfo; + sizeGiB?: number; } // @public diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts index 8d1d57edc110..13cbfb8a29c0 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts @@ -1,79 +1,55 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { ElasticSan} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create ElasticSan. + * This sample demonstrates how to create ElasticSan. * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json */ async function elasticSansCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { location: "France Central", - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, }, - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, }, + availabilityZones: ["1"], + baseSizeTiB: 5, + extendedCapacitySizeTiB: 25, + publicNetworkAccess: "Enabled", + sku: { name: "Premium_LRS", tier: "Premium" }, tags: { key9316: "ihndtieqibtob" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create ElasticSan. + * This sample demonstrates how to create ElasticSan. * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MinimumSet_Gen.json + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MinimumSet_Gen.json */ async function elasticSansCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { - location: "France Central", - properties: { - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + location: "France Central", + baseSizeTiB: 15, + extendedCapacitySizeTiB: 27, + sku: { name: "Premium_LRS" }, + }); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts index 6681034a19fd..9bcc04f5edfd 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansDeleteSample.ts @@ -3,48 +3,31 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a Elastic San. + * This sample demonstrates how to delete a Elastic San. * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json */ async function elasticSansDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); } /** - * This sample demonstrates how to Delete a Elastic San. + * This sample demonstrates how to delete a Elastic San. * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MinimumSet_Gen.json + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MinimumSet_Gen.json */ async function elasticSansDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts index 5503e5b2811a..e80a93aa8f0e 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansGetSample.ts @@ -3,47 +3,32 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a ElasticSan. + * This sample demonstrates how to get a ElasticSan. * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json */ async function elasticSansGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); console.log(result); } /** - * This sample demonstrates how to Get a ElasticSan. + * This sample demonstrates how to get a ElasticSan. * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MinimumSet_Gen.json + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MinimumSet_Gen.json */ async function elasticSansGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts index 5a364acd441f..a2ac1576753a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListByResourceGroupSample.ts @@ -3,49 +3,40 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. + * This sample demonstrates how to gets a list of ElasticSan in a resource group. * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ async function elasticSansListByResourceGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. + * This sample demonstrates how to gets a list of ElasticSan in a resource group. * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ async function elasticSansListByResourceGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts index fc5c6843145c..1fc752343bbf 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansListBySubscriptionSample.ts @@ -3,41 +3,40 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ async function elasticSansListBySubscriptionMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ async function elasticSansListBySubscriptionMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts index 8a3bcaf08103..d5982b896791 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts @@ -1,69 +1,47 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { ElasticSanUpdate} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a Elastic San. + * This sample demonstrates how to update a Elastic San. * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json */ async function elasticSansUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = { - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Update a Elastic San. + * This sample demonstrates how to update a Elastic San. * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MinimumSet_Gen.json + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MinimumSet_Gen.json */ async function elasticSansUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", {}); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts index a63cdbdf87e8..6dd402a1bf11 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/operationsListSample.ts @@ -3,43 +3,40 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List the operations for the provider + * This sample demonstrates how to list the operations for the provider * - * @summary List the operations for the provider - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json */ async function operationsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List the operations for the provider + * This sample demonstrates how to list the operations for the provider * - * @summary List the operations for the provider - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MinimumSet_Gen.json + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MinimumSet_Gen.json */ async function operationsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts index 2d3cee1e4b30..a3add2ffff07 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts @@ -1,29 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - PrivateEndpointConnection} from "@azure/arm-elasticsan"; -import { - ElasticSanManagement, -} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json */ async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { groupIds: ["jdwrzpemdjrpiwzvy"], privateEndpoint: {}, privateLinkServiceConnectionState: { @@ -32,41 +27,25 @@ async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { status: "Pending", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MinimumSet_Gen.json */ async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { privateLinkServiceConnectionState: {} }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { privateLinkServiceConnectionState: {} }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts index 12ae9b5b7739..abc29f16677e 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -3,52 +3,39 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json */ async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", ); - console.log(result); } /** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MinimumSet_Gen.json */ async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts index dc0fd963828d..f7fea37d0372 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsGetSample.ts @@ -3,50 +3,39 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json */ async function privateEndpointConnectionsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", ); console.log(result); } /** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MinimumSet_Gen.json */ async function privateEndpointConnectionsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts index c7ae9c013252..3616a6035b66 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsListSample.ts @@ -3,53 +3,46 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json */ async function privateEndpointConnectionsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MinimumSet_Gen.json */ async function privateEndpointConnectionsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts index bb565b6098bc..233d5378e795 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateLinkResourcesListByElasticSanSample.ts @@ -3,46 +3,37 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json */ async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", ); console.log(result); } /** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json */ async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts index afb9587eac91..f70a88942fed 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/skusListSample.ts @@ -1,49 +1,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - SkusListOptionalParams} from "@azure/arm-elasticsan"; -import { - ElasticSanManagement, -} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List all the available Skus in the region and information related to them + * This sample demonstrates how to list all the available Skus in the region and information related to them * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json */ async function skusListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const filter = "obwwdrkq"; - const options: SkusListOptionalParams = { filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.skus.list(options)) { + for await (const item of client.skus.list({ filter: "obwwdrkq" })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List all the available Skus in the region and information related to them + * This sample demonstrates how to list all the available Skus in the region and information related to them * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MinimumSet_Gen.json + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MinimumSet_Gen.json */ async function skusListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.skus.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts index 2fcb48e9acbe..d9996d788fb6 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts @@ -1,27 +1,25 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { VolumeGroup} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create a Volume Group. + * This sample demonstrates how to create a Volume Group. * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json */ async function volumeGroupsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, encryption: "EncryptionAtRestWithPlatformKey", encryptionProperties: { encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, @@ -33,45 +31,29 @@ async function volumeGroupsCreateMaximumSetGen(): Promise { }, enforceDataIntegrityCheckForIscsi: true, networkAcls: { - virtualNetworkRules: [ - { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, - ], + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], }, protocolType: "Iscsi", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Create a Volume Group. + * This sample demonstrates how to create a Volume Group. * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MinimumSet_Gen.json + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MinimumSet_Gen.json */ async function volumeGroupsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts index 0fe6183e9fc9..ac965081580a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsDeleteSample.ts @@ -3,52 +3,31 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete an VolumeGroup. + * This sample demonstrates how to delete an VolumeGroup. * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json */ async function volumeGroupsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); } /** - * This sample demonstrates how to Delete an VolumeGroup. + * This sample demonstrates how to delete an VolumeGroup. * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MinimumSet_Gen.json */ async function volumeGroupsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts index 655d34fc4f2d..a128c689a18d 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsGetSample.ts @@ -3,50 +3,39 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get an VolumeGroups. + * This sample demonstrates how to get an VolumeGroups. * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json */ async function volumeGroupsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", ); console.log(result); } /** - * This sample demonstrates how to Get an VolumeGroups. + * This sample demonstrates how to get an VolumeGroups. * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MinimumSet_Gen.json + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MinimumSet_Gen.json */ async function volumeGroupsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts index 61e3533f75b4..380a5aa9623f 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsListByElasticSanSample.ts @@ -3,53 +3,46 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List VolumeGroups. + * This sample demonstrates how to list VolumeGroups. * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json */ async function volumeGroupsListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List VolumeGroups. + * This sample demonstrates how to list VolumeGroups. * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json */ async function volumeGroupsListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts index c735a5945d65..2b1eb21298d2 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts @@ -1,27 +1,25 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { VolumeGroupUpdate} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update an VolumeGroup. + * This sample demonstrates how to update an VolumeGroup. * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json */ async function volumeGroupsUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, encryption: "EncryptionAtRestWithPlatformKey", encryptionProperties: { encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, @@ -33,45 +31,29 @@ async function volumeGroupsUpdateMaximumSetGen(): Promise { }, enforceDataIntegrityCheckForIscsi: true, networkAcls: { - virtualNetworkRules: [ - { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, - ], + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], }, protocolType: "Iscsi", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Update an VolumeGroup. + * This sample demonstrates how to update an VolumeGroup. * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MinimumSet_Gen.json + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MinimumSet_Gen.json */ async function volumeGroupsUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts index 03ec9c6ba4aa..2c538ba186d0 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts @@ -1,75 +1,55 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { Snapshot} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create a Volume Snapshot. + * This sample demonstrates how to create a Volume Snapshot. * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json */ async function volumeSnapshotsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { creationData: { sourceId: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Create a Volume Snapshot. + * This sample demonstrates how to create a Volume Snapshot. * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MinimumSet_Gen.json */ async function volumeSnapshotsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { creationData: { sourceId: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts index 35566fcd9a85..e8db98290e6c 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsDeleteSample.ts @@ -3,56 +3,41 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a Volume Snapshot. + * This sample demonstrates how to delete a Volume Snapshot. * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json */ async function volumeSnapshotsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", ); - console.log(result); } /** - * This sample demonstrates how to Delete a Volume Snapshot. + * This sample demonstrates how to delete a Volume Snapshot. * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MinimumSet_Gen.json */ async function volumeSnapshotsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts index b167b69380ab..7f78d243e440 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsGetSample.ts @@ -3,54 +3,41 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a Volume Snapshot. + * This sample demonstrates how to get a Volume Snapshot. * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json */ async function volumeSnapshotsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", ); console.log(result); } /** - * This sample demonstrates how to Get a Volume Snapshot. + * This sample demonstrates how to get a Volume Snapshot. * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MinimumSet_Gen.json */ async function volumeSnapshotsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts index dc6d85afba1b..1e5259e46a94 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsListByVolumeGroupSample.ts @@ -1,66 +1,51 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VolumeSnapshotsListByVolumeGroupOptionalParams} from "@azure/arm-elasticsan"; -import { - ElasticSanManagement, -} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json */ async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const filter = "volumeName eq "; - const options: VolumeSnapshotsListByVolumeGroupOptionalParams = { filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { filter: "volumeName eq " }, )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json */ async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts index 9d12c0efc67a..f8762a82329a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts @@ -1,67 +1,49 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { Volume} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create a Volume. + * This sample demonstrates how to create a Volume. * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json */ async function volumesCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { - properties: { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { creationData: { createSource: "None", sourceId: "mdonegivjquite" }, managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 23, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Create a Volume. + * This sample demonstrates how to create a Volume. * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MinimumSet_Gen.json + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MinimumSet_Gen.json */ async function volumesCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { properties: { sizeGiB: 9 } }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { sizeGiB: 9 }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts index 24a92fd1bdff..39b9e7aa96bf 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesDeleteSample.ts @@ -1,69 +1,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VolumesDeleteOptionalParams} from "@azure/arm-elasticsan"; -import { - ElasticSanManagement, -} from "@azure/arm-elasticsan"; +import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete an Volume. + * This sample demonstrates how to delete an Volume. * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json */ async function volumesDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const xMsDeleteSnapshots = "true"; - const xMsForceDelete = "true"; - const options: VolumesDeleteOptionalParams = { - xMsDeleteSnapshots, - xMsForceDelete, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { xMsDeleteSnapshots: "true", xMsForceDelete: "true" }, ); - console.log(result); } /** - * This sample demonstrates how to Delete an Volume. + * This sample demonstrates how to delete an Volume. * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MinimumSet_Gen.json + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MinimumSet_Gen.json */ async function volumesDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts index 1ba5db7bc799..3a086869b011 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesGetSample.ts @@ -3,54 +3,41 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get an Volume. + * This sample demonstrates how to get an Volume. * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json */ async function volumesGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", ); console.log(result); } /** - * This sample demonstrates how to Get an Volume. + * This sample demonstrates how to get an Volume. * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MinimumSet_Gen.json + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MinimumSet_Gen.json */ async function volumesGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts index e7779b4d358b..a0050c15050a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesListByVolumeGroupSample.ts @@ -3,57 +3,48 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List Volumes in a VolumeGroup. + * This sample demonstrates how to list Volumes in a VolumeGroup. * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json */ async function volumesListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List Volumes in a VolumeGroup. + * This sample demonstrates how to list Volumes in a VolumeGroup. * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MinimumSet_Gen.json */ async function volumesListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, + "resourcegroupname", + "elasticsanname", + "volumegroupname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts index 12056f7be2d7..b75df801c2bf 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreBackupSample.ts @@ -1,32 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { VolumeNameList} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Validate whether a disk snapshot backup can be taken for list of volumes. + * This sample demonstrates how to validate whether a disk snapshot backup can be taken for list of volumes. * - * @summary Validate whether a disk snapshot backup can be taken for list of volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json + * @summary validate whether a disk snapshot backup can be taken for list of volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json */ async function volumeGroupsPreBackupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeNameList = { volumeNames: ["volumename"] }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreBackupAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, + const result = await client.volumes.preBackup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { volumeNames: ["volumename"] }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts index a023e0e9880c..1ab7276bf849 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesPreRestoreSample.ts @@ -1,36 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { DiskSnapshotList} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * This sample demonstrates how to validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. * - * @summary Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json + * @summary validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json */ async function volumeGroupsPreRestoreMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: DiskSnapshotList = { - diskSnapshotIds: [ - "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", - ], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreRestoreAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, + const result = await client.volumes.preRestore( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + diskSnapshotIds: [ + "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", + ], + }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts index 84ef112f4c45..a9d8ca0d4380 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts @@ -1,66 +1,45 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { VolumeUpdate} from "@azure/arm-elasticsan"; import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update an Volume. + * This sample demonstrates how to update an Volume. * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json */ async function volumesUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = { - properties: { - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 7, - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 7 }, ); console.log(result); } /** - * This sample demonstrates how to Update an Volume. + * This sample demonstrates how to update an Volume. * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MinimumSet_Gen.json + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MinimumSet_Gen.json */ async function volumesUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + {}, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md deleted file mode 100644 index 463e9d96d3c3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [elasticSansCreateSample.js][elasticsanscreatesample] | Create ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json | -| [elasticSansDeleteSample.js][elasticsansdeletesample] | Delete a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json | -| [elasticSansGetSample.js][elasticsansgetsample] | Get a ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json | -| [elasticSansListByResourceGroupSample.js][elasticsanslistbyresourcegroupsample] | Gets a list of ElasticSan in a resource group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | -| [elasticSansListBySubscriptionSample.js][elasticsanslistbysubscriptionsample] | Gets a list of ElasticSans in a subscription x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json | -| [elasticSansUpdateSample.js][elasticsansupdatesample] | Update a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json | -| [privateEndpointConnectionsCreateSample.js][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json | -| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | List all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json | -| [privateLinkResourcesListByElasticSanSample.js][privatelinkresourceslistbyelasticsansample] | Gets the private link resources that need to be created for a elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | -| [skusListSample.js][skuslistsample] | List all the available Skus in the region and information related to them x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json | -| [volumeGroupsCreateSample.js][volumegroupscreatesample] | Create a Volume Group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json | -| [volumeGroupsDeleteSample.js][volumegroupsdeletesample] | Delete an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json | -| [volumeGroupsGetSample.js][volumegroupsgetsample] | Get an VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json | -| [volumeGroupsListByElasticSanSample.js][volumegroupslistbyelasticsansample] | List VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | -| [volumeGroupsUpdateSample.js][volumegroupsupdatesample] | Update an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json | -| [volumeSnapshotsCreateSample.js][volumesnapshotscreatesample] | Create a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json | -| [volumeSnapshotsDeleteSample.js][volumesnapshotsdeletesample] | Delete a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json | -| [volumeSnapshotsGetSample.js][volumesnapshotsgetsample] | Get a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json | -| [volumeSnapshotsListByVolumeGroupSample.js][volumesnapshotslistbyvolumegroupsample] | List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesCreateSample.js][volumescreatesample] | Create a Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json | -| [volumesDeleteSample.js][volumesdeletesample] | Delete an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json | -| [volumesGetSample.js][volumesgetsample] | Get an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json | -| [volumesListByVolumeGroupSample.js][volumeslistbyvolumegroupsample] | List Volumes in a VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesPreBackupSample.js][volumesprebackupsample] | Validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json | -| [volumesPreRestoreSample.js][volumesprerestoresample] | Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json | -| [volumesUpdateSample.js][volumesupdatesample] | Update an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node elasticSansCreateSample.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 -cross-env ELASTICSANS_SUBSCRIPTION_ID="" ELASTICSANS_RESOURCE_GROUP="" node elasticSansCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js -[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js -[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js -[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js -[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js -[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js -[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js -[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js -[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js -[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js -[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js -[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js -[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js -[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js -[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js -[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js -[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js -[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js -[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js -[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js -[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js -[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js -[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js -[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js deleted file mode 100644 index aa0935d3eec3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansCreateSample.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json - */ -async function elasticSansCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = { - location: "France Central", - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, - }, - tags: { key9316: "ihndtieqibtob" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MinimumSet_Gen.json - */ -async function elasticSansCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = { - location: "France Central", - properties: { - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main() { - await elasticSansCreateMaximumSetGen(); - await elasticSansCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js deleted file mode 100644 index 670515632fa2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansDeleteSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json - */ -async function elasticSansDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait(resourceGroupName, elasticSanName); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MinimumSet_Gen.json - */ -async function elasticSansDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait(resourceGroupName, elasticSanName); - console.log(result); -} - -async function main() { - await elasticSansDeleteMaximumSetGen(); - await elasticSansDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js deleted file mode 100644 index 68ec551a32a5..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansGetSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json - */ -async function elasticSansGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get(resourceGroupName, elasticSanName); - console.log(result); -} - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MinimumSet_Gen.json - */ -async function elasticSansGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get(resourceGroupName, elasticSanName); - console.log(result); -} - -async function main() { - await elasticSansGetMaximumSetGen(); - await elasticSansGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js deleted file mode 100644 index 15c59d13a901..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansUpdateSample.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json - */ -async function elasticSansUpdateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = { - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", - }, - tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MinimumSet_Gen.json - */ -async function elasticSansUpdateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main() { - await elasticSansUpdateMaximumSetGen(); - await elasticSansUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js deleted file mode 100644 index c9b88a2a69aa..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsCreateSample.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters = { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters = { - properties: { privateLinkServiceConnectionState: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -async function main() { - await privateEndpointConnectionsCreateMaximumSetGen(); - await privateEndpointConnectionsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js deleted file mode 100644 index f740d4f75656..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsDeleteSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - await privateEndpointConnectionsDeleteMaximumSetGen(); - await privateEndpointConnectionsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js deleted file mode 100644 index 6f53594b189a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsGetSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - await privateEndpointConnectionsGetMaximumSetGen(); - await privateEndpointConnectionsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js deleted file mode 100644 index f44120a88437..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateLinkResourcesListByElasticSanSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main() { - await privateLinkResourcesListByElasticSanMaximumSetGen(); - await privateLinkResourcesListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js deleted file mode 100644 index d4568e26282b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsCreateSample.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json - */ -async function volumeGroupsCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MinimumSet_Gen.json - */ -async function volumeGroupsCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeGroupsCreateMaximumSetGen(); - await volumeGroupsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js deleted file mode 100644 index 146156a77359..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsDeleteSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json - */ -async function volumeGroupsDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json - */ -async function volumeGroupsDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -async function main() { - await volumeGroupsDeleteMaximumSetGen(); - await volumeGroupsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js deleted file mode 100644 index a69bd4048f60..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsGetSample.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json - */ -async function volumeGroupsGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get(resourceGroupName, elasticSanName, volumeGroupName); - console.log(result); -} - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MinimumSet_Gen.json - */ -async function volumeGroupsGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get(resourceGroupName, elasticSanName, volumeGroupName); - console.log(result); -} - -async function main() { - await volumeGroupsGetMaximumSetGen(); - await volumeGroupsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js deleted file mode 100644 index 5b0dd14c47f8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsListByElasticSanSample.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List VolumeGroups. - * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json - */ -async function volumeGroupsListByElasticSanMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await volumeGroupsListByElasticSanMaximumSetGen(); - await volumeGroupsListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js deleted file mode 100644 index 666cc672b360..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeGroupsUpdateSample.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json - */ -async function volumeGroupsUpdateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MinimumSet_Gen.json - */ -async function volumeGroupsUpdateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeGroupsUpdateMaximumSetGen(); - await volumeGroupsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js deleted file mode 100644 index 4f8eea37369e..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsCreateSample.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json - */ -async function volumeSnapshotsCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json - */ -async function volumeSnapshotsCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeSnapshotsCreateMaximumSetGen(); - await volumeSnapshotsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js deleted file mode 100644 index 861a87c71235..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsDeleteSample.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json - */ -async function volumeSnapshotsDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json - */ -async function volumeSnapshotsDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main() { - await volumeSnapshotsDeleteMaximumSetGen(); - await volumeSnapshotsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js deleted file mode 100644 index ed0a7892f76b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsGetSample.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json - */ -async function volumeSnapshotsGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json - */ -async function volumeSnapshotsGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main() { - await volumeSnapshotsGetMaximumSetGen(); - await volumeSnapshotsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js deleted file mode 100644 index 04127b1e42c7..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumeSnapshotsListByVolumeGroupSample.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const filter = "volumeName eq "; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await volumeSnapshotsListByVolumeGroupMaximumSetGen(); - await volumeSnapshotsListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js deleted file mode 100644 index 99fe8b6654bf..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesCreateSample.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json - */ -async function volumesCreateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = { - properties: { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MinimumSet_Gen.json - */ -async function volumesCreateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = { properties: { sizeGiB: 9 } }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumesCreateMaximumSetGen(); - await volumesCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js deleted file mode 100644 index a6c5a8223f98..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesDeleteSample.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json - */ -async function volumesDeleteMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const xMsDeleteSnapshots = "true"; - const xMsForceDelete = "true"; - const options = { - xMsDeleteSnapshots, - xMsForceDelete, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MinimumSet_Gen.json - */ -async function volumesDeleteMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main() { - await volumesDeleteMaximumSetGen(); - await volumesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js deleted file mode 100644 index cdff05c35d0c..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesGetSample.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json - */ -async function volumesGetMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MinimumSet_Gen.json - */ -async function volumesGetMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main() { - await volumesGetMaximumSetGen(); - await volumesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js deleted file mode 100644 index 65ff4c1ed00a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesListByVolumeGroupSample.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumesListByVolumeGroupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumesListByVolumeGroupMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await volumesListByVolumeGroupMaximumSetGen(); - await volumesListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js deleted file mode 100644 index 9889084764b6..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreBackupSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Validate whether a disk snapshot backup can be taken for list of volumes. - * - * @summary Validate whether a disk snapshot backup can be taken for list of volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json - */ -async function volumeGroupsPreBackupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { volumeNames: ["volumename"] }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreBackupAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeGroupsPreBackupMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js deleted file mode 100644 index 3ec38c7616a8..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesPreRestoreSample.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * - * @summary Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json - */ -async function volumeGroupsPreRestoreMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters = { - diskSnapshotIds: [ - "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreRestoreAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumeGroupsPreRestoreMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js deleted file mode 100644 index 0f3e53515072..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/volumesUpdateSample.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ElasticSanManagement } = require("@azure/arm-elasticsan"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json - */ -async function volumesUpdateMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = { - properties: { - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 7, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MinimumSet_Gen.json - */ -async function volumesUpdateMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main() { - await volumesUpdateMaximumSetGen(); - await volumesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md deleted file mode 100644 index f5c2a9c60244..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [elasticSansCreateSample.ts][elasticsanscreatesample] | Create ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json | -| [elasticSansDeleteSample.ts][elasticsansdeletesample] | Delete a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json | -| [elasticSansGetSample.ts][elasticsansgetsample] | Get a ElasticSan. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json | -| [elasticSansListByResourceGroupSample.ts][elasticsanslistbyresourcegroupsample] | Gets a list of ElasticSan in a resource group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | -| [elasticSansListBySubscriptionSample.ts][elasticsanslistbysubscriptionsample] | Gets a list of ElasticSans in a subscription x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json | -| [elasticSansUpdateSample.ts][elasticsansupdatesample] | Update a Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json | -| [privateEndpointConnectionsCreateSample.ts][privateendpointconnectionscreatesample] | Update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json | -| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | List all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json | -| [privateLinkResourcesListByElasticSanSample.ts][privatelinkresourceslistbyelasticsansample] | Gets the private link resources that need to be created for a elastic San. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | -| [skusListSample.ts][skuslistsample] | List all the available Skus in the region and information related to them x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json | -| [volumeGroupsCreateSample.ts][volumegroupscreatesample] | Create a Volume Group. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json | -| [volumeGroupsDeleteSample.ts][volumegroupsdeletesample] | Delete an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json | -| [volumeGroupsGetSample.ts][volumegroupsgetsample] | Get an VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json | -| [volumeGroupsListByElasticSanSample.ts][volumegroupslistbyelasticsansample] | List VolumeGroups. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | -| [volumeGroupsUpdateSample.ts][volumegroupsupdatesample] | Update an VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json | -| [volumeSnapshotsCreateSample.ts][volumesnapshotscreatesample] | Create a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json | -| [volumeSnapshotsDeleteSample.ts][volumesnapshotsdeletesample] | Delete a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json | -| [volumeSnapshotsGetSample.ts][volumesnapshotsgetsample] | Get a Volume Snapshot. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json | -| [volumeSnapshotsListByVolumeGroupSample.ts][volumesnapshotslistbyvolumegroupsample] | List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesCreateSample.ts][volumescreatesample] | Create a Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json | -| [volumesDeleteSample.ts][volumesdeletesample] | Delete an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json | -| [volumesGetSample.ts][volumesgetsample] | Get an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json | -| [volumesListByVolumeGroupSample.ts][volumeslistbyvolumegroupsample] | List Volumes in a VolumeGroup. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | -| [volumesPreBackupSample.ts][volumesprebackupsample] | Validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json | -| [volumesPreRestoreSample.ts][volumesprerestoresample] | Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json | -| [volumesUpdateSample.ts][volumesupdatesample] | Update an Volume. x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/elasticSansCreateSample.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 -cross-env ELASTICSANS_SUBSCRIPTION_ID="" ELASTICSANS_RESOURCE_GROUP="" node dist/elasticSansCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts -[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts -[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts -[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts -[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts -[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts -[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts -[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts -[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts -[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts -[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts -[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts -[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts -[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts -[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts -[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts -[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts -[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts -[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts -[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts -[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts -[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts -[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts -[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts -[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts deleted file mode 100644 index 8d1d57edc110..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansCreateSample.ts +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSan} from "@azure/arm-elasticsan"; -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MaximumSet_Gen.json - */ -async function elasticSansCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { - location: "France Central", - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, - }, - tags: { key9316: "ihndtieqibtob" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create ElasticSan. - * - * @summary Create ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Create_MinimumSet_Gen.json - */ -async function elasticSansCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSan = { - location: "France Central", - properties: { - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginCreateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await elasticSansCreateMaximumSetGen(); - await elasticSansCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts deleted file mode 100644 index 6681034a19fd..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansDeleteSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MaximumSet_Gen.json - */ -async function elasticSansDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Elastic San. - * - * @summary Delete a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Delete_MinimumSet_Gen.json - */ -async function elasticSansDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main(): Promise { - await elasticSansDeleteMaximumSetGen(); - await elasticSansDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts deleted file mode 100644 index 5503e5b2811a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansGetSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MaximumSet_Gen.json - */ -async function elasticSansGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a ElasticSan. - * - * @summary Get a ElasticSan. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Get_MinimumSet_Gen.json - */ -async function elasticSansGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.get( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main(): Promise { - await elasticSansGetMaximumSetGen(); - await elasticSansGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts deleted file mode 100644 index 8a3bcaf08103..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansUpdateSample.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { ElasticSanUpdate} from "@azure/arm-elasticsan"; -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MaximumSet_Gen.json - */ -async function elasticSansUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = { - properties: { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, - }, - }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", - }, - tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a Elastic San. - * - * @summary Update a Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_Update_MinimumSet_Gen.json - */ -async function elasticSansUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const parameters: ElasticSanUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.elasticSans.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await elasticSansUpdateMaximumSetGen(); - await elasticSansUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts deleted file mode 100644 index 2d3cee1e4b30..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsCreateSample.ts +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - PrivateEndpointConnection} from "@azure/arm-elasticsan"; -import { - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the Elastic San - * - * @summary Update the state of specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const parameters: PrivateEndpointConnection = { - properties: { privateLinkServiceConnectionState: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await privateEndpointConnectionsCreateMaximumSetGen(); - await privateEndpointConnectionsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index 12ae9b5b7739..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the Elastic San - * - * @summary Deletes the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main(): Promise { - await privateEndpointConnectionsDeleteMaximumSetGen(); - await privateEndpointConnectionsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index dc0fd963828d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json - */ -async function privateEndpointConnectionsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the Elastic San - * - * @summary Gets the specified private endpoint connection associated with the Elastic San - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json - */ -async function privateEndpointConnectionsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const privateEndpointConnectionName = "privateendpointconnectionname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main(): Promise { - await privateEndpointConnectionsGetMaximumSetGen(); - await privateEndpointConnectionsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts deleted file mode 100644 index bb565b6098bc..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateLinkResourcesListByElasticSanSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a elastic San. - * - * @summary Gets the private link resources that need to be created for a elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json - */ -async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.privateLinkResources.listByElasticSan( - resourceGroupName, - elasticSanName, - ); - console.log(result); -} - -async function main(): Promise { - await privateLinkResourcesListByElasticSanMaximumSetGen(); - await privateLinkResourcesListByElasticSanMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts deleted file mode 100644 index afb9587eac91..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/skusListSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - SkusListOptionalParams} from "@azure/arm-elasticsan"; -import { - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json - */ -async function skusListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const filter = "obwwdrkq"; - const options: SkusListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.skus.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the available Skus in the region and information related to them - * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MinimumSet_Gen.json - */ -async function skusListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.skus.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await skusListMaximumSetGen(); - await skusListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts deleted file mode 100644 index 2fcb48e9acbe..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsCreateSample.ts +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { VolumeGroup} from "@azure/arm-elasticsan"; -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MaximumSet_Gen.json - */ -async function volumeGroupsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, - ], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Group. - * - * @summary Create a Volume Group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Create_MinimumSet_Gen.json - */ -async function volumeGroupsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroup = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsCreateMaximumSetGen(); - await volumeGroupsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts deleted file mode 100644 index 0fe6183e9fc9..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsDeleteSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json - */ -async function volumeGroupsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an VolumeGroup. - * - * @summary Delete an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json - */ -async function volumeGroupsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsDeleteMaximumSetGen(); - await volumeGroupsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts deleted file mode 100644 index 655d34fc4f2d..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsGetSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MaximumSet_Gen.json - */ -async function volumeGroupsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get an VolumeGroups. - * - * @summary Get an VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Get_MinimumSet_Gen.json - */ -async function volumeGroupsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsGetMaximumSetGen(); - await volumeGroupsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts deleted file mode 100644 index c735a5945d65..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsUpdateSample.ts +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { VolumeGroupUpdate} from "@azure/arm-elasticsan"; -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MaximumSet_Gen.json - */ -async function volumeGroupsUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = { - identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - properties: { - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", - }, - }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [ - { action: "Allow", virtualNetworkResourceId: "fhhawhc" }, - ], - }, - protocolType: "Iscsi", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an VolumeGroup. - * - * @summary Update an VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_Update_MinimumSet_Gen.json - */ -async function volumeGroupsUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeGroupUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeGroups.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsUpdateMaximumSetGen(); - await volumeGroupsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts deleted file mode 100644 index 03ec9c6ba4aa..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsCreateSample.ts +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { Snapshot} from "@azure/arm-elasticsan"; -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json - */ -async function volumeSnapshotsCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume Snapshot. - * - * @summary Create a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json - */ -async function volumeSnapshotsCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const parameters: Snapshot = { - properties: { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeSnapshotsCreateMaximumSetGen(); - await volumeSnapshotsCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts deleted file mode 100644 index 35566fcd9a85..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsDeleteSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json - */ -async function volumeSnapshotsDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a Volume Snapshot. - * - * @summary Delete a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json - */ -async function volumeSnapshotsDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main(): Promise { - await volumeSnapshotsDeleteMaximumSetGen(); - await volumeSnapshotsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts deleted file mode 100644 index b167b69380ab..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsGetSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json - */ -async function volumeSnapshotsGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a Volume Snapshot. - * - * @summary Get a Volume Snapshot. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json - */ -async function volumeSnapshotsGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const snapshotName = "snapshotname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumeSnapshots.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - ); - console.log(result); -} - -async function main(): Promise { - await volumeSnapshotsGetMaximumSetGen(); - await volumeSnapshotsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts deleted file mode 100644 index dc6d85afba1b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VolumeSnapshotsListByVolumeGroupOptionalParams} from "@azure/arm-elasticsan"; -import { - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const filter = "volumeName eq "; - const options: VolumeSnapshotsListByVolumeGroupOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * - * @summary List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumeSnapshots.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await volumeSnapshotsListByVolumeGroupMaximumSetGen(); - await volumeSnapshotsListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts deleted file mode 100644 index 9d12c0efc67a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesCreateSample.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { Volume} from "@azure/arm-elasticsan"; -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MaximumSet_Gen.json - */ -async function volumesCreateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { - properties: { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a Volume. - * - * @summary Create a Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Create_MinimumSet_Gen.json - */ -async function volumesCreateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: Volume = { properties: { sizeGiB: 9 } }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginCreateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumesCreateMaximumSetGen(); - await volumesCreateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts deleted file mode 100644 index 24a92fd1bdff..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesDeleteSample.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VolumesDeleteOptionalParams} from "@azure/arm-elasticsan"; -import { - ElasticSanManagement, -} from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MaximumSet_Gen.json - */ -async function volumesDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const xMsDeleteSnapshots = "true"; - const xMsForceDelete = "true"; - const options: VolumesDeleteOptionalParams = { - xMsDeleteSnapshots, - xMsForceDelete, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an Volume. - * - * @summary Delete an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Delete_MinimumSet_Gen.json - */ -async function volumesDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginDeleteAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main(): Promise { - await volumesDeleteMaximumSetGen(); - await volumesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts deleted file mode 100644 index 1ba5db7bc799..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesGetSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MaximumSet_Gen.json - */ -async function volumesGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get an Volume. - * - * @summary Get an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Get_MinimumSet_Gen.json - */ -async function volumesGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.get( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - ); - console.log(result); -} - -async function main(): Promise { - await volumesGetMaximumSetGen(); - await volumesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts deleted file mode 100644 index e7779b4d358b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesListByVolumeGroupSample.ts +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json - */ -async function volumesListByVolumeGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List Volumes in a VolumeGroup. - * - * @summary List Volumes in a VolumeGroup. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json - */ -async function volumesListByVolumeGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.volumes.listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await volumesListByVolumeGroupMaximumSetGen(); - await volumesListByVolumeGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts deleted file mode 100644 index 12056f7be2d7..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreBackupSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { VolumeNameList} from "@azure/arm-elasticsan"; -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Validate whether a disk snapshot backup can be taken for list of volumes. - * - * @summary Validate whether a disk snapshot backup can be taken for list of volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreBackup_MaximumSet_Gen.json - */ -async function volumeGroupsPreBackupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: VolumeNameList = { volumeNames: ["volumename"] }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreBackupAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsPreBackupMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts deleted file mode 100644 index a023e0e9880c..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesPreRestoreSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { DiskSnapshotList} from "@azure/arm-elasticsan"; -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * - * @summary Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_PreRestore_MaximumSet_Gen.json - */ -async function volumeGroupsPreRestoreMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const parameters: DiskSnapshotList = { - diskSnapshotIds: [ - "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginPreRestoreAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumeGroupsPreRestoreMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts deleted file mode 100644 index 84ef112f4c45..000000000000 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumesUpdateSample.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { VolumeUpdate} from "@azure/arm-elasticsan"; -import { ElasticSanManagement } from "@azure/arm-elasticsan"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MaximumSet_Gen.json - */ -async function volumesUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = { - properties: { - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 7, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an Volume. - * - * @summary Update an Volume. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Volumes_Update_MinimumSet_Gen.json - */ -async function volumesUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; - const volumeGroupName = "volumegroupname"; - const volumeName = "volumename"; - const parameters: VolumeUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ElasticSanManagement(credential, subscriptionId); - const result = await client.volumes.beginUpdateAndWait( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await volumesUpdateMaximumSetGen(); - await volumesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md new file mode 100644 index 000000000000..fc732665d1ce --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/README.md @@ -0,0 +1,106 @@ +# @azure/arm-elasticsan client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for @azure/arm-elasticsan in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [elasticSansCreateSample.js][elasticsanscreatesample] | create ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json | +| [elasticSansDeleteSample.js][elasticsansdeletesample] | delete a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json | +| [elasticSansGetSample.js][elasticsansgetsample] | get a ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json | +| [elasticSansListByResourceGroupSample.js][elasticsanslistbyresourcegroupsample] | gets a list of ElasticSan in a resource group. x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | +| [elasticSansListBySubscriptionSample.js][elasticsanslistbysubscriptionsample] | gets a list of ElasticSans in a subscription x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json | +| [elasticSansUpdateSample.js][elasticsansupdatesample] | update a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json | +| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json | +| [privateEndpointConnectionsCreateSample.js][privateendpointconnectionscreatesample] | update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json | +| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | list all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json | +| [privateLinkResourcesListByElasticSanSample.js][privatelinkresourceslistbyelasticsansample] | gets the private link resources that need to be created for a elastic San. x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | +| [skusListSample.js][skuslistsample] | list all the available Skus in the region and information related to them x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json | +| [volumeGroupsCreateSample.js][volumegroupscreatesample] | create a Volume Group. x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json | +| [volumeGroupsDeleteSample.js][volumegroupsdeletesample] | delete an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json | +| [volumeGroupsGetSample.js][volumegroupsgetsample] | get an VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json | +| [volumeGroupsListByElasticSanSample.js][volumegroupslistbyelasticsansample] | list VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | +| [volumeGroupsUpdateSample.js][volumegroupsupdatesample] | update an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json | +| [volumeSnapshotsCreateSample.js][volumesnapshotscreatesample] | create a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json | +| [volumeSnapshotsDeleteSample.js][volumesnapshotsdeletesample] | delete a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json | +| [volumeSnapshotsGetSample.js][volumesnapshotsgetsample] | get a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json | +| [volumeSnapshotsListByVolumeGroupSample.js][volumesnapshotslistbyvolumegroupsample] | list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesCreateSample.js][volumescreatesample] | create a Volume. x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json | +| [volumesDeleteSample.js][volumesdeletesample] | delete an Volume. x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json | +| [volumesGetSample.js][volumesgetsample] | get an Volume. x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json | +| [volumesListByVolumeGroupSample.js][volumeslistbyvolumegroupsample] | list Volumes in a VolumeGroup. x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesPreBackupSample.js][volumesprebackupsample] | validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json | +| [volumesPreRestoreSample.js][volumesprerestoresample] | validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json | +| [volumesUpdateSample.js][volumesupdatesample] | update an Volume. x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node elasticSansCreateSample.js +``` + +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +node elasticSansCreateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js +[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js +[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js +[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js +[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js +[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js +[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js +[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js +[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js +[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js +[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js +[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js +[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js +[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js +[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js +[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js +[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js +[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js new file mode 100644 index 000000000000..06fd3ab41965 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create ElasticSan. + * + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json + */ +async function elasticSansCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + location: "France Central", + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + availabilityZones: ["1"], + baseSizeTiB: 5, + extendedCapacitySizeTiB: 25, + publicNetworkAccess: "Enabled", + sku: { name: "Premium_LRS", tier: "Premium" }, + tags: { key9316: "ihndtieqibtob" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create ElasticSan. + * + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MinimumSet_Gen.json + */ +async function elasticSansCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + location: "France Central", + baseSizeTiB: 15, + extendedCapacitySizeTiB: 27, + sku: { name: "Premium_LRS" }, + }); + console.log(result); +} + +async function main() { + await elasticSansCreateMaximumSetGen(); + await elasticSansCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js new file mode 100644 index 000000000000..d36487a88c75 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a Elastic San. + * + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json + */ +async function elasticSansDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); +} + +/** + * This sample demonstrates how to delete a Elastic San. + * + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MinimumSet_Gen.json + */ +async function elasticSansDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); +} + +async function main() { + await elasticSansDeleteMaximumSetGen(); + await elasticSansDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js new file mode 100644 index 000000000000..0c66343632cb --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansGetSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a ElasticSan. + * + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json + */ +async function elasticSansGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + console.log(result); +} + +/** + * This sample demonstrates how to get a ElasticSan. + * + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MinimumSet_Gen.json + */ +async function elasticSansGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + console.log(result); +} + +async function main() { + await elasticSansGetMaximumSetGen(); + await elasticSansGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js similarity index 51% rename from sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js index 63ffe4c5ae87..43425daa3ffd 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListByResourceGroupSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListByResourceGroupSample.js @@ -3,41 +3,40 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. + * This sample demonstrates how to gets a list of ElasticSan in a resource group. * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ async function elasticSansListByResourceGroupMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup(resourceGroupName)) { + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. + * This sample demonstrates how to gets a list of ElasticSan in a resource group. * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ async function elasticSansListByResourceGroupMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup(resourceGroupName)) { + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js similarity index 58% rename from sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js index b6b179c1b874..fbd12a16fea1 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/elasticSansListBySubscriptionSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansListBySubscriptionSample.js @@ -3,39 +3,40 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ async function elasticSansListBySubscriptionMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ async function elasticSansListBySubscriptionMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js new file mode 100644 index 000000000000..0be02ba6db84 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a Elastic San. + * + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json + */ +async function elasticSansUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", + tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to update a Elastic San. + * + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MinimumSet_Gen.json + */ +async function elasticSansUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", {}); + console.log(result); +} + +async function main() { + await elasticSansUpdateMaximumSetGen(); + await elasticSansUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js similarity index 55% rename from sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js index ed7119d6a520..ce0ceec732c8 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/operationsListSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/operationsListSample.js @@ -3,41 +3,40 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List the operations for the provider + * This sample demonstrates how to list the operations for the provider * - * @summary List the operations for the provider - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json */ async function operationsListMaximumSetGen() { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List the operations for the provider + * This sample demonstrates how to list the operations for the provider * - * @summary List the operations for the provider - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MinimumSet_Gen.json + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MinimumSet_Gen.json */ async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/package.json b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/package.json similarity index 83% rename from sdk/elasticsans/arm-elasticsan/samples/v1/javascript/package.json rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/package.json index 8e272a763190..89ce28944445 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/package.json +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-elasticsan-js", "private": true, "version": "1.0.0", - "description": " client library samples for JavaScript", + "description": "@azure/arm-elasticsan client library samples for JavaScript", "engines": { "node": ">=20.0.0" }, @@ -14,10 +14,10 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "author": "Microsoft Corporation", "license": "MIT", @@ -28,7 +28,7 @@ "dependencies": { "@azure/arm-elasticsan": "latest", "dotenv": "latest", - "@azure/identity": "^4.11.1" + "@azure/identity": "^4.13.0" }, "devDependencies": { "cross-env": "latest" diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js new file mode 100644 index 000000000000..7f5dc4e44e06 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { privateLinkServiceConnectionState: {} }, + ); + console.log(result); +} + +async function main() { + await privateEndpointConnectionsCreateMaximumSetGen(); + await privateEndpointConnectionsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js new file mode 100644 index 000000000000..140151618cc1 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); +} + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); +} + +async function main() { + await privateEndpointConnectionsDeleteMaximumSetGen(); + await privateEndpointConnectionsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..229aff5a10c3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsGetSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); + console.log(result); +} + +async function main() { + await privateEndpointConnectionsGetMaximumSetGen(); + await privateEndpointConnectionsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js similarity index 50% rename from sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js index 0bfca1b4ea7f..00aeb2a50d1b 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/privateEndpointConnectionsListSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsListSample.js @@ -3,49 +3,46 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json */ async function privateEndpointConnectionsListMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MinimumSet_Gen.json */ async function privateEndpointConnectionsListMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js new file mode 100644 index 000000000000..da29e9a59320 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateLinkResourcesListByElasticSanSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + "resourcegroupname", + "elasticsanname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + "resourcegroupname", + "elasticsanname", + ); + console.log(result); +} + +async function main() { + await privateLinkResourcesListByElasticSanMaximumSetGen(); + await privateLinkResourcesListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/sample.env b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/sample.env similarity index 100% rename from sdk/elasticsans/arm-elasticsan/samples/v1/javascript/sample.env rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/sample.env diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js similarity index 54% rename from sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js rename to sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js index 2def731db728..ee66ec740044 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/javascript/skusListSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/skusListSample.js @@ -3,41 +3,40 @@ const { ElasticSanManagement } = require("@azure/arm-elasticsan"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List all the available Skus in the region and information related to them + * This sample demonstrates how to list all the available Skus in the region and information related to them * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MaximumSet_Gen.json + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json */ async function skusListMaximumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const filter = "obwwdrkq"; - const options = { filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.skus.list(options)) { + for await (const item of client.skus.list({ filter: "obwwdrkq" })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List all the available Skus in the region and information related to them + * This sample demonstrates how to list all the available Skus in the region and information related to them * - * @summary List all the available Skus in the region and information related to them - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Skus_List_MinimumSet_Gen.json + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MinimumSet_Gen.json */ async function skusListMinimumSetGen() { - const subscriptionId = process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.skus.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js new file mode 100644 index 000000000000..8ab159f81be0 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create a Volume Group. + * + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json + */ +async function volumeGroupsCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume Group. + * + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MinimumSet_Gen.json + */ +async function volumeGroupsCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, + ); + console.log(result); +} + +async function main() { + await volumeGroupsCreateMaximumSetGen(); + await volumeGroupsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js new file mode 100644 index 000000000000..d621f38ce0b2 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete an VolumeGroup. + * + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json + */ +async function volumeGroupsDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); +} + +/** + * This sample demonstrates how to delete an VolumeGroup. + * + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MinimumSet_Gen.json + */ +async function volumeGroupsDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); +} + +async function main() { + await volumeGroupsDeleteMaximumSetGen(); + await volumeGroupsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js new file mode 100644 index 000000000000..d3ef3cb3ce45 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsGetSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get an VolumeGroups. + * + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json + */ +async function volumeGroupsGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get an VolumeGroups. + * + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MinimumSet_Gen.json + */ +async function volumeGroupsGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + ); + console.log(result); +} + +async function main() { + await volumeGroupsGetMaximumSetGen(); + await volumeGroupsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js new file mode 100644 index 000000000000..631796fbda96 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsListByElasticSanSample.js @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list VolumeGroups. + * + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + */ +async function volumeGroupsListByElasticSanMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeGroups.listByElasticSan( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list VolumeGroups. + * + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + */ +async function volumeGroupsListByElasticSanMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeGroups.listByElasticSan( + "resourcegroupname", + "elasticsanname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await volumeGroupsListByElasticSanMaximumSetGen(); + await volumeGroupsListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js new file mode 100644 index 000000000000..acf8ee768653 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update an VolumeGroup. + * + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json + */ +async function volumeGroupsUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update an VolumeGroup. + * + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MinimumSet_Gen.json + */ +async function volumeGroupsUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, + ); + console.log(result); +} + +async function main() { + await volumeGroupsUpdateMaximumSetGen(); + await volumeGroupsUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js new file mode 100644 index 000000000000..82cb28a45d41 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create a Volume Snapshot. + * + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json + */ +async function volumeSnapshotsCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume Snapshot. + * + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MinimumSet_Gen.json + */ +async function volumeSnapshotsCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + ); + console.log(result); +} + +async function main() { + await volumeSnapshotsCreateMaximumSetGen(); + await volumeSnapshotsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js new file mode 100644 index 000000000000..82bc0741abfc --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsDeleteSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a Volume Snapshot. + * + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json + */ +async function volumeSnapshotsDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); +} + +/** + * This sample demonstrates how to delete a Volume Snapshot. + * + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MinimumSet_Gen.json + */ +async function volumeSnapshotsDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); +} + +async function main() { + await volumeSnapshotsDeleteMaximumSetGen(); + await volumeSnapshotsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js new file mode 100644 index 000000000000..7271fd913ba7 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsGetSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a Volume Snapshot. + * + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json + */ +async function volumeSnapshotsGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get a Volume Snapshot. + * + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MinimumSet_Gen.json + */ +async function volumeSnapshotsGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); + console.log(result); +} + +async function main() { + await volumeSnapshotsGetMaximumSetGen(); + await volumeSnapshotsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js new file mode 100644 index 000000000000..4b891d95a2c5 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsListByVolumeGroupSample.js @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { filter: "volumeName eq " }, + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await volumeSnapshotsListByVolumeGroupMaximumSetGen(); + await volumeSnapshotsListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js new file mode 100644 index 000000000000..deaffff97f05 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create a Volume. + * + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json + */ +async function volumesCreateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume. + * + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MinimumSet_Gen.json + */ +async function volumesCreateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { sizeGiB: 9 }, + ); + console.log(result); +} + +async function main() { + await volumesCreateMaximumSetGen(); + await volumesCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js new file mode 100644 index 000000000000..c8e310e3895a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesDeleteSample.js @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete an Volume. + * + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json + */ +async function volumesDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { xMsDeleteSnapshots: "true", xMsForceDelete: "true" }, + ); +} + +/** + * This sample demonstrates how to delete an Volume. + * + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MinimumSet_Gen.json + */ +async function volumesDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); +} + +async function main() { + await volumesDeleteMaximumSetGen(); + await volumesDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js new file mode 100644 index 000000000000..8987e9ec5d3e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesGetSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get an Volume. + * + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json + */ +async function volumesGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get an Volume. + * + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MinimumSet_Gen.json + */ +async function volumesGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); + console.log(result); +} + +async function main() { + await volumesGetMaximumSetGen(); + await volumesGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js new file mode 100644 index 000000000000..00e72f6c8cbe --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesListByVolumeGroupSample.js @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list Volumes in a VolumeGroup. + * + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumesListByVolumeGroupMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list Volumes in a VolumeGroup. + * + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumesListByVolumeGroupMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await volumesListByVolumeGroupMaximumSetGen(); + await volumesListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js new file mode 100644 index 000000000000..ddb7ebd7b6e3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreBackupSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to validate whether a disk snapshot backup can be taken for list of volumes. + * + * @summary validate whether a disk snapshot backup can be taken for list of volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json + */ +async function volumeGroupsPreBackupMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.preBackup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { volumeNames: ["volumename"] }, + ); + console.log(result); +} + +async function main() { + await volumeGroupsPreBackupMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js new file mode 100644 index 000000000000..4aacd52202f7 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesPreRestoreSample.js @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * + * @summary validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json + */ +async function volumeGroupsPreRestoreMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.preRestore( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + diskSnapshotIds: [ + "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", + ], + }, + ); + console.log(result); +} + +async function main() { + await volumeGroupsPreRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js new file mode 100644 index 000000000000..487c6bc3e4f6 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ElasticSanManagement } = require("@azure/arm-elasticsan"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update an Volume. + * + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json + */ +async function volumesUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 7 }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update an Volume. + * + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MinimumSet_Gen.json + */ +async function volumesUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + {}, + ); + console.log(result); +} + +async function main() { + await volumesUpdateMaximumSetGen(); + await volumesUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md new file mode 100644 index 000000000000..1340d76ebc6d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/README.md @@ -0,0 +1,119 @@ +# @azure/arm-elasticsan client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for @azure/arm-elasticsan in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [elasticSansCreateSample.ts][elasticsanscreatesample] | create ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json | +| [elasticSansDeleteSample.ts][elasticsansdeletesample] | delete a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json | +| [elasticSansGetSample.ts][elasticsansgetsample] | get a ElasticSan. x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json | +| [elasticSansListByResourceGroupSample.ts][elasticsanslistbyresourcegroupsample] | gets a list of ElasticSan in a resource group. x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json | +| [elasticSansListBySubscriptionSample.ts][elasticsanslistbysubscriptionsample] | gets a list of ElasticSans in a subscription x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json | +| [elasticSansUpdateSample.ts][elasticsansupdatesample] | update a Elastic San. x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json | +| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json | +| [privateEndpointConnectionsCreateSample.ts][privateendpointconnectionscreatesample] | update the state of specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | deletes the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | gets the specified private endpoint connection associated with the Elastic San x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json | +| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | list all Private Endpoint Connections associated with the Elastic San. x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json | +| [privateLinkResourcesListByElasticSanSample.ts][privatelinkresourceslistbyelasticsansample] | gets the private link resources that need to be created for a elastic San. x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json | +| [skusListSample.ts][skuslistsample] | list all the available Skus in the region and information related to them x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json | +| [volumeGroupsCreateSample.ts][volumegroupscreatesample] | create a Volume Group. x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json | +| [volumeGroupsDeleteSample.ts][volumegroupsdeletesample] | delete an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json | +| [volumeGroupsGetSample.ts][volumegroupsgetsample] | get an VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json | +| [volumeGroupsListByElasticSanSample.ts][volumegroupslistbyelasticsansample] | list VolumeGroups. x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json | +| [volumeGroupsUpdateSample.ts][volumegroupsupdatesample] | update an VolumeGroup. x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json | +| [volumeSnapshotsCreateSample.ts][volumesnapshotscreatesample] | create a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json | +| [volumeSnapshotsDeleteSample.ts][volumesnapshotsdeletesample] | delete a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json | +| [volumeSnapshotsGetSample.ts][volumesnapshotsgetsample] | get a Volume Snapshot. x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json | +| [volumeSnapshotsListByVolumeGroupSample.ts][volumesnapshotslistbyvolumegroupsample] | list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesCreateSample.ts][volumescreatesample] | create a Volume. x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json | +| [volumesDeleteSample.ts][volumesdeletesample] | delete an Volume. x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json | +| [volumesGetSample.ts][volumesgetsample] | get an Volume. x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json | +| [volumesListByVolumeGroupSample.ts][volumeslistbyvolumegroupsample] | list Volumes in a VolumeGroup. x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json | +| [volumesPreBackupSample.ts][volumesprebackupsample] | validate whether a disk snapshot backup can be taken for list of volumes. x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json | +| [volumesPreRestoreSample.ts][volumesprerestoresample] | validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json | +| [volumesUpdateSample.ts][volumesupdatesample] | update an Volume. x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/elasticSansCreateSample.js +``` + +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +node dist/elasticSansCreateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[elasticsanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts +[elasticsansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts +[elasticsansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts +[elasticsanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts +[elasticsanslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts +[elasticsansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts +[privateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts +[privatelinkresourceslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts +[volumegroupscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts +[volumegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts +[volumegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts +[volumegroupslistbyelasticsansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts +[volumegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts +[volumesnapshotscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts +[volumesnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts +[volumesnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts +[volumesnapshotslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts +[volumescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts +[volumeslistbyvolumegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts +[volumesprebackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts +[volumesprerestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/package.json b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/package.json similarity index 86% rename from sdk/elasticsans/arm-elasticsan/samples/v1/typescript/package.json rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/package.json index b19dc273f2c6..77d2980c1c96 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/package.json +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-elasticsan-ts", "private": true, "version": "1.0.0", - "description": " client library samples for TypeScript", + "description": "@azure/arm-elasticsan client library samples for TypeScript", "engines": { "node": ">=20.0.0" }, @@ -18,10 +18,10 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "author": "Microsoft Corporation", "license": "MIT", @@ -32,7 +32,7 @@ "dependencies": { "@azure/arm-elasticsan": "latest", "dotenv": "latest", - "@azure/identity": "^4.11.1" + "@azure/identity": "^4.13.0" }, "devDependencies": { "@types/node": "^20.0.0", diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/sample.env b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/sample.env similarity index 100% rename from sdk/elasticsans/arm-elasticsan/samples/v1/typescript/sample.env rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/sample.env diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts new file mode 100644 index 000000000000..13cbfb8a29c0 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create ElasticSan. + * + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MaximumSet_Gen.json + */ +async function elasticSansCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + location: "France Central", + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + availabilityZones: ["1"], + baseSizeTiB: 5, + extendedCapacitySizeTiB: 25, + publicNetworkAccess: "Enabled", + sku: { name: "Premium_LRS", tier: "Premium" }, + tags: { key9316: "ihndtieqibtob" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create ElasticSan. + * + * @summary create ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Create_MinimumSet_Gen.json + */ +async function elasticSansCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { + location: "France Central", + baseSizeTiB: 15, + extendedCapacitySizeTiB: 27, + sku: { name: "Premium_LRS" }, + }); + console.log(result); +} + +async function main(): Promise { + await elasticSansCreateMaximumSetGen(); + await elasticSansCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts new file mode 100644 index 000000000000..9bcc04f5edfd --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a Elastic San. + * + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MaximumSet_Gen.json + */ +async function elasticSansDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); +} + +/** + * This sample demonstrates how to delete a Elastic San. + * + * @summary delete a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Delete_MinimumSet_Gen.json + */ +async function elasticSansDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.elasticSans.delete("resourcegroupname", "elasticsanname"); +} + +async function main(): Promise { + await elasticSansDeleteMaximumSetGen(); + await elasticSansDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts new file mode 100644 index 000000000000..e80a93aa8f0e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansGetSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a ElasticSan. + * + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MaximumSet_Gen.json + */ +async function elasticSansGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + console.log(result); +} + +/** + * This sample demonstrates how to get a ElasticSan. + * + * @summary get a ElasticSan. + * x-ms-original-file: 2025-09-01/ElasticSans_Get_MinimumSet_Gen.json + */ +async function elasticSansGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.get("resourcegroupname", "elasticsanname"); + console.log(result); +} + +async function main(): Promise { + await elasticSansGetMaximumSetGen(); + await elasticSansGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts similarity index 51% rename from sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts index 5a364acd441f..a2ac1576753a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListByResourceGroupSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListByResourceGroupSample.ts @@ -3,49 +3,40 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. + * This sample demonstrates how to gets a list of ElasticSan in a resource group. * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ async function elasticSansListByResourceGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSan in a resource group. + * This sample demonstrates how to gets a list of ElasticSan in a resource group. * - * @summary Gets a list of ElasticSan in a resource group. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * @summary gets a list of ElasticSan in a resource group. + * x-ms-original-file: 2025-09-01/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ async function elasticSansListByResourceGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.elasticSans.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.elasticSans.listByResourceGroup("resourcegroupname")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts similarity index 58% rename from sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts index fc5c6843145c..1fc752343bbf 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/elasticSansListBySubscriptionSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansListBySubscriptionSample.ts @@ -3,41 +3,40 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ async function elasticSansListBySubscriptionMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of ElasticSans in a subscription + * This sample demonstrates how to gets a list of ElasticSans in a subscription * - * @summary Gets a list of ElasticSans in a subscription - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * @summary gets a list of ElasticSans in a subscription + * x-ms-original-file: 2025-09-01/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ async function elasticSansListBySubscriptionMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.elasticSans.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts new file mode 100644 index 000000000000..d5982b896791 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a Elastic San. + * + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MaximumSet_Gen.json + */ +async function elasticSansUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, + }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", + tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to update a Elastic San. + * + * @summary update a Elastic San. + * x-ms-original-file: 2025-09-01/ElasticSans_Update_MinimumSet_Gen.json + */ +async function elasticSansUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", {}); + console.log(result); +} + +async function main(): Promise { + await elasticSansUpdateMaximumSetGen(); + await elasticSansUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts similarity index 56% rename from sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts index a63cdbdf87e8..6dd402a1bf11 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/operationsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/operationsListSample.ts @@ -3,43 +3,40 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List the operations for the provider + * This sample demonstrates how to list the operations for the provider * - * @summary List the operations for the provider - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MaximumSet_Gen.json + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MaximumSet_Gen.json */ async function operationsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List the operations for the provider + * This sample demonstrates how to list the operations for the provider * - * @summary List the operations for the provider - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/Operations_List_MinimumSet_Gen.json + * @summary list the operations for the provider + * x-ms-original-file: 2025-09-01/Operations_List_MinimumSet_Gen.json */ async function operationsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts new file mode 100644 index 000000000000..a3add2ffff07 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the Elastic San + * + * @summary update the state of specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Create_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.create( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + { privateLinkServiceConnectionState: {} }, + ); + console.log(result); +} + +async function main(): Promise { + await privateEndpointConnectionsCreateMaximumSetGen(); + await privateEndpointConnectionsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..abc29f16677e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); +} + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the Elastic San + * + * @summary deletes the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.privateEndpointConnections.delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); +} + +async function main(): Promise { + await privateEndpointConnectionsDeleteMaximumSetGen(); + await privateEndpointConnectionsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..f7fea37d0372 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json + */ +async function privateEndpointConnectionsGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the Elastic San + * + * @summary gets the specified private endpoint connection associated with the Elastic San + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_Get_MinimumSet_Gen.json + */ +async function privateEndpointConnectionsGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + ); + console.log(result); +} + +async function main(): Promise { + await privateEndpointConnectionsGetMaximumSetGen(); + await privateEndpointConnectionsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts similarity index 51% rename from sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts index c7ae9c013252..3616a6035b66 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/privateEndpointConnectionsListSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts @@ -3,53 +3,46 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MaximumSet_Gen.json */ async function privateEndpointConnectionsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List all Private Endpoint Connections associated with the Elastic San. + * This sample demonstrates how to list all Private Endpoint Connections associated with the Elastic San. * - * @summary List all Private Endpoint Connections associated with the Elastic San. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json + * @summary list all Private Endpoint Connections associated with the Elastic San. + * x-ms-original-file: 2025-09-01/PrivateEndpointConnections_List_MinimumSet_Gen.json */ async function privateEndpointConnectionsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateEndpointConnections.list( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts new file mode 100644 index 000000000000..233d5378e795 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateLinkResourcesListByElasticSanSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + "resourcegroupname", + "elasticsanname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a elastic San. + * + * @summary gets the private link resources that need to be created for a elastic San. + * x-ms-original-file: 2025-09-01/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + */ +async function privateLinkResourcesListByElasticSanMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.privateLinkResources.listByElasticSan( + "resourcegroupname", + "elasticsanname", + ); + console.log(result); +} + +async function main(): Promise { + await privateLinkResourcesListByElasticSanMaximumSetGen(); + await privateLinkResourcesListByElasticSanMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts new file mode 100644 index 000000000000..f70a88942fed --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/skusListSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list all the available Skus in the region and information related to them + * + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MaximumSet_Gen.json + */ +async function skusListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.skus.list({ filter: "obwwdrkq" })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list all the available Skus in the region and information related to them + * + * @summary list all the available Skus in the region and information related to them + * x-ms-original-file: 2025-09-01/Skus_List_MinimumSet_Gen.json + */ +async function skusListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.skus.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await skusListMaximumSetGen(); + await skusListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts new file mode 100644 index 000000000000..d9996d788fb6 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create a Volume Group. + * + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MaximumSet_Gen.json + */ +async function volumeGroupsCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume Group. + * + * @summary create a Volume Group. + * x-ms-original-file: 2025-09-01/VolumeGroups_Create_MinimumSet_Gen.json + */ +async function volumeGroupsCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsCreateMaximumSetGen(); + await volumeGroupsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts new file mode 100644 index 000000000000..ac965081580a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete an VolumeGroup. + * + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MaximumSet_Gen.json + */ +async function volumeGroupsDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); +} + +/** + * This sample demonstrates how to delete an VolumeGroup. + * + * @summary delete an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Delete_MinimumSet_Gen.json + */ +async function volumeGroupsDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeGroups.delete("resourcegroupname", "elasticsanname", "volumegroupname"); +} + +async function main(): Promise { + await volumeGroupsDeleteMaximumSetGen(); + await volumeGroupsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts new file mode 100644 index 000000000000..a128c689a18d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsGetSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get an VolumeGroups. + * + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MaximumSet_Gen.json + */ +async function volumeGroupsGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get an VolumeGroups. + * + * @summary get an VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_Get_MinimumSet_Gen.json + */ +async function volumeGroupsGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsGetMaximumSetGen(); + await volumeGroupsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts similarity index 50% rename from sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts index 61e3533f75b4..380a5aa9623f 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/src/volumeGroupsListByElasticSanSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsListByElasticSanSample.ts @@ -3,53 +3,46 @@ import { ElasticSanManagement } from "@azure/arm-elasticsan"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List VolumeGroups. + * This sample demonstrates how to list VolumeGroups. * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json */ async function volumeGroupsListByElasticSanMaximumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List VolumeGroups. + * This sample demonstrates how to list VolumeGroups. * - * @summary List VolumeGroups. - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/stable/2025-09-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + * @summary list VolumeGroups. + * x-ms-original-file: 2025-09-01/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json */ async function volumeGroupsListByElasticSanMinimumSetGen(): Promise { - const subscriptionId = - process.env["ELASTICSANS_SUBSCRIPTION_ID"] || "subscriptionid"; - const resourceGroupName = - process.env["ELASTICSANS_RESOURCE_GROUP"] || "resourcegroupname"; - const elasticSanName = "elasticsanname"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const resArray = new Array(); for await (const item of client.volumeGroups.listByElasticSan( - resourceGroupName, - elasticSanName, + "resourcegroupname", + "elasticsanname", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts new file mode 100644 index 000000000000..2b1eb21298d2 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update an VolumeGroup. + * + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MaximumSet_Gen.json + */ +async function volumeGroupsUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + identity: { type: "None", userAssignedIdentities: { key2350: {} } }, + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, + }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update an VolumeGroup. + * + * @summary update an VolumeGroup. + * x-ms-original-file: 2025-09-01/VolumeGroups_Update_MinimumSet_Gen.json + */ +async function volumeGroupsUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeGroups.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsUpdateMaximumSetGen(); + await volumeGroupsUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts new file mode 100644 index 000000000000..2c538ba186d0 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create a Volume Snapshot. + * + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MaximumSet_Gen.json + */ +async function volumeSnapshotsCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume Snapshot. + * + * @summary create a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Create_MinimumSet_Gen.json + */ +async function volumeSnapshotsCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await volumeSnapshotsCreateMaximumSetGen(); + await volumeSnapshotsCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts new file mode 100644 index 000000000000..e8db98290e6c --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsDeleteSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a Volume Snapshot. + * + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MaximumSet_Gen.json + */ +async function volumeSnapshotsDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); +} + +/** + * This sample demonstrates how to delete a Volume Snapshot. + * + * @summary delete a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Delete_MinimumSet_Gen.json + */ +async function volumeSnapshotsDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumeSnapshots.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); +} + +async function main(): Promise { + await volumeSnapshotsDeleteMaximumSetGen(); + await volumeSnapshotsDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts new file mode 100644 index 000000000000..7f78d243e440 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsGetSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a Volume Snapshot. + * + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MaximumSet_Gen.json + */ +async function volumeSnapshotsGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get a Volume Snapshot. + * + * @summary get a Volume Snapshot. + * x-ms-original-file: 2025-09-01/VolumeSnapshots_Get_MinimumSet_Gen.json + */ +async function volumeSnapshotsGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumeSnapshots.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + ); + console.log(result); +} + +async function main(): Promise { + await volumeSnapshotsGetMaximumSetGen(); + await volumeSnapshotsGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts new file mode 100644 index 000000000000..1e5259e46a94 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsListByVolumeGroupSample.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { filter: "volumeName eq " }, + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * + * @summary list Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter + * x-ms-original-file: 2025-09-01/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumeSnapshotsListByVolumeGroupMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumeSnapshots.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await volumeSnapshotsListByVolumeGroupMaximumSetGen(); + await volumeSnapshotsListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts new file mode 100644 index 000000000000..f8762a82329a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create a Volume. + * + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MaximumSet_Gen.json + */ +async function volumesCreateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create a Volume. + * + * @summary create a Volume. + * x-ms-original-file: 2025-09-01/Volumes_Create_MinimumSet_Gen.json + */ +async function volumesCreateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.create( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { sizeGiB: 9 }, + ); + console.log(result); +} + +async function main(): Promise { + await volumesCreateMaximumSetGen(); + await volumesCreateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts new file mode 100644 index 000000000000..39b9e7aa96bf --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesDeleteSample.ts @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete an Volume. + * + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MaximumSet_Gen.json + */ +async function volumesDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { xMsDeleteSnapshots: "true", xMsForceDelete: "true" }, + ); +} + +/** + * This sample demonstrates how to delete an Volume. + * + * @summary delete an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Delete_MinimumSet_Gen.json + */ +async function volumesDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + await client.volumes.delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); +} + +async function main(): Promise { + await volumesDeleteMaximumSetGen(); + await volumesDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts new file mode 100644 index 000000000000..3a086869b011 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesGetSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get an Volume. + * + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MaximumSet_Gen.json + */ +async function volumesGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get an Volume. + * + * @summary get an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Get_MinimumSet_Gen.json + */ +async function volumesGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.get( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + ); + console.log(result); +} + +async function main(): Promise { + await volumesGetMaximumSetGen(); + await volumesGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts new file mode 100644 index 000000000000..a0050c15050a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesListByVolumeGroupSample.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list Volumes in a VolumeGroup. + * + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + */ +async function volumesListByVolumeGroupMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list Volumes in a VolumeGroup. + * + * @summary list Volumes in a VolumeGroup. + * x-ms-original-file: 2025-09-01/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + */ +async function volumesListByVolumeGroupMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.volumes.listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await volumesListByVolumeGroupMaximumSetGen(); + await volumesListByVolumeGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts new file mode 100644 index 000000000000..b75df801c2bf --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreBackupSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to validate whether a disk snapshot backup can be taken for list of volumes. + * + * @summary validate whether a disk snapshot backup can be taken for list of volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreBackup_MaximumSet_Gen.json + */ +async function volumeGroupsPreBackupMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.preBackup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { volumeNames: ["volumename"] }, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsPreBackupMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts new file mode 100644 index 000000000000..1ab7276bf849 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesPreRestoreSample.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * + * @summary validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + * x-ms-original-file: 2025-09-01/Volumes_PreRestore_MaximumSet_Gen.json + */ +async function volumeGroupsPreRestoreMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.preRestore( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + { + diskSnapshotIds: [ + "/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/snapshots/disksnapshot1", + ], + }, + ); + console.log(result); +} + +async function main(): Promise { + await volumeGroupsPreRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts new file mode 100644 index 000000000000..a9d8ca0d4380 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ElasticSanManagement } from "@azure/arm-elasticsan"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update an Volume. + * + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MaximumSet_Gen.json + */ +async function volumesUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + { managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 7 }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update an Volume. + * + * @summary update an Volume. + * x-ms-original-file: 2025-09-01/Volumes_Update_MinimumSet_Gen.json + */ +async function volumesUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subscriptionid"; + const client = new ElasticSanManagement(credential, subscriptionId); + const result = await client.volumes.update( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await volumesUpdateMaximumSetGen(); + await volumesUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v1/typescript/tsconfig.json b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/tsconfig.json similarity index 100% rename from sdk/elasticsans/arm-elasticsan/samples/v1/typescript/tsconfig.json rename to sdk/elasticsans/arm-elasticsan/samples/v2/typescript/tsconfig.json diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts new file mode 100644 index 000000000000..dab669896e9b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import type { AzureSupportedClouds } from "../static-helpers/cloudSettingHelpers.js"; +import { getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import type { Client, ClientOptions } from "@azure-rest/core-client"; +import { getClient } from "@azure-rest/core-client"; +import type { TokenCredential } from "@azure/core-auth"; + +/** Elastic SAN is a fully integrated solution that simplifies deploying, scaling, managing, and configuring a storage area network (SAN). It also offers built-in cloud capabilities like high availability. Elastic SAN works with many types of compute resources, such as Azure Virtual Machines, Azure VMware Solution, and Azure Kubernetes Service. */ +export interface ElasticSanManagementContext extends Client { + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; +} + +/** Optional parameters for the client. */ +export interface ElasticSanManagementOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +/** Elastic SAN is a fully integrated solution that simplifies deploying, scaling, managing, and configuring a storage area network (SAN). It also offers built-in cloud capabilities like high availability. Elastic SAN works with many types of compute resources, such as Azure Virtual Machines, Azure VMware Solution, and Azure Kubernetes Service. */ +export function createElasticSanManagement( + credential: TokenCredential, + subscriptionId: string, + options: ElasticSanManagementOptionalParams = {}, +): ElasticSanManagementContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-elasticsan/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`] }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + const apiVersion = options.apiVersion; + return { ...clientContext, apiVersion, subscriptionId } as ElasticSanManagementContext; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts new file mode 100644 index 000000000000..4638e024014e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansDeleteOptionalParams, + ElasticSansUpdateOptionalParams, + ElasticSansCreateOptionalParams, + ElasticSansGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts new file mode 100644 index 000000000000..6ed918a3e123 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/operations.ts @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { ElasticSan, ElasticSanUpdate, _ElasticSanList } from "../../models/models.js"; +import { + errorResponseDeserializer, + elasticSanSerializer, + elasticSanDeserializer, + elasticSanUpdateSerializer, + _elasticSanListDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansDeleteOptionalParams, + ElasticSansUpdateOptionalParams, + ElasticSansCreateOptionalParams, + ElasticSansGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listBySubscriptionSend( + context: Client, + options: ElasticSansListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_ElasticSanList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _elasticSanListDeserializer(result.body); +} + +/** Gets a list of ElasticSans in a subscription */ +export function listBySubscription( + context: Client, + options: ElasticSansListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-09-01" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: ElasticSansListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_ElasticSanList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _elasticSanListDeserializer(result.body); +} + +/** Gets a list of ElasticSan in a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: ElasticSansListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-09-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: ElasticSansDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete a Elastic San. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: ElasticSansDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, elasticSanName, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options: ElasticSansUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: elasticSanUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return elasticSanDeserializer(result.body); +} + +/** Update a Elastic San. */ +export function update( + context: Client, + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options: ElasticSansUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, ElasticSan> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, elasticSanName, parameters, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, ElasticSan>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options: ElasticSansCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: elasticSanSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return elasticSanDeserializer(result.body); +} + +/** Create ElasticSan. */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options: ElasticSansCreateOptionalParams = { requestOptions: {} }, +): PollerLike, ElasticSan> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend(context, resourceGroupName, elasticSanName, parameters, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, ElasticSan>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: ElasticSansGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return elasticSanDeserializer(result.body); +} + +/** Get a ElasticSan. */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: ElasticSansGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, elasticSanName, options); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts new file mode 100644 index 000000000000..1f22eab99e21 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/elasticSans/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ElasticSansListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ElasticSansListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ElasticSansDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ElasticSansUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ElasticSansCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ElasticSansGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/index.ts new file mode 100644 index 000000000000..b78c2b276cec --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createElasticSanManagement, + ElasticSanManagementContext, + ElasticSanManagementOptionalParams, +} from "./elasticSanManagementContext.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts new file mode 100644 index 000000000000..24a804d14fcf --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts new file mode 100644 index 000000000000..0f96811ea52e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/operations/operations.ts @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { _OperationListResult, Operation } from "../../models/models.js"; +import { + _operationListResultDeserializer, + errorResponseDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { OperationsListOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.ElasticSan/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _operationListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-09-01" }, + ); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts new file mode 100644 index 000000000000..b9a3fd9758a3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts new file mode 100644 index 000000000000..c7afff4982ae --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, create, get } from "./operations.js"; +export { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts new file mode 100644 index 000000000000..53a60031500e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/operations.ts @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { + PrivateEndpointConnection, + _PrivateEndpointConnectionListResult, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + privateEndpointConnectionSerializer, + privateEndpointConnectionDeserializer, + _privateEndpointConnectionListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: PrivateEndpointConnectionsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_PrivateEndpointConnectionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _privateEndpointConnectionListResultDeserializer(result.body); +} + +/** List all Private Endpoint Connections associated with the Elastic San. */ +export function list( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: PrivateEndpointConnectionsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, elasticSanName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-09-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified private endpoint connection associated with the Elastic San */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, void>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options: PrivateEndpointConnectionsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: privateEndpointConnectionSerializer(parameters), + }); +} + +export async function _createDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Update the state of specified private endpoint connection associated with the Elastic San */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options: PrivateEndpointConnectionsCreateOptionalParams = { requestOptions: {} }, +): PollerLike, PrivateEndpointConnection> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, PrivateEndpointConnection>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Gets the specified private endpoint connection associated with the Elastic San */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts new file mode 100644 index 000000000000..689834e08f57 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateEndpointConnections/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts new file mode 100644 index 000000000000..d5c988e5a1b6 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByElasticSan } from "./operations.js"; +export { PrivateLinkResourcesListByElasticSanOptionalParams } from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts new file mode 100644 index 000000000000..f4dd9f961bae --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/operations.ts @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { PrivateLinkResourceListResult } from "../../models/models.js"; +import { + errorResponseDeserializer, + privateLinkResourceListResultDeserializer, +} from "../../models/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { PrivateLinkResourcesListByElasticSanOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listByElasticSanSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: PrivateLinkResourcesListByElasticSanOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByElasticSanDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return privateLinkResourceListResultDeserializer(result.body); +} + +/** Gets the private link resources that need to be created for a elastic San. */ +export async function listByElasticSan( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: PrivateLinkResourcesListByElasticSanOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listByElasticSanSend(context, resourceGroupName, elasticSanName, options); + return _listByElasticSanDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts new file mode 100644 index 000000000000..9db7ac557807 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/privateLinkResources/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByElasticSanOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts new file mode 100644 index 000000000000..b8728b770497 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/skus/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { SkusListOptionalParams } from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts new file mode 100644 index 000000000000..7e8b47fdcc3c --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/skus/operations.ts @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { _SkuInformationList, SkuInformation } from "../../models/models.js"; +import { errorResponseDeserializer, _skuInformationListDeserializer } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { SkusListOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: SkusListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_SkuInformationList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _skuInformationListDeserializer(result.body); +} + +/** List all the available Skus in the region and information related to them */ +export function list( + context: Client, + options: SkusListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-09-01" }, + ); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts new file mode 100644 index 000000000000..b2213de33fc1 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/skus/options.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SkusListOptionalParams extends OperationOptions { + /** Specify $filter='location eq ' to filter on location. */ + filter?: string; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts new file mode 100644 index 000000000000..4ddfa1645112 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByElasticSan, $delete, update, create, get } from "./operations.js"; +export { + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsCreateOptionalParams, + VolumeGroupsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts new file mode 100644 index 000000000000..8710e04f3879 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/operations.ts @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { VolumeGroup, VolumeGroupUpdate, _VolumeGroupList } from "../../models/models.js"; +import { + errorResponseDeserializer, + volumeGroupSerializer, + volumeGroupDeserializer, + volumeGroupUpdateSerializer, + _volumeGroupListDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsCreateOptionalParams, + VolumeGroupsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByElasticSanSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: VolumeGroupsListByElasticSanOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByElasticSanDeserialize( + result: PathUncheckedResponse, +): Promise<_VolumeGroupList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _volumeGroupListDeserializer(result.body); +} + +/** List VolumeGroups. */ +export function listByElasticSan( + context: Client, + resourceGroupName: string, + elasticSanName: string, + options: VolumeGroupsListByElasticSanOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByElasticSanSend(context, resourceGroupName, elasticSanName, options), + _listByElasticSanDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-09-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeGroupsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete an VolumeGroup. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeGroupsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, elasticSanName, volumeGroupName, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options: VolumeGroupsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: volumeGroupUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeGroupDeserializer(result.body); +} + +/** Update an VolumeGroup. */ +export function update( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options: VolumeGroupsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VolumeGroup> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, VolumeGroup>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options: VolumeGroupsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: volumeGroupSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeGroupDeserializer(result.body); +} + +/** Create a Volume Group. */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options: VolumeGroupsCreateOptionalParams = { requestOptions: {} }, +): PollerLike, VolumeGroup> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, VolumeGroup>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeGroupsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeGroupDeserializer(result.body); +} + +/** Get an VolumeGroups. */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeGroupsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts new file mode 100644 index 000000000000..12d120a9c455 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeGroups/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VolumeGroupsListByElasticSanOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VolumeGroupsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeGroupsCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeGroupsGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts new file mode 100644 index 000000000000..eb2b6e895b40 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByVolumeGroup, $delete, create, get } from "./operations.js"; +export { + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts new file mode 100644 index 000000000000..92fb29c788dc --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/operations.ts @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { Snapshot, _SnapshotList } from "../../models/models.js"; +import { + errorResponseDeserializer, + snapshotSerializer, + snapshotDeserializer, + _snapshotListDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByVolumeGroupSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeSnapshotsListByVolumeGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByVolumeGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_SnapshotList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _snapshotListDeserializer(result.body); +} + +/** List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter */ +export function listByVolumeGroup( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumeSnapshotsListByVolumeGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByVolumeGroupSend(context, resourceGroupName, elasticSanName, volumeGroupName, options), + _listByVolumeGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-09-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options: VolumeSnapshotsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + snapshotName: snapshotName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete a Volume Snapshot. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options: VolumeSnapshotsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, void>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options: VolumeSnapshotsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + snapshotName: snapshotName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: snapshotSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return snapshotDeserializer(result.body); +} + +/** Create a Volume Snapshot. */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options: VolumeSnapshotsCreateOptionalParams = { requestOptions: {} }, +): PollerLike, Snapshot> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, Snapshot>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options: VolumeSnapshotsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + snapshotName: snapshotName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return snapshotDeserializer(result.body); +} + +/** Get a Volume Snapshot. */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options: VolumeSnapshotsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts new file mode 100644 index 000000000000..cc3e99fd0dd9 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumeSnapshots/options.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends OperationOptions { + /** Specify $filter='volumeName eq ' to filter on volume. */ + filter?: string; +} + +/** Optional parameters. */ +export interface VolumeSnapshotsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeSnapshotsCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumeSnapshotsGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts new file mode 100644 index 000000000000..5240bc680a08 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumes/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + preRestore, + preBackup, + listByVolumeGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + VolumesPreRestoreOptionalParams, + VolumesPreBackupOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesCreateOptionalParams, + VolumesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts new file mode 100644 index 000000000000..33fbec5be5f1 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumes/operations.ts @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext as Client } from "../index.js"; +import type { + Volume, + VolumeUpdate, + _VolumeList, + VolumeNameList, + PreValidationResponse, + DiskSnapshotList, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + volumeSerializer, + volumeDeserializer, + volumeUpdateSerializer, + _volumeListDeserializer, + volumeNameListSerializer, + preValidationResponseDeserializer, + diskSnapshotListSerializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VolumesPreRestoreOptionalParams, + VolumesPreBackupOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesCreateOptionalParams, + VolumesGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _preRestoreSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options: VolumesPreRestoreOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: diskSnapshotListSerializer(parameters), + }); +} + +export async function _preRestoreDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return preValidationResponseDeserializer(result.body); +} + +/** Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. */ +export function preRestore( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options: VolumesPreRestoreOptionalParams = { requestOptions: {} }, +): PollerLike, PreValidationResponse> { + return getLongRunningPoller(context, _preRestoreDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _preRestoreSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, PreValidationResponse>; +} + +export function _preBackupSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options: VolumesPreBackupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: volumeNameListSerializer(parameters), + }); +} + +export async function _preBackupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return preValidationResponseDeserializer(result.body); +} + +/** Validate whether a disk snapshot backup can be taken for list of volumes. */ +export function preBackup( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options: VolumesPreBackupOptionalParams = { requestOptions: {} }, +): PollerLike, PreValidationResponse> { + return getLongRunningPoller(context, _preBackupDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _preBackupSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, PreValidationResponse>; +} + +export function _listByVolumeGroupSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumesListByVolumeGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByVolumeGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_VolumeList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _volumeListDeserializer(result.body); +} + +/** List Volumes in a VolumeGroup. */ +export function listByVolumeGroup( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options: VolumesListByVolumeGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByVolumeGroupSend(context, resourceGroupName, elasticSanName, volumeGroupName, options), + _listByVolumeGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-09-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options: VolumesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + volumeName: volumeName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ + ...operationOptionsToRequestParameters(options), + headers: { + ...(options?.xMsDeleteSnapshots !== undefined + ? { "x-ms-delete-snapshots": options?.xMsDeleteSnapshots } + : {}), + ...(options?.xMsForceDelete !== undefined + ? { "x-ms-force-delete": options?.xMsForceDelete } + : {}), + ...options.requestOptions?.headers, + }, + }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete an Volume. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options: VolumesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options: VolumesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + volumeName: volumeName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: volumeUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeDeserializer(result.body); +} + +/** Update an Volume. */ +export function update( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options: VolumesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Volume> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, Volume>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options: VolumesCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + volumeName: volumeName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: volumeSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeDeserializer(result.body); +} + +/** Create a Volume. */ +export function create( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options: VolumesCreateOptionalParams = { requestOptions: {} }, +): PollerLike, Volume> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-09-01", + }) as PollerLike, Volume>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options: VolumesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + elasticSanName: elasticSanName, + volumeGroupName: volumeGroupName, + volumeName: volumeName, + "api%2Dversion": context.apiVersion ?? "2025-09-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return volumeDeserializer(result.body); +} + +/** Get an Volume. */ +export async function get( + context: Client, + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options: VolumesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts b/sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts new file mode 100644 index 000000000000..df5e283bb7c8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/api/volumes/options.ts @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { XMsDeleteSnapshots, XMsForceDelete } from "../../models/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VolumesPreRestoreOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumesPreBackupOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumesListByVolumeGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VolumesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Optional, used to delete snapshots under volume. Allowed value are only true or false. Default value is false. */ + xMsDeleteSnapshots?: XMsDeleteSnapshots; + /** Optional, used to delete volume if active sessions present. Allowed value are only true or false. Default value is false. */ + xMsForceDelete?: XMsForceDelete; +} + +/** Optional parameters. */ +export interface VolumesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumesCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VolumesGetOptionalParams extends OperationOptions {} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts new file mode 100644 index 000000000000..60c7b64b8f14 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/elasticSans/index.ts @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "../../api/elasticSans/operations.js"; +import type { + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansDeleteOptionalParams, + ElasticSansUpdateOptionalParams, + ElasticSansCreateOptionalParams, + ElasticSansGetOptionalParams, +} from "../../api/elasticSans/options.js"; +import type { ElasticSan, ElasticSanUpdate } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a ElasticSans operations. */ +export interface ElasticSansOperations { + /** Gets a list of ElasticSans in a subscription */ + listBySubscription: ( + options?: ElasticSansListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets a list of ElasticSan in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a Elastic San. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ) => Promise; + /** Update a Elastic San. */ + update: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ) => PollerLike, ElasticSan>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ) => Promise, ElasticSan>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ) => Promise; + /** Create ElasticSan. */ + create: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ) => PollerLike, ElasticSan>; + /** @deprecated use create instead */ + beginCreate: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ) => Promise, ElasticSan>>; + /** @deprecated use create instead */ + beginCreateAndWait: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ) => Promise; + /** Get a ElasticSan. */ + get: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansGetOptionalParams, + ) => Promise; +} + +function _getElasticSans(context: ElasticSanManagementContext) { + return { + listBySubscription: (options?: ElasticSansListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ) => $delete(context, resourceGroupName, elasticSanName, options), + beginDelete: async ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, elasticSanName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, elasticSanName, options); + }, + update: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ) => update(context, resourceGroupName, elasticSanName, parameters, options), + beginUpdate: async ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ) => { + const poller = update(context, resourceGroupName, elasticSanName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, elasticSanName, parameters, options); + }, + create: ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ) => create(context, resourceGroupName, elasticSanName, parameters, options), + beginCreate: async ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ) => { + const poller = create(context, resourceGroupName, elasticSanName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams, + ) => { + return await create(context, resourceGroupName, elasticSanName, parameters, options); + }, + get: ( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, options), + }; +} + +export function _getElasticSansOperations( + context: ElasticSanManagementContext, +): ElasticSansOperations { + return { + ..._getElasticSans(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/index.ts new file mode 100644 index 000000000000..9fe4a49d838b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { ElasticSansOperations } from "./elasticSans/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { PrivateEndpointConnectionsOperations } from "./privateEndpointConnections/index.js"; +export { PrivateLinkResourcesOperations } from "./privateLinkResources/index.js"; +export { SkusOperations } from "./skus/index.js"; +export { VolumeGroupsOperations } from "./volumeGroups/index.js"; +export { VolumesOperations } from "./volumes/index.js"; +export { VolumeSnapshotsOperations } from "./volumeSnapshots/index.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts new file mode 100644 index 000000000000..af7a1bdd4416 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/operations/index.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { list } from "../../api/operations/operations.js"; +import type { OperationsListOptionalParams } from "../../api/operations/options.js"; +import type { Operation } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getOperations(context: ElasticSanManagementContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations( + context: ElasticSanManagementContext, +): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts new file mode 100644 index 000000000000..638428421817 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/privateEndpointConnections/index.ts @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { list, $delete, create, get } from "../../api/privateEndpointConnections/operations.js"; +import type { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "../../api/privateEndpointConnections/options.js"; +import type { PrivateEndpointConnection } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a PrivateEndpointConnections operations. */ +export interface PrivateEndpointConnectionsOperations { + /** List all Private Endpoint Connections associated with the Elastic San. */ + list: ( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified private endpoint connection associated with the Elastic San */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => Promise; + /** Update the state of specified private endpoint connection associated with the Elastic San */ + create: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => PollerLike, PrivateEndpointConnection>; + /** @deprecated use create instead */ + beginCreate: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => Promise< + SimplePollerLike, PrivateEndpointConnection> + >; + /** @deprecated use create instead */ + beginCreateAndWait: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => Promise; + /** Gets the specified private endpoint connection associated with the Elastic San */ + get: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ) => Promise; +} + +function _getPrivateEndpointConnections(context: ElasticSanManagementContext) { + return { + list: ( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ) => list(context, resourceGroupName, elasticSanName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => + $delete(context, resourceGroupName, elasticSanName, privateEndpointConnectionName, options), + beginDelete: async ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options, + ); + }, + create: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => + create( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + options, + ), + beginCreate: async ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => { + const poller = create( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams, + ) => { + return await create( + context, + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, privateEndpointConnectionName, options), + }; +} + +export function _getPrivateEndpointConnectionsOperations( + context: ElasticSanManagementContext, +): PrivateEndpointConnectionsOperations { + return { + ..._getPrivateEndpointConnections(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts new file mode 100644 index 000000000000..8387dbc9c878 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/privateLinkResources/index.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { listByElasticSan } from "../../api/privateLinkResources/operations.js"; +import type { PrivateLinkResourcesListByElasticSanOptionalParams } from "../../api/privateLinkResources/options.js"; +import type { PrivateLinkResourceListResult } from "../../models/models.js"; + +/** Interface representing a PrivateLinkResources operations. */ +export interface PrivateLinkResourcesOperations { + /** Gets the private link resources that need to be created for a elastic San. */ + listByElasticSan: ( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateLinkResourcesListByElasticSanOptionalParams, + ) => Promise; +} + +function _getPrivateLinkResources(context: ElasticSanManagementContext) { + return { + listByElasticSan: ( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateLinkResourcesListByElasticSanOptionalParams, + ) => listByElasticSan(context, resourceGroupName, elasticSanName, options), + }; +} + +export function _getPrivateLinkResourcesOperations( + context: ElasticSanManagementContext, +): PrivateLinkResourcesOperations { + return { + ..._getPrivateLinkResources(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts new file mode 100644 index 000000000000..8796ec7e12b8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/skus/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { list } from "../../api/skus/operations.js"; +import type { SkusListOptionalParams } from "../../api/skus/options.js"; +import type { SkuInformation } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Skus operations. */ +export interface SkusOperations { + /** List all the available Skus in the region and information related to them */ + list: (options?: SkusListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getSkus(context: ElasticSanManagementContext) { + return { + list: (options?: SkusListOptionalParams) => list(context, options), + }; +} + +export function _getSkusOperations(context: ElasticSanManagementContext): SkusOperations { + return { + ..._getSkus(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts new file mode 100644 index 000000000000..58bb8db60d2d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/volumeGroups/index.ts @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { + listByElasticSan, + $delete, + update, + create, + get, +} from "../../api/volumeGroups/operations.js"; +import type { + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsCreateOptionalParams, + VolumeGroupsGetOptionalParams, +} from "../../api/volumeGroups/options.js"; +import type { VolumeGroup, VolumeGroupUpdate } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VolumeGroups operations. */ +export interface VolumeGroupsOperations { + /** List VolumeGroups. */ + listByElasticSan: ( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete an VolumeGroup. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ) => Promise; + /** Update an VolumeGroup. */ + update: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ) => PollerLike, VolumeGroup>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ) => Promise, VolumeGroup>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ) => Promise; + /** Create a Volume Group. */ + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ) => PollerLike, VolumeGroup>; + /** @deprecated use create instead */ + beginCreate: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ) => Promise, VolumeGroup>>; + /** @deprecated use create instead */ + beginCreateAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ) => Promise; + /** Get an VolumeGroups. */ + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsGetOptionalParams, + ) => Promise; +} + +function _getVolumeGroups(context: ElasticSanManagementContext) { + return { + listByElasticSan: ( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams, + ) => listByElasticSan(context, resourceGroupName, elasticSanName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, elasticSanName, volumeGroupName, options), + beginDelete: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, elasticSanName, volumeGroupName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, elasticSanName, volumeGroupName, options); + }, + update: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ) => update(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + beginUpdate: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + }, + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ) => create(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + beginCreate: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ) => { + const poller = create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams, + ) => { + return await create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, volumeGroupName, options), + }; +} + +export function _getVolumeGroupsOperations( + context: ElasticSanManagementContext, +): VolumeGroupsOperations { + return { + ..._getVolumeGroups(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts new file mode 100644 index 000000000000..f09cac7afbd6 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/volumeSnapshots/index.ts @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { listByVolumeGroup, $delete, create, get } from "../../api/volumeSnapshots/operations.js"; +import type { + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsGetOptionalParams, +} from "../../api/volumeSnapshots/options.js"; +import type { Snapshot } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VolumeSnapshots operations. */ +export interface VolumeSnapshotsOperations { + /** List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter */ + listByVolumeGroup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeSnapshotsListByVolumeGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a Volume Snapshot. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ) => Promise; + /** Create a Volume Snapshot. */ + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ) => PollerLike, Snapshot>; + /** @deprecated use create instead */ + beginCreate: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ) => Promise, Snapshot>>; + /** @deprecated use create instead */ + beginCreateAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ) => Promise; + /** Get a Volume Snapshot. */ + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsGetOptionalParams, + ) => Promise; +} + +function _getVolumeSnapshots(context: ElasticSanManagementContext) { + return { + listByVolumeGroup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeSnapshotsListByVolumeGroupOptionalParams, + ) => listByVolumeGroup(context, resourceGroupName, elasticSanName, volumeGroupName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ) => + $delete(context, resourceGroupName, elasticSanName, volumeGroupName, snapshotName, options), + beginDelete: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + options, + ); + }, + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ) => + create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + options, + ), + beginCreate: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ) => { + const poller = create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + parameters: Snapshot, + options?: VolumeSnapshotsCreateOptionalParams, + ) => { + return await create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + snapshotName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + snapshotName: string, + options?: VolumeSnapshotsGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, volumeGroupName, snapshotName, options), + }; +} + +export function _getVolumeSnapshotsOperations( + context: ElasticSanManagementContext, +): VolumeSnapshotsOperations { + return { + ..._getVolumeSnapshots(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts b/sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts new file mode 100644 index 000000000000..2554704ea440 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/classic/volumes/index.ts @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagementContext } from "../../api/elasticSanManagementContext.js"; +import { + preRestore, + preBackup, + listByVolumeGroup, + $delete, + update, + create, + get, +} from "../../api/volumes/operations.js"; +import type { + VolumesPreRestoreOptionalParams, + VolumesPreBackupOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesCreateOptionalParams, + VolumesGetOptionalParams, +} from "../../api/volumes/options.js"; +import type { + Volume, + VolumeUpdate, + VolumeNameList, + PreValidationResponse, + DiskSnapshotList, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Volumes operations. */ +export interface VolumesOperations { + /** Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. */ + preRestore: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ) => PollerLike, PreValidationResponse>; + /** @deprecated use preRestore instead */ + beginPreRestore: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ) => Promise, PreValidationResponse>>; + /** @deprecated use preRestore instead */ + beginPreRestoreAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ) => Promise; + /** Validate whether a disk snapshot backup can be taken for list of volumes. */ + preBackup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ) => PollerLike, PreValidationResponse>; + /** @deprecated use preBackup instead */ + beginPreBackup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ) => Promise, PreValidationResponse>>; + /** @deprecated use preBackup instead */ + beginPreBackupAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ) => Promise; + /** List Volumes in a VolumeGroup. */ + listByVolumeGroup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete an Volume. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ) => Promise; + /** Update an Volume. */ + update: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ) => PollerLike, Volume>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ) => Promise, Volume>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ) => Promise; + /** Create a Volume. */ + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ) => PollerLike, Volume>; + /** @deprecated use create instead */ + beginCreate: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ) => Promise, Volume>>; + /** @deprecated use create instead */ + beginCreateAndWait: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ) => Promise; + /** Get an Volume. */ + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams, + ) => Promise; +} + +function _getVolumes(context: ElasticSanManagementContext) { + return { + preRestore: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ) => + preRestore(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + beginPreRestore: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ) => { + const poller = preRestore( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginPreRestoreAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: DiskSnapshotList, + options?: VolumesPreRestoreOptionalParams, + ) => { + return await preRestore( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + }, + preBackup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ) => + preBackup(context, resourceGroupName, elasticSanName, volumeGroupName, parameters, options), + beginPreBackup: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ) => { + const poller = preBackup( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginPreBackupAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeNameList, + options?: VolumesPreBackupOptionalParams, + ) => { + return await preBackup( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options, + ); + }, + listByVolumeGroup: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams, + ) => listByVolumeGroup(context, resourceGroupName, elasticSanName, volumeGroupName, options), + delete: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, elasticSanName, volumeGroupName, volumeName, options), + beginDelete: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options, + ); + }, + update: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ); + }, + create: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ) => + create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ), + beginCreate: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ) => { + const poller = create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateAndWait: async ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams, + ) => { + return await create( + context, + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams, + ) => get(context, resourceGroupName, elasticSanName, volumeGroupName, volumeName, options), + }; +} + +export function _getVolumesOperations(context: ElasticSanManagementContext): VolumesOperations { + return { + ..._getVolumes(context), + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts index 505273f79c92..04efc1638766 100644 --- a/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts +++ b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts @@ -1,160 +1,76 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import type { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; -import type * as coreAuth from "@azure/core-auth"; -import { - OperationsImpl, - ElasticSansImpl, - SkusImpl, - PrivateEndpointConnectionsImpl, - PrivateLinkResourcesImpl, - VolumeGroupsImpl, - VolumesImpl, - VolumeSnapshotsImpl, -} from "./operations/index.js"; import type { - Operations, - ElasticSans, - Skus, - PrivateEndpointConnections, - PrivateLinkResources, - VolumeGroups, - Volumes, - VolumeSnapshots, -} from "./operationsInterfaces/index.js"; -import type { ElasticSanManagementOptionalParams } from "./models/index.js"; + ElasticSanManagementContext, + ElasticSanManagementOptionalParams, +} from "./api/index.js"; +import { createElasticSanManagement } from "./api/index.js"; +import type { ElasticSansOperations } from "./classic/elasticSans/index.js"; +import { _getElasticSansOperations } from "./classic/elasticSans/index.js"; +import type { OperationsOperations } from "./classic/operations/index.js"; +import { _getOperationsOperations } from "./classic/operations/index.js"; +import type { PrivateEndpointConnectionsOperations } from "./classic/privateEndpointConnections/index.js"; +import { _getPrivateEndpointConnectionsOperations } from "./classic/privateEndpointConnections/index.js"; +import type { PrivateLinkResourcesOperations } from "./classic/privateLinkResources/index.js"; +import { _getPrivateLinkResourcesOperations } from "./classic/privateLinkResources/index.js"; +import type { SkusOperations } from "./classic/skus/index.js"; +import { _getSkusOperations } from "./classic/skus/index.js"; +import type { VolumeGroupsOperations } from "./classic/volumeGroups/index.js"; +import { _getVolumeGroupsOperations } from "./classic/volumeGroups/index.js"; +import type { VolumeSnapshotsOperations } from "./classic/volumeSnapshots/index.js"; +import { _getVolumeSnapshotsOperations } from "./classic/volumeSnapshots/index.js"; +import type { VolumesOperations } from "./classic/volumes/index.js"; +import { _getVolumesOperations } from "./classic/volumes/index.js"; +import type { TokenCredential } from "@azure/core-auth"; +import type { Pipeline } from "@azure/core-rest-pipeline"; + +export { ElasticSanManagementOptionalParams } from "./api/elasticSanManagementContext.js"; -export class ElasticSanManagement extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; +export class ElasticSanManagement { + private _client: ElasticSanManagementContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; - /** - * Initializes a new instance of the ElasticSanManagement class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. - * @param options The parameter options - */ + /** Elastic SAN is a fully integrated solution that simplifies deploying, scaling, managing, and configuring a storage area network (SAN). It also offers built-in cloud capabilities like high availability. Elastic SAN works with many types of compute resources, such as Azure Virtual Machines, Azure VMware Solution, and Azure Kubernetes Service. */ constructor( - credentials: coreAuth.TokenCredential, + credential: TokenCredential, subscriptionId: string, - options?: ElasticSanManagementOptionalParams, + options: ElasticSanManagementOptionalParams = {}, ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ElasticSanManagementOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials, - }; - - const packageDetails = `azsdk-js-arm-elasticsan/1.2.0`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createElasticSanManagement(credential, subscriptionId, { ...options, - userAgentOptions: { - userAgentPrefix, - }, - endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com", - }; - super(optionsWithDefaults); - - let bearerTokenAuthenticationPolicyFound: boolean = false; - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = - options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, - ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName, - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, - }, - }), - ); - } - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2025-09-01"; - this.operations = new OperationsImpl(this); - this.elasticSans = new ElasticSansImpl(this); - this.skus = new SkusImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); - this.privateLinkResources = new PrivateLinkResourcesImpl(this); - this.volumeGroups = new VolumeGroupsImpl(this); - this.volumes = new VolumesImpl(this); - this.volumeSnapshots = new VolumeSnapshotsImpl(this); - this.addCustomApiVersionPolicy(options.apiVersion); - } - - /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ - private addCustomApiVersionPolicy(apiVersion?: string) { - if (!apiVersion) { - return; - } - const apiVersionPolicy = { - name: "CustomApiVersionPolicy", - async sendRequest(request: PipelineRequest, next: SendRequest): Promise { - const param = request.url.split("?"); - if (param.length > 1) { - const newParams = param[1].split("&").map((item) => { - if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; - } else { - return item; - } - }); - request.url = param[0] + "?" + newParams.join("&"); - } - return next(request); - }, - }; - this.pipeline.addPolicy(apiVersionPolicy); + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.skus = _getSkusOperations(this._client); + this.volumeSnapshots = _getVolumeSnapshotsOperations(this._client); + this.privateLinkResources = _getPrivateLinkResourcesOperations(this._client); + this.volumeGroups = _getVolumeGroupsOperations(this._client); + this.volumes = _getVolumesOperations(this._client); + this.privateEndpointConnections = _getPrivateEndpointConnectionsOperations(this._client); + this.elasticSans = _getElasticSansOperations(this._client); + this.operations = _getOperationsOperations(this._client); } - operations: Operations; - elasticSans: ElasticSans; - skus: Skus; - privateEndpointConnections: PrivateEndpointConnections; - privateLinkResources: PrivateLinkResources; - volumeGroups: VolumeGroups; - volumes: Volumes; - volumeSnapshots: VolumeSnapshots; + /** The operation groups for skus */ + public readonly skus: SkusOperations; + /** The operation groups for volumeSnapshots */ + public readonly volumeSnapshots: VolumeSnapshotsOperations; + /** The operation groups for privateLinkResources */ + public readonly privateLinkResources: PrivateLinkResourcesOperations; + /** The operation groups for volumeGroups */ + public readonly volumeGroups: VolumeGroupsOperations; + /** The operation groups for volumes */ + public readonly volumes: VolumesOperations; + /** The operation groups for privateEndpointConnections */ + public readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; + /** The operation groups for elasticSans */ + public readonly elasticSans: ElasticSansOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; } diff --git a/sdk/elasticsans/arm-elasticsan/src/index.ts b/sdk/elasticsans/arm-elasticsan/src/index.ts index 1cf65868b3c6..9f2dcf5a0186 100644 --- a/sdk/elasticsans/arm-elasticsan/src/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/index.ts @@ -1,11 +1,152 @@ // Copyright (c) Microsoft Corporation. // Licensed under the 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 { AzureClouds, AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; -/// -export { getContinuationToken } from "./pagingHelper.js"; -export * from "./models/index.js"; export { ElasticSanManagement } from "./elasticSanManagement.js"; -export * from "./operationsInterfaces/index.js"; +export { SimplePollerLike } from "./static-helpers/simplePollerHelpers.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + ElasticSan, + ElasticSanProperties, + Sku, + KnownSkuName, + SkuName, + KnownSkuTier, + SkuTier, + KnownProvisioningStates, + ProvisioningStates, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + KnownPrivateEndpointServiceConnectionStatus, + PrivateEndpointServiceConnectionStatus, + KnownPublicNetworkAccess, + PublicNetworkAccess, + AutoScaleProperties, + ScaleUpProperties, + KnownAutoScalePolicyEnforcement, + AutoScalePolicyEnforcement, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + TrackedResource, + ElasticSanUpdate, + ElasticSanUpdateProperties, + Volume, + VolumeProperties, + SourceCreationData, + KnownVolumeCreateOption, + VolumeCreateOption, + IscsiTargetInfo, + KnownOperationalStatus, + OperationalStatus, + ManagedByInfo, + VolumeUpdate, + VolumeUpdateProperties, + VolumeNameList, + PreValidationResponse, + DiskSnapshotList, + VolumeGroup, + Identity, + KnownIdentityType, + IdentityType, + UserAssignedIdentity, + VolumeGroupProperties, + KnownStorageTargetType, + StorageTargetType, + KnownEncryptionType, + EncryptionType, + EncryptionProperties, + KeyVaultProperties, + EncryptionIdentity, + NetworkRuleSet, + VirtualNetworkRule, + KnownAction, + Action, + VolumeGroupUpdate, + VolumeGroupUpdateProperties, + PrivateLinkResourceListResult, + PrivateLinkResource, + PrivateLinkResourceProperties, + Snapshot, + SnapshotProperties, + SnapshotCreationData, + SkuInformation, + SkuLocationInfo, + SKUCapability, + KnownXMsDeleteSnapshots, + XMsDeleteSnapshots, + KnownXMsForceDelete, + XMsForceDelete, + KnownVersions, +} from "./models/index.js"; +export { ElasticSanManagementOptionalParams } from "./api/index.js"; +export { + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansDeleteOptionalParams, + ElasticSansUpdateOptionalParams, + ElasticSansCreateOptionalParams, + ElasticSansGetOptionalParams, +} from "./api/elasticSans/index.js"; +export { OperationsListOptionalParams } from "./api/operations/index.js"; +export { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./api/privateEndpointConnections/index.js"; +export { PrivateLinkResourcesListByElasticSanOptionalParams } from "./api/privateLinkResources/index.js"; +export { SkusListOptionalParams } from "./api/skus/index.js"; +export { + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsCreateOptionalParams, + VolumeGroupsGetOptionalParams, +} from "./api/volumeGroups/index.js"; +export { + VolumesPreRestoreOptionalParams, + VolumesPreBackupOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesCreateOptionalParams, + VolumesGetOptionalParams, +} from "./api/volumes/index.js"; +export { + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsGetOptionalParams, +} from "./api/volumeSnapshots/index.js"; +export { + ElasticSansOperations, + OperationsOperations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + SkusOperations, + VolumeGroupsOperations, + VolumesOperations, + VolumeSnapshotsOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds, AzureSupportedClouds }; diff --git a/sdk/elasticsans/arm-elasticsan/src/logger.ts b/sdk/elasticsans/arm-elasticsan/src/logger.ts new file mode 100644 index 000000000000..cc7e3e30af65 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-elasticsan"); diff --git a/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts b/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts deleted file mode 100644 index 064aab0f7c7f..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { AbortSignalLike } from "@azure/abort-controller"; -import type { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export function createLroSpec(inputs: { - sendOperationFn: (args: any, spec: any) => Promise>; - args: Record; - spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record; -}): LongRunningOperation { - const { args, spec, sendOperationFn } = inputs; - return { - requestMethod: spec.httpMethod, - requestPath: spec.path!, - sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => { - const { requestBody, ...restSpec } = spec; - return sendOperationFn(args, { - ...restSpec, - httpMethod: "GET", - path, - abortSignal: options?.abortSignal, - }); - }, - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/models/index.ts b/sdk/elasticsans/arm-elasticsan/src/models/index.ts index 5928c18d03fa..c96145b6e392 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/index.ts @@ -1,1529 +1,90 @@ // Copyright (c) Microsoft Corporation. // Licensed under the 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 type * as coreClient from "@azure/core-client"; - -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface OperationListResult { - /** - * List of operations supported by the resource provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Operation[]; - /** - * URL to get the next set of operation list results (if there are any). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Details of a REST API operation, returned from the Resource Provider Operations API */ -export interface Operation { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ - display?: OperationDisplay; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly actionType?: ActionType; -} - -/** Localized display information for this particular operation. */ -export interface OperationDisplay { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - -/** List of Elastic Sans */ -export interface ElasticSanList { - /** The ElasticSan items on this page */ - value: ElasticSan[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Elastic San response properties. */ -export interface ElasticSanProperties { - /** resource sku */ - sku: Sku; - /** Logical zone for Elastic San resource; example: ["1"]. */ - availabilityZones?: string[]; - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** Base size of the Elastic San appliance in TiB. */ - baseSizeTiB: number; - /** Extended size of the Elastic San appliance in TiB. */ - extendedCapacitySizeTiB: number; - /** - * Total size of the provisioned Volumes in GiB. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly totalVolumeSizeGiB?: number; - /** - * Total number of volume groups in this Elastic San appliance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly volumeGroupCount?: number; - /** - * Total Provisioned IOPS of the Elastic San appliance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly totalIops?: number; - /** - * Total Provisioned MBps Elastic San appliance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly totalMBps?: number; - /** - * Total size of the Elastic San appliance in TB. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly totalSizeTiB?: number; - /** - * The list of Private Endpoint Connections. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Auto Scale Properties for Elastic San Appliance. */ - autoScaleProperties?: AutoScaleProperties; -} - -/** The SKU name. Required for account creation; optional for update. */ -export interface Sku { - /** The sku name. */ - name: SkuName; - /** The sku tier. */ - tier?: SkuTier; -} - -/** Response for PrivateEndpoint connection properties */ -export interface PrivateEndpointConnectionProperties { - /** - * Provisioning State of Private Endpoint connection resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** Private Endpoint resource */ - privateEndpoint?: PrivateEndpoint; - /** Private Link Service Connection State. */ - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; - /** List of resources private endpoint is mapped */ - groupIds?: string[]; -} - -/** Response for PrivateEndpoint */ -export interface PrivateEndpoint { - /** - * The ARM identifier for Private Endpoint - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -/** Response for Private Link Service Connection state */ -export interface PrivateLinkServiceConnectionState { - /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - status?: PrivateEndpointServiceConnectionStatus; - /** The reason for approval/rejection of the connection. */ - description?: string; - /** A message indicating if changes on the service provider require any updates on the consumer. */ - actionsRequired?: string; -} - -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; -} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - -/** The auto scale settings on Elastic San Appliance. */ -export interface AutoScaleProperties { - /** Scale up settings on Elastic San Appliance. */ - scaleUpProperties?: ScaleUpProperties; -} - -/** Scale up properties on Elastic San Appliance. */ -export interface ScaleUpProperties { - /** Unused size on Elastic San appliance in TiB. */ - unusedSizeTiB?: number; - /** Unit to increase Capacity Unit on Elastic San appliance in TiB. */ - increaseCapacityUnitByTiB?: number; - /** Maximum scale up size on Elastic San appliance in TiB. */ - capacityUnitScaleUpLimitTiB?: number; - /** Enable or Disable scale up setting on Elastic San Appliance. */ - autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; -} - -/** List of SKU Information objects */ -export interface SkuInformationList { - /** - * The SkuInformation items on this page - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value: SkuInformation[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** ElasticSAN SKU and its properties */ -export interface SkuInformation { - /** Sku Name */ - name: SkuName; - /** Sku Tier */ - tier?: SkuTier; - /** - * The type of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceType?: string; - /** - * The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly locations?: string[]; - /** - * Availability of the SKU for the location/zone - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly locationInfo?: SkuLocationInfo[]; - /** - * The capability information in the specified SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capabilities?: SKUCapability[]; -} - -/** The location info. */ -export interface SkuLocationInfo { - /** - * The location. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** - * The zones. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly zones?: string[]; -} - -/** The capability information in the specified SKU. */ -export interface SKUCapability { - /** - * The name of capability. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * A string value to indicate states of given capability. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: string; -} - -/** Response for ElasticSan update request. */ -export interface ElasticSanUpdate { - /** Properties of ElasticSan. */ - properties?: ElasticSanUpdateProperties; - /** Update tags */ - tags?: { [propertyName: string]: string }; -} - -/** Elastic San update properties. */ -export interface ElasticSanUpdateProperties { - /** Base size of the Elastic San appliance in TiB. */ - baseSizeTiB?: number; - /** Extended size of the Elastic San appliance in TiB. */ - extendedCapacitySizeTiB?: number; - /** Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Auto Scale Properties for Elastic San Appliance. */ - autoScaleProperties?: AutoScaleProperties; -} - -/** The response of a PrivateEndpointConnection list operation. */ -export interface PrivateEndpointConnectionListResult { - /** The PrivateEndpointConnection items on this page */ - value: PrivateEndpointConnection[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** A list of private link resources */ -export interface PrivateLinkResourceListResult { - /** Array of private link resources */ - value: PrivateLinkResource[]; - /** - * URI to fetch the next section of the paginated response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Properties of a private link resource. */ -export interface PrivateLinkResourceProperties { - /** - * The private link resource group id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly groupId?: string; - /** - * The private link resource required member names. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requiredMembers?: string[]; - /** The private link resource Private link DNS zone name. */ - requiredZoneNames?: string[]; -} - -/** List of Volume Groups */ -export interface VolumeGroupList { - /** The VolumeGroup items on this page */ - value: VolumeGroup[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Identity for the resource. */ -export interface Identity { - /** - * The principal ID of resource identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The identity type. */ - type: IdentityType; - /** Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this volume group. The key is the ARM resource identifier of the identity. */ - userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; -} - -/** UserAssignedIdentity for the resource. */ -export interface UserAssignedIdentity { - /** - * The principal ID of the identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The client ID of the identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly clientId?: string; -} - -/** VolumeGroup response properties. */ -export interface VolumeGroupProperties { - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** Type of storage target */ - protocolType?: StorageTargetType; - /** Type of encryption */ - encryption?: EncryptionType; - /** Encryption Properties describing Key Vault and Identity information */ - encryptionProperties?: EncryptionProperties; - /** A collection of rules governing the accessibility from specific network locations. */ - networkAcls?: NetworkRuleSet; - /** - * The list of Private Endpoint Connections. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** A boolean indicating whether or not Data Integrity Check is enabled */ - enforceDataIntegrityCheckForIscsi?: boolean; -} - -/** The encryption settings on the volume group. */ -export interface EncryptionProperties { - /** Properties provided by key vault. */ - keyVaultProperties?: KeyVaultProperties; - /** The identity to be used with service-side encryption at rest. */ - encryptionIdentity?: EncryptionIdentity; -} - -/** Properties of key vault. */ -export interface KeyVaultProperties { - /** The name of KeyVault key. */ - keyName?: string; - /** The version of KeyVault key. */ - keyVersion?: string; - /** The Uri of KeyVault. */ - keyVaultUri?: string; - /** - * The object identifier of the current versioned Key Vault Key in use. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly currentVersionedKeyIdentifier?: string; - /** - * Timestamp of last rotation of the Key Vault Key. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastKeyRotationTimestamp?: Date; - /** - * This is a read only property that represents the expiration time of the current version of the customer managed key used for encryption. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly currentVersionedKeyExpirationTimestamp?: Date; -} - -/** Encryption identity for the volume group. */ -export interface EncryptionIdentity { - /** Resource identifier of the UserAssigned identity to be associated with server-side encryption on the volume group. */ - encryptionUserAssignedIdentity?: string; -} - -/** A set of rules governing the network accessibility. */ -export interface NetworkRuleSet { - /** The list of virtual network rules. */ - virtualNetworkRules?: VirtualNetworkRule[]; -} - -/** Virtual Network rule. */ -export interface VirtualNetworkRule { - /** Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. */ - virtualNetworkResourceId: string; - /** The action of virtual network rule. */ - action?: Action; -} - -/** Volume Group request. */ -export interface VolumeGroupUpdate { - /** The identity of the resource. */ - identity?: Identity; - /** Properties of VolumeGroup. */ - properties?: VolumeGroupUpdateProperties; -} - -/** VolumeGroup response properties. */ -export interface VolumeGroupUpdateProperties { - /** Type of storage target */ - protocolType?: StorageTargetType; - /** Type of encryption */ - encryption?: EncryptionType; - /** Encryption Properties describing Key Vault and Identity information */ - encryptionProperties?: EncryptionProperties; - /** A collection of rules governing the accessibility from specific network locations. */ - networkAcls?: NetworkRuleSet; - /** A boolean indicating whether or not Data Integrity Check is enabled */ - enforceDataIntegrityCheckForIscsi?: boolean; -} - -/** object to hold array of volume names */ -export interface VolumeNameList { - /** array of volume names */ - volumeNames: string[]; -} - -/** response object for pre validation api */ -export interface PreValidationResponse { - /** a status value indicating success or failure of validation */ - validationStatus?: string; -} - -/** object to hold array of Disk Snapshot ARM IDs */ -export interface DiskSnapshotList { - /** array of DiskSnapshot ARM IDs */ - diskSnapshotIds: string[]; -} - -/** List of Snapshots */ -export interface SnapshotList { - /** The Snapshot items on this page */ - value: Snapshot[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Properties for Snapshot. */ -export interface SnapshotProperties { - /** Data used when creating a volume snapshot. */ - creationData: SnapshotCreationData; - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** - * Size of Source Volume - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sourceVolumeSizeGiB?: number; - /** - * Source Volume Name of a snapshot - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly volumeName?: string; -} - -/** Data used when creating a volume snapshot. */ -export interface SnapshotCreationData { - /** Fully qualified resource ID of the volume. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" */ - sourceId: string; -} - -/** List of Volumes */ -export interface VolumeList { - /** The Volume items on this page */ - value: Volume[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Volume response properties. */ -export interface VolumeProperties { - /** - * Unique Id of the volume in GUID format - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly volumeId?: string; - /** State of the operation on the resource. */ - creationData?: SourceCreationData; - /** Volume size. */ - sizeGiB: number; - /** - * Storage target information - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly storageTarget?: IscsiTargetInfo; - /** Parent resource information. */ - managedBy?: ManagedByInfo; - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; -} - -/** Data source used when creating the volume. */ -export interface SourceCreationData { - /** This enumerates the possible sources of a volume creation. */ - createSource?: VolumeCreateOption; - /** Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ - sourceId?: string; -} - -/** Iscsi target information */ -export interface IscsiTargetInfo { - /** - * iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly targetIqn?: string; - /** - * iSCSI Target Portal Host Name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly targetPortalHostname?: string; - /** - * iSCSI Target Portal Port - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly targetPortalPort?: number; - /** - * State of the operation on the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningStates; - /** Operational status of the iSCSI Target. */ - status?: OperationalStatus; -} - -/** Parent resource information. */ -export interface ManagedByInfo { - /** Resource ID of the resource managing the volume, this is a restricted field and can only be set for internal use. */ - resourceId?: string; -} - -/** Response for Volume request. */ -export interface VolumeUpdate { - /** Properties of Volume. */ - properties?: VolumeUpdateProperties; -} - -/** Volume response properties. */ -export interface VolumeUpdateProperties { - /** Volume size. */ - sizeGiB?: number; - /** Parent resource information. */ - managedBy?: ManagedByInfo; -} - -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - -/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends Resource { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The geo-location where the resource lives */ - location: string; -} - -/** A private link resource */ -export interface PrivateLinkResource extends Resource { - /** Resource properties. */ - properties?: PrivateLinkResourceProperties; -} - -/** Response for PrivateEndpoint Connection object */ -export interface PrivateEndpointConnection extends ProxyResource { - /** Private Endpoint Connection Properties. */ - properties: PrivateEndpointConnectionProperties; -} - -/** Response for Volume Group request. */ -export interface VolumeGroup extends ProxyResource { - /** The identity of the resource. */ - identity?: Identity; - /** Properties of VolumeGroup. */ - properties?: VolumeGroupProperties; -} - -/** Response for Volume Snapshot request. */ -export interface Snapshot extends ProxyResource { - /** Properties of Volume Snapshot. */ - properties: SnapshotProperties; -} - -/** Response for Volume request. */ -export interface Volume extends ProxyResource { - /** Properties of Volume. */ - properties: VolumeProperties; -} - -/** Response for ElasticSan request. */ -export interface ElasticSan extends TrackedResource { - /** Properties of ElasticSan. */ - properties: ElasticSanProperties; -} - -/** Defines headers for ElasticSans_create operation. */ -export interface ElasticSansCreateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for ElasticSans_update operation. */ -export interface ElasticSansUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for ElasticSans_delete operation. */ -export interface ElasticSansDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for PrivateEndpointConnections_create operation. */ -export interface PrivateEndpointConnectionsCreateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for PrivateEndpointConnections_delete operation. */ -export interface PrivateEndpointConnectionsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VolumeGroups_create operation. */ -export interface VolumeGroupsCreateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VolumeGroups_update operation. */ -export interface VolumeGroupsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VolumeGroups_delete operation. */ -export interface VolumeGroupsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Volumes_preBackup operation. */ -export interface VolumesPreBackupHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Volumes_preRestore operation. */ -export interface VolumesPreRestoreHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Volumes_create operation. */ -export interface VolumesCreateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Volumes_update operation. */ -export interface VolumesUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Volumes_delete operation. */ -export interface VolumesDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VolumeSnapshots_create operation. */ -export interface VolumeSnapshotsCreateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VolumeSnapshots_delete operation. */ -export interface VolumeSnapshotsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - UserSystem = "user,system", -} - -/** - * Defines values for Origin. \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** - */ -export type Origin = string; - -/** Known values of {@link ActionType} that the service accepts. */ -export enum KnownActionType { - /** Internal */ - Internal = "Internal", -} - -/** - * Defines values for ActionType. \ - * {@link KnownActionType} can be used interchangeably with ActionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Internal** - */ -export type ActionType = string; - -/** Known values of {@link SkuName} that the service accepts. */ -export enum KnownSkuName { - /** Premium locally redundant storage */ - PremiumLRS = "Premium_LRS", - /** Premium zone redundant storage */ - PremiumZRS = "Premium_ZRS", -} - -/** - * Defines values for SkuName. \ - * {@link KnownSkuName} can be used interchangeably with SkuName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Premium_LRS**: Premium locally redundant storage \ - * **Premium_ZRS**: Premium zone redundant storage - */ -export type SkuName = string; - -/** Known values of {@link SkuTier} that the service accepts. */ -export enum KnownSkuTier { - /** Premium Tier */ - Premium = "Premium", -} - -/** - * Defines values for SkuTier. \ - * {@link KnownSkuTier} can be used interchangeably with SkuTier, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Premium**: Premium Tier - */ -export type SkuTier = string; - -/** Known values of {@link ProvisioningStates} that the service accepts. */ -export enum KnownProvisioningStates { - /** Invalid */ - Invalid = "Invalid", - /** Succeeded */ - Succeeded = "Succeeded", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled", - /** Pending */ - Pending = "Pending", - /** Creating */ - Creating = "Creating", - /** Updating */ - Updating = "Updating", - /** Deleting */ - Deleting = "Deleting", - /** Deleted */ - Deleted = "Deleted", - /** Restoring */ - Restoring = "Restoring", -} - -/** - * Defines values for ProvisioningStates. \ - * {@link KnownProvisioningStates} can be used interchangeably with ProvisioningStates, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invalid** \ - * **Succeeded** \ - * **Failed** \ - * **Canceled** \ - * **Pending** \ - * **Creating** \ - * **Updating** \ - * **Deleting** \ - * **Deleted** \ - * **Restoring** - */ -export type ProvisioningStates = string; - -/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ -export enum KnownPrivateEndpointServiceConnectionStatus { - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Failed */ - Failed = "Failed", - /** Rejected */ - Rejected = "Rejected", -} - -/** - * Defines values for PrivateEndpointServiceConnectionStatus. \ - * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Pending** \ - * **Approved** \ - * **Failed** \ - * **Rejected** - */ -export type PrivateEndpointServiceConnectionStatus = string; - -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key", -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - -/** Known values of {@link PublicNetworkAccess} that the service accepts. */ -export enum KnownPublicNetworkAccess { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Defines values for PublicNetworkAccess. \ - * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** - */ -export type PublicNetworkAccess = string; - -/** Known values of {@link AutoScalePolicyEnforcement} that the service accepts. */ -export enum KnownAutoScalePolicyEnforcement { - /** None */ - None = "None", - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Defines values for AutoScalePolicyEnforcement. \ - * {@link KnownAutoScalePolicyEnforcement} can be used interchangeably with AutoScalePolicyEnforcement, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **Enabled** \ - * **Disabled** - */ -export type AutoScalePolicyEnforcement = string; - -/** Known values of {@link IdentityType} that the service accepts. */ -export enum KnownIdentityType { - /** None */ - None = "None", - /** SystemAssigned */ - SystemAssigned = "SystemAssigned", - /** UserAssigned */ - UserAssigned = "UserAssigned", -} - -/** - * Defines values for IdentityType. \ - * {@link KnownIdentityType} can be used interchangeably with IdentityType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **SystemAssigned** \ - * **UserAssigned** - */ -export type IdentityType = string; - -/** Known values of {@link StorageTargetType} that the service accepts. */ -export enum KnownStorageTargetType { - /** Iscsi */ - Iscsi = "Iscsi", - /** None */ - None = "None", -} - -/** - * Defines values for StorageTargetType. \ - * {@link KnownStorageTargetType} can be used interchangeably with StorageTargetType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Iscsi** \ - * **None** - */ -export type StorageTargetType = string; - -/** Known values of {@link EncryptionType} that the service accepts. */ -export enum KnownEncryptionType { - /** Volume is encrypted at rest with Platform managed key. It is the default encryption type. */ - EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", - /** Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ - EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", -} - -/** - * Defines values for EncryptionType. \ - * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EncryptionAtRestWithPlatformKey**: Volume is encrypted at rest with Platform managed key. It is the default encryption type. \ - * **EncryptionAtRestWithCustomerManagedKey**: Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. - */ -export type EncryptionType = string; - -/** Known values of {@link Action} that the service accepts. */ -export enum KnownAction { - /** Allow */ - Allow = "Allow", -} - -/** - * Defines values for Action. \ - * {@link KnownAction} can be used interchangeably with Action, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Allow** - */ -export type Action = string; - -/** Known values of {@link VolumeCreateOption} that the service accepts. */ -export enum KnownVolumeCreateOption { - /** None */ - None = "None", - /** VolumeSnapshot */ - VolumeSnapshot = "VolumeSnapshot", - /** DiskSnapshot */ - DiskSnapshot = "DiskSnapshot", - /** Disk */ - Disk = "Disk", - /** DiskRestorePoint */ - DiskRestorePoint = "DiskRestorePoint", -} - -/** - * Defines values for VolumeCreateOption. \ - * {@link KnownVolumeCreateOption} can be used interchangeably with VolumeCreateOption, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **VolumeSnapshot** \ - * **DiskSnapshot** \ - * **Disk** \ - * **DiskRestorePoint** - */ -export type VolumeCreateOption = string; - -/** Known values of {@link OperationalStatus} that the service accepts. */ -export enum KnownOperationalStatus { - /** Invalid */ - Invalid = "Invalid", - /** Unknown */ - Unknown = "Unknown", - /** Healthy */ - Healthy = "Healthy", - /** Unhealthy */ - Unhealthy = "Unhealthy", - /** Updating */ - Updating = "Updating", - /** Running */ - Running = "Running", - /** Stopped */ - Stopped = "Stopped", - /** StoppedDeallocated */ - StoppedDeallocated = "Stopped (deallocated)", -} - -/** - * Defines values for OperationalStatus. \ - * {@link KnownOperationalStatus} can be used interchangeably with OperationalStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invalid** \ - * **Unknown** \ - * **Healthy** \ - * **Unhealthy** \ - * **Updating** \ - * **Running** \ - * **Stopped** \ - * **Stopped (deallocated)** - */ -export type OperationalStatus = string; - -/** Known values of {@link XMsDeleteSnapshots} that the service accepts. */ -export enum KnownXMsDeleteSnapshots { - /** True */ - True = "true", - /** False */ - False = "false", -} - -/** - * Defines values for XMsDeleteSnapshots. \ - * {@link KnownXMsDeleteSnapshots} can be used interchangeably with XMsDeleteSnapshots, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true** \ - * **false** - */ -export type XMsDeleteSnapshots = string; - -/** Known values of {@link XMsForceDelete} that the service accepts. */ -export enum KnownXMsForceDelete { - /** True */ - True = "true", - /** False */ - False = "false", -} - -/** - * Defines values for XMsForceDelete. \ - * {@link KnownXMsForceDelete} can be used interchangeably with XMsForceDelete, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true** \ - * **false** - */ -export type XMsForceDelete = string; - -/** Optional parameters. */ -export interface OperationsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; - -/** Optional parameters. */ -export interface ElasticSansListBySubscriptionOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type ElasticSansListBySubscriptionResponse = ElasticSanList; - -/** Optional parameters. */ -export interface ElasticSansListByResourceGroupOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type ElasticSansListByResourceGroupResponse = ElasticSanList; - -/** Optional parameters. */ -export interface ElasticSansGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type ElasticSansGetResponse = ElasticSan; - -/** Optional parameters. */ -export interface ElasticSansCreateOptionalParams 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 ElasticSansCreateResponse = ElasticSan; - -/** Optional parameters. */ -export interface ElasticSansUpdateOptionalParams 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 ElasticSansUpdateResponse = ElasticSan; - -/** Optional parameters. */ -export interface ElasticSansDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface ElasticSansListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type ElasticSansListBySubscriptionNextResponse = ElasticSanList; - -/** Optional parameters. */ -export interface ElasticSansListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type ElasticSansListByResourceGroupNextResponse = ElasticSanList; - -/** Optional parameters. */ -export interface SkusListOptionalParams extends coreClient.OperationOptions { - /** Specify $filter='location eq ' to filter on location. */ - filter?: string; -} - -/** Contains response data for the list operation. */ -export type SkusListResponse = SkuInformationList; - -/** Optional parameters. */ -export interface SkusListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type SkusListNextResponse = SkuInformationList; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsCreateOptionalParams - 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 PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult; - -/** Optional parameters. */ -export interface PrivateLinkResourcesListByElasticSanOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByElasticSan operation. */ -export type PrivateLinkResourcesListByElasticSanResponse = PrivateLinkResourceListResult; - -/** Optional parameters. */ -export interface VolumeGroupsListByElasticSanOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByElasticSan operation. */ -export type VolumeGroupsListByElasticSanResponse = VolumeGroupList; - -/** Optional parameters. */ -export interface VolumeGroupsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VolumeGroupsGetResponse = VolumeGroup; - -/** Optional parameters. */ -export interface VolumeGroupsCreateOptionalParams 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 VolumeGroupsCreateResponse = VolumeGroup; - -/** Optional parameters. */ -export interface VolumeGroupsUpdateOptionalParams 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 VolumeGroupsUpdateResponse = VolumeGroup; - -/** Optional parameters. */ -export interface VolumeGroupsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VolumeGroupsListByElasticSanNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByElasticSanNext operation. */ -export type VolumeGroupsListByElasticSanNextResponse = VolumeGroupList; - -/** Optional parameters. */ -export interface VolumesPreBackupOptionalParams 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 preBackup operation. */ -export type VolumesPreBackupResponse = PreValidationResponse; - -/** Optional parameters. */ -export interface VolumesPreRestoreOptionalParams 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 preRestore operation. */ -export type VolumesPreRestoreResponse = PreValidationResponse; - -/** Optional parameters. */ -export interface VolumesListByVolumeGroupOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByVolumeGroup operation. */ -export type VolumesListByVolumeGroupResponse = VolumeList; - -/** Optional parameters. */ -export interface VolumesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VolumesGetResponse = Volume; - -/** Optional parameters. */ -export interface VolumesCreateOptionalParams 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 VolumesCreateResponse = Volume; - -/** Optional parameters. */ -export interface VolumesUpdateOptionalParams 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 VolumesUpdateResponse = Volume; - -/** Optional parameters. */ -export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { - /** Optional, used to delete snapshots under volume. Allowed value are only true or false. Default value is false. */ - xMsDeleteSnapshots?: XMsDeleteSnapshots; - /** Optional, used to delete volume if active sessions present. Allowed value are only true or false. Default value is false. */ - xMsForceDelete?: XMsForceDelete; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VolumesListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByVolumeGroupNext operation. */ -export type VolumesListByVolumeGroupNextResponse = VolumeList; - -/** Optional parameters. */ -export interface VolumeSnapshotsListByVolumeGroupOptionalParams - extends coreClient.OperationOptions { - /** Specify $filter='volumeName eq ' to filter on volume. */ - filter?: string; -} - -/** Contains response data for the listByVolumeGroup operation. */ -export type VolumeSnapshotsListByVolumeGroupResponse = SnapshotList; - -/** Optional parameters. */ -export interface VolumeSnapshotsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VolumeSnapshotsGetResponse = Snapshot; - -/** Optional parameters. */ -export interface VolumeSnapshotsCreateOptionalParams 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 VolumeSnapshotsCreateResponse = Snapshot; - -/** Optional parameters. */ -export interface VolumeSnapshotsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VolumeSnapshotsListByVolumeGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByVolumeGroupNext operation. */ -export type VolumeSnapshotsListByVolumeGroupNextResponse = SnapshotList; - -/** Optional parameters. */ -export interface ElasticSanManagementOptionalParams extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Api Version */ - apiVersion?: string; - /** Overrides client endpoint. */ - endpoint?: string; -} +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + ElasticSan, + ElasticSanProperties, + Sku, + KnownSkuName, + SkuName, + KnownSkuTier, + SkuTier, + KnownProvisioningStates, + ProvisioningStates, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + KnownPrivateEndpointServiceConnectionStatus, + PrivateEndpointServiceConnectionStatus, + KnownPublicNetworkAccess, + PublicNetworkAccess, + AutoScaleProperties, + ScaleUpProperties, + KnownAutoScalePolicyEnforcement, + AutoScalePolicyEnforcement, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + TrackedResource, + ElasticSanUpdate, + ElasticSanUpdateProperties, + Volume, + VolumeProperties, + SourceCreationData, + KnownVolumeCreateOption, + VolumeCreateOption, + IscsiTargetInfo, + KnownOperationalStatus, + OperationalStatus, + ManagedByInfo, + VolumeUpdate, + VolumeUpdateProperties, + VolumeNameList, + PreValidationResponse, + DiskSnapshotList, + VolumeGroup, + Identity, + KnownIdentityType, + IdentityType, + UserAssignedIdentity, + VolumeGroupProperties, + KnownStorageTargetType, + StorageTargetType, + KnownEncryptionType, + EncryptionType, + EncryptionProperties, + KeyVaultProperties, + EncryptionIdentity, + NetworkRuleSet, + VirtualNetworkRule, + KnownAction, + Action, + VolumeGroupUpdate, + VolumeGroupUpdateProperties, + PrivateLinkResourceListResult, + PrivateLinkResource, + PrivateLinkResourceProperties, + Snapshot, + SnapshotProperties, + SnapshotCreationData, + SkuInformation, + SkuLocationInfo, + SKUCapability, + KnownXMsDeleteSnapshots, + XMsDeleteSnapshots, + KnownXMsForceDelete, + XMsForceDelete, + KnownVersions, +} from "./models.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts deleted file mode 100644 index 6f00feed2b46..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts +++ /dev/null @@ -1,2024 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type * as coreClient from "@azure/core-client"; - -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean", - }, - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay", - }, - }, - origin: { - serializedName: "origin", - readOnly: true, - type: { - name: "String", - }, - }, - actionType: { - serializedName: "actionType", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String", - }, - }, - resource: { - serializedName: "resource", - readOnly: true, - type: { - name: "String", - }, - }, - operation: { - serializedName: "operation", - readOnly: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, - }, - }, - }, - }, -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const ElasticSanList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSanList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ElasticSan", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ElasticSanProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSanProperties", - modelProperties: { - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - availabilityZones: { - serializedName: "availabilityZones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - baseSizeTiB: { - serializedName: "baseSizeTiB", - required: true, - type: { - name: "Number", - }, - }, - extendedCapacitySizeTiB: { - serializedName: "extendedCapacitySizeTiB", - required: true, - type: { - name: "Number", - }, - }, - totalVolumeSizeGiB: { - serializedName: "totalVolumeSizeGiB", - readOnly: true, - type: { - name: "Number", - }, - }, - volumeGroupCount: { - serializedName: "volumeGroupCount", - readOnly: true, - type: { - name: "Number", - }, - }, - totalIops: { - serializedName: "totalIops", - readOnly: true, - type: { - name: "Number", - }, - }, - totalMBps: { - serializedName: "totalMBps", - readOnly: true, - type: { - name: "Number", - }, - }, - totalSizeTiB: { - serializedName: "totalSizeTiB", - readOnly: true, - type: { - name: "Number", - }, - }, - privateEndpointConnections: { - serializedName: "privateEndpointConnections", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - publicNetworkAccess: { - serializedName: "publicNetworkAccess", - type: { - name: "String", - }, - }, - autoScaleProperties: { - serializedName: "autoScaleProperties", - type: { - name: "Composite", - className: "AutoScaleProperties", - }, - }, - }, - }, -}; - -export const Sku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Sku", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionProperties", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - privateEndpoint: { - serializedName: "privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint", - }, - }, - privateLinkServiceConnectionState: { - serializedName: "privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - }, - }, - groupIds: { - serializedName: "groupIds", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - actionsRequired: { - serializedName: "actionsRequired", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - }, - }, -}; - -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String", - }, - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String", - }, - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime", - }, - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String", - }, - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String", - }, - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const AutoScaleProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutoScaleProperties", - modelProperties: { - scaleUpProperties: { - serializedName: "scaleUpProperties", - type: { - name: "Composite", - className: "ScaleUpProperties", - }, - }, - }, - }, -}; - -export const ScaleUpProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScaleUpProperties", - modelProperties: { - unusedSizeTiB: { - serializedName: "unusedSizeTiB", - type: { - name: "Number", - }, - }, - increaseCapacityUnitByTiB: { - serializedName: "increaseCapacityUnitByTiB", - type: { - name: "Number", - }, - }, - capacityUnitScaleUpLimitTiB: { - serializedName: "capacityUnitScaleUpLimitTiB", - type: { - name: "Number", - }, - }, - autoScalePolicyEnforcement: { - serializedName: "autoScalePolicyEnforcement", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SkuInformationList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkuInformationList", - modelProperties: { - value: { - serializedName: "value", - required: true, - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuInformation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SkuInformation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkuInformation", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - type: { - name: "String", - }, - }, - resourceType: { - serializedName: "resourceType", - readOnly: true, - type: { - name: "String", - }, - }, - locations: { - serializedName: "locations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - locationInfo: { - serializedName: "locationInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuLocationInfo", - }, - }, - }, - }, - capabilities: { - serializedName: "capabilities", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SKUCapability", - }, - }, - }, - }, - }, - }, -}; - -export const SkuLocationInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkuLocationInfo", - modelProperties: { - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - zones: { - serializedName: "zones", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const SKUCapability: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SKUCapability", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ElasticSanUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSanUpdate", - modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ElasticSanUpdateProperties", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const ElasticSanUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSanUpdateProperties", - modelProperties: { - baseSizeTiB: { - serializedName: "baseSizeTiB", - type: { - name: "Number", - }, - }, - extendedCapacitySizeTiB: { - serializedName: "extendedCapacitySizeTiB", - type: { - name: "Number", - }, - }, - publicNetworkAccess: { - serializedName: "publicNetworkAccess", - type: { - name: "String", - }, - }, - autoScaleProperties: { - serializedName: "autoScaleProperties", - type: { - name: "Composite", - className: "AutoScaleProperties", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateLinkResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceProperties", - modelProperties: { - groupId: { - serializedName: "groupId", - readOnly: true, - type: { - name: "String", - }, - }, - requiredMembers: { - serializedName: "requiredMembers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - requiredZoneNames: { - serializedName: "requiredZoneNames", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const VolumeGroupList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VolumeGroup", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Identity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Identity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - required: true, - type: { - name: "String", - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserAssignedIdentity" }, - }, - }, - }, - }, - }, -}; - -export const UserAssignedIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - clientId: { - serializedName: "clientId", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeGroupProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupProperties", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - protocolType: { - serializedName: "protocolType", - type: { - name: "String", - }, - }, - encryption: { - serializedName: "encryption", - type: { - name: "String", - }, - }, - encryptionProperties: { - serializedName: "encryptionProperties", - type: { - name: "Composite", - className: "EncryptionProperties", - }, - }, - networkAcls: { - serializedName: "networkAcls", - type: { - name: "Composite", - className: "NetworkRuleSet", - }, - }, - privateEndpointConnections: { - serializedName: "privateEndpointConnections", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - enforceDataIntegrityCheckForIscsi: { - serializedName: "enforceDataIntegrityCheckForIscsi", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const EncryptionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionProperties", - modelProperties: { - keyVaultProperties: { - serializedName: "keyVaultProperties", - type: { - name: "Composite", - className: "KeyVaultProperties", - }, - }, - encryptionIdentity: { - serializedName: "identity", - type: { - name: "Composite", - className: "EncryptionIdentity", - }, - }, - }, - }, -}; - -export const KeyVaultProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultProperties", - modelProperties: { - keyName: { - serializedName: "keyName", - type: { - name: "String", - }, - }, - keyVersion: { - serializedName: "keyVersion", - type: { - name: "String", - }, - }, - keyVaultUri: { - serializedName: "keyVaultUri", - type: { - name: "String", - }, - }, - currentVersionedKeyIdentifier: { - serializedName: "currentVersionedKeyIdentifier", - readOnly: true, - type: { - name: "String", - }, - }, - lastKeyRotationTimestamp: { - serializedName: "lastKeyRotationTimestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - currentVersionedKeyExpirationTimestamp: { - serializedName: "currentVersionedKeyExpirationTimestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const EncryptionIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionIdentity", - modelProperties: { - encryptionUserAssignedIdentity: { - serializedName: "userAssignedIdentity", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const NetworkRuleSet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkRuleSet", - modelProperties: { - virtualNetworkRules: { - serializedName: "virtualNetworkRules", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualNetworkRule", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualNetworkRule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualNetworkRule", - modelProperties: { - virtualNetworkResourceId: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - action: { - defaultValue: "Allow", - serializedName: "action", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeGroupUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupUpdate", - modelProperties: { - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VolumeGroupUpdateProperties", - }, - }, - }, - }, -}; - -export const VolumeGroupUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupUpdateProperties", - modelProperties: { - protocolType: { - serializedName: "protocolType", - type: { - name: "String", - }, - }, - encryption: { - serializedName: "encryption", - type: { - name: "String", - }, - }, - encryptionProperties: { - serializedName: "encryptionProperties", - type: { - name: "Composite", - className: "EncryptionProperties", - }, - }, - networkAcls: { - serializedName: "networkAcls", - type: { - name: "Composite", - className: "NetworkRuleSet", - }, - }, - enforceDataIntegrityCheckForIscsi: { - serializedName: "enforceDataIntegrityCheckForIscsi", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VolumeNameList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeNameList", - modelProperties: { - volumeNames: { - serializedName: "volumeNames", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const PreValidationResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PreValidationResponse", - modelProperties: { - validationStatus: { - serializedName: "validationStatus", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskSnapshotList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskSnapshotList", - modelProperties: { - diskSnapshotIds: { - serializedName: "diskSnapshotIds", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const SnapshotList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Snapshot", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SnapshotProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotProperties", - modelProperties: { - creationData: { - serializedName: "creationData", - type: { - name: "Composite", - className: "SnapshotCreationData", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - sourceVolumeSizeGiB: { - serializedName: "sourceVolumeSizeGiB", - readOnly: true, - type: { - name: "Number", - }, - }, - volumeName: { - serializedName: "volumeName", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SnapshotCreationData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotCreationData", - modelProperties: { - sourceId: { - serializedName: "sourceId", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Volume", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeProperties", - modelProperties: { - volumeId: { - serializedName: "volumeId", - readOnly: true, - type: { - name: "String", - }, - }, - creationData: { - serializedName: "creationData", - type: { - name: "Composite", - className: "SourceCreationData", - }, - }, - sizeGiB: { - serializedName: "sizeGiB", - required: true, - type: { - name: "Number", - }, - }, - storageTarget: { - serializedName: "storageTarget", - type: { - name: "Composite", - className: "IscsiTargetInfo", - }, - }, - managedBy: { - serializedName: "managedBy", - type: { - name: "Composite", - className: "ManagedByInfo", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SourceCreationData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SourceCreationData", - modelProperties: { - createSource: { - serializedName: "createSource", - type: { - name: "String", - }, - }, - sourceId: { - serializedName: "sourceId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const IscsiTargetInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "IscsiTargetInfo", - modelProperties: { - targetIqn: { - serializedName: "targetIqn", - readOnly: true, - type: { - name: "String", - }, - }, - targetPortalHostname: { - serializedName: "targetPortalHostname", - readOnly: true, - type: { - name: "String", - }, - }, - targetPortalPort: { - serializedName: "targetPortalPort", - readOnly: true, - type: { - name: "Number", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ManagedByInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagedByInfo", - modelProperties: { - resourceId: { - serializedName: "resourceId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VolumeUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeUpdate", - modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VolumeUpdateProperties", - }, - }, - }, - }, -}; - -export const VolumeUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeUpdateProperties", - modelProperties: { - sizeGiB: { - serializedName: "sizeGiB", - type: { - name: "Number", - }, - }, - managedBy: { - serializedName: "managedBy", - type: { - name: "Composite", - className: "ManagedByInfo", - }, - }, - }, - }, -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties, - }, - }, -}; - -export const TrackedResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TrackedResource", - modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResource", - modelProperties: { - ...Resource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "PrivateLinkResourceProperties", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "PrivateEndpointConnectionProperties", - }, - }, - }, - }, -}; - -export const VolumeGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroup", - modelProperties: { - ...ProxyResource.type.modelProperties, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VolumeGroupProperties", - }, - }, - }, - }, -}; - -export const Snapshot: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Snapshot", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "SnapshotProperties", - }, - }, - }, - }, -}; - -export const Volume: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Volume", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VolumeProperties", - }, - }, - }, - }, -}; - -export const ElasticSan: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSan", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ElasticSanProperties", - }, - }, - }, - }, -}; - -export const ElasticSansCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSansCreateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ElasticSansUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSansUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ElasticSansDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ElasticSansDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionsCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionsCreateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumeGroupsCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupsCreateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumeGroupsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumeGroupsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeGroupsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumesPreBackupHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumesPreBackupHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumesPreRestoreHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumesPreRestoreHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumesCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumesCreateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumesUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumesDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumesDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumeSnapshotsCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeSnapshotsCreateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VolumeSnapshotsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VolumeSnapshotsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/models/models.ts b/sdk/elasticsans/arm-elasticsan/src/models/models.ts new file mode 100644 index 000000000000..6f3a1314aa66 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/models/models.ts @@ -0,0 +1,2133 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { areAllPropsUndefined } from "../static-helpers/serialization/check-prop-undefined.js"; + +/** + * This file contains only generated model types and their (de)serializers. + * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input. + */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface _OperationListResult { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + readonly actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; +} + +/** Localized display information for an operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ +export enum KnownOrigin { + /** Indicates the operation is initiated by a user. */ + User = "user", + /** Indicates the operation is initiated by a system. */ + System = "system", + /** Indicates the operation is initiated by a user or system. */ + UserSystem = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user**: Indicates the operation is initiated by a user. \ + * **system**: Indicates the operation is initiated by a system. \ + * **user,system**: Indicates the operation is initiated by a user or system. + */ +export type Origin = string; + +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +export enum KnownActionType { + /** Actions are for internal-only APIs. */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal**: Actions are for internal-only APIs. + */ +export type ActionType = string; + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: any; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: item["info"], + }; +} + +/** Response for ElasticSan request. */ +export interface ElasticSan extends TrackedResource { + /** resource sku */ + sku: Sku; + /** Logical zone for Elastic San resource; example: ["1"]. */ + availabilityZones?: string[]; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB: number; + /** Total size of the provisioned Volumes in GiB. */ + readonly totalVolumeSizeGiB?: number; + /** Total number of volume groups in this Elastic San appliance. */ + readonly volumeGroupCount?: number; + /** Total Provisioned IOPS of the Elastic San appliance. */ + readonly totalIops?: number; + /** Total Provisioned MBps Elastic San appliance. */ + readonly totalMBps?: number; + /** Total size of the Elastic San appliance in TB. */ + readonly totalSizeTiB?: number; + /** The list of Private Endpoint Connections. */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Auto Scale Properties for Elastic San Appliance. */ + autoScaleProperties?: AutoScaleProperties; +} + +export function elasticSanSerializer(item: ElasticSan): any { + return { + tags: item["tags"], + location: item["location"], + properties: _elasticSanPropertiesSerializer(item), + }; +} + +export function elasticSanDeserializer(item: any): ElasticSan { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ..._elasticSanPropertiesDeserializer(item["properties"]), + }; +} + +/** Elastic San response properties. */ +export interface ElasticSanProperties { + /** resource sku */ + sku: Sku; + /** Logical zone for Elastic San resource; example: ["1"]. */ + availabilityZones?: string[]; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB: number; + /** Total size of the provisioned Volumes in GiB. */ + readonly totalVolumeSizeGiB?: number; + /** Total number of volume groups in this Elastic San appliance. */ + readonly volumeGroupCount?: number; + /** Total Provisioned IOPS of the Elastic San appliance. */ + readonly totalIops?: number; + /** Total Provisioned MBps Elastic San appliance. */ + readonly totalMBps?: number; + /** Total size of the Elastic San appliance in TB. */ + readonly totalSizeTiB?: number; + /** The list of Private Endpoint Connections. */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Auto Scale Properties for Elastic San Appliance. */ + autoScaleProperties?: AutoScaleProperties; +} + +export function elasticSanPropertiesSerializer(item: ElasticSanProperties): any { + return { + sku: skuSerializer(item["sku"]), + availabilityZones: !item["availabilityZones"] + ? item["availabilityZones"] + : item["availabilityZones"].map((p: any) => { + return p; + }), + baseSizeTiB: item["baseSizeTiB"], + extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], + publicNetworkAccess: item["publicNetworkAccess"], + autoScaleProperties: !item["autoScaleProperties"] + ? item["autoScaleProperties"] + : autoScalePropertiesSerializer(item["autoScaleProperties"]), + }; +} + +export function elasticSanPropertiesDeserializer(item: any): ElasticSanProperties { + return { + sku: skuDeserializer(item["sku"]), + availabilityZones: !item["availabilityZones"] + ? item["availabilityZones"] + : item["availabilityZones"].map((p: any) => { + return p; + }), + provisioningState: item["provisioningState"], + baseSizeTiB: item["baseSizeTiB"], + extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], + totalVolumeSizeGiB: item["totalVolumeSizeGiB"], + volumeGroupCount: item["volumeGroupCount"], + totalIops: item["totalIops"], + totalMBps: item["totalMBps"], + totalSizeTiB: item["totalSizeTiB"], + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + publicNetworkAccess: item["publicNetworkAccess"], + autoScaleProperties: !item["autoScaleProperties"] + ? item["autoScaleProperties"] + : autoScalePropertiesDeserializer(item["autoScaleProperties"]), + }; +} + +/** The SKU name. Required for account creation; optional for update. */ +export interface Sku { + /** The sku name. */ + name: SkuName; + /** The sku tier. */ + tier?: SkuTier; +} + +export function skuSerializer(item: Sku): any { + return { name: item["name"], tier: item["tier"] }; +} + +export function skuDeserializer(item: any): Sku { + return { + name: item["name"], + tier: item["tier"], + }; +} + +/** The sku name. */ +export enum KnownSkuName { + /** Premium locally redundant storage */ + PremiumLRS = "Premium_LRS", + /** Premium zone redundant storage */ + PremiumZRS = "Premium_ZRS", +} + +/** + * The sku name. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Premium_LRS**: Premium locally redundant storage \ + * **Premium_ZRS**: Premium zone redundant storage + */ +export type SkuName = string; + +/** The sku tier. */ +export enum KnownSkuTier { + /** Premium Tier */ + Premium = "Premium", +} + +/** + * The sku tier. \ + * {@link KnownSkuTier} can be used interchangeably with SkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Premium**: Premium Tier + */ +export type SkuTier = string; + +/** Provisioning state of the iSCSI Target. */ +export enum KnownProvisioningStates { + /** Invalid */ + Invalid = "Invalid", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Pending */ + Pending = "Pending", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", + /** Deleted */ + Deleted = "Deleted", + /** Restoring */ + Restoring = "Restoring", +} + +/** + * Provisioning state of the iSCSI Target. \ + * {@link KnownProvisioningStates} can be used interchangeably with ProvisioningStates, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Pending** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Deleted** \ + * **Restoring** + */ +export type ProvisioningStates = string; + +export function privateEndpointConnectionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionSerializer(item); + }); +} + +export function privateEndpointConnectionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionDeserializer(item); + }); +} + +/** Response for PrivateEndpoint Connection object */ +export interface PrivateEndpointConnection extends ProxyResource { + /** Provisioning State of Private Endpoint connection resource */ + readonly provisioningState?: ProvisioningStates; + /** Private Endpoint resource */ + privateEndpoint?: PrivateEndpoint; + /** Private Link Service Connection State. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** List of resources private endpoint is mapped */ + groupIds?: string[]; +} + +export function privateEndpointConnectionSerializer(item: PrivateEndpointConnection): any { + return { properties: _privateEndpointConnectionPropertiesSerializer(item) }; +} + +export function privateEndpointConnectionDeserializer(item: any): PrivateEndpointConnection { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ..._privateEndpointConnectionPropertiesDeserializer(item["properties"]), + }; +} + +/** Response for PrivateEndpoint connection properties */ +export interface PrivateEndpointConnectionProperties { + /** Provisioning State of Private Endpoint connection resource */ + readonly provisioningState?: ProvisioningStates; + /** Private Endpoint resource */ + privateEndpoint?: PrivateEndpoint; + /** Private Link Service Connection State. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** List of resources private endpoint is mapped */ + groupIds?: string[]; +} + +export function privateEndpointConnectionPropertiesSerializer( + item: PrivateEndpointConnectionProperties, +): any { + return { + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointSerializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateSerializer( + item["privateLinkServiceConnectionState"], + ), + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + }; +} + +export function privateEndpointConnectionPropertiesDeserializer( + item: any, +): PrivateEndpointConnectionProperties { + return { + provisioningState: item["provisioningState"], + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointDeserializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateDeserializer( + item["privateLinkServiceConnectionState"], + ), + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + }; +} + +/** Response for PrivateEndpoint */ +export interface PrivateEndpoint { + /** The ARM identifier for Private Endpoint */ + readonly id?: string; +} + +export function privateEndpointSerializer(item: PrivateEndpoint): any { + return item; +} + +export function privateEndpointDeserializer(item: any): PrivateEndpoint { + return { + id: item["id"], + }; +} + +/** Response for Private Link Service Connection state */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +export function privateLinkServiceConnectionStateSerializer( + item: PrivateLinkServiceConnectionState, +): any { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +export function privateLinkServiceConnectionStateDeserializer( + item: any, +): PrivateLinkServiceConnectionState { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +/** The private endpoint connection status. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Failed */ + Failed = "Failed", + /** Rejected */ + Rejected = "Rejected", +} + +/** + * The private endpoint connection status. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Failed** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type PublicNetworkAccess = string; + +/** The auto scale settings on Elastic San Appliance. */ +export interface AutoScaleProperties { + /** Scale up settings on Elastic San Appliance. */ + scaleUpProperties?: ScaleUpProperties; +} + +export function autoScalePropertiesSerializer(item: AutoScaleProperties): any { + return { + scaleUpProperties: !item["scaleUpProperties"] + ? item["scaleUpProperties"] + : scaleUpPropertiesSerializer(item["scaleUpProperties"]), + }; +} + +export function autoScalePropertiesDeserializer(item: any): AutoScaleProperties { + return { + scaleUpProperties: !item["scaleUpProperties"] + ? item["scaleUpProperties"] + : scaleUpPropertiesDeserializer(item["scaleUpProperties"]), + }; +} + +/** Scale up properties on Elastic San Appliance. */ +export interface ScaleUpProperties { + /** Unused size on Elastic San appliance in TiB. */ + unusedSizeTiB?: number; + /** Unit to increase Capacity Unit on Elastic San appliance in TiB. */ + increaseCapacityUnitByTiB?: number; + /** Maximum scale up size on Elastic San appliance in TiB. */ + capacityUnitScaleUpLimitTiB?: number; + /** Enable or Disable scale up setting on Elastic San Appliance. */ + autoScalePolicyEnforcement?: AutoScalePolicyEnforcement; +} + +export function scaleUpPropertiesSerializer(item: ScaleUpProperties): any { + return { + unusedSizeTiB: item["unusedSizeTiB"], + increaseCapacityUnitByTiB: item["increaseCapacityUnitByTiB"], + capacityUnitScaleUpLimitTiB: item["capacityUnitScaleUpLimitTiB"], + autoScalePolicyEnforcement: item["autoScalePolicyEnforcement"], + }; +} + +export function scaleUpPropertiesDeserializer(item: any): ScaleUpProperties { + return { + unusedSizeTiB: item["unusedSizeTiB"], + increaseCapacityUnitByTiB: item["increaseCapacityUnitByTiB"], + capacityUnitScaleUpLimitTiB: item["capacityUnitScaleUpLimitTiB"], + autoScalePolicyEnforcement: item["autoScalePolicyEnforcement"], + }; +} + +/** Enable or Disable scale up setting on Elastic San Appliance. */ +export enum KnownAutoScalePolicyEnforcement { + /** None */ + None = "None", + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * Enable or Disable scale up setting on Elastic San Appliance. \ + * {@link KnownAutoScalePolicyEnforcement} can be used interchangeably with AutoScalePolicyEnforcement, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Enabled** \ + * **Disabled** + */ +export type AutoScalePolicyEnforcement = string; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceSerializer(item: ProxyResource): any { + return item; +} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + }; +} + +/** Response for ElasticSan update request. */ +export interface ElasticSanUpdate { + /** Update tags */ + tags?: Record; + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB?: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB?: number; + /** Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Auto Scale Properties for Elastic San Appliance. */ + autoScaleProperties?: AutoScaleProperties; +} + +export function elasticSanUpdateSerializer(item: ElasticSanUpdate): any { + return { + properties: areAllPropsUndefined(item, [ + "baseSizeTiB", + "extendedCapacitySizeTiB", + "publicNetworkAccess", + "autoScaleProperties", + ]) + ? undefined + : _elasticSanUpdatePropertiesSerializer(item), + tags: item["tags"], + }; +} + +/** Elastic San update properties. */ +export interface ElasticSanUpdateProperties { + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB?: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB?: number; + /** Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Auto Scale Properties for Elastic San Appliance. */ + autoScaleProperties?: AutoScaleProperties; +} + +export function elasticSanUpdatePropertiesSerializer(item: ElasticSanUpdateProperties): any { + return { + baseSizeTiB: item["baseSizeTiB"], + extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], + publicNetworkAccess: item["publicNetworkAccess"], + autoScaleProperties: !item["autoScaleProperties"] + ? item["autoScaleProperties"] + : autoScalePropertiesSerializer(item["autoScaleProperties"]), + }; +} + +/** List of Elastic Sans */ +export interface _ElasticSanList { + /** The ElasticSan items on this page */ + value: ElasticSan[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _elasticSanListDeserializer(item: any): _ElasticSanList { + return { + value: elasticSanArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function elasticSanArraySerializer(result: Array): any[] { + return result.map((item) => { + return elasticSanSerializer(item); + }); +} + +export function elasticSanArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return elasticSanDeserializer(item); + }); +} + +/** The response of a PrivateEndpointConnection list operation. */ +export interface _PrivateEndpointConnectionListResult { + /** The PrivateEndpointConnection items on this page */ + value: PrivateEndpointConnection[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _privateEndpointConnectionListResultDeserializer( + item: any, +): _PrivateEndpointConnectionListResult { + return { + value: privateEndpointConnectionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +/** Response for Volume request. */ +export interface Volume extends ProxyResource { + /** Unique Id of the volume in GUID format */ + readonly volumeId?: string; + /** State of the operation on the resource. */ + creationData?: SourceCreationData; + /** Volume size. */ + sizeGiB: number; + /** Storage target information */ + readonly storageTarget?: IscsiTargetInfo; + /** Parent resource information. */ + managedBy?: ManagedByInfo; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; +} + +export function volumeSerializer(item: Volume): any { + return { properties: _volumePropertiesSerializer(item) }; +} + +export function volumeDeserializer(item: any): Volume { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ..._volumePropertiesDeserializer(item["properties"]), + }; +} + +/** Volume response properties. */ +export interface VolumeProperties { + /** Unique Id of the volume in GUID format */ + readonly volumeId?: string; + /** State of the operation on the resource. */ + creationData?: SourceCreationData; + /** Volume size. */ + sizeGiB: number; + /** Storage target information */ + readonly storageTarget?: IscsiTargetInfo; + /** Parent resource information. */ + managedBy?: ManagedByInfo; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; +} + +export function volumePropertiesSerializer(item: VolumeProperties): any { + return { + creationData: !item["creationData"] + ? item["creationData"] + : sourceCreationDataSerializer(item["creationData"]), + sizeGiB: item["sizeGiB"], + managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), + }; +} + +export function volumePropertiesDeserializer(item: any): VolumeProperties { + return { + volumeId: item["volumeId"], + creationData: !item["creationData"] + ? item["creationData"] + : sourceCreationDataDeserializer(item["creationData"]), + sizeGiB: item["sizeGiB"], + storageTarget: !item["storageTarget"] + ? item["storageTarget"] + : iscsiTargetInfoDeserializer(item["storageTarget"]), + managedBy: !item["managedBy"] + ? item["managedBy"] + : managedByInfoDeserializer(item["managedBy"]), + provisioningState: item["provisioningState"], + }; +} + +/** Data source used when creating the volume. */ +export interface SourceCreationData { + /** This enumerates the possible sources of a volume creation. */ + createSource?: VolumeCreateOption; + /** Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ + sourceId?: string; +} + +export function sourceCreationDataSerializer(item: SourceCreationData): any { + return { createSource: item["createSource"], sourceId: item["sourceId"] }; +} + +export function sourceCreationDataDeserializer(item: any): SourceCreationData { + return { + createSource: item["createSource"], + sourceId: item["sourceId"], + }; +} + +/** This enumerates the possible sources of a volume creation. */ +export enum KnownVolumeCreateOption { + /** None */ + None = "None", + /** VolumeSnapshot */ + VolumeSnapshot = "VolumeSnapshot", + /** DiskSnapshot */ + DiskSnapshot = "DiskSnapshot", + /** Disk */ + Disk = "Disk", + /** DiskRestorePoint */ + DiskRestorePoint = "DiskRestorePoint", +} + +/** + * This enumerates the possible sources of a volume creation. \ + * {@link KnownVolumeCreateOption} can be used interchangeably with VolumeCreateOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **VolumeSnapshot** \ + * **DiskSnapshot** \ + * **Disk** \ + * **DiskRestorePoint** + */ +export type VolumeCreateOption = string; + +/** Iscsi target information */ +export interface IscsiTargetInfo { + /** iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". */ + readonly targetIqn?: string; + /** iSCSI Target Portal Host Name */ + readonly targetPortalHostname?: string; + /** iSCSI Target Portal Port */ + readonly targetPortalPort?: number; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Operational status of the iSCSI Target. */ + status?: OperationalStatus; +} + +export function iscsiTargetInfoDeserializer(item: any): IscsiTargetInfo { + return { + targetIqn: item["targetIqn"], + targetPortalHostname: item["targetPortalHostname"], + targetPortalPort: item["targetPortalPort"], + provisioningState: item["provisioningState"], + status: item["status"], + }; +} + +/** Operational status of the resource. */ +export enum KnownOperationalStatus { + /** Invalid */ + Invalid = "Invalid", + /** Unknown */ + Unknown = "Unknown", + /** Healthy */ + Healthy = "Healthy", + /** Unhealthy */ + Unhealthy = "Unhealthy", + /** Updating */ + Updating = "Updating", + /** Running */ + Running = "Running", + /** Stopped */ + Stopped = "Stopped", + /** Stopped (deallocated) */ + StoppedDeallocated = "Stopped (deallocated)", +} + +/** + * Operational status of the resource. \ + * {@link KnownOperationalStatus} can be used interchangeably with OperationalStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Unknown** \ + * **Healthy** \ + * **Unhealthy** \ + * **Updating** \ + * **Running** \ + * **Stopped** \ + * **Stopped (deallocated)** + */ +export type OperationalStatus = string; + +/** Parent resource information. */ +export interface ManagedByInfo { + /** Resource ID of the resource managing the volume, this is a restricted field and can only be set for internal use. */ + resourceId?: string; +} + +export function managedByInfoSerializer(item: ManagedByInfo): any { + return { resourceId: item["resourceId"] }; +} + +export function managedByInfoDeserializer(item: any): ManagedByInfo { + return { + resourceId: item["resourceId"], + }; +} + +/** Response for Volume request. */ +export interface VolumeUpdate { + /** Volume size. */ + sizeGiB?: number; + /** Parent resource information. */ + managedBy?: ManagedByInfo; +} + +export function volumeUpdateSerializer(item: VolumeUpdate): any { + return { + properties: areAllPropsUndefined(item, ["sizeGiB", "managedBy"]) + ? undefined + : _volumeUpdatePropertiesSerializer(item), + }; +} + +/** Volume response properties. */ +export interface VolumeUpdateProperties { + /** Volume size. */ + sizeGiB?: number; + /** Parent resource information. */ + managedBy?: ManagedByInfo; +} + +export function volumeUpdatePropertiesSerializer(item: VolumeUpdateProperties): any { + return { + sizeGiB: item["sizeGiB"], + managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), + }; +} + +/** List of Volumes */ +export interface _VolumeList { + /** The Volume items on this page */ + value: Volume[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _volumeListDeserializer(item: any): _VolumeList { + return { + value: volumeArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function volumeArraySerializer(result: Array): any[] { + return result.map((item) => { + return volumeSerializer(item); + }); +} + +export function volumeArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return volumeDeserializer(item); + }); +} + +/** object to hold array of volume names */ +export interface VolumeNameList { + /** array of volume names */ + volumeNames: string[]; +} + +export function volumeNameListSerializer(item: VolumeNameList): any { + return { + volumeNames: item["volumeNames"].map((p: any) => { + return p; + }), + }; +} + +/** response object for pre validation api */ +export interface PreValidationResponse { + /** a status value indicating success or failure of validation */ + validationStatus?: string; +} + +export function preValidationResponseDeserializer(item: any): PreValidationResponse { + return { + validationStatus: item["validationStatus"], + }; +} + +/** object to hold array of Disk Snapshot ARM IDs */ +export interface DiskSnapshotList { + /** array of DiskSnapshot ARM IDs */ + diskSnapshotIds: string[]; +} + +export function diskSnapshotListSerializer(item: DiskSnapshotList): any { + return { + diskSnapshotIds: item["diskSnapshotIds"].map((p: any) => { + return p; + }), + }; +} + +/** Response for Volume Group request. */ +export interface VolumeGroup extends ProxyResource { + /** The identity of the resource. */ + identity?: Identity; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** Encryption Properties describing Key Vault and Identity information */ + encryptionProperties?: EncryptionProperties; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; + /** The list of Private Endpoint Connections. */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** A boolean indicating whether or not Data Integrity Check is enabled */ + enforceDataIntegrityCheckForIscsi?: boolean; +} + +export function volumeGroupSerializer(item: VolumeGroup): any { + return { + identity: !item["identity"] ? item["identity"] : identitySerializer(item["identity"]), + properties: areAllPropsUndefined(item, [ + "protocolType", + "encryption", + "encryptionProperties", + "networkAcls", + "enforceDataIntegrityCheckForIscsi", + ]) + ? undefined + : _volumeGroupPropertiesSerializer(item), + }; +} + +export function volumeGroupDeserializer(item: any): VolumeGroup { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + identity: !item["identity"] ? item["identity"] : identityDeserializer(item["identity"]), + ...(!item["properties"] + ? item["properties"] + : _volumeGroupPropertiesDeserializer(item["properties"])), + }; +} + +/** Identity for the resource. */ +export interface Identity { + /** The principal ID of resource identity. */ + readonly principalId?: string; + /** The tenant ID of resource. */ + readonly tenantId?: string; + /** The identity type. */ + type: IdentityType; + /** Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this volume group. The key is the ARM resource identifier of the identity. */ + userAssignedIdentities?: Record; +} + +export function identitySerializer(item: Identity): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function identityDeserializer(item: any): Identity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** The identity type. */ +export enum KnownIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", +} + +/** + * The identity type. \ + * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** + */ +export type IdentityType = string; + +export function userAssignedIdentityRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentitySerializer(item[key]); + }); + return result; +} + +export function userAssignedIdentityRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentityDeserializer(item[key]); + }); + return result; +} + +/** UserAssignedIdentity for the resource. */ +export interface UserAssignedIdentity { + /** The principal ID of the identity. */ + readonly principalId?: string; + /** The client ID of the identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitySerializer(item: UserAssignedIdentity): any { + return item; +} + +export function userAssignedIdentityDeserializer(item: any): UserAssignedIdentity { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** VolumeGroup response properties. */ +export interface VolumeGroupProperties { + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** Encryption Properties describing Key Vault and Identity information */ + encryptionProperties?: EncryptionProperties; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; + /** The list of Private Endpoint Connections. */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** A boolean indicating whether or not Data Integrity Check is enabled */ + enforceDataIntegrityCheckForIscsi?: boolean; +} + +export function volumeGroupPropertiesSerializer(item: VolumeGroupProperties): any { + return { + protocolType: item["protocolType"], + encryption: item["encryption"], + encryptionProperties: !item["encryptionProperties"] + ? item["encryptionProperties"] + : encryptionPropertiesSerializer(item["encryptionProperties"]), + networkAcls: !item["networkAcls"] + ? item["networkAcls"] + : networkRuleSetSerializer(item["networkAcls"]), + enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], + }; +} + +export function volumeGroupPropertiesDeserializer(item: any): VolumeGroupProperties { + return { + provisioningState: item["provisioningState"], + protocolType: item["protocolType"], + encryption: item["encryption"], + encryptionProperties: !item["encryptionProperties"] + ? item["encryptionProperties"] + : encryptionPropertiesDeserializer(item["encryptionProperties"]), + networkAcls: !item["networkAcls"] + ? item["networkAcls"] + : networkRuleSetDeserializer(item["networkAcls"]), + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], + }; +} + +/** Storage Target type. */ +export enum KnownStorageTargetType { + /** Iscsi */ + Iscsi = "Iscsi", + /** None */ + None = "None", +} + +/** + * Storage Target type. \ + * {@link KnownStorageTargetType} can be used interchangeably with StorageTargetType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Iscsi** \ + * **None** + */ +export type StorageTargetType = string; + +/** The type of key used to encrypt the data of the disk. */ +export enum KnownEncryptionType { + /** Volume is encrypted at rest with Platform managed key. It is the default encryption type. */ + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", + /** Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ + EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", +} + +/** + * The type of key used to encrypt the data of the disk. \ + * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptionAtRestWithPlatformKey**: Volume is encrypted at rest with Platform managed key. It is the default encryption type. \ + * **EncryptionAtRestWithCustomerManagedKey**: Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. + */ +export type EncryptionType = string; + +/** The encryption settings on the volume group. */ +export interface EncryptionProperties { + /** Properties provided by key vault. */ + keyVaultProperties?: KeyVaultProperties; + /** The identity to be used with service-side encryption at rest. */ + encryptionIdentity?: EncryptionIdentity; +} + +export function encryptionPropertiesSerializer(item: EncryptionProperties): any { + return { + keyVaultProperties: !item["keyVaultProperties"] + ? item["keyVaultProperties"] + : keyVaultPropertiesSerializer(item["keyVaultProperties"]), + identity: !item["encryptionIdentity"] + ? item["encryptionIdentity"] + : encryptionIdentitySerializer(item["encryptionIdentity"]), + }; +} + +export function encryptionPropertiesDeserializer(item: any): EncryptionProperties { + return { + keyVaultProperties: !item["keyVaultProperties"] + ? item["keyVaultProperties"] + : keyVaultPropertiesDeserializer(item["keyVaultProperties"]), + encryptionIdentity: !item["identity"] + ? item["identity"] + : encryptionIdentityDeserializer(item["identity"]), + }; +} + +/** Properties of key vault. */ +export interface KeyVaultProperties { + /** The name of KeyVault key. */ + keyName?: string; + /** The version of KeyVault key. */ + keyVersion?: string; + /** The Uri of KeyVault. */ + keyVaultUri?: string; + /** The object identifier of the current versioned Key Vault Key in use. */ + readonly currentVersionedKeyIdentifier?: string; + /** Timestamp of last rotation of the Key Vault Key. */ + readonly lastKeyRotationTimestamp?: Date; + /** This is a read only property that represents the expiration time of the current version of the customer managed key used for encryption. */ + readonly currentVersionedKeyExpirationTimestamp?: Date; +} + +export function keyVaultPropertiesSerializer(item: KeyVaultProperties): any { + return { + keyName: item["keyName"], + keyVersion: item["keyVersion"], + keyVaultUri: item["keyVaultUri"], + }; +} + +export function keyVaultPropertiesDeserializer(item: any): KeyVaultProperties { + return { + keyName: item["keyName"], + keyVersion: item["keyVersion"], + keyVaultUri: item["keyVaultUri"], + currentVersionedKeyIdentifier: item["currentVersionedKeyIdentifier"], + lastKeyRotationTimestamp: !item["lastKeyRotationTimestamp"] + ? item["lastKeyRotationTimestamp"] + : new Date(item["lastKeyRotationTimestamp"]), + currentVersionedKeyExpirationTimestamp: !item["currentVersionedKeyExpirationTimestamp"] + ? item["currentVersionedKeyExpirationTimestamp"] + : new Date(item["currentVersionedKeyExpirationTimestamp"]), + }; +} + +/** Encryption identity for the volume group. */ +export interface EncryptionIdentity { + /** Resource identifier of the UserAssigned identity to be associated with server-side encryption on the volume group. */ + encryptionUserAssignedIdentity?: string; +} + +export function encryptionIdentitySerializer(item: EncryptionIdentity): any { + return { userAssignedIdentity: item["encryptionUserAssignedIdentity"] }; +} + +export function encryptionIdentityDeserializer(item: any): EncryptionIdentity { + return { + encryptionUserAssignedIdentity: item["userAssignedIdentity"], + }; +} + +/** A set of rules governing the network accessibility. */ +export interface NetworkRuleSet { + /** The list of virtual network rules. */ + virtualNetworkRules?: VirtualNetworkRule[]; +} + +export function networkRuleSetSerializer(item: NetworkRuleSet): any { + return { + virtualNetworkRules: !item["virtualNetworkRules"] + ? item["virtualNetworkRules"] + : virtualNetworkRuleArraySerializer(item["virtualNetworkRules"]), + }; +} + +export function networkRuleSetDeserializer(item: any): NetworkRuleSet { + return { + virtualNetworkRules: !item["virtualNetworkRules"] + ? item["virtualNetworkRules"] + : virtualNetworkRuleArrayDeserializer(item["virtualNetworkRules"]), + }; +} + +export function virtualNetworkRuleArraySerializer(result: Array): any[] { + return result.map((item) => { + return virtualNetworkRuleSerializer(item); + }); +} + +export function virtualNetworkRuleArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualNetworkRuleDeserializer(item); + }); +} + +/** Virtual Network rule. */ +export interface VirtualNetworkRule { + /** Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. */ + virtualNetworkResourceId: string; + /** The action of virtual network rule. */ + action?: Action; +} + +export function virtualNetworkRuleSerializer(item: VirtualNetworkRule): any { + return { id: item["virtualNetworkResourceId"], action: item["action"] }; +} + +export function virtualNetworkRuleDeserializer(item: any): VirtualNetworkRule { + return { + virtualNetworkResourceId: item["id"], + action: item["action"], + }; +} + +/** The action of virtual network rule. */ +export enum KnownAction { + /** Allow */ + Allow = "Allow", +} + +/** + * The action of virtual network rule. \ + * {@link KnownAction} can be used interchangeably with Action, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** + */ +export type Action = string; + +/** Volume Group request. */ +export interface VolumeGroupUpdate { + /** The identity of the resource. */ + identity?: Identity; + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** Encryption Properties describing Key Vault and Identity information */ + encryptionProperties?: EncryptionProperties; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; + /** A boolean indicating whether or not Data Integrity Check is enabled */ + enforceDataIntegrityCheckForIscsi?: boolean; +} + +export function volumeGroupUpdateSerializer(item: VolumeGroupUpdate): any { + return { + identity: !item["identity"] ? item["identity"] : identitySerializer(item["identity"]), + properties: areAllPropsUndefined(item, [ + "protocolType", + "encryption", + "encryptionProperties", + "networkAcls", + "enforceDataIntegrityCheckForIscsi", + ]) + ? undefined + : _volumeGroupUpdatePropertiesSerializer(item), + }; +} + +/** VolumeGroup response properties. */ +export interface VolumeGroupUpdateProperties { + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** Encryption Properties describing Key Vault and Identity information */ + encryptionProperties?: EncryptionProperties; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; + /** A boolean indicating whether or not Data Integrity Check is enabled */ + enforceDataIntegrityCheckForIscsi?: boolean; +} + +export function volumeGroupUpdatePropertiesSerializer(item: VolumeGroupUpdateProperties): any { + return { + protocolType: item["protocolType"], + encryption: item["encryption"], + encryptionProperties: !item["encryptionProperties"] + ? item["encryptionProperties"] + : encryptionPropertiesSerializer(item["encryptionProperties"]), + networkAcls: !item["networkAcls"] + ? item["networkAcls"] + : networkRuleSetSerializer(item["networkAcls"]), + enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], + }; +} + +/** List of Volume Groups */ +export interface _VolumeGroupList { + /** The VolumeGroup items on this page */ + value: VolumeGroup[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _volumeGroupListDeserializer(item: any): _VolumeGroupList { + return { + value: volumeGroupArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function volumeGroupArraySerializer(result: Array): any[] { + return result.map((item) => { + return volumeGroupSerializer(item); + }); +} + +export function volumeGroupArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return volumeGroupDeserializer(item); + }); +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value: PrivateLinkResource[]; + /** URI to fetch the next section of the paginated response. */ + readonly nextLink?: string; +} + +export function privateLinkResourceListResultDeserializer( + item: any, +): PrivateLinkResourceListResult { + return { + value: privateLinkResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function privateLinkResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return privateLinkResourceDeserializer(item); + }); +} + +/** A private link resource */ +export interface PrivateLinkResource extends Resource { + /** The private link resource group id. */ + readonly groupId?: string; + /** The private link resource required member names. */ + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +export function privateLinkResourceDeserializer(item: any): PrivateLinkResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _privateLinkResourcePropertiesDeserializer(item["properties"])), + }; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourceProperties { + /** The private link resource group id. */ + readonly groupId?: string; + /** The private link resource required member names. */ + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +export function privateLinkResourcePropertiesDeserializer( + item: any, +): PrivateLinkResourceProperties { + return { + groupId: item["groupId"], + requiredMembers: !item["requiredMembers"] + ? item["requiredMembers"] + : item["requiredMembers"].map((p: any) => { + return p; + }), + requiredZoneNames: !item["requiredZoneNames"] + ? item["requiredZoneNames"] + : item["requiredZoneNames"].map((p: any) => { + return p; + }), + }; +} + +/** Response for Volume Snapshot request. */ +export interface Snapshot extends ProxyResource { + /** Data used when creating a volume snapshot. */ + creationData: SnapshotCreationData; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Size of Source Volume */ + readonly sourceVolumeSizeGiB?: number; + /** Source Volume Name of a snapshot */ + readonly volumeName?: string; +} + +export function snapshotSerializer(item: Snapshot): any { + return { properties: _snapshotPropertiesSerializer(item) }; +} + +export function snapshotDeserializer(item: any): Snapshot { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ..._snapshotPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties for Snapshot. */ +export interface SnapshotProperties { + /** Data used when creating a volume snapshot. */ + creationData: SnapshotCreationData; + /** State of the operation on the resource. */ + readonly provisioningState?: ProvisioningStates; + /** Size of Source Volume */ + readonly sourceVolumeSizeGiB?: number; + /** Source Volume Name of a snapshot */ + readonly volumeName?: string; +} + +export function snapshotPropertiesSerializer(item: SnapshotProperties): any { + return { creationData: snapshotCreationDataSerializer(item["creationData"]) }; +} + +export function snapshotPropertiesDeserializer(item: any): SnapshotProperties { + return { + creationData: snapshotCreationDataDeserializer(item["creationData"]), + provisioningState: item["provisioningState"], + sourceVolumeSizeGiB: item["sourceVolumeSizeGiB"], + volumeName: item["volumeName"], + }; +} + +/** Data used when creating a volume snapshot. */ +export interface SnapshotCreationData { + /** Fully qualified resource ID of the volume. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" */ + sourceId: string; +} + +export function snapshotCreationDataSerializer(item: SnapshotCreationData): any { + return { sourceId: item["sourceId"] }; +} + +export function snapshotCreationDataDeserializer(item: any): SnapshotCreationData { + return { + sourceId: item["sourceId"], + }; +} + +/** List of Snapshots */ +export interface _SnapshotList { + /** The Snapshot items on this page */ + value: Snapshot[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _snapshotListDeserializer(item: any): _SnapshotList { + return { + value: snapshotArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function snapshotArraySerializer(result: Array): any[] { + return result.map((item) => { + return snapshotSerializer(item); + }); +} + +export function snapshotArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return snapshotDeserializer(item); + }); +} + +/** List of SKU Information objects */ +export interface _SkuInformationList { + /** The SkuInformation items on this page */ + readonly value: SkuInformation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _skuInformationListDeserializer(item: any): _SkuInformationList { + return { + value: skuInformationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function skuInformationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return skuInformationDeserializer(item); + }); +} + +/** ElasticSAN SKU and its properties */ +export interface SkuInformation { + /** Sku Name */ + name: SkuName; + /** Sku Tier */ + tier?: SkuTier; + /** The type of the resource. */ + readonly resourceType?: string; + /** The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). */ + readonly locations?: string[]; + /** Availability of the SKU for the location/zone */ + readonly locationInfo?: SkuLocationInfo[]; + /** The capability information in the specified SKU. */ + readonly capabilities?: SKUCapability[]; +} + +export function skuInformationDeserializer(item: any): SkuInformation { + return { + name: item["name"], + tier: item["tier"], + resourceType: item["resourceType"], + locations: !item["locations"] + ? item["locations"] + : item["locations"].map((p: any) => { + return p; + }), + locationInfo: !item["locationInfo"] + ? item["locationInfo"] + : skuLocationInfoArrayDeserializer(item["locationInfo"]), + capabilities: !item["capabilities"] + ? item["capabilities"] + : skuCapabilityArrayDeserializer(item["capabilities"]), + }; +} + +export function skuLocationInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return skuLocationInfoDeserializer(item); + }); +} + +/** The location info. */ +export interface SkuLocationInfo { + /** The location. */ + readonly location?: string; + /** The zones. */ + readonly zones?: string[]; +} + +export function skuLocationInfoDeserializer(item: any): SkuLocationInfo { + return { + location: item["location"], + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +export function skuCapabilityArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return skuCapabilityDeserializer(item); + }); +} + +/** The capability information in the specified SKU. */ +export interface SKUCapability { + /** The name of capability. */ + readonly name?: string; + /** A string value to indicate states of given capability. */ + readonly value?: string; +} + +export function skuCapabilityDeserializer(item: any): SKUCapability { + return { + name: item["name"], + value: item["value"], + }; +} + +/** Known values of {@link x-ms-delete-snapshots} that the service accepts. */ +export enum KnownXMsDeleteSnapshots { + /** true */ + True = "true", + /** false */ + False = "false", +} + +/** Type of XMsDeleteSnapshots */ +export type XMsDeleteSnapshots = string; + +/** Known values of {@link x-ms-force-delete} that the service accepts. */ +export enum KnownXMsForceDelete { + /** true */ + True = "true", + /** false */ + False = "false", +} + +/** Type of XMsForceDelete */ +export type XMsForceDelete = string; + +/** The available API versions. */ +export enum KnownVersions { + /** The 2025-09-01 stable API version. */ + V20250901 = "2025-09-01", +} + +export function _privateEndpointConnectionPropertiesSerializer( + item: PrivateEndpointConnection, +): any { + return { + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointSerializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateSerializer( + item["privateLinkServiceConnectionState"], + ), + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + }; +} + +export function _privateEndpointConnectionPropertiesDeserializer(item: any) { + return { + provisioningState: item["provisioningState"], + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointDeserializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateDeserializer( + item["privateLinkServiceConnectionState"], + ), + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + }; +} + +export function _elasticSanPropertiesSerializer(item: ElasticSan): any { + return { + sku: skuSerializer(item["sku"]), + availabilityZones: !item["availabilityZones"] + ? item["availabilityZones"] + : item["availabilityZones"].map((p: any) => { + return p; + }), + baseSizeTiB: item["baseSizeTiB"], + extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], + publicNetworkAccess: item["publicNetworkAccess"], + autoScaleProperties: !item["autoScaleProperties"] + ? item["autoScaleProperties"] + : autoScalePropertiesSerializer(item["autoScaleProperties"]), + }; +} + +export function _elasticSanPropertiesDeserializer(item: any) { + return { + sku: skuDeserializer(item["sku"]), + availabilityZones: !item["availabilityZones"] + ? item["availabilityZones"] + : item["availabilityZones"].map((p: any) => { + return p; + }), + provisioningState: item["provisioningState"], + baseSizeTiB: item["baseSizeTiB"], + extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], + totalVolumeSizeGiB: item["totalVolumeSizeGiB"], + volumeGroupCount: item["volumeGroupCount"], + totalIops: item["totalIops"], + totalMBps: item["totalMBps"], + totalSizeTiB: item["totalSizeTiB"], + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + publicNetworkAccess: item["publicNetworkAccess"], + autoScaleProperties: !item["autoScaleProperties"] + ? item["autoScaleProperties"] + : autoScalePropertiesDeserializer(item["autoScaleProperties"]), + }; +} + +export function _elasticSanUpdatePropertiesSerializer(item: ElasticSanUpdate): any { + return { + baseSizeTiB: item["baseSizeTiB"], + extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], + publicNetworkAccess: item["publicNetworkAccess"], + autoScaleProperties: !item["autoScaleProperties"] + ? item["autoScaleProperties"] + : autoScalePropertiesSerializer(item["autoScaleProperties"]), + }; +} + +export function _volumePropertiesSerializer(item: Volume): any { + return { + creationData: !item["creationData"] + ? item["creationData"] + : sourceCreationDataSerializer(item["creationData"]), + sizeGiB: item["sizeGiB"], + managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), + }; +} + +export function _volumePropertiesDeserializer(item: any) { + return { + volumeId: item["volumeId"], + creationData: !item["creationData"] + ? item["creationData"] + : sourceCreationDataDeserializer(item["creationData"]), + sizeGiB: item["sizeGiB"], + storageTarget: !item["storageTarget"] + ? item["storageTarget"] + : iscsiTargetInfoDeserializer(item["storageTarget"]), + managedBy: !item["managedBy"] + ? item["managedBy"] + : managedByInfoDeserializer(item["managedBy"]), + provisioningState: item["provisioningState"], + }; +} + +export function _volumeUpdatePropertiesSerializer(item: VolumeUpdate): any { + return { + sizeGiB: item["sizeGiB"], + managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), + }; +} + +export function _volumeGroupPropertiesSerializer(item: VolumeGroup): any { + return { + protocolType: item["protocolType"], + encryption: item["encryption"], + encryptionProperties: !item["encryptionProperties"] + ? item["encryptionProperties"] + : encryptionPropertiesSerializer(item["encryptionProperties"]), + networkAcls: !item["networkAcls"] + ? item["networkAcls"] + : networkRuleSetSerializer(item["networkAcls"]), + enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], + }; +} + +export function _volumeGroupPropertiesDeserializer(item: any) { + return { + provisioningState: item["provisioningState"], + protocolType: item["protocolType"], + encryption: item["encryption"], + encryptionProperties: !item["encryptionProperties"] + ? item["encryptionProperties"] + : encryptionPropertiesDeserializer(item["encryptionProperties"]), + networkAcls: !item["networkAcls"] + ? item["networkAcls"] + : networkRuleSetDeserializer(item["networkAcls"]), + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], + }; +} + +export function _volumeGroupUpdatePropertiesSerializer(item: VolumeGroupUpdate): any { + return { + protocolType: item["protocolType"], + encryption: item["encryption"], + encryptionProperties: !item["encryptionProperties"] + ? item["encryptionProperties"] + : encryptionPropertiesSerializer(item["encryptionProperties"]), + networkAcls: !item["networkAcls"] + ? item["networkAcls"] + : networkRuleSetSerializer(item["networkAcls"]), + enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], + }; +} + +export function _privateLinkResourcePropertiesDeserializer(item: any) { + return { + groupId: item["groupId"], + requiredMembers: !item["requiredMembers"] + ? item["requiredMembers"] + : item["requiredMembers"].map((p: any) => { + return p; + }), + requiredZoneNames: !item["requiredZoneNames"] + ? item["requiredZoneNames"] + : item["requiredZoneNames"].map((p: any) => { + return p; + }), + }; +} + +export function _snapshotPropertiesSerializer(item: Snapshot): any { + return { creationData: snapshotCreationDataSerializer(item["creationData"]) }; +} + +export function _snapshotPropertiesDeserializer(item: any) { + return { + creationData: snapshotCreationDataDeserializer(item["creationData"]), + provisioningState: item["provisioningState"], + sourceVolumeSizeGiB: item["sourceVolumeSizeGiB"], + volumeName: item["volumeName"], + }; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts deleted file mode 100644 index 423bc1b7fbc2..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { - OperationParameter, - OperationURLParameter, - OperationQueryParameter, -} from "@azure/core-client"; -import { - ElasticSan as ElasticSanMapper, - ElasticSanUpdate as ElasticSanUpdateMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper, - VolumeGroup as VolumeGroupMapper, - VolumeGroupUpdate as VolumeGroupUpdateMapper, - VolumeNameList as VolumeNameListMapper, - DiskSnapshotList as DiskSnapshotListMapper, - Volume as VolumeMapper, - VolumeUpdate as VolumeUpdateMapper, - Snapshot as SnapshotMapper, -} from "../models/mappers.js"; - -export const accept: OperationParameter = { - parameterPath: "accept", - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Accept", - type: { - name: "String", - }, - }, -}; - -export const $host: OperationURLParameter = { - parameterPath: "$host", - mapper: { - serializedName: "$host", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2025-09-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - constraints: { - MinLength: 1, - }, - serializedName: "subscriptionId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - MaxLength: 90, - MinLength: 1, - }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const elasticSanName: OperationURLParameter = { - parameterPath: "elasticSanName", - mapper: { - constraints: { - Pattern: new RegExp("^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"), - MaxLength: 24, - MinLength: 3, - }, - serializedName: "elasticSanName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: ElasticSanMapper, -}; - -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: ElasticSanUpdateMapper, -}; - -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String", - }, - }, -}; - -export const privateEndpointConnectionName: OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", - mapper: { - serializedName: "privateEndpointConnectionName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: PrivateEndpointConnectionMapper, -}; - -export const volumeGroupName: OperationURLParameter = { - parameterPath: "volumeGroupName", - mapper: { - constraints: { - Pattern: new RegExp("^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"), - MaxLength: 63, - MinLength: 3, - }, - serializedName: "volumeGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeGroupMapper, -}; - -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeGroupUpdateMapper, -}; - -export const parameters5: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeNameListMapper, -}; - -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: DiskSnapshotListMapper, -}; - -export const volumeName: OperationURLParameter = { - parameterPath: "volumeName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-z0-9]+(-[a-z0-9A-Z]+)*$"), - MaxLength: 63, - MinLength: 3, - }, - serializedName: "volumeName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters7: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeMapper, -}; - -export const parameters8: OperationParameter = { - parameterPath: "parameters", - mapper: VolumeUpdateMapper, -}; - -export const xMsDeleteSnapshots: OperationParameter = { - parameterPath: ["options", "xMsDeleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - type: { - name: "String", - }, - }, -}; - -export const xMsForceDelete: OperationParameter = { - parameterPath: ["options", "xMsForceDelete"], - mapper: { - serializedName: "x-ms-force-delete", - type: { - name: "String", - }, - }, -}; - -export const snapshotName: OperationURLParameter = { - parameterPath: "snapshotName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-z0-9]+(?:[._-][a-z0-9]+)*$"), - MaxLength: 80, - MinLength: 1, - }, - serializedName: "snapshotName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters9: OperationParameter = { - parameterPath: "parameters", - mapper: SnapshotMapper, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts deleted file mode 100644 index 3b5414d40904..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts +++ /dev/null @@ -1,661 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { ElasticSans } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ElasticSanManagement } from "../elasticSanManagement.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - ElasticSan, - ElasticSansListBySubscriptionNextOptionalParams, - ElasticSansListBySubscriptionOptionalParams, - ElasticSansListBySubscriptionResponse, - ElasticSansListByResourceGroupNextOptionalParams, - ElasticSansListByResourceGroupOptionalParams, - ElasticSansListByResourceGroupResponse, - ElasticSansGetOptionalParams, - ElasticSansGetResponse, - ElasticSansCreateOptionalParams, - ElasticSansCreateResponse, - ElasticSanUpdate, - ElasticSansUpdateOptionalParams, - ElasticSansUpdateResponse, - ElasticSansDeleteOptionalParams, - ElasticSansListBySubscriptionNextResponse, - ElasticSansListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing ElasticSans operations. */ -export class ElasticSansImpl implements ElasticSans { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class ElasticSans class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * Gets a list of ElasticSans in a subscription - * @param options The options parameters. - */ - public listBySubscription( - options?: ElasticSansListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: ElasticSansListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ElasticSansListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: ElasticSansListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Gets a list of ElasticSan in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ElasticSansListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Gets a list of ElasticSans in a subscription - * @param options The options parameters. - */ - private _listBySubscription( - options?: ElasticSansListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec); - } - - /** - * Gets a list of ElasticSan in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Get a ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, options }, - getOperationSpec, - ); - } - - /** - * Create ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ): Promise< - SimplePollerLike, ElasticSansCreateResponse> - > { - 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, elasticSanName, parameters, options }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - ElasticSansCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate(resourceGroupName, elasticSanName, parameters, options); - return poller.pollUntilDone(); - } - - /** - * Update a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ): Promise< - SimplePollerLike, ElasticSansUpdateResponse> - > { - 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, elasticSanName, parameters, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - ElasticSansUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, elasticSanName, parameters, options); - return poller.pollUntilDone(); - } - - /** - * Delete a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ): Promise, void>> { - 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, elasticSanName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, elasticSanName, options); - return poller.pollUntilDone(); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: ElasticSansListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: ElasticSansListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSanList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSanList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSan, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ElasticSan, - }, - 201: { - bodyMapper: Mappers.ElasticSan, - }, - 202: { - bodyMapper: Mappers.ElasticSan, - }, - 204: { - bodyMapper: Mappers.ElasticSan, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.ElasticSan, - }, - 201: { - bodyMapper: Mappers.ElasticSan, - }, - 202: { - bodyMapper: Mappers.ElasticSan, - }, - 204: { - bodyMapper: Mappers.ElasticSan, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSanList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ElasticSanList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/operations/index.ts deleted file mode 100644 index b291dba769e0..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -export * from "./operations.js"; -export * from "./elasticSans.js"; -export * from "./skus.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkResources.js"; -export * from "./volumeGroups.js"; -export * from "./volumes.js"; -export * from "./volumeSnapshots.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts b/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts deleted file mode 100644 index 124a98e1a5be..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { Operations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ElasticSanManagement } from "../elasticSanManagement.js"; -import type { - Operation, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List the operations for the provider - * @param options The options parameters. - */ - public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: OperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * List the operations for the provider - * @param options The options parameters. - */ - private _list(options?: OperationsListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: OperationsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.ElasticSan/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts deleted file mode 100644 index e1023a63f686..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts +++ /dev/null @@ -1,483 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { PrivateEndpointConnections } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ElasticSanManagement } from "../elasticSanManagement.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - PrivateEndpointConnection, - PrivateEndpointConnectionsListNextOptionalParams, - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsListResponse, - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsCreateResponse, - PrivateEndpointConnectionsDeleteOptionalParams, - PrivateEndpointConnectionsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing PrivateEndpointConnections operations. */ -export class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class PrivateEndpointConnections class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List all Private Endpoint Connections associated with the Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, elasticSanName, 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(resourceGroupName, elasticSanName, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PrivateEndpointConnectionsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, elasticSanName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(resourceGroupName, elasticSanName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, elasticSanName, options)) { - yield* page; - } - } - - /** - * List all Private Endpoint Connections associated with the Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, options }, - listOperationSpec, - ); - } - - /** - * Gets the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - options, - }, - getOperationSpec, - ); - } - - /** - * Update the state of specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param parameters Private Endpoint Connection Approval object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionsCreateResponse - > - > { - 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, - elasticSanName, - privateEndpointConnectionName, - parameters, - options, - }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - PrivateEndpointConnectionsCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update the state of specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param parameters Private Endpoint Connection Approval object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise, void>> { - 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, - elasticSanName, - privateEndpointConnectionName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - elasticSanName, - privateEndpointConnectionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - elasticSanName: string, - nextLink: string, - options?: PrivateEndpointConnectionsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 201: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 202: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 204: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts b/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts deleted file mode 100644 index 0c2a0b3f04da..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PrivateLinkResources } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ElasticSanManagement } from "../elasticSanManagement.js"; -import type { - PrivateLinkResourcesListByElasticSanOptionalParams, - PrivateLinkResourcesListByElasticSanResponse, -} from "../models/index.js"; - -/** Class containing PrivateLinkResources operations. */ -export class PrivateLinkResourcesImpl implements PrivateLinkResources { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class PrivateLinkResources class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * Gets the private link resources that need to be created for a elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateLinkResourcesListByElasticSanOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, options }, - listByElasticSanOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByElasticSanOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateLinkResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts b/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts deleted file mode 100644 index fe9b1b9f314b..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { Skus } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ElasticSanManagement } from "../elasticSanManagement.js"; -import type { - SkuInformation, - SkusListNextOptionalParams, - SkusListOptionalParams, - SkusListResponse, - SkusListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Skus operations. */ -export class SkusImpl implements Skus { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class Skus class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List all the available Skus in the region and information related to them - * @param options The options parameters. - */ - public list(options?: SkusListOptionalParams): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: SkusListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SkusListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: SkusListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * List all the available Skus in the region and information related to them - * @param options The options parameters. - */ - private _list(options?: SkusListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: SkusListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SkuInformationList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SkuInformationList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts deleted file mode 100644 index 47c892c406ac..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts +++ /dev/null @@ -1,622 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { VolumeGroups } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ElasticSanManagement } from "../elasticSanManagement.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - VolumeGroup, - VolumeGroupsListByElasticSanNextOptionalParams, - VolumeGroupsListByElasticSanOptionalParams, - VolumeGroupsListByElasticSanResponse, - VolumeGroupsGetOptionalParams, - VolumeGroupsGetResponse, - VolumeGroupsCreateOptionalParams, - VolumeGroupsCreateResponse, - VolumeGroupUpdate, - VolumeGroupsUpdateOptionalParams, - VolumeGroupsUpdateResponse, - VolumeGroupsDeleteOptionalParams, - VolumeGroupsListByElasticSanNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VolumeGroups operations. */ -export class VolumeGroupsImpl implements VolumeGroups { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class VolumeGroups class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - public listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByElasticSanPagingAll(resourceGroupName, elasticSanName, 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.listByElasticSanPagingPage( - resourceGroupName, - elasticSanName, - options, - settings, - ); - }, - }; - } - - private async *listByElasticSanPagingPage( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VolumeGroupsListByElasticSanResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByElasticSan(resourceGroupName, elasticSanName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByElasticSanNext( - resourceGroupName, - elasticSanName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByElasticSanPagingAll( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByElasticSanPagingPage( - resourceGroupName, - elasticSanName, - options, - )) { - yield* page; - } - } - - /** - * List VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - private _listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, options }, - listByElasticSanOperationSpec, - ); - } - - /** - * Get an VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, options }, - getOperationSpec, - ); - } - - /** - * Create a Volume Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ): Promise< - SimplePollerLike, VolumeGroupsCreateResponse> - > { - 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, - elasticSanName, - volumeGroupName, - parameters, - options, - }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - VolumeGroupsCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create a Volume Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ): Promise< - SimplePollerLike, VolumeGroupsUpdateResponse> - > { - 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, - elasticSanName, - volumeGroupName, - parameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VolumeGroupsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ): Promise, void>> { - 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, elasticSanName, volumeGroupName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByElasticSanNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param nextLink The nextLink from the previous successful call to the ListByElasticSan method. - * @param options The options parameters. - */ - private _listByElasticSanNext( - resourceGroupName: string, - elasticSanName: string, - nextLink: string, - options?: VolumeGroupsListByElasticSanNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, nextLink, options }, - listByElasticSanNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByElasticSanOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroupList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroup, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroup, - }, - 201: { - bodyMapper: Mappers.VolumeGroup, - }, - 202: { - bodyMapper: Mappers.VolumeGroup, - }, - 204: { - bodyMapper: Mappers.VolumeGroup, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroup, - }, - 201: { - bodyMapper: Mappers.VolumeGroup, - }, - 202: { - bodyMapper: Mappers.VolumeGroup, - }, - 204: { - bodyMapper: Mappers.VolumeGroup, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByElasticSanNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeGroupList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts deleted file mode 100644 index 7046274eb97a..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts +++ /dev/null @@ -1,535 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { VolumeSnapshots } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ElasticSanManagement } from "../elasticSanManagement.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - Snapshot, - VolumeSnapshotsListByVolumeGroupNextOptionalParams, - VolumeSnapshotsListByVolumeGroupOptionalParams, - VolumeSnapshotsListByVolumeGroupResponse, - VolumeSnapshotsGetOptionalParams, - VolumeSnapshotsGetResponse, - VolumeSnapshotsCreateOptionalParams, - VolumeSnapshotsCreateResponse, - VolumeSnapshotsDeleteOptionalParams, - VolumeSnapshotsListByVolumeGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VolumeSnapshots operations. */ -export class VolumeSnapshotsImpl implements VolumeSnapshots { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class VolumeSnapshots class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - public listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByVolumeGroupPagingAll( - resourceGroupName, - elasticSanName, - volumeGroupName, - 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.listByVolumeGroupPagingPage( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByVolumeGroupPagingPage( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VolumeSnapshotsListByVolumeGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByVolumeGroupNext( - resourceGroupName, - elasticSanName, - volumeGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByVolumeGroupPagingAll( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByVolumeGroupPagingPage( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - yield* page; - } - } - - /** - * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - private _listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, options }, - listByVolumeGroupOperationSpec, - ); - } - - /** - * Get a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - options, - }, - getOperationSpec, - ); - } - - /** - * Create a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param parameters Snapshot object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ): Promise< - SimplePollerLike, VolumeSnapshotsCreateResponse> - > { - 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, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - options, - }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - VolumeSnapshotsCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param parameters Snapshot object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ): Promise, void>> { - 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, - elasticSanName, - volumeGroupName, - snapshotName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - elasticSanName, - volumeGroupName, - snapshotName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByVolumeGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param nextLink The nextLink from the previous successful call to the ListByVolumeGroup method. - * @param options The options parameters. - */ - private _listByVolumeGroupNext( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - nextLink: string, - options?: VolumeSnapshotsListByVolumeGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, nextLink, options }, - listByVolumeGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByVolumeGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SnapshotList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Snapshot, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Snapshot, - }, - 201: { - bodyMapper: Mappers.Snapshot, - }, - 202: { - bodyMapper: Mappers.Snapshot, - }, - 204: { - bodyMapper: Mappers.Snapshot, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters9, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SnapshotList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts deleted file mode 100644 index 27f4afeadd19..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts +++ /dev/null @@ -1,956 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { Volumes } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ElasticSanManagement } from "../elasticSanManagement.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - Volume, - VolumesListByVolumeGroupNextOptionalParams, - VolumesListByVolumeGroupOptionalParams, - VolumesListByVolumeGroupResponse, - VolumeNameList, - VolumesPreBackupOptionalParams, - VolumesPreBackupResponse, - DiskSnapshotList, - VolumesPreRestoreOptionalParams, - VolumesPreRestoreResponse, - VolumesGetOptionalParams, - VolumesGetResponse, - VolumesCreateOptionalParams, - VolumesCreateResponse, - VolumeUpdate, - VolumesUpdateOptionalParams, - VolumesUpdateResponse, - VolumesDeleteOptionalParams, - VolumesListByVolumeGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Volumes operations. */ -export class VolumesImpl implements Volumes { - private readonly client: ElasticSanManagement; - - /** - * Initialize a new instance of the class Volumes class. - * @param client Reference to the service client - */ - constructor(client: ElasticSanManagement) { - this.client = client; - } - - /** - * List Volumes in a VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - public listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByVolumeGroupPagingAll( - resourceGroupName, - elasticSanName, - volumeGroupName, - 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.listByVolumeGroupPagingPage( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByVolumeGroupPagingPage( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VolumesListByVolumeGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByVolumeGroup( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByVolumeGroupNext( - resourceGroupName, - elasticSanName, - volumeGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByVolumeGroupPagingAll( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByVolumeGroupPagingPage( - resourceGroupName, - elasticSanName, - volumeGroupName, - options, - )) { - yield* page; - } - } - - /** - * Validate whether a disk snapshot backup can be taken for list of volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Name List (currently only one volume name in the list is supported. Server - * would return error if list is bigger) - * @param options The options parameters. - */ - async beginPreBackup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ): Promise, VolumesPreBackupResponse>> { - 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, - elasticSanName, - volumeGroupName, - parameters, - options, - }, - spec: preBackupOperationSpec, - }); - const poller = await createHttpPoller< - VolumesPreBackupResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Validate whether a disk snapshot backup can be taken for list of volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Name List (currently only one volume name in the list is supported. Server - * would return error if list is bigger) - * @param options The options parameters. - */ - async beginPreBackupAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ): Promise { - const poller = await this.beginPreBackup( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and - * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if - * list is bigger) - * @param options The options parameters. - */ - async beginPreRestore( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ): Promise< - SimplePollerLike, VolumesPreRestoreResponse> - > { - 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, - elasticSanName, - volumeGroupName, - parameters, - options, - }, - spec: preRestoreOperationSpec, - }); - const poller = await createHttpPoller< - VolumesPreRestoreResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and - * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if - * list is bigger) - * @param options The options parameters. - */ - async beginPreRestoreAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ): Promise { - const poller = await this.beginPreRestore( - resourceGroupName, - elasticSanName, - volumeGroupName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * List Volumes in a VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - private _listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, options }, - listByVolumeGroupOperationSpec, - ); - } - - /** - * Get an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - }, - getOperationSpec, - ); - } - - /** - * Create a Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ): Promise, VolumesCreateResponse>> { - 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, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - VolumesCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create a Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ): Promise, VolumesUpdateResponse>> { - 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, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VolumesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ): Promise, void>> { - 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, - elasticSanName, - volumeGroupName, - volumeName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - elasticSanName, - volumeGroupName, - volumeName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByVolumeGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param nextLink The nextLink from the previous successful call to the ListByVolumeGroup method. - * @param options The options parameters. - */ - private _listByVolumeGroupNext( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - nextLink: string, - options?: VolumesListByVolumeGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, elasticSanName, volumeGroupName, nextLink, options }, - listByVolumeGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const preBackupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PreValidationResponse, - }, - 201: { - bodyMapper: Mappers.PreValidationResponse, - }, - 202: { - bodyMapper: Mappers.PreValidationResponse, - }, - 204: { - bodyMapper: Mappers.PreValidationResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const preRestoreOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PreValidationResponse, - }, - 201: { - bodyMapper: Mappers.PreValidationResponse, - }, - 202: { - bodyMapper: Mappers.PreValidationResponse, - }, - 204: { - bodyMapper: Mappers.PreValidationResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listByVolumeGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Volume, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.volumeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Volume, - }, - 201: { - bodyMapper: Mappers.Volume, - }, - 202: { - bodyMapper: Mappers.Volume, - }, - 204: { - bodyMapper: Mappers.Volume, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.volumeName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Volume, - }, - 201: { - bodyMapper: Mappers.Volume, - }, - 202: { - bodyMapper: Mappers.Volume, - }, - 204: { - bodyMapper: Mappers.Volume, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters8, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.volumeName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - Parameters.volumeName, - ], - headerParameters: [Parameters.accept, Parameters.xMsDeleteSnapshots, Parameters.xMsForceDelete], - serializer, -}; -const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VolumeList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.elasticSanName, - Parameters.volumeGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts deleted file mode 100644 index a7c93f537527..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - ElasticSan, - ElasticSansListBySubscriptionOptionalParams, - ElasticSansListByResourceGroupOptionalParams, - ElasticSansGetOptionalParams, - ElasticSansGetResponse, - ElasticSansCreateOptionalParams, - ElasticSansCreateResponse, - ElasticSanUpdate, - ElasticSansUpdateOptionalParams, - ElasticSansUpdateResponse, - ElasticSansDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a ElasticSans. */ -export interface ElasticSans { - /** - * Gets a list of ElasticSans in a subscription - * @param options The options parameters. - */ - listBySubscription( - options?: ElasticSansListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a list of ElasticSan in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: ElasticSansListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get a ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansGetOptionalParams, - ): Promise; - /** - * Create ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ): Promise< - SimplePollerLike, ElasticSansCreateResponse> - >; - /** - * Create ElasticSan. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSan, - options?: ElasticSansCreateOptionalParams, - ): Promise; - /** - * Update a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ): Promise< - SimplePollerLike, ElasticSansUpdateResponse> - >; - /** - * Update a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param parameters Elastic San object. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - parameters: ElasticSanUpdate, - options?: ElasticSansUpdateOptionalParams, - ): Promise; - /** - * Delete a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - options?: ElasticSansDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts deleted file mode 100644 index b291dba769e0..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -export * from "./operations.js"; -export * from "./elasticSans.js"; -export * from "./skus.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkResources.js"; -export * from "./volumeGroups.js"; -export * from "./volumes.js"; -export * from "./volumeSnapshots.js"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts deleted file mode 100644 index 58533294df40..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { Operation, OperationsListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * List the operations for the provider - * @param options The options parameters. - */ - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts deleted file mode 100644 index 75512df709b3..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - PrivateEndpointConnection, - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionsCreateOptionalParams, - PrivateEndpointConnectionsCreateResponse, - PrivateEndpointConnectionsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a PrivateEndpointConnections. */ -export interface PrivateEndpointConnections { - /** - * List all Private Endpoint Connections associated with the Elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ): Promise; - /** - * Update the state of specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param parameters Private Endpoint Connection Approval object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionsCreateResponse - > - >; - /** - * Update the state of specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param parameters Private Endpoint Connection Approval object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOptionalParams, - ): Promise; - /** - * Deletes the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes the specified private endpoint connection associated with the Elastic San - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param privateEndpointConnectionName The name of the Private Endpoint connection. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts deleted file mode 100644 index cd151bcafdb1..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { - PrivateLinkResourcesListByElasticSanOptionalParams, - PrivateLinkResourcesListByElasticSanResponse, -} from "../models/index.js"; - -/** Interface representing a PrivateLinkResources. */ -export interface PrivateLinkResources { - /** - * Gets the private link resources that need to be created for a elastic San. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: PrivateLinkResourcesListByElasticSanOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts deleted file mode 100644 index a21495848a84..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SkuInformation, SkusListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a Skus. */ -export interface Skus { - /** - * List all the available Skus in the region and information related to them - * @param options The options parameters. - */ - list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts deleted file mode 100644 index 9afddd92b868..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - VolumeGroup, - VolumeGroupsListByElasticSanOptionalParams, - VolumeGroupsGetOptionalParams, - VolumeGroupsGetResponse, - VolumeGroupsCreateOptionalParams, - VolumeGroupsCreateResponse, - VolumeGroupUpdate, - VolumeGroupsUpdateOptionalParams, - VolumeGroupsUpdateResponse, - VolumeGroupsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a VolumeGroups. */ -export interface VolumeGroups { - /** - * List VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param options The options parameters. - */ - listByElasticSan( - resourceGroupName: string, - elasticSanName: string, - options?: VolumeGroupsListByElasticSanOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get an VolumeGroups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsGetOptionalParams, - ): Promise; - /** - * Create a Volume Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ): Promise< - SimplePollerLike, VolumeGroupsCreateResponse> - >; - /** - * Create a Volume Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroup, - options?: VolumeGroupsCreateOptionalParams, - ): Promise; - /** - * Update an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ): Promise< - SimplePollerLike, VolumeGroupsUpdateResponse> - >; - /** - * Update an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Group object. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeGroupUpdate, - options?: VolumeGroupsUpdateOptionalParams, - ): Promise; - /** - * Delete an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete an VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeGroupsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts deleted file mode 100644 index 986d89a2e356..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - Snapshot, - VolumeSnapshotsListByVolumeGroupOptionalParams, - VolumeSnapshotsGetOptionalParams, - VolumeSnapshotsGetResponse, - VolumeSnapshotsCreateOptionalParams, - VolumeSnapshotsCreateResponse, - VolumeSnapshotsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a VolumeSnapshots. */ -export interface VolumeSnapshots { - /** - * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumeSnapshotsListByVolumeGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsGetOptionalParams, - ): Promise; - /** - * Create a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param parameters Snapshot object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ): Promise< - SimplePollerLike, VolumeSnapshotsCreateResponse> - >; - /** - * Create a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param parameters Snapshot object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - parameters: Snapshot, - options?: VolumeSnapshotsCreateOptionalParams, - ): Promise; - /** - * Delete a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a Volume Snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param snapshotName The name of the volume snapshot within the given volume group. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - snapshotName: string, - options?: VolumeSnapshotsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts deleted file mode 100644 index 6961bf365ebf..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - Volume, - VolumesListByVolumeGroupOptionalParams, - VolumeNameList, - VolumesPreBackupOptionalParams, - VolumesPreBackupResponse, - DiskSnapshotList, - VolumesPreRestoreOptionalParams, - VolumesPreRestoreResponse, - VolumesGetOptionalParams, - VolumesGetResponse, - VolumesCreateOptionalParams, - VolumesCreateResponse, - VolumeUpdate, - VolumesUpdateOptionalParams, - VolumesUpdateResponse, - VolumesDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a Volumes. */ -export interface Volumes { - /** - * List Volumes in a VolumeGroup. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param options The options parameters. - */ - listByVolumeGroup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - options?: VolumesListByVolumeGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Validate whether a disk snapshot backup can be taken for list of volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Name List (currently only one volume name in the list is supported. Server - * would return error if list is bigger) - * @param options The options parameters. - */ - beginPreBackup( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ): Promise, VolumesPreBackupResponse>>; - /** - * Validate whether a disk snapshot backup can be taken for list of volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Volume Name List (currently only one volume name in the list is supported. Server - * would return error if list is bigger) - * @param options The options parameters. - */ - beginPreBackupAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: VolumeNameList, - options?: VolumesPreBackupOptionalParams, - ): Promise; - /** - * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and - * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if - * list is bigger) - * @param options The options parameters. - */ - beginPreRestore( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ): Promise< - SimplePollerLike, VolumesPreRestoreResponse> - >; - /** - * Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param parameters Disk Snapshot List (currently only one Disk Snapshot in the list is supported and - * that the Disk Snapshot must be in same azure region as the ElasticSan. Server would return error if - * list is bigger) - * @param options The options parameters. - */ - beginPreRestoreAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - parameters: DiskSnapshotList, - options?: VolumesPreRestoreOptionalParams, - ): Promise; - /** - * Get an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesGetOptionalParams, - ): Promise; - /** - * Create a Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ): Promise, VolumesCreateResponse>>; - /** - * Create a Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: Volume, - options?: VolumesCreateOptionalParams, - ): Promise; - /** - * Update an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ): Promise, VolumesUpdateResponse>>; - /** - * Update an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param parameters Volume object. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - parameters: VolumeUpdate, - options?: VolumesUpdateOptionalParams, - ): Promise; - /** - * Delete an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete an Volume. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param elasticSanName The name of the ElasticSan. - * @param volumeGroupName The name of the VolumeGroup. - * @param volumeName The name of the Volume. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - elasticSanName: string, - volumeGroupName: string, - volumeName: string, - options?: VolumesDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts b/sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts deleted file mode 100644 index f64c4c8390ed..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/pagingHelper.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -export interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given the last `.value` produced by the `byPage` iterator, - * returns a continuation token that can be used to begin paging from - * that point later. - * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. - * @returns The continuation token that can be passed into byPage() during future calls. - */ -export function getContinuationToken(page: unknown): string | undefined { - if (typeof page !== "object" || page === null) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..a559e27b0fcb --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/restorePollerHelpers.ts @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ElasticSanManagement } from "./elasticSanManagement.js"; +import { _$deleteDeserialize, _createDeserialize } from "./api/volumeSnapshots/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeVolumeGroups, + _updateDeserialize, + _createDeserialize as _createDeserializeVolumeGroups, +} from "./api/volumeGroups/operations.js"; +import { + _preRestoreDeserialize, + _preBackupDeserialize, + _$deleteDeserialize as _$deleteDeserializeVolumes, + _updateDeserialize as _updateDeserializeVolumes, + _createDeserialize as _createDeserializeVolumes, +} from "./api/volumes/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializePrivateEndpointConnections, + _createDeserialize as _createDeserializePrivateEndpointConnections, +} from "./api/privateEndpointConnections/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeElasticSans, + _updateDeserialize as _updateDeserializeElasticSans, + _createDeserialize as _createDeserializeElasticSans, +} from "./api/elasticSans/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; +import type { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro"; +import { deserializeState } from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: ElasticSanManagement, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + const apiVersion = getApiVersionFromUrl(initialRequestUrl); + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + apiVersion, + }, + ); +} + +interface DeserializationHelper { + deserializer: (result: PathUncheckedResponse) => Promise; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}": + { deserializer: _$deleteDeserialize, expectedStatuses: ["200", "202", "204"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}": + { deserializer: _createDeserialize, expectedStatuses: ["200", "201", "202"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}": + { deserializer: _$deleteDeserializeVolumeGroups, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}": + { deserializer: _updateDeserialize, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}": + { deserializer: _createDeserializeVolumeGroups, expectedStatuses: ["200", "201", "202"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore": + { deserializer: _preRestoreDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup": + { deserializer: _preBackupDeserialize, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}": + { deserializer: _$deleteDeserializeVolumes, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}": + { deserializer: _updateDeserializeVolumes, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}": + { deserializer: _createDeserializeVolumes, expectedStatuses: ["200", "201", "202"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}": + { + deserializer: _$deleteDeserializePrivateEndpointConnections, + expectedStatuses: ["200", "202", "204"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}": + { + deserializer: _createDeserializePrivateEndpointConnections, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}": + { deserializer: _$deleteDeserializeElasticSans, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}": + { deserializer: _updateDeserializeElasticSans, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}": + { deserializer: _createDeserializeElasticSans, expectedStatuses: ["200", "201", "202"] }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} + +function getApiVersionFromUrl(urlStr: string): string | undefined { + const url = new URL(urlStr); + return url.searchParams.get("api-version") ?? undefined; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..613112c6e397 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..9258ba95eda8 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; + nextLinkMethod?: "GET" | "POST"; + apiVersion?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const nextLinkMethod = options.nextLinkMethod ?? "GET"; + const apiVersion = options.apiVersion; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + let result; + if (pageLink === undefined) { + result = await getInitialResponse(); + } else { + const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink; + result = + nextLinkMethod === "POST" + ? await client.pathUnchecked(resolvedPageLink).post() + : await client.pathUnchecked(resolvedPageLink).get(); + } + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..8e36a866edcc --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + OperationResponse, +} from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; + /** + * The api-version of the LRO + */ + apiVersion?: string; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse, apiVersion } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + const pollingPath = apiVersion ? addApiVersionToUrl(path, apiVersion) : path; + response = await client.pathUnchecked(pollingPath).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/serialization/check-prop-undefined.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/serialization/check-prop-undefined.ts new file mode 100644 index 000000000000..50f78829e491 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/serialization/check-prop-undefined.ts @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Returns true if all specified properties of the item are undefined. + * @param item The object to check. + * @param properties The list of property names to check on the item. + * @returns True if all specified properties are undefined, otherwise false. + */ +export function areAllPropsUndefined(item: Record, properties: string[]): boolean { + for (const property of properties) { + if (item[property] !== undefined) { + return false; + } + } + return true; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/simplePollerHelpers.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/simplePollerHelpers.ts new file mode 100644 index 000000000000..f6996f3cee67 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/simplePollerHelpers.ts @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PollerLike, OperationState, CancelOnProgress } from "@azure/core-lro"; +import type { AbortSignalLike } from "@azure/abort-controller"; + +/** + * A simple poller that can be used to poll a long running operation. + */ +export interface SimplePollerLike, TResult> { + /** + * Returns true if the poller has finished polling. + */ + isDone(): boolean; + /** + * Returns the state of the operation. + */ + getOperationState(): TState; + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult(): TResult | undefined; + /** + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. + */ + poll(options?: { abortSignal?: AbortSignalLike }): Promise; + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise; + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback: (state: TState) => void): CancelOnProgress; + + /** + * Returns a promise that could be used for serialized version of the poller's operation + * by invoking the operation's serialize method. + */ + serialize(): Promise; + + /** + * Wait the poller to be submitted. + */ + submitted(): Promise; + + /** + * Returns a string representation of the poller's operation. Similar to serialize but returns a string. + * @deprecated Use serialize() instead. + */ + toString(): string; + + /** + * Stops the poller from continuing to poll. Please note this will only stop the client-side polling + * @deprecated Use abortSignal to stop polling instead. + */ + stopPolling(): void; + + /** + * Returns true if the poller is stopped. + * @deprecated Use abortSignal status to track this instead. + */ + isStopped(): boolean; +} + +/** + * Create the deprecated SimplePollerLike from PollerLike + * @param poller PollerLike to convert + * @returns SimplePollerLike + */ +export function getSimplePoller( + poller: PollerLike, TResult>, +): SimplePollerLike, TResult> { + const simplePoller: SimplePollerLike, TResult> = { + isDone() { + return poller.isDone; + }, + isStopped() { + throw new Error("isStopped is deprecated. Use abortSignal status to track this instead."); + }, + getOperationState() { + if (!poller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return poller.operationState; + }, + getResult() { + return poller.result; + }, + toString() { + if (!poller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return JSON.stringify({ + state: poller.operationState, + }); + }, + stopPolling() { + throw new Error("stopPolling is deprecated. Use abortSignal to stop polling instead."); + }, + onProgress: poller.onProgress, + poll: poller.poll, + pollUntilDone: poller.pollUntilDone, + serialize: poller.serialize, + submitted: poller.submitted, + }; + return simplePoller; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..c7109898692a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// --------------------- +// interfaces +// --------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string): string { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string): string { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any): boolean { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false): string { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions): string { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions): string | undefined { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + const result = template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + op = expr[0]; + expr = expr.slice(1); + } + const varList = expr.split(/,/g); + const result = []; + for (const varSpec of varList) { + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: result.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + result.push(varValue); + } + } + return result.join(""); + }); + + return normalizeUnreserved(result); +} + +/** + * Normalize an expanded URI by decoding percent-encoded unreserved characters. + * RFC 3986 unreserved: "-" / "." / "~" + */ +function normalizeUnreserved(uri: string): string { + return uri.replace(/%([0-9A-Fa-f]{2})/g, (match, hex) => { + const char = String.fromCharCode(parseInt(hex, 16)); + // Decode only if it's unreserved + if (/[\-.~]/.test(char)) { + return char; + } + return match; // leave other encodings intact + }); +} diff --git a/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts b/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts index 77b37b2c9084..411f19c69d70 100644 --- a/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts +++ b/sdk/elasticsans/arm-elasticsan/test/snippets.spec.ts @@ -13,11 +13,11 @@ describe("snippets", () => { }); it("ReadmeSampleCreateClient_Browser", async () => { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ElasticSanManagement(credential, subscriptionId); }); diff --git a/sdk/elasticsans/arm-elasticsan/tsp-location.yaml b/sdk/elasticsans/arm-elasticsan/tsp-location.yaml new file mode 100644 index 000000000000..efa770fcad9c --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan +commit: 75ef537e80d5c4ea14adac72bd7e67114df06e8e +repo: Azure/azure-rest-api-specs +additionalDirectories: From 5e9b1e71db16cdf5328c8263ca818c0ff8043086 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 24 Feb 2026 08:30:37 +0000 Subject: [PATCH 5/8] Configurations: 'specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/tspconfig.yaml', API Version: 2025-09-01, SDK Release Type: stable, and CommitSHA: '6ebb23debab3faa4fda0722a706aeb4da6b64963' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5917142 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- sdk/elasticsans/arm-elasticsan/CHANGELOG.md | 74 +--- sdk/elasticsans/arm-elasticsan/metadata.json | 2 +- .../review/arm-elasticsan-models-node.api.md | 57 +-- .../review/arm-elasticsan-node.api.md | 57 +-- .../samples-dev/elasticSansCreateSample.ts | 28 +- .../samples-dev/elasticSansUpdateSample.ts | 20 +- .../privateEndpointConnectionsCreateSample.ts | 16 +- .../samples-dev/volumeGroupsCreateSample.ts | 26 +- .../samples-dev/volumeGroupsUpdateSample.ts | 26 +- .../volumeSnapshotsCreateSample.ts | 16 +- .../samples-dev/volumesCreateSample.ts | 10 +- .../samples-dev/volumesUpdateSample.ts | 2 +- .../v2/javascript/elasticSansCreateSample.js | 28 +- .../v2/javascript/elasticSansUpdateSample.js | 20 +- .../privateEndpointConnectionsCreateSample.js | 16 +- .../v2/javascript/volumeGroupsCreateSample.js | 26 +- .../v2/javascript/volumeGroupsUpdateSample.js | 26 +- .../javascript/volumeSnapshotsCreateSample.js | 16 +- .../v2/javascript/volumesCreateSample.js | 10 +- .../v2/javascript/volumesUpdateSample.js | 2 +- .../typescript/src/elasticSansCreateSample.ts | 28 +- .../typescript/src/elasticSansUpdateSample.ts | 20 +- .../privateEndpointConnectionsCreateSample.ts | 16 +- .../src/volumeGroupsCreateSample.ts | 26 +- .../src/volumeGroupsUpdateSample.ts | 26 +- .../src/volumeSnapshotsCreateSample.ts | 16 +- .../v2/typescript/src/volumesCreateSample.ts | 10 +- .../v2/typescript/src/volumesUpdateSample.ts | 2 +- .../arm-elasticsan/src/models/models.ts | 379 ++---------------- .../serialization/check-prop-undefined.ts | 17 - .../src/static-helpers/urlTemplate.ts | 10 +- .../arm-elasticsan/tsp-location.yaml | 2 +- 32 files changed, 305 insertions(+), 725 deletions(-) delete mode 100644 sdk/elasticsans/arm-elasticsan/src/static-helpers/serialization/check-prop-undefined.ts diff --git a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md index 94f84bda9423..25e9c50a2800 100644 --- a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md +++ b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 2.0.0 (2026-02-14) +## 2.0.0 (2026-02-24) ### Features Added - Added operation ElasticSansOperations.create @@ -33,50 +33,8 @@ - Added Interface VolumeNameList - Added Interface VolumesPreBackupOptionalParams - Added Interface VolumesPreRestoreOptionalParams - - Interface ElasticSan has a new optional parameter autoScaleProperties - - Interface ElasticSan has a new optional parameter availabilityZones - - Interface ElasticSan has a new optional parameter privateEndpointConnections - - Interface ElasticSan has a new optional parameter provisioningState - - Interface ElasticSan has a new optional parameter publicNetworkAccess - - Interface ElasticSan has a new optional parameter totalIops - - Interface ElasticSan has a new optional parameter totalMBps - - Interface ElasticSan has a new optional parameter totalSizeTiB - - Interface ElasticSan has a new optional parameter totalVolumeSizeGiB - - Interface ElasticSan has a new optional parameter volumeGroupCount - Interface ElasticSanProperties has a new optional parameter autoScaleProperties - - Interface ElasticSanUpdate has a new optional parameter autoScaleProperties - - Interface ElasticSanUpdate has a new optional parameter baseSizeTiB - - Interface ElasticSanUpdate has a new optional parameter extendedCapacitySizeTiB - - Interface ElasticSanUpdate has a new optional parameter publicNetworkAccess - Interface ElasticSanUpdateProperties has a new optional parameter autoScaleProperties - - Interface PrivateEndpointConnection has a new optional parameter groupIds - - Interface PrivateEndpointConnection has a new optional parameter privateEndpoint - - Interface PrivateEndpointConnection has a new optional parameter provisioningState - - Interface PrivateLinkResource has a new optional parameter groupId - - Interface PrivateLinkResource has a new optional parameter requiredMembers - - Interface PrivateLinkResource has a new optional parameter requiredZoneNames - - Interface Snapshot has a new optional parameter provisioningState - - Interface Snapshot has a new optional parameter sourceVolumeSizeGiB - - Interface Snapshot has a new optional parameter volumeName - - Interface Volume has a new optional parameter creationData - - Interface Volume has a new optional parameter managedBy - - Interface Volume has a new optional parameter provisioningState - - Interface Volume has a new optional parameter storageTarget - - Interface Volume has a new optional parameter volumeId - - Interface VolumeGroup has a new optional parameter encryption - - Interface VolumeGroup has a new optional parameter encryptionProperties - - Interface VolumeGroup has a new optional parameter enforceDataIntegrityCheckForIscsi - - Interface VolumeGroup has a new optional parameter networkAcls - - Interface VolumeGroup has a new optional parameter privateEndpointConnections - - Interface VolumeGroup has a new optional parameter protocolType - - Interface VolumeGroup has a new optional parameter provisioningState - - Interface VolumeGroupUpdate has a new optional parameter encryption - - Interface VolumeGroupUpdate has a new optional parameter encryptionProperties - - Interface VolumeGroupUpdate has a new optional parameter enforceDataIntegrityCheckForIscsi - - Interface VolumeGroupUpdate has a new optional parameter networkAcls - - Interface VolumeGroupUpdate has a new optional parameter protocolType - - Interface VolumeUpdate has a new optional parameter managedBy - - Interface VolumeUpdate has a new optional parameter sizeGiB - Added Type Alias AutoScalePolicyEnforcement - Added Type Alias AzureSupportedClouds - Added Enum AzureClouds @@ -86,41 +44,11 @@ - Enum KnownProvisioningStates has a new value Restoring ### Breaking Changes - - Operation ElasticSans.beginCreate has a new signature - - Operation ElasticSans.beginCreateAndWait has a new signature - - Operation ElasticSans.beginUpdateAndWait has a new signature - - Operation ElasticSans.get has a new signature - - Operation PrivateEndpointConnections.beginCreate has a new signature - - Operation PrivateEndpointConnections.beginCreateAndWait has a new signature - - Operation PrivateEndpointConnections.get has a new signature - - Operation Volumes.beginCreate has a new signature - - Operation Volumes.beginCreateAndWait has a new signature - - Operation Volumes.beginUpdate has a new signature - - Operation Volumes.beginUpdateAndWait has a new signature - - Operation Volumes.get has a new signature - - Operation VolumeSnapshots.beginCreate has a new signature - - Operation VolumeSnapshots.beginCreateAndWait has a new signature - - Operation VolumeSnapshots.get has a new signature - Removed Interface ElasticSanList - Removed Interface SkuInformationList - Removed Interface SnapshotList - Removed Interface VolumeGroupList - Removed Interface VolumeList - - Interface ElasticSan has a new required parameter baseSizeTiB - - Interface ElasticSan has a new required parameter extendedCapacitySizeTiB - - Interface ElasticSan has a new required parameter sku - - Interface PrivateEndpointConnection has a new required parameter privateLinkServiceConnectionState - - Interface Snapshot has a new required parameter creationData - - Interface Volume has a new required parameter sizeGiB - - Interface ElasticSan no longer has parameter properties - - Interface ElasticSanUpdate no longer has parameter properties - - Interface PrivateEndpointConnection no longer has parameter properties - - Interface PrivateLinkResource no longer has parameter properties - - Interface Snapshot no longer has parameter properties - - Interface Volume no longer has parameter properties - - Interface VolumeGroup no longer has parameter properties - - Interface VolumeGroupUpdate no longer has parameter properties - - Interface VolumeUpdate no longer has parameter properties - Parameter value of interface PrivateLinkResourceListResult is now required diff --git a/sdk/elasticsans/arm-elasticsan/metadata.json b/sdk/elasticsans/arm-elasticsan/metadata.json index 5deb2d01b43d..c0b70eba9d45 100644 --- a/sdk/elasticsans/arm-elasticsan/metadata.json +++ b/sdk/elasticsans/arm-elasticsan/metadata.json @@ -1,6 +1,6 @@ { "apiVersion": "2025-09-01", - "emitterVersion": "0.49.0", + "emitterVersion": "0.49.1", "crossLanguageDefinitions": { "CrossLanguagePackageId": "Microsoft.ElasticSan", "CrossLanguageDefinitionId": { diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md index 70a7e1fc07a7..106fea2202b8 100644 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-models-node.api.md @@ -28,19 +28,7 @@ export interface DiskSnapshotList { // @public export interface ElasticSan extends TrackedResource { - autoScaleProperties?: AutoScaleProperties; - availabilityZones?: string[]; - baseSizeTiB: number; - extendedCapacitySizeTiB: number; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - readonly provisioningState?: ProvisioningStates; - publicNetworkAccess?: PublicNetworkAccess; - sku: Sku; - readonly totalIops?: number; - readonly totalMBps?: number; - readonly totalSizeTiB?: number; - readonly totalVolumeSizeGiB?: number; - readonly volumeGroupCount?: number; + properties: ElasticSanProperties; } // @public @@ -62,10 +50,7 @@ export interface ElasticSanProperties { // @public export interface ElasticSanUpdate { - autoScaleProperties?: AutoScaleProperties; - baseSizeTiB?: number; - extendedCapacitySizeTiB?: number; - publicNetworkAccess?: PublicNetworkAccess; + properties?: ElasticSanUpdateProperties; tags?: Record; } @@ -314,10 +299,7 @@ export interface PrivateEndpoint { // @public export interface PrivateEndpointConnection extends ProxyResource { - groupIds?: string[]; - privateEndpoint?: PrivateEndpoint; - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; - readonly provisioningState?: ProvisioningStates; + properties: PrivateEndpointConnectionProperties; } // @public @@ -333,9 +315,7 @@ export type PrivateEndpointServiceConnectionStatus = string; // @public export interface PrivateLinkResource extends Resource { - readonly groupId?: string; - readonly requiredMembers?: string[]; - requiredZoneNames?: string[]; + properties?: PrivateLinkResourceProperties; } // @public @@ -420,10 +400,7 @@ export type SkuTier = string; // @public export interface Snapshot extends ProxyResource { - creationData: SnapshotCreationData; - readonly provisioningState?: ProvisioningStates; - readonly sourceVolumeSizeGiB?: number; - readonly volumeName?: string; + properties: SnapshotProperties; } // @public @@ -478,12 +455,7 @@ export interface VirtualNetworkRule { // @public export interface Volume extends ProxyResource { - creationData?: SourceCreationData; - managedBy?: ManagedByInfo; - readonly provisioningState?: ProvisioningStates; - sizeGiB: number; - readonly storageTarget?: IscsiTargetInfo; - readonly volumeId?: string; + properties: VolumeProperties; } // @public @@ -491,14 +463,8 @@ export type VolumeCreateOption = string; // @public export interface VolumeGroup extends ProxyResource { - encryption?: EncryptionType; - encryptionProperties?: EncryptionProperties; - enforceDataIntegrityCheckForIscsi?: boolean; identity?: Identity; - networkAcls?: NetworkRuleSet; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - protocolType?: StorageTargetType; - readonly provisioningState?: ProvisioningStates; + properties?: VolumeGroupProperties; } // @public @@ -514,12 +480,8 @@ export interface VolumeGroupProperties { // @public export interface VolumeGroupUpdate { - encryption?: EncryptionType; - encryptionProperties?: EncryptionProperties; - enforceDataIntegrityCheckForIscsi?: boolean; identity?: Identity; - networkAcls?: NetworkRuleSet; - protocolType?: StorageTargetType; + properties?: VolumeGroupUpdateProperties; } // @public @@ -548,8 +510,7 @@ export interface VolumeProperties { // @public export interface VolumeUpdate { - managedBy?: ManagedByInfo; - sizeGiB?: number; + properties?: VolumeUpdateProperties; } // @public diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md index bcfc1b695c9a..b77d9ad04f03 100644 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan-node.api.md @@ -53,19 +53,7 @@ export interface DiskSnapshotList { // @public export interface ElasticSan extends TrackedResource { - autoScaleProperties?: AutoScaleProperties; - availabilityZones?: string[]; - baseSizeTiB: number; - extendedCapacitySizeTiB: number; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - readonly provisioningState?: ProvisioningStates; - publicNetworkAccess?: PublicNetworkAccess; - sku: Sku; - readonly totalIops?: number; - readonly totalMBps?: number; - readonly totalSizeTiB?: number; - readonly totalVolumeSizeGiB?: number; - readonly volumeGroupCount?: number; + properties: ElasticSanProperties; } // @public (undocumented) @@ -156,10 +144,7 @@ export interface ElasticSansUpdateOptionalParams extends OperationOptions { // @public export interface ElasticSanUpdate { - autoScaleProperties?: AutoScaleProperties; - baseSizeTiB?: number; - extendedCapacitySizeTiB?: number; - publicNetworkAccess?: PublicNetworkAccess; + properties?: ElasticSanUpdateProperties; tags?: Record; } @@ -429,10 +414,7 @@ export interface PrivateEndpoint { // @public export interface PrivateEndpointConnection extends ProxyResource { - groupIds?: string[]; - privateEndpoint?: PrivateEndpoint; - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; - readonly provisioningState?: ProvisioningStates; + properties: PrivateEndpointConnectionProperties; } // @public @@ -482,9 +464,7 @@ export type PrivateEndpointServiceConnectionStatus = string; // @public export interface PrivateLinkResource extends Resource { - readonly groupId?: string; - readonly requiredMembers?: string[]; - requiredZoneNames?: string[]; + properties?: PrivateLinkResourceProperties; } // @public @@ -620,10 +600,7 @@ export type SkuTier = string; // @public export interface Snapshot extends ProxyResource { - creationData: SnapshotCreationData; - readonly provisioningState?: ProvisioningStates; - readonly sourceVolumeSizeGiB?: number; - readonly volumeName?: string; + properties: SnapshotProperties; } // @public @@ -678,12 +655,7 @@ export interface VirtualNetworkRule { // @public export interface Volume extends ProxyResource { - creationData?: SourceCreationData; - managedBy?: ManagedByInfo; - readonly provisioningState?: ProvisioningStates; - sizeGiB: number; - readonly storageTarget?: IscsiTargetInfo; - readonly volumeId?: string; + properties: VolumeProperties; } // @public @@ -691,14 +663,8 @@ export type VolumeCreateOption = string; // @public export interface VolumeGroup extends ProxyResource { - encryption?: EncryptionType; - encryptionProperties?: EncryptionProperties; - enforceDataIntegrityCheckForIscsi?: boolean; identity?: Identity; - networkAcls?: NetworkRuleSet; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - protocolType?: StorageTargetType; - readonly provisioningState?: ProvisioningStates; + properties?: VolumeGroupProperties; } // @public @@ -758,12 +724,8 @@ export interface VolumeGroupsUpdateOptionalParams extends OperationOptions { // @public export interface VolumeGroupUpdate { - encryption?: EncryptionType; - encryptionProperties?: EncryptionProperties; - enforceDataIntegrityCheckForIscsi?: boolean; identity?: Identity; - networkAcls?: NetworkRuleSet; - protocolType?: StorageTargetType; + properties?: VolumeGroupUpdateProperties; } // @public @@ -893,8 +855,7 @@ export interface VolumesUpdateOptionalParams extends OperationOptions { // @public export interface VolumeUpdate { - managedBy?: ManagedByInfo; - sizeGiB?: number; + properties?: VolumeUpdateProperties; } // @public diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts index 13cbfb8a29c0..67335063b788 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansCreateSample.ts @@ -16,19 +16,21 @@ async function elasticSansCreateMaximumSetGen(): Promise { const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { location: "France Central", - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, }, + availabilityZones: ["1"], + baseSizeTiB: 5, + extendedCapacitySizeTiB: 25, + publicNetworkAccess: "Enabled", + sku: { name: "Premium_LRS", tier: "Premium" }, }, - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, tags: { key9316: "ihndtieqibtob" }, }); console.log(result); @@ -46,9 +48,7 @@ async function elasticSansCreateMinimumSetGen(): Promise { const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { location: "France Central", - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, + properties: { baseSizeTiB: 15, extendedCapacitySizeTiB: 27, sku: { name: "Premium_LRS" } }, }); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts index d5982b896791..084de695151d 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/elasticSansUpdateSample.ts @@ -15,17 +15,19 @@ async function elasticSansUpdateMaximumSetGen(): Promise { const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, }); console.log(result); diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts index a3add2ffff07..6fd03552435e 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/privateEndpointConnectionsCreateSample.ts @@ -19,12 +19,14 @@ async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { "elasticsanname", "privateendpointconnectionname", { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", + properties: { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, }, }, ); @@ -45,7 +47,7 @@ async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { "resourcegroupname", "elasticsanname", "privateendpointconnectionname", - { privateLinkServiceConnectionState: {} }, + { properties: { privateLinkServiceConnectionState: {} } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts index d9996d788fb6..c1398e7a49cc 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsCreateSample.ts @@ -20,20 +20,22 @@ async function volumeGroupsCreateMaximumSetGen(): Promise { "volumegroupname", { identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", }, ); console.log(result); diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts index 2b1eb21298d2..e8da78a56733 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeGroupsUpdateSample.ts @@ -20,20 +20,22 @@ async function volumeGroupsUpdateMaximumSetGen(): Promise { "volumegroupname", { identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", }, ); console.log(result); diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts index 2c538ba186d0..35de4b6c63f4 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumeSnapshotsCreateSample.ts @@ -20,9 +20,11 @@ async function volumeSnapshotsCreateMaximumSetGen(): Promise { "volumegroupname", "snapshotname", { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, }, }, ); @@ -45,9 +47,11 @@ async function volumeSnapshotsCreateMinimumSetGen(): Promise { "volumegroupname", "snapshotname", { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, }, }, ); diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts index f8762a82329a..df22ebd67cee 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesCreateSample.ts @@ -20,9 +20,11 @@ async function volumesCreateMaximumSetGen(): Promise { "volumegroupname", "volumename", { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, + properties: { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, }, ); console.log(result); @@ -43,7 +45,7 @@ async function volumesCreateMinimumSetGen(): Promise { "elasticsanname", "volumegroupname", "volumename", - { sizeGiB: 9 }, + { properties: { sizeGiB: 9 } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts index a9d8ca0d4380..9790606ddbfb 100644 --- a/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples-dev/volumesUpdateSample.ts @@ -19,7 +19,7 @@ async function volumesUpdateMaximumSetGen(): Promise { "elasticsanname", "volumegroupname", "volumename", - { managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 7 }, + { properties: { managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 7 } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js index 06fd3ab41965..f2b4ef9560e5 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansCreateSample.js @@ -16,19 +16,21 @@ async function elasticSansCreateMaximumSetGen() { const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { location: "France Central", - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, }, + availabilityZones: ["1"], + baseSizeTiB: 5, + extendedCapacitySizeTiB: 25, + publicNetworkAccess: "Enabled", + sku: { name: "Premium_LRS", tier: "Premium" }, }, - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, tags: { key9316: "ihndtieqibtob" }, }); console.log(result); @@ -46,9 +48,7 @@ async function elasticSansCreateMinimumSetGen() { const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { location: "France Central", - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, + properties: { baseSizeTiB: 15, extendedCapacitySizeTiB: 27, sku: { name: "Premium_LRS" } }, }); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js index 0be02ba6db84..4ada1c52889d 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/elasticSansUpdateSample.js @@ -15,17 +15,19 @@ async function elasticSansUpdateMaximumSetGen() { const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, }); console.log(result); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js index 7f5dc4e44e06..01924887ee54 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/privateEndpointConnectionsCreateSample.js @@ -19,12 +19,14 @@ async function privateEndpointConnectionsCreateMaximumSetGen() { "elasticsanname", "privateendpointconnectionname", { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", + properties: { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, }, }, ); @@ -45,7 +47,7 @@ async function privateEndpointConnectionsCreateMinimumSetGen() { "resourcegroupname", "elasticsanname", "privateendpointconnectionname", - { privateLinkServiceConnectionState: {} }, + { properties: { privateLinkServiceConnectionState: {} } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js index 8ab159f81be0..9c1b1de893f0 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsCreateSample.js @@ -20,20 +20,22 @@ async function volumeGroupsCreateMaximumSetGen() { "volumegroupname", { identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", }, ); console.log(result); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js index acf8ee768653..89380acfee0a 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeGroupsUpdateSample.js @@ -20,20 +20,22 @@ async function volumeGroupsUpdateMaximumSetGen() { "volumegroupname", { identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", }, ); console.log(result); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js index 82cb28a45d41..fd3b55af627f 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumeSnapshotsCreateSample.js @@ -20,9 +20,11 @@ async function volumeSnapshotsCreateMaximumSetGen() { "volumegroupname", "snapshotname", { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, }, }, ); @@ -45,9 +47,11 @@ async function volumeSnapshotsCreateMinimumSetGen() { "volumegroupname", "snapshotname", { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, }, }, ); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js index deaffff97f05..7122c688916f 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesCreateSample.js @@ -20,9 +20,11 @@ async function volumesCreateMaximumSetGen() { "volumegroupname", "volumename", { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, + properties: { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, }, ); console.log(result); @@ -43,7 +45,7 @@ async function volumesCreateMinimumSetGen() { "elasticsanname", "volumegroupname", "volumename", - { sizeGiB: 9 }, + { properties: { sizeGiB: 9 } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js index 487c6bc3e4f6..28c58b8b61b9 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/javascript/volumesUpdateSample.js @@ -19,7 +19,7 @@ async function volumesUpdateMaximumSetGen() { "elasticsanname", "volumegroupname", "volumename", - { managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 7 }, + { properties: { managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 7 } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts index 13cbfb8a29c0..67335063b788 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansCreateSample.ts @@ -16,19 +16,21 @@ async function elasticSansCreateMaximumSetGen(): Promise { const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { location: "France Central", - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, }, + availabilityZones: ["1"], + baseSizeTiB: 5, + extendedCapacitySizeTiB: 25, + publicNetworkAccess: "Enabled", + sku: { name: "Premium_LRS", tier: "Premium" }, }, - availabilityZones: ["1"], - baseSizeTiB: 5, - extendedCapacitySizeTiB: 25, - publicNetworkAccess: "Enabled", - sku: { name: "Premium_LRS", tier: "Premium" }, tags: { key9316: "ihndtieqibtob" }, }); console.log(result); @@ -46,9 +48,7 @@ async function elasticSansCreateMinimumSetGen(): Promise { const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.elasticSans.create("resourcegroupname", "elasticsanname", { location: "France Central", - baseSizeTiB: 15, - extendedCapacitySizeTiB: 27, - sku: { name: "Premium_LRS" }, + properties: { baseSizeTiB: 15, extendedCapacitySizeTiB: 27, sku: { name: "Premium_LRS" } }, }); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts index d5982b896791..084de695151d 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/elasticSansUpdateSample.ts @@ -15,17 +15,19 @@ async function elasticSansUpdateMaximumSetGen(): Promise { const subscriptionId = "subscriptionid"; const client = new ElasticSanManagement(credential, subscriptionId); const result = await client.elasticSans.update("resourcegroupname", "elasticsanname", { - autoScaleProperties: { - scaleUpProperties: { - autoScalePolicyEnforcement: "None", - capacityUnitScaleUpLimitTiB: 17, - increaseCapacityUnitByTiB: 4, - unusedSizeTiB: 24, + properties: { + autoScaleProperties: { + scaleUpProperties: { + autoScalePolicyEnforcement: "None", + capacityUnitScaleUpLimitTiB: 17, + increaseCapacityUnitByTiB: 4, + unusedSizeTiB: 24, + }, }, + baseSizeTiB: 13, + extendedCapacitySizeTiB: 29, + publicNetworkAccess: "Enabled", }, - baseSizeTiB: 13, - extendedCapacitySizeTiB: 29, - publicNetworkAccess: "Enabled", tags: { key1931: "yhjwkgmrrwrcoxblgwgzjqusch" }, }); console.log(result); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts index a3add2ffff07..6fd03552435e 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/privateEndpointConnectionsCreateSample.ts @@ -19,12 +19,14 @@ async function privateEndpointConnectionsCreateMaximumSetGen(): Promise { "elasticsanname", "privateendpointconnectionname", { - groupIds: ["jdwrzpemdjrpiwzvy"], - privateEndpoint: {}, - privateLinkServiceConnectionState: { - description: "dxl", - actionsRequired: "jhjdpwvyzipggtn", - status: "Pending", + properties: { + groupIds: ["jdwrzpemdjrpiwzvy"], + privateEndpoint: {}, + privateLinkServiceConnectionState: { + description: "dxl", + actionsRequired: "jhjdpwvyzipggtn", + status: "Pending", + }, }, }, ); @@ -45,7 +47,7 @@ async function privateEndpointConnectionsCreateMinimumSetGen(): Promise { "resourcegroupname", "elasticsanname", "privateendpointconnectionname", - { privateLinkServiceConnectionState: {} }, + { properties: { privateLinkServiceConnectionState: {} } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts index d9996d788fb6..c1398e7a49cc 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsCreateSample.ts @@ -20,20 +20,22 @@ async function volumeGroupsCreateMaximumSetGen(): Promise { "volumegroupname", { identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", }, ); console.log(result); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts index 2b1eb21298d2..e8da78a56733 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeGroupsUpdateSample.ts @@ -20,20 +20,22 @@ async function volumeGroupsUpdateMaximumSetGen(): Promise { "volumegroupname", { identity: { type: "None", userAssignedIdentities: { key2350: {} } }, - encryption: "EncryptionAtRestWithPlatformKey", - encryptionProperties: { - encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, - keyVaultProperties: { - keyName: "rommjwp", - keyVaultUri: "https://microsoft.com/at", - keyVersion: "ulmxxgzgsuhalwesmhfslq", + properties: { + encryption: "EncryptionAtRestWithPlatformKey", + encryptionProperties: { + encryptionIdentity: { encryptionUserAssignedIdentity: "vgbeephfgecgg" }, + keyVaultProperties: { + keyName: "rommjwp", + keyVaultUri: "https://microsoft.com/at", + keyVersion: "ulmxxgzgsuhalwesmhfslq", + }, }, + enforceDataIntegrityCheckForIscsi: true, + networkAcls: { + virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], + }, + protocolType: "Iscsi", }, - enforceDataIntegrityCheckForIscsi: true, - networkAcls: { - virtualNetworkRules: [{ action: "Allow", virtualNetworkResourceId: "fhhawhc" }], - }, - protocolType: "Iscsi", }, ); console.log(result); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts index 2c538ba186d0..35de4b6c63f4 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumeSnapshotsCreateSample.ts @@ -20,9 +20,11 @@ async function volumeSnapshotsCreateMaximumSetGen(): Promise { "volumegroupname", "snapshotname", { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, }, }, ); @@ -45,9 +47,11 @@ async function volumeSnapshotsCreateMinimumSetGen(): Promise { "volumegroupname", "snapshotname", { - creationData: { - sourceId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + properties: { + creationData: { + sourceId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + }, }, }, ); diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts index f8762a82329a..df22ebd67cee 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesCreateSample.ts @@ -20,9 +20,11 @@ async function volumesCreateMaximumSetGen(): Promise { "volumegroupname", "volumename", { - creationData: { createSource: "None", sourceId: "mdonegivjquite" }, - managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, - sizeGiB: 23, + properties: { + creationData: { createSource: "None", sourceId: "mdonegivjquite" }, + managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, + sizeGiB: 23, + }, }, ); console.log(result); @@ -43,7 +45,7 @@ async function volumesCreateMinimumSetGen(): Promise { "elasticsanname", "volumegroupname", "volumename", - { sizeGiB: 9 }, + { properties: { sizeGiB: 9 } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts index a9d8ca0d4380..9790606ddbfb 100644 --- a/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts +++ b/sdk/elasticsans/arm-elasticsan/samples/v2/typescript/src/volumesUpdateSample.ts @@ -19,7 +19,7 @@ async function volumesUpdateMaximumSetGen(): Promise { "elasticsanname", "volumegroupname", "volumename", - { managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 7 }, + { properties: { managedBy: { resourceId: "pclpkrpkpmvcsegcubrakcoodrubo" }, sizeGiB: 7 } }, ); console.log(result); } diff --git a/sdk/elasticsans/arm-elasticsan/src/models/models.ts b/sdk/elasticsans/arm-elasticsan/src/models/models.ts index 6f3a1314aa66..f8dfaa69681e 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/models.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/models.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { areAllPropsUndefined } from "../static-helpers/serialization/check-prop-undefined.js"; - /** * This file contains only generated model types and their (de)serializers. * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input. @@ -178,39 +176,15 @@ export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo /** Response for ElasticSan request. */ export interface ElasticSan extends TrackedResource { - /** resource sku */ - sku: Sku; - /** Logical zone for Elastic San resource; example: ["1"]. */ - availabilityZones?: string[]; - /** State of the operation on the resource. */ - readonly provisioningState?: ProvisioningStates; - /** Base size of the Elastic San appliance in TiB. */ - baseSizeTiB: number; - /** Extended size of the Elastic San appliance in TiB. */ - extendedCapacitySizeTiB: number; - /** Total size of the provisioned Volumes in GiB. */ - readonly totalVolumeSizeGiB?: number; - /** Total number of volume groups in this Elastic San appliance. */ - readonly volumeGroupCount?: number; - /** Total Provisioned IOPS of the Elastic San appliance. */ - readonly totalIops?: number; - /** Total Provisioned MBps Elastic San appliance. */ - readonly totalMBps?: number; - /** Total size of the Elastic San appliance in TB. */ - readonly totalSizeTiB?: number; - /** The list of Private Endpoint Connections. */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Auto Scale Properties for Elastic San Appliance. */ - autoScaleProperties?: AutoScaleProperties; + /** Properties of ElasticSan. */ + properties: ElasticSanProperties; } export function elasticSanSerializer(item: ElasticSan): any { return { tags: item["tags"], location: item["location"], - properties: _elasticSanPropertiesSerializer(item), + properties: elasticSanPropertiesSerializer(item["properties"]), }; } @@ -226,7 +200,7 @@ export function elasticSanDeserializer(item: any): ElasticSan { systemData: !item["systemData"] ? item["systemData"] : systemDataDeserializer(item["systemData"]), - ..._elasticSanPropertiesDeserializer(item["properties"]), + properties: elasticSanPropertiesDeserializer(item["properties"]), }; } @@ -415,18 +389,12 @@ export function privateEndpointConnectionArrayDeserializer( /** Response for PrivateEndpoint Connection object */ export interface PrivateEndpointConnection extends ProxyResource { - /** Provisioning State of Private Endpoint connection resource */ - readonly provisioningState?: ProvisioningStates; - /** Private Endpoint resource */ - privateEndpoint?: PrivateEndpoint; - /** Private Link Service Connection State. */ - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; - /** List of resources private endpoint is mapped */ - groupIds?: string[]; + /** Private Endpoint Connection Properties. */ + properties: PrivateEndpointConnectionProperties; } export function privateEndpointConnectionSerializer(item: PrivateEndpointConnection): any { - return { properties: _privateEndpointConnectionPropertiesSerializer(item) }; + return { properties: privateEndpointConnectionPropertiesSerializer(item["properties"]) }; } export function privateEndpointConnectionDeserializer(item: any): PrivateEndpointConnection { @@ -437,7 +405,7 @@ export function privateEndpointConnectionDeserializer(item: any): PrivateEndpoin systemData: !item["systemData"] ? item["systemData"] : systemDataDeserializer(item["systemData"]), - ..._privateEndpointConnectionPropertiesDeserializer(item["properties"]), + properties: privateEndpointConnectionPropertiesDeserializer(item["properties"]), }; } @@ -778,28 +746,17 @@ export function trackedResourceDeserializer(item: any): TrackedResource { /** Response for ElasticSan update request. */ export interface ElasticSanUpdate { + /** Properties of ElasticSan. */ + properties?: ElasticSanUpdateProperties; /** Update tags */ tags?: Record; - /** Base size of the Elastic San appliance in TiB. */ - baseSizeTiB?: number; - /** Extended size of the Elastic San appliance in TiB. */ - extendedCapacitySizeTiB?: number; - /** Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Auto Scale Properties for Elastic San Appliance. */ - autoScaleProperties?: AutoScaleProperties; } export function elasticSanUpdateSerializer(item: ElasticSanUpdate): any { return { - properties: areAllPropsUndefined(item, [ - "baseSizeTiB", - "extendedCapacitySizeTiB", - "publicNetworkAccess", - "autoScaleProperties", - ]) - ? undefined - : _elasticSanUpdatePropertiesSerializer(item), + properties: !item["properties"] + ? item["properties"] + : elasticSanUpdatePropertiesSerializer(item["properties"]), tags: item["tags"], }; } @@ -873,22 +830,12 @@ export function _privateEndpointConnectionListResultDeserializer( /** Response for Volume request. */ export interface Volume extends ProxyResource { - /** Unique Id of the volume in GUID format */ - readonly volumeId?: string; - /** State of the operation on the resource. */ - creationData?: SourceCreationData; - /** Volume size. */ - sizeGiB: number; - /** Storage target information */ - readonly storageTarget?: IscsiTargetInfo; - /** Parent resource information. */ - managedBy?: ManagedByInfo; - /** State of the operation on the resource. */ - readonly provisioningState?: ProvisioningStates; + /** Properties of Volume. */ + properties: VolumeProperties; } export function volumeSerializer(item: Volume): any { - return { properties: _volumePropertiesSerializer(item) }; + return { properties: volumePropertiesSerializer(item["properties"]) }; } export function volumeDeserializer(item: any): Volume { @@ -899,7 +846,7 @@ export function volumeDeserializer(item: any): Volume { systemData: !item["systemData"] ? item["systemData"] : systemDataDeserializer(item["systemData"]), - ..._volumePropertiesDeserializer(item["properties"]), + properties: volumePropertiesDeserializer(item["properties"]), }; } @@ -1070,17 +1017,15 @@ export function managedByInfoDeserializer(item: any): ManagedByInfo { /** Response for Volume request. */ export interface VolumeUpdate { - /** Volume size. */ - sizeGiB?: number; - /** Parent resource information. */ - managedBy?: ManagedByInfo; + /** Properties of Volume. */ + properties?: VolumeUpdateProperties; } export function volumeUpdateSerializer(item: VolumeUpdate): any { return { - properties: areAllPropsUndefined(item, ["sizeGiB", "managedBy"]) - ? undefined - : _volumeUpdatePropertiesSerializer(item), + properties: !item["properties"] + ? item["properties"] + : volumeUpdatePropertiesSerializer(item["properties"]), }; } @@ -1170,34 +1115,16 @@ export function diskSnapshotListSerializer(item: DiskSnapshotList): any { export interface VolumeGroup extends ProxyResource { /** The identity of the resource. */ identity?: Identity; - /** State of the operation on the resource. */ - readonly provisioningState?: ProvisioningStates; - /** Type of storage target */ - protocolType?: StorageTargetType; - /** Type of encryption */ - encryption?: EncryptionType; - /** Encryption Properties describing Key Vault and Identity information */ - encryptionProperties?: EncryptionProperties; - /** A collection of rules governing the accessibility from specific network locations. */ - networkAcls?: NetworkRuleSet; - /** The list of Private Endpoint Connections. */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** A boolean indicating whether or not Data Integrity Check is enabled */ - enforceDataIntegrityCheckForIscsi?: boolean; + /** Properties of VolumeGroup. */ + properties?: VolumeGroupProperties; } export function volumeGroupSerializer(item: VolumeGroup): any { return { identity: !item["identity"] ? item["identity"] : identitySerializer(item["identity"]), - properties: areAllPropsUndefined(item, [ - "protocolType", - "encryption", - "encryptionProperties", - "networkAcls", - "enforceDataIntegrityCheckForIscsi", - ]) - ? undefined - : _volumeGroupPropertiesSerializer(item), + properties: !item["properties"] + ? item["properties"] + : volumeGroupPropertiesSerializer(item["properties"]), }; } @@ -1210,9 +1137,9 @@ export function volumeGroupDeserializer(item: any): VolumeGroup { ? item["systemData"] : systemDataDeserializer(item["systemData"]), identity: !item["identity"] ? item["identity"] : identityDeserializer(item["identity"]), - ...(!item["properties"] + properties: !item["properties"] ? item["properties"] - : _volumeGroupPropertiesDeserializer(item["properties"])), + : volumeGroupPropertiesDeserializer(item["properties"]), }; } @@ -1551,30 +1478,16 @@ export type Action = string; export interface VolumeGroupUpdate { /** The identity of the resource. */ identity?: Identity; - /** Type of storage target */ - protocolType?: StorageTargetType; - /** Type of encryption */ - encryption?: EncryptionType; - /** Encryption Properties describing Key Vault and Identity information */ - encryptionProperties?: EncryptionProperties; - /** A collection of rules governing the accessibility from specific network locations. */ - networkAcls?: NetworkRuleSet; - /** A boolean indicating whether or not Data Integrity Check is enabled */ - enforceDataIntegrityCheckForIscsi?: boolean; + /** Properties of VolumeGroup. */ + properties?: VolumeGroupUpdateProperties; } export function volumeGroupUpdateSerializer(item: VolumeGroupUpdate): any { return { identity: !item["identity"] ? item["identity"] : identitySerializer(item["identity"]), - properties: areAllPropsUndefined(item, [ - "protocolType", - "encryption", - "encryptionProperties", - "networkAcls", - "enforceDataIntegrityCheckForIscsi", - ]) - ? undefined - : _volumeGroupUpdatePropertiesSerializer(item), + properties: !item["properties"] + ? item["properties"] + : volumeGroupUpdatePropertiesSerializer(item["properties"]), }; } @@ -1658,12 +1571,8 @@ export function privateLinkResourceArrayDeserializer(result: Array { - return p; - }), - }; -} - -export function _privateEndpointConnectionPropertiesDeserializer(item: any) { - return { - provisioningState: item["provisioningState"], - privateEndpoint: !item["privateEndpoint"] - ? item["privateEndpoint"] - : privateEndpointDeserializer(item["privateEndpoint"]), - privateLinkServiceConnectionState: privateLinkServiceConnectionStateDeserializer( - item["privateLinkServiceConnectionState"], - ), - groupIds: !item["groupIds"] - ? item["groupIds"] - : item["groupIds"].map((p: any) => { - return p; - }), - }; -} - -export function _elasticSanPropertiesSerializer(item: ElasticSan): any { - return { - sku: skuSerializer(item["sku"]), - availabilityZones: !item["availabilityZones"] - ? item["availabilityZones"] - : item["availabilityZones"].map((p: any) => { - return p; - }), - baseSizeTiB: item["baseSizeTiB"], - extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], - publicNetworkAccess: item["publicNetworkAccess"], - autoScaleProperties: !item["autoScaleProperties"] - ? item["autoScaleProperties"] - : autoScalePropertiesSerializer(item["autoScaleProperties"]), - }; -} - -export function _elasticSanPropertiesDeserializer(item: any) { - return { - sku: skuDeserializer(item["sku"]), - availabilityZones: !item["availabilityZones"] - ? item["availabilityZones"] - : item["availabilityZones"].map((p: any) => { - return p; - }), - provisioningState: item["provisioningState"], - baseSizeTiB: item["baseSizeTiB"], - extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], - totalVolumeSizeGiB: item["totalVolumeSizeGiB"], - volumeGroupCount: item["volumeGroupCount"], - totalIops: item["totalIops"], - totalMBps: item["totalMBps"], - totalSizeTiB: item["totalSizeTiB"], - privateEndpointConnections: !item["privateEndpointConnections"] - ? item["privateEndpointConnections"] - : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), - publicNetworkAccess: item["publicNetworkAccess"], - autoScaleProperties: !item["autoScaleProperties"] - ? item["autoScaleProperties"] - : autoScalePropertiesDeserializer(item["autoScaleProperties"]), - }; -} - -export function _elasticSanUpdatePropertiesSerializer(item: ElasticSanUpdate): any { - return { - baseSizeTiB: item["baseSizeTiB"], - extendedCapacitySizeTiB: item["extendedCapacitySizeTiB"], - publicNetworkAccess: item["publicNetworkAccess"], - autoScaleProperties: !item["autoScaleProperties"] - ? item["autoScaleProperties"] - : autoScalePropertiesSerializer(item["autoScaleProperties"]), - }; -} - -export function _volumePropertiesSerializer(item: Volume): any { - return { - creationData: !item["creationData"] - ? item["creationData"] - : sourceCreationDataSerializer(item["creationData"]), - sizeGiB: item["sizeGiB"], - managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), - }; -} - -export function _volumePropertiesDeserializer(item: any) { - return { - volumeId: item["volumeId"], - creationData: !item["creationData"] - ? item["creationData"] - : sourceCreationDataDeserializer(item["creationData"]), - sizeGiB: item["sizeGiB"], - storageTarget: !item["storageTarget"] - ? item["storageTarget"] - : iscsiTargetInfoDeserializer(item["storageTarget"]), - managedBy: !item["managedBy"] - ? item["managedBy"] - : managedByInfoDeserializer(item["managedBy"]), - provisioningState: item["provisioningState"], - }; -} - -export function _volumeUpdatePropertiesSerializer(item: VolumeUpdate): any { - return { - sizeGiB: item["sizeGiB"], - managedBy: !item["managedBy"] ? item["managedBy"] : managedByInfoSerializer(item["managedBy"]), - }; -} - -export function _volumeGroupPropertiesSerializer(item: VolumeGroup): any { - return { - protocolType: item["protocolType"], - encryption: item["encryption"], - encryptionProperties: !item["encryptionProperties"] - ? item["encryptionProperties"] - : encryptionPropertiesSerializer(item["encryptionProperties"]), - networkAcls: !item["networkAcls"] - ? item["networkAcls"] - : networkRuleSetSerializer(item["networkAcls"]), - enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], - }; -} - -export function _volumeGroupPropertiesDeserializer(item: any) { - return { - provisioningState: item["provisioningState"], - protocolType: item["protocolType"], - encryption: item["encryption"], - encryptionProperties: !item["encryptionProperties"] - ? item["encryptionProperties"] - : encryptionPropertiesDeserializer(item["encryptionProperties"]), - networkAcls: !item["networkAcls"] - ? item["networkAcls"] - : networkRuleSetDeserializer(item["networkAcls"]), - privateEndpointConnections: !item["privateEndpointConnections"] - ? item["privateEndpointConnections"] - : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), - enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], - }; -} - -export function _volumeGroupUpdatePropertiesSerializer(item: VolumeGroupUpdate): any { - return { - protocolType: item["protocolType"], - encryption: item["encryption"], - encryptionProperties: !item["encryptionProperties"] - ? item["encryptionProperties"] - : encryptionPropertiesSerializer(item["encryptionProperties"]), - networkAcls: !item["networkAcls"] - ? item["networkAcls"] - : networkRuleSetSerializer(item["networkAcls"]), - enforceDataIntegrityCheckForIscsi: item["enforceDataIntegrityCheckForIscsi"], - }; -} - -export function _privateLinkResourcePropertiesDeserializer(item: any) { - return { - groupId: item["groupId"], - requiredMembers: !item["requiredMembers"] - ? item["requiredMembers"] - : item["requiredMembers"].map((p: any) => { - return p; - }), - requiredZoneNames: !item["requiredZoneNames"] - ? item["requiredZoneNames"] - : item["requiredZoneNames"].map((p: any) => { - return p; - }), - }; -} - -export function _snapshotPropertiesSerializer(item: Snapshot): any { - return { creationData: snapshotCreationDataSerializer(item["creationData"]) }; -} - -export function _snapshotPropertiesDeserializer(item: any) { - return { - creationData: snapshotCreationDataDeserializer(item["creationData"]), - provisioningState: item["provisioningState"], - sourceVolumeSizeGiB: item["sourceVolumeSizeGiB"], - volumeName: item["volumeName"], - }; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/serialization/check-prop-undefined.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/serialization/check-prop-undefined.ts deleted file mode 100644 index 50f78829e491..000000000000 --- a/sdk/elasticsans/arm-elasticsan/src/static-helpers/serialization/check-prop-undefined.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * Returns true if all specified properties of the item are undefined. - * @param item The object to check. - * @param properties The list of property names to check on the item. - * @returns True if all specified properties are undefined, otherwise false. - */ -export function areAllPropsUndefined(item: Record, properties: string[]): boolean { - for (const property of properties) { - if (item[property] !== undefined) { - return false; - } - } - return true; -} diff --git a/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts b/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts index c7109898692a..e8af8cd3ab73 100644 --- a/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts +++ b/sdk/elasticsans/arm-elasticsan/src/static-helpers/urlTemplate.ts @@ -187,14 +187,14 @@ export function expandUrlTemplate( expr = expr.slice(1); } const varList = expr.split(/,/g); - const result = []; + const innerResult = []; for (const varSpec of varList) { const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); if (!varMatch || !varMatch[1]) { continue; } const varValue = getVarValue({ - isFirst: result.length === 0, + isFirst: innerResult.length === 0, op, varValue: context[varMatch[1]], varName: varMatch[1], @@ -202,10 +202,10 @@ export function expandUrlTemplate( reserved: option?.allowReserved, }); if (varValue) { - result.push(varValue); + innerResult.push(varValue); } } - return result.join(""); + return innerResult.join(""); }); return normalizeUnreserved(result); @@ -219,7 +219,7 @@ function normalizeUnreserved(uri: string): string { return uri.replace(/%([0-9A-Fa-f]{2})/g, (match, hex) => { const char = String.fromCharCode(parseInt(hex, 16)); // Decode only if it's unreserved - if (/[\-.~]/.test(char)) { + if (/[.~-]/.test(char)) { return char; } return match; // leave other encodings intact diff --git a/sdk/elasticsans/arm-elasticsan/tsp-location.yaml b/sdk/elasticsans/arm-elasticsan/tsp-location.yaml index efa770fcad9c..5e72e9f30af1 100644 --- a/sdk/elasticsans/arm-elasticsan/tsp-location.yaml +++ b/sdk/elasticsans/arm-elasticsan/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan -commit: 75ef537e80d5c4ea14adac72bd7e67114df06e8e +commit: 6ebb23debab3faa4fda0722a706aeb4da6b64963 repo: Azure/azure-rest-api-specs additionalDirectories: From 11ca588e7d665ba1cdec381594431fe5cb642fbc Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:42:32 +0800 Subject: [PATCH 6/8] Update assets.json --- sdk/elasticsans/arm-elasticsan/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/elasticsans/arm-elasticsan/assets.json b/sdk/elasticsans/arm-elasticsan/assets.json index c798e37cc5aa..e904f00a9da5 100644 --- a/sdk/elasticsans/arm-elasticsan/assets.json +++ b/sdk/elasticsans/arm-elasticsan/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/elasticsans/arm-elasticsan", - "Tag": "js/elasticsans/arm-elasticsan_7d6df06b33" + "Tag": "js/elasticsans/arm-elasticsan_f66c6b98c0" } From 8e2a09bb2f4e36cdba6022a90488e5fdbe1f0e9d Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 25 Feb 2026 10:10:42 +0000 Subject: [PATCH 7/8] Configurations: 'specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan/tspconfig.yaml', API Version: 2025-09-01, SDK Release Type: stable, and CommitSHA: '3a8cc999dcbcbb4239b11c470614fb343e0157a8' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5924799 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- sdk/elasticsans/arm-elasticsan/CHANGELOG.md | 2 +- sdk/elasticsans/arm-elasticsan/tsp-location.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md index 25e9c50a2800..ca94bd9bef45 100644 --- a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md +++ b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 2.0.0 (2026-02-24) +## 2.0.0 (2026-02-25) ### Features Added - Added operation ElasticSansOperations.create diff --git a/sdk/elasticsans/arm-elasticsan/tsp-location.yaml b/sdk/elasticsans/arm-elasticsan/tsp-location.yaml index 5e72e9f30af1..d67e2bef2e73 100644 --- a/sdk/elasticsans/arm-elasticsan/tsp-location.yaml +++ b/sdk/elasticsans/arm-elasticsan/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/elasticsan/resource-manager/Microsoft.ElasticSan/ElasticSan -commit: 6ebb23debab3faa4fda0722a706aeb4da6b64963 +commit: 3a8cc999dcbcbb4239b11c470614fb343e0157a8 repo: Azure/azure-rest-api-specs additionalDirectories: From 88a302cb79a46b6c28fc4156ba53352d970b8063 Mon Sep 17 00:00:00 2001 From: ZiWei Chen <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 26 Feb 2026 10:04:50 +0800 Subject: [PATCH 8/8] Apply suggestion from @kazrael2119 --- .../arm-elasticsan/src/api/elasticSanManagementContext.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts b/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts index dab669896e9b..40fbf9955aaf 100644 --- a/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts +++ b/sdk/elasticsans/arm-elasticsan/src/api/elasticSanManagementContext.ts @@ -36,7 +36,7 @@ export function createElasticSanManagement( const endpointUrl = options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; - const userAgentInfo = `azsdk-js-arm-elasticsan/1.0.0-beta.1`; + const userAgentInfo = `azsdk-js-arm-elasticsan/2.0.0`; const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` : `azsdk-js-api ${userAgentInfo}`;