diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 53e5e3aa0493..14675d2b33a1 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4613,7 +4613,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20230926 + typescript: 5.3.0-dev.20230927 dev: false /eastasianwidth@0.2.0: @@ -9424,8 +9424,8 @@ packages: hasBin: true dev: false - /typescript@5.3.0-dev.20230926: - resolution: {integrity: sha512-Di7UazUfEeXHROiWH/D24zvK848YbcJAvO3CKEoQK4d3WSNxkbqWW5ipmr8SF6srpZ1achwisBGUI1HFbttRZQ==} + /typescript@5.3.0-dev.20230927: + resolution: {integrity: sha512-FHoT/nbOZjlXfK1yYTtCVT6yOp7Y9Vab/8Do4KiEGl3jI6rxPD7d1ssB/5vlH4ZXZ//0DW96vsvp/OUyjxCqgA==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -13110,7 +13110,7 @@ packages: dev: false file:projects/arm-elasticsan.tgz: - resolution: {integrity: sha512-65O5CYJyDcvnvysrYJUYVghC3ckaYzKGAKnE/SsxxTq7NuoEjQ/wz5d7D+vwc1GFK7fpB8M1otcSryEueshPNQ==, tarball: file:projects/arm-elasticsan.tgz} + resolution: {integrity: sha512-AK51wZD1IV6AbLj3cpg+iMYi3ptbX//PT94y2sg6fsLpOm6KdVw+/JsAqFEluBJ/cHIBXuLjAOxLRFQ6WQOTeQ==, tarball: file:projects/arm-elasticsan.tgz} name: '@rush-temp/arm-elasticsan' version: 0.0.0 dependencies: @@ -13126,8 +13126,8 @@ packages: cross-env: 7.0.3 dotenv: 16.3.1 mkdirp: 2.1.6 - mocha: 10.2.0 - rimraf: 3.0.2 + mocha: 7.2.0 + rimraf: 5.0.1 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3(@types/node@14.18.56)(rollup@2.79.1) ts-node: 10.9.1(@types/node@14.18.56)(typescript@5.0.4) @@ -13137,6 +13137,7 @@ packages: transitivePeerDependencies: - '@swc/core' - '@swc/wasm' + - supports-color dev: false file:projects/arm-eventgrid.tgz: diff --git a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md index 69a8bdc3b33c..6e423637b86a 100644 --- a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md +++ b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md @@ -1,79 +1,5 @@ # Release History - -## 1.0.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.2 (2023-07-12) - -**Features** - - - Added operation group PrivateEndpointConnections - - Added operation group PrivateLinkResources - - Added Interface ElasticSansDeleteHeaders - - Added Interface ElasticSansUpdateHeaders - - Added Interface ErrorDetail - - Added Interface Operation - - Added Interface OperationDisplay - - Added Interface OperationListResult - - Added Interface PrivateEndpoint - - Added Interface PrivateEndpointConnection - - Added Interface PrivateEndpointConnectionListResult - - Added Interface PrivateEndpointConnectionsCreateOptionalParams - - Added Interface PrivateEndpointConnectionsDeleteHeaders - - Added Interface PrivateEndpointConnectionsDeleteOptionalParams - - Added Interface PrivateEndpointConnectionsGetOptionalParams - - Added Interface PrivateEndpointConnectionsListOptionalParams - - Added Interface PrivateLinkResource - - Added Interface PrivateLinkResourceListResult - - Added Interface PrivateLinkResourcesListByElasticSanOptionalParams - - Added Interface PrivateLinkServiceConnectionState - - Added Interface ProxyResource - - Added Interface VolumeGroupsDeleteHeaders - - Added Interface VolumeGroupsUpdateHeaders - - Added Interface VolumesDeleteHeaders - - Added Interface VolumesUpdateHeaders - - Added Type Alias ActionType - - Added Type Alias Origin - - Added Type Alias PrivateEndpointConnectionsCreateResponse - - Added Type Alias PrivateEndpointConnectionsGetResponse - - Added Type Alias PrivateEndpointConnectionsListResponse - - Added Type Alias PrivateEndpointServiceConnectionStatus - - Added Type Alias PrivateLinkResourcesListByElasticSanResponse - - Interface ElasticSan has a new optional parameter privateEndpointConnections - - Interface ErrorResponse has a new optional parameter error - - Interface Resource has a new optional parameter systemData - - Interface SkuInformationList has a new optional parameter nextLink - - Interface TrackedResource has a new optional parameter tags - - Interface VolumeGroup has a new optional parameter privateEndpointConnections - - Added Enum KnownActionType - - Added Enum KnownOrigin - - Added Enum KnownPrivateEndpointServiceConnectionStatus - - Added function getContinuationToken - - Interface ElasticSan no longer has parameter systemData - - Interface ErrorResponse no longer has parameter additionalInfo - - Interface ErrorResponse no longer has parameter code - - Interface ErrorResponse no longer has parameter details - - Interface ErrorResponse no longer has parameter message - - Interface ErrorResponse no longer has parameter target - - Interface Resource no longer has parameter tags - - Interface Volume no longer has parameter systemData - - Interface VolumeGroup no longer has parameter systemData - - Interface VolumeGroupUpdate no longer has parameter tags - - Interface VolumeUpdate no longer has parameter tags - -**Breaking Changes** - - - Parameter location of interface TrackedResource is now required - - Parameter sizeGiB of interface Volume is now required - -## 1.0.0-beta.1 (2022-10-21) +## 1.0.0 (2023-09-27) -The package of @azure/arm-elasticsan is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-elasticsan is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/elasticsans/arm-elasticsan/README.md b/sdk/elasticsans/arm-elasticsan/README.md index 3528d9b75ee3..eb3f113592dc 100644 --- a/sdk/elasticsans/arm-elasticsan/README.md +++ b/sdk/elasticsans/arm-elasticsan/README.md @@ -6,7 +6,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f [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://docs.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-elasticsan) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/elasticsans/arm-elasticsan/_meta.json b/sdk/elasticsans/arm-elasticsan/_meta.json index d8b334dc2a04..5cfb10f5c3f8 100644 --- a/sdk/elasticsans/arm-elasticsan/_meta.json +++ b/sdk/elasticsans/arm-elasticsan/_meta.json @@ -1,8 +1,8 @@ { - "commit": "eabc87b2e8e5ab5d5365cb2db064d7fd25a65f1a", + "commit": "7b99d88798aa1ba10cbcc9fd0aa978869ecb5610", "readme": "specification/elasticsan/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --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.5 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/elasticsan/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", - "use": "@autorest/typescript@6.0.5" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/package.json b/sdk/elasticsans/arm-elasticsan/package.json index 722ddb79f081..792043fa68e5 100644 --- a/sdk/elasticsans/arm-elasticsan/package.json +++ b/sdk/elasticsans/arm-elasticsan/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ElasticSanManagement.", - "version": "1.0.0-beta.3", + "version": "1.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.3", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -38,18 +38,18 @@ "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", - "@azure/identity": "^3.3.0", + "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", - "mocha": "^10.0.0", + "mocha": "^7.1.1", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0" + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -84,7 +84,7 @@ "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -112,13 +112,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan" +} \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md index 58cec2fd7ed2..2c027827fcd4 100644 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md @@ -10,6 +10,9 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; +// @public +export type Action = string; + // @public export type ActionType = string; @@ -23,6 +26,7 @@ export interface ElasticSan extends TrackedResource { extendedCapacitySizeTiB: number; readonly privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: ProvisioningStates; + publicNetworkAccess?: PublicNetworkAccess; sku: Sku; readonly totalIops?: number; readonly totalMBps?: number; @@ -60,6 +64,8 @@ export class ElasticSanManagement extends coreClient.ServiceClient { volumeGroups: VolumeGroups; // (undocumented) volumes: Volumes; + // (undocumented) + volumeSnapshots: VolumeSnapshots; } // @public @@ -157,11 +163,23 @@ export type ElasticSansUpdateResponse = ElasticSan; export interface ElasticSanUpdate { baseSizeTiB?: number; extendedCapacitySizeTiB?: number; + publicNetworkAccess?: PublicNetworkAccess; tags?: { [propertyName: string]: string; }; } +// @public +export interface EncryptionIdentity { + encryptionUserAssignedIdentity?: string; +} + +// @public +export interface EncryptionProperties { + encryptionIdentity?: EncryptionIdentity; + keyVaultProperties?: KeyVaultProperties; +} + // @public export type EncryptionType = string; @@ -188,6 +206,19 @@ export interface ErrorResponse { // @public export function getContinuationToken(page: unknown): string | undefined; +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type: IdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; +} + +// @public +export type IdentityType = string; + // @public export interface IscsiTargetInfo { readonly provisioningState?: ProvisioningStates; @@ -197,6 +228,21 @@ export interface IscsiTargetInfo { 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" @@ -212,9 +258,17 @@ export enum KnownCreatedByType { // @public export enum KnownEncryptionType { + EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey", EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" } +// @public +export enum KnownIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned" +} + // @public export enum KnownOperationalStatus { Healthy = "Healthy", @@ -254,6 +308,12 @@ export enum KnownProvisioningStates { Updating = "Updating" } +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled" +} + // @public export enum KnownSkuName { PremiumLRS = "Premium_LRS", @@ -271,6 +331,32 @@ export enum KnownStorageTargetType { None = "None" } +// @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[]; @@ -423,6 +509,9 @@ export type ProvisioningStates = string; export interface ProxyResource extends Resource { } +// @public +export type PublicNetworkAccess = string; + // @public export interface Resource { readonly id?: string; @@ -485,13 +574,29 @@ export type SkusListResponse = SkuInformationList; export type SkuTier = string; // @public -export interface SourceCreationData { - createSource?: "None"; - sourceUri?: string; +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 SnapshotList { + readonly nextLink?: string; + value?: Snapshot[]; } // @public -export type State = "provisioning" | "deprovisioning" | "succeeded" | "failed" | "networkSourceDeleted"; +export interface SourceCreationData { + createSource?: VolumeCreateOption; + sourceId?: string; +} // @public export type StorageTargetType = string; @@ -514,24 +619,36 @@ export interface TrackedResource extends Resource { }; } +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // @public export interface VirtualNetworkRule { - action?: "Allow"; - readonly state?: State; + 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; + identity?: Identity; networkAcls?: NetworkRuleSet; readonly privateEndpointConnections?: PrivateEndpointConnection[]; protocolType?: StorageTargetType; @@ -616,6 +733,8 @@ export type VolumeGroupsUpdateResponse = VolumeGroup; // @public export interface VolumeGroupUpdate { encryption?: EncryptionType; + encryptionProperties?: EncryptionProperties; + identity?: Identity; networkAcls?: NetworkRuleSet; protocolType?: StorageTargetType; } @@ -657,6 +776,8 @@ export interface VolumesDeleteHeaders { export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; + xMsDeleteSnapshots?: XMsDeleteSnapshots; + xMsForceDelete?: XMsForceDelete; } // @public @@ -680,6 +801,59 @@ export interface VolumesListByVolumeGroupOptionalParams extends coreClient.Opera // @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; + updateIntervalInMs?: number; +} + +// @public +export type VolumeSnapshotsCreateResponse = Snapshot; + +// @public +export interface VolumeSnapshotsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface VolumeSnapshotsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VolumeSnapshotsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumeSnapshotsGetResponse = Snapshot; + +// @public +export interface VolumeSnapshotsListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumeSnapshotsListByVolumeGroupNextResponse = SnapshotList; + +// @public +export interface VolumeSnapshotsListByVolumeGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type VolumeSnapshotsListByVolumeGroupResponse = SnapshotList; + // @public export interface VolumesUpdateHeaders { // (undocumented) @@ -697,9 +871,16 @@ export type VolumesUpdateResponse = Volume; // @public export interface VolumeUpdate { + 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/src/elasticSanManagement.ts b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts index e581eb761a07..bec5058feada 100644 --- a/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts +++ b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts @@ -21,7 +21,8 @@ import { VolumeGroupsImpl, VolumesImpl, PrivateEndpointConnectionsImpl, - PrivateLinkResourcesImpl + PrivateLinkResourcesImpl, + VolumeSnapshotsImpl } from "./operations"; import { Operations, @@ -30,7 +31,8 @@ import { VolumeGroups, Volumes, PrivateEndpointConnections, - PrivateLinkResources + PrivateLinkResources, + VolumeSnapshots } from "./operationsInterfaces"; import { ElasticSanManagementOptionalParams } from "./models"; @@ -66,7 +68,7 @@ export class ElasticSanManagement extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-elasticsan/1.0.0-beta.3`; + const packageDetails = `azsdk-js-arm-elasticsan/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -119,7 +121,7 @@ export class ElasticSanManagement extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-12-01-preview"; + this.apiVersion = options.apiVersion || "2023-01-01"; this.operations = new OperationsImpl(this); this.skus = new SkusImpl(this); this.elasticSans = new ElasticSansImpl(this); @@ -127,6 +129,7 @@ export class ElasticSanManagement extends coreClient.ServiceClient { this.volumes = new VolumesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.volumeSnapshots = new VolumeSnapshotsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -165,4 +168,5 @@ export class ElasticSanManagement extends coreClient.ServiceClient { volumes: Volumes; privateEndpointConnections: PrivateEndpointConnections; privateLinkResources: PrivateLinkResources; + volumeSnapshots: VolumeSnapshots; } diff --git a/sdk/elasticsans/arm-elasticsan/src/models/index.ts b/sdk/elasticsans/arm-elasticsan/src/models/index.ts index 93941518b2aa..2337c132aecf 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/index.ts @@ -277,6 +277,8 @@ export interface ElasticSanUpdate { 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; } /** List of Volume Groups */ @@ -290,6 +292,77 @@ export interface VolumeGroupList { 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; +} + +/** 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. */ @@ -301,20 +374,19 @@ 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?: "Allow"; - /** - * Gets the state of virtual network rule. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly state?: State; + action?: Action; } /** 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; } @@ -322,9 +394,9 @@ export interface VolumeGroupUpdate { /** Data source used when creating the volume. */ export interface SourceCreationData { /** This enumerates the possible sources of a volume creation. */ - createSource?: "None"; - /** If createOption is Copy, this is the ARM id of the source snapshot or disk. If createOption is Restore, this is the ARM-like id of the source disk restore point. */ - sourceUri?: string; + createSource?: VolumeCreateOption; + /** Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ + sourceId?: string; } /** Iscsi target information */ @@ -353,10 +425,18 @@ export interface IscsiTargetInfo { 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 { /** Volume size. */ sizeGiB?: number; + /** Parent resource information. */ + managedBy?: ManagedByInfo; } /** List of Volumes */ @@ -392,6 +472,23 @@ export interface PrivateLinkResourceListResult { readonly nextLink?: 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; +} + +/** 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; +} + /** Response for PrivateEndpoint Connection object */ export interface PrivateEndpointConnection extends Resource { /** @@ -479,10 +576,14 @@ export interface ElasticSan extends TrackedResource { * 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; } /** Response for Volume Group request. */ export interface VolumeGroup extends ProxyResource { + /** The identity of the resource. */ + identity?: Identity; /** * State of the operation on the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -492,6 +593,8 @@ export interface VolumeGroup extends ProxyResource { 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; /** @@ -517,6 +620,34 @@ export interface Volume extends ProxyResource { * 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; +} + +/** 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. + * 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; } /** Defines headers for ElasticSans_update operation. */ @@ -554,6 +685,11 @@ 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 */ @@ -707,6 +843,45 @@ export enum KnownCreatedByType { */ 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 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 */ @@ -728,7 +903,9 @@ 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" + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", + /** Volume is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ + EncryptionAtRestWithCustomerManagedKey = "EncryptionAtRestWithCustomerManagedKey" } /** @@ -736,10 +913,53 @@ export enum KnownEncryptionType { * {@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. + * **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 */ @@ -775,13 +995,42 @@ export enum KnownOperationalStatus { * **Stopped (deallocated)** */ export type OperationalStatus = string; -/** Defines values for State. */ -export type State = - | "provisioning" - | "deprovisioning" - | "succeeded" - | "failed" - | "networkSourceDeleted"; + +/** 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 @@ -948,6 +1197,10 @@ 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. */ @@ -1016,6 +1269,51 @@ export interface PrivateLinkResourcesListByElasticSanOptionalParams /** 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 { diff --git a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts index fd4c5cc2982c..43269508f890 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts @@ -559,6 +559,12 @@ export const ElasticSanUpdate: coreClient.CompositeMapper = { type: { name: "Number" } + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String" + } } } } @@ -592,6 +598,154 @@ export const VolumeGroupList: coreClient.CompositeMapper = { } }; +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 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", @@ -627,25 +781,10 @@ export const VirtualNetworkRule: coreClient.CompositeMapper = { }, action: { defaultValue: "Allow", - isConstant: true, serializedName: "action", type: { name: "String" } - }, - state: { - serializedName: "state", - readOnly: true, - type: { - name: "Enum", - allowedValues: [ - "provisioning", - "deprovisioning", - "succeeded", - "failed", - "networkSourceDeleted" - ] - } } } } @@ -656,6 +795,13 @@ export const VolumeGroupUpdate: coreClient.CompositeMapper = { name: "Composite", className: "VolumeGroupUpdate", modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, protocolType: { serializedName: "properties.protocolType", type: { @@ -668,6 +814,13 @@ export const VolumeGroupUpdate: coreClient.CompositeMapper = { name: "String" } }, + encryptionProperties: { + serializedName: "properties.encryptionProperties", + type: { + name: "Composite", + className: "EncryptionProperties" + } + }, networkAcls: { serializedName: "properties.networkAcls", type: { @@ -685,15 +838,13 @@ export const SourceCreationData: coreClient.CompositeMapper = { className: "SourceCreationData", modelProperties: { createSource: { - defaultValue: "None", - isConstant: true, serializedName: "createSource", type: { name: "String" } }, - sourceUri: { - serializedName: "sourceUri", + sourceId: { + serializedName: "sourceId", type: { name: "String" } @@ -745,6 +896,21 @@ export const IscsiTargetInfo: coreClient.CompositeMapper = { } }; +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", @@ -755,6 +921,13 @@ export const VolumeUpdate: coreClient.CompositeMapper = { type: { name: "Number" } + }, + managedBy: { + serializedName: "properties.managedBy", + type: { + name: "Composite", + className: "ManagedByInfo" + } } } } @@ -844,6 +1017,50 @@ export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { } }; +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 SnapshotCreationData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotCreationData", + modelProperties: { + sourceId: { + serializedName: "sourceId", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1052,6 +1269,12 @@ export const ElasticSan: coreClient.CompositeMapper = { } } } + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String" + } } } } @@ -1063,6 +1286,13 @@ export const VolumeGroup: coreClient.CompositeMapper = { className: "VolumeGroup", modelProperties: { ...ProxyResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, @@ -1082,6 +1312,13 @@ export const VolumeGroup: coreClient.CompositeMapper = { name: "String" } }, + encryptionProperties: { + serializedName: "properties.encryptionProperties", + type: { + name: "Composite", + className: "EncryptionProperties" + } + }, networkAcls: { serializedName: "properties.networkAcls", type: { @@ -1139,6 +1376,58 @@ export const Volume: coreClient.CompositeMapper = { name: "Composite", className: "IscsiTargetInfo" } + }, + managedBy: { + serializedName: "properties.managedBy", + type: { + name: "Composite", + className: "ManagedByInfo" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Snapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Snapshot", + modelProperties: { + ...ProxyResource.type.modelProperties, + creationData: { + serializedName: "properties.creationData", + type: { + name: "Composite", + className: "SnapshotCreationData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + sourceVolumeSizeGiB: { + serializedName: "properties.sourceVolumeSizeGiB", + readOnly: true, + type: { + name: "Number" + } + }, + volumeName: { + serializedName: "properties.volumeName", + readOnly: true, + type: { + name: "String" + } } } } @@ -1248,3 +1537,18 @@ export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper } } }; + +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/parameters.ts b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts index c9d051837228..69cbf5834770 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts @@ -18,7 +18,8 @@ import { VolumeGroupUpdate as VolumeGroupUpdateMapper, Volume as VolumeMapper, VolumeUpdate as VolumeUpdateMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + Snapshot as SnapshotMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -48,7 +49,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-12-01-preview", + defaultValue: "2023-01-01", isConstant: true, serializedName: "api-version", type: { @@ -198,6 +199,26 @@ export const parameters5: OperationParameter = { 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 parameters6: OperationParameter = { parameterPath: "parameters", mapper: PrivateEndpointConnectionMapper @@ -213,3 +234,24 @@ export const privateEndpointConnectionName: OperationURLParameter = { } } }; + +export const parameters7: 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/index.ts b/sdk/elasticsans/arm-elasticsan/src/operations/index.ts index 617c77039b87..af04bcc4d271 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operations/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operations/index.ts @@ -13,3 +13,4 @@ export * from "./volumeGroups"; export * from "./volumes"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; +export * from "./volumeSnapshots"; 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..7977556076a7 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/volumeSnapshots.ts @@ -0,0 +1,551 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { VolumeSnapshots } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ElasticSanManagement } from "../elasticSanManagement"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Snapshot, + VolumeSnapshotsListByVolumeGroupNextOptionalParams, + VolumeSnapshotsListByVolumeGroupOptionalParams, + VolumeSnapshotsListByVolumeGroupResponse, + VolumeSnapshotsCreateOptionalParams, + VolumeSnapshotsCreateResponse, + VolumeSnapshotsDeleteOptionalParams, + VolumeSnapshotsGetOptionalParams, + VolumeSnapshotsGetResponse, + VolumeSnapshotsListByVolumeGroupNextResponse +} from "../models"; + +/// +/** 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.parameters7, + 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 index a24f3e36d5c4..f12b0b4c28b9 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts @@ -628,7 +628,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.volumeGroupName, Parameters.volumeName ], - headerParameters: [Parameters.accept], + headerParameters: [ + Parameters.accept, + Parameters.xMsDeleteSnapshots, + Parameters.xMsForceDelete + ], serializer }; const getOperationSpec: coreClient.OperationSpec = { diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts index 617c77039b87..af04bcc4d271 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts @@ -13,3 +13,4 @@ export * from "./volumeGroups"; export * from "./volumes"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; +export * from "./volumeSnapshots"; 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..e19bb38dddf7 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeSnapshots.ts @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; + +/// +/** 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/test/sampleTest.ts b/sdk/elasticsans/arm-elasticsan/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/elasticsans/arm-elasticsan/tsconfig.json b/sdk/elasticsans/arm-elasticsan/tsconfig.json index a25947875abf..3e6ae96443f3 100644 --- a/sdk/elasticsans/arm-elasticsan/tsconfig.json +++ b/sdk/elasticsans/arm-elasticsan/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-elasticsan": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"