diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f93ef640a707..5d8e5895e792 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -15305,7 +15305,7 @@ packages: dev: false file:projects/arm-hardwaresecuritymodules.tgz: - resolution: {integrity: sha512-V1b8zbcdRvBsq+r2I/u8qXpYxoeckYtmwXffPbucFXhGoCYU/bceb36+TPshbnlo7lVtDJdAA7PgMSDp7p0blQ==, tarball: file:projects/arm-hardwaresecuritymodules.tgz} + resolution: {integrity: sha512-o/8lBLIUz3s8F+IAf4zlTBEe+By1vGq0RbaMAyTb7xGkKxZW9V7LBEeQ3ZdbhYYbWgF81BabbJV3/2HC2RUwGQ==, tarball: file:projects/arm-hardwaresecuritymodules.tgz} name: '@rush-temp/arm-hardwaresecuritymodules' version: 0.0.0 dependencies: @@ -15313,15 +15313,21 @@ packages: '@azure-tools/test-recorder': 3.5.2 '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 + '@microsoft/api-extractor': 7.47.11(@types/node@18.19.64) '@types/chai': 4.3.20 '@types/mocha': 10.0.9 '@types/node': 18.19.64 chai: 4.3.10 + cross-env: 7.0.3 dotenv: 16.4.5 + mkdirp: 3.0.1 mocha: 10.8.2 - ts-node: 10.9.2(@types/node@18.19.64)(typescript@5.6.3) + rimraf: 5.0.10 + ts-node: 10.9.2(@types/node@18.19.64)(typescript@5.5.4) tslib: 2.8.1 - typescript: 5.6.3 + tsx: 4.19.2 + typescript: 5.5.4 + uglify-js: 3.19.3 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/CHANGELOG.md b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/CHANGELOG.md index a9012f74717a..d536c9b699db 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/CHANGELOG.md +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/CHANGELOG.md @@ -1,15 +1,149 @@ # Release History - -## 2.0.0-beta.2 (Unreleased) - + +## 2.0.0-beta.2 (2024-11-11) +Compared with version 1.0.0 + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Added operation group CloudHsmClusterBackupStatus + - Added operation group CloudHsmClusterPrivateEndpointConnections + - Added operation group CloudHsmClusterPrivateLinkResources + - Added operation group CloudHsmClusterRestoreStatus + - Added operation group CloudHsmClusters + - Added operation group PrivateEndpointConnections + - Added Interface AzureHSMResourceProviderOptionalParams + - Added Interface BackupRequestProperties + - Added Interface BackupRestoreBaseResultProperties + - Added Interface BackupRestoreRequestBaseProperties + - Added Interface BackupResult + - Added Interface BackupResultProperties + - Added Interface CloudHsmCluster + - Added Interface CloudHsmClusterBackupStatusGetExceptionHeaders + - Added Interface CloudHsmClusterBackupStatusGetHeaders + - Added Interface CloudHsmClusterBackupStatusGetOptionalParams + - Added Interface CloudHsmClusterListResult + - Added Interface CloudHsmClusterPatchParameters + - Added Interface CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams + - Added Interface CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders + - Added Interface CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams + - Added Interface CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams + - Added Interface CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextOptionalParams + - Added Interface CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams + - Added Interface CloudHsmClusterResource + - Added Interface CloudHsmClusterRestoreStatusGetExceptionHeaders + - Added Interface CloudHsmClusterRestoreStatusGetHeaders + - Added Interface CloudHsmClusterRestoreStatusGetOptionalParams + - Added Interface CloudHsmClustersBackupHeaders + - Added Interface CloudHsmClustersBackupOptionalParams + - Added Interface CloudHsmClustersCreateOrUpdateOptionalParams + - Added Interface CloudHsmClustersDeleteHeaders + - Added Interface CloudHsmClustersDeleteOptionalParams + - Added Interface CloudHsmClustersGetOptionalParams + - Added Interface CloudHsmClusterSku + - Added Interface CloudHsmClustersListByResourceGroupNextOptionalParams + - Added Interface CloudHsmClustersListByResourceGroupOptionalParams + - Added Interface CloudHsmClustersListBySubscriptionNextOptionalParams + - Added Interface CloudHsmClustersListBySubscriptionOptionalParams + - Added Interface CloudHsmClustersRestoreHeaders + - Added Interface CloudHsmClustersRestoreOptionalParams + - Added Interface CloudHsmClustersUpdateHeaders + - Added Interface CloudHsmClustersUpdateOptionalParams + - Added Interface CloudHsmClustersValidateBackupPropertiesHeaders + - Added Interface CloudHsmClustersValidateBackupPropertiesOptionalParams + - Added Interface CloudHsmClustersValidateRestorePropertiesHeaders + - Added Interface CloudHsmClustersValidateRestorePropertiesOptionalParams + - Added Interface CloudHsmProperties + - Added Interface DedicatedHsm + - Added Interface DedicatedHsmDeleteHeaders + - Added Interface DedicatedHsmUpdateHeaders + - Added Interface ErrorAdditionalInfo + - Added Interface ErrorDetail + - Added Interface ErrorResponse + - Added Interface ManagedServiceIdentity + - Added Interface Operation + - Added Interface OperationDisplay + - Added Interface OperationListResult + - Added Interface PrivateEndpoint + - Added Interface PrivateEndpointConnection + - Added Interface PrivateEndpointConnectionListResult + - Added Interface PrivateEndpointConnectionsListByCloudHsmClusterNextOptionalParams + - Added Interface PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams + - Added Interface PrivateLinkResource + - Added Interface PrivateLinkResourceListResult + - Added Interface PrivateLinkServiceConnectionState + - Added Interface ProxyResource + - Added Interface RestoreRequestProperties + - Added Interface RestoreResult + - Added Interface TrackedResource + - Added Interface UserAssignedIdentity + - Added Class AzureHSMResourceProvider + - Added Type Alias ActionType + - Added Type Alias ActivationState + - Added Type Alias AutoGeneratedDomainNameLabelScope + - Added Type Alias BackupRestoreOperationStatus + - Added Type Alias CloudHsmClusterBackupStatusGetResponse + - Added Type Alias CloudHsmClusterPrivateEndpointConnectionsCreateResponse + - Added Type Alias CloudHsmClusterPrivateEndpointConnectionsDeleteResponse + - Added Type Alias CloudHsmClusterPrivateEndpointConnectionsGetResponse + - Added Type Alias CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextResponse + - Added Type Alias CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse + - Added Type Alias CloudHsmClusterRestoreStatusGetResponse + - Added Type Alias CloudHsmClustersBackupResponse + - Added Type Alias CloudHsmClustersCreateOrUpdateResponse + - Added Type Alias CloudHsmClustersDeleteResponse + - Added Type Alias CloudHsmClustersGetResponse + - Added Type Alias CloudHsmClusterSkuFamily + - Added Type Alias CloudHsmClusterSkuName + - Added Type Alias CloudHsmClustersListByResourceGroupNextResponse + - Added Type Alias CloudHsmClustersListByResourceGroupResponse + - Added Type Alias CloudHsmClustersListBySubscriptionNextResponse + - Added Type Alias CloudHsmClustersListBySubscriptionResponse + - Added Type Alias CloudHsmClustersRestoreResponse + - Added Type Alias CloudHsmClustersUpdateResponse + - Added Type Alias CloudHsmClustersValidateBackupPropertiesResponse + - Added Type Alias CloudHsmClustersValidateRestorePropertiesResponse + - Added Type Alias CreatedByType + - Added Type Alias DedicatedHsmDeleteResponse + - Added Type Alias ManagedServiceIdentityType + - Added Type Alias Origin + - Added Type Alias PrivateEndpointConnectionProvisioningState + - Added Type Alias PrivateEndpointConnectionsListByCloudHsmClusterNextResponse + - Added Type Alias PrivateEndpointConnectionsListByCloudHsmClusterResponse + - Added Type Alias PrivateEndpointServiceConnectionStatus + - Added Type Alias ProvisioningState + - Added Type Alias PublicNetworkAccess + - Interface ApiEntityReference has a new optional parameter resourceId + - Interface NetworkInterface has a new optional parameter resourceId + - Interface Resource has a new optional parameter systemData + - Added Enum KnownActionType + - Added Enum KnownActivationState + - Added Enum KnownAutoGeneratedDomainNameLabelScope + - Added Enum KnownBackupRestoreOperationStatus + - Added Enum KnownCloudHsmClusterSkuFamily + - Added Enum KnownCreatedByType + - Added Enum KnownManagedServiceIdentityType + - Added Enum KnownOrigin + - Added Enum KnownPrivateEndpointConnectionProvisioningState + - Added Enum KnownPrivateEndpointServiceConnectionStatus + - Added Enum KnownProvisioningState + - Added Enum KnownPublicNetworkAccess + - Added function getContinuationToken -### Other Changes +### Breaking Changes + - Deleted Class AzureDedicatedHSMResourceProvider + - Interface ApiEntityReference no longer has parameter id + - Interface DedicatedHsmListByResourceGroupNextOptionalParams no longer has parameter top + - Interface DedicatedHsmListBySubscriptionNextOptionalParams no longer has parameter top + - Interface NetworkInterface no longer has parameter id + - Interface Resource no longer has parameter location + - Interface Resource no longer has parameter sku + - Interface Resource no longer has parameter tags + - Interface Resource no longer has parameter zones + - Type of parameter createdByType of interface SystemData is changed from IdentityType to CreatedByType + - Type of parameter lastModifiedByType of interface SystemData is changed from IdentityType to CreatedByType + + ## 2.0.0-beta.1 (2024-01-04) ### Features Added diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/_meta.json b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/_meta.json index 4bda5739cf4f..4f55041d8900 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/_meta.json +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/_meta.json @@ -1,8 +1,8 @@ { - "commit": "be0d1c383d683a8eb22ab5fd5b75e380ac3c2eea", + "commit": "766fbdcae199a5b2a3b7d2910f32b37cac7947de", "readme": "specification/hardwaresecuritymodules/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\\hardwaresecuritymodules\\resource-manager\\readme.md --use=@autorest/typescript@6.0.13 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\hardwaresecuritymodules\\resource-manager\\readme.md --use=@autorest/typescript@6.0.27 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", - "use": "@autorest/typescript@6.0.13" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.15", + "use": "@autorest/typescript@6.0.27" } \ No newline at end of file diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/assets.json b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/assets.json index fa55eb80fbd3..43073259821b 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/assets.json +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/hardwaresecuritymodules/arm-hardwaresecuritymodules", - "Tag": "js/hardwaresecuritymodules/arm-hardwaresecuritymodules_7bbf0ccc4a" + "Tag": "js/hardwaresecuritymodules/arm-hardwaresecuritymodules_031f420a43" } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/package.json b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/package.json index e36f560e1a05..8530fbf8875d 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/package.json +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/package.json @@ -8,12 +8,12 @@ "node": ">=18.0.0" }, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.7.0", "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.12.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -28,18 +28,24 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-hardwaresecuritymodules.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "@microsoft/api-extractor": "^7.31.1", + "mkdirp": "^3.0.1", + "typescript": "~5.5.3", + "uglify-js": "^3.4.9", + "rimraf": "^5.0.0", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^10.0.0", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "cross-env": "^7.0.2", + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -67,29 +73,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored 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", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", - "update-snippets": "echo skipped" + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -110,4 +115,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-hardwaresecuritymodules?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/review/arm-hardwaresecuritymodules.api.md b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/review/arm-hardwaresecuritymodules.api.md index 72b5d69799f9..7bf9d05ee4df 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/review/arm-hardwaresecuritymodules.api.md +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/review/arm-hardwaresecuritymodules.api.md @@ -10,21 +10,36 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; +// @public +export type ActionType = string; + +// @public +export type ActivationState = string; + // @public export interface ApiEntityReference { - id?: string; + resourceId?: string; } +// @public +export type AutoGeneratedDomainNameLabelScope = string; + // @public (undocumented) export class AzureHSMResourceProvider extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureHSMResourceProviderOptionalParams); // (undocumented) + apiVersion: string; + // (undocumented) + cloudHsmClusterBackupStatus: CloudHsmClusterBackupStatus; + // (undocumented) cloudHsmClusterPrivateEndpointConnections: CloudHsmClusterPrivateEndpointConnections; // (undocumented) cloudHsmClusterPrivateLinkResources: CloudHsmClusterPrivateLinkResources; // (undocumented) + cloudHsmClusterRestoreStatus: CloudHsmClusterRestoreStatus; + // (undocumented) cloudHsmClusters: CloudHsmClusters; // (undocumented) dedicatedHsmOperations: DedicatedHsmOperations; @@ -39,40 +54,84 @@ export class AzureHSMResourceProvider extends coreClient.ServiceClient { // @public export interface AzureHSMResourceProviderOptionalParams extends coreClient.ServiceClientOptions { $host?: string; + apiVersion?: string; endpoint?: string; } // @public -export interface BackupProperties { - azureStorageResourceUri?: string; - readonly lastBackupDateTime?: Date; - readonly lastBackupStatus?: string; +export interface BackupRequestProperties extends BackupRestoreRequestBaseProperties { } // @public -export interface CHsmError { - readonly code?: string; - readonly message?: string; +export interface BackupRestoreBaseResultProperties { + readonly endTime?: Date; + error?: ErrorDetail; + jobId?: string; + readonly startTime?: Date; + readonly status?: BackupRestoreOperationStatus; + statusDetails?: string; +} + +// @public +export type BackupRestoreOperationStatus = string; + +// @public +export interface BackupRestoreRequestBaseProperties { + azureStorageBlobContainerUri: string; + token?: string; +} + +// @public +export interface BackupResult { + azureStorageBlobContainerUri?: string; + backupId?: string; + readonly endTime?: Date; + error?: ErrorDetail; + jobId?: string; + readonly startTime?: Date; + readonly status?: BackupRestoreOperationStatus; + statusDetails?: string; +} + +// @public +export interface BackupResultProperties extends BackupRestoreBaseResultProperties { + azureStorageBlobContainerUri?: string; + backupId?: string; } // @public export interface CloudHsmCluster extends CloudHsmClusterResource { - autoGeneratedDomainNameLabelScope?: string; - backupProperties?: BackupProperties; - hsms?: CloudHsmProperties[]; - privateEndpointConnections?: PrivateEndpointConnection[]; - provisioningState?: ProvisioningState; - publicNetworkAccess?: string; - restoreProperties?: RestoreProperties; - securityDomain?: CloudHsmClusterSecurityDomainProperties; + readonly activationState?: ActivationState; + autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; + readonly hsms?: CloudHsmProperties[]; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; + publicNetworkAccess?: PublicNetworkAccess; readonly statusMessage?: string; } // @public -export interface CloudHsmClusterError { - error?: CHsmError; +export interface CloudHsmClusterBackupStatus { + get(resourceGroupName: string, cloudHsmClusterName: string, jobId: string, options?: CloudHsmClusterBackupStatusGetOptionalParams): Promise; +} + +// @public +export interface CloudHsmClusterBackupStatusGetExceptionHeaders { + xMsRequestId?: string; +} + +// @public +export interface CloudHsmClusterBackupStatusGetHeaders { + xMsRequestId?: string; +} + +// @public +export interface CloudHsmClusterBackupStatusGetOptionalParams extends coreClient.OperationOptions { } +// @public +export type CloudHsmClusterBackupStatusGetResponse = CloudHsmClusterBackupStatusGetHeaders & BackupResult; + // @public export interface CloudHsmClusterListResult { nextLink?: string; @@ -81,9 +140,7 @@ export interface CloudHsmClusterListResult { // @public export interface CloudHsmClusterPatchParameters { - backupProperties?: BackupProperties; identity?: ManagedServiceIdentity; - sku?: CloudHsmClusterSku; tags?: { [propertyName: string]: string; }; @@ -91,8 +148,8 @@ export interface CloudHsmClusterPatchParameters { // @public export interface CloudHsmClusterPrivateEndpointConnections { - beginDelete(resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams): Promise; + beginDelete(resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams): Promise, CloudHsmClusterPrivateEndpointConnectionsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams): Promise; create(resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, properties: PrivateEndpointConnection, options?: CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams): Promise; get(resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, options?: CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams): Promise; } @@ -115,6 +172,9 @@ export interface CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams e updateIntervalInMs?: number; } +// @public +export type CloudHsmClusterPrivateEndpointConnectionsDeleteResponse = CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders; + // @public export interface CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { } @@ -124,9 +184,16 @@ export type CloudHsmClusterPrivateEndpointConnectionsGetResponse = PrivateEndpoi // @public export interface CloudHsmClusterPrivateLinkResources { - listByCloudHsmCluster(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams): Promise; + listByCloudHsmCluster(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextOptionalParams extends coreClient.OperationOptions { } +// @public +export type CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextResponse = PrivateLinkResourceListResult; + // @public export interface CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams extends coreClient.OperationOptions { } @@ -140,31 +207,70 @@ export interface CloudHsmClusterResource extends TrackedResource { sku?: CloudHsmClusterSku; } +// @public +export interface CloudHsmClusterRestoreStatus { + get(resourceGroupName: string, cloudHsmClusterName: string, jobId: string, options?: CloudHsmClusterRestoreStatusGetOptionalParams): Promise; +} + +// @public +export interface CloudHsmClusterRestoreStatusGetExceptionHeaders { + xMsRequestId?: string; +} + +// @public +export interface CloudHsmClusterRestoreStatusGetHeaders { + xMsRequestId?: string; +} + +// @public +export interface CloudHsmClusterRestoreStatusGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudHsmClusterRestoreStatusGetResponse = CloudHsmClusterRestoreStatusGetHeaders & RestoreResult; + // @public export interface CloudHsmClusters { + beginBackup(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersBackupOptionalParams): Promise, CloudHsmClustersBackupResponse>>; + beginBackupAndWait(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersBackupOptionalParams): Promise; beginCreateOrUpdate(resourceGroupName: string, cloudHsmClusterName: string, location: string, options?: CloudHsmClustersCreateOrUpdateOptionalParams): Promise, CloudHsmClustersCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, cloudHsmClusterName: string, location: string, options?: CloudHsmClustersCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersDeleteOptionalParams): Promise; + beginDelete(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersDeleteOptionalParams): Promise, CloudHsmClustersDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersDeleteOptionalParams): Promise; + beginRestore(resourceGroupName: string, cloudHsmClusterName: string, restoreRequestProperties: RestoreRequestProperties, options?: CloudHsmClustersRestoreOptionalParams): Promise, CloudHsmClustersRestoreResponse>>; + beginRestoreAndWait(resourceGroupName: string, cloudHsmClusterName: string, restoreRequestProperties: RestoreRequestProperties, options?: CloudHsmClustersRestoreOptionalParams): Promise; beginUpdate(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersUpdateOptionalParams): Promise, CloudHsmClustersUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersUpdateOptionalParams): Promise; + beginValidateBackupProperties(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersValidateBackupPropertiesOptionalParams): Promise, CloudHsmClustersValidateBackupPropertiesResponse>>; + beginValidateBackupPropertiesAndWait(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersValidateBackupPropertiesOptionalParams): Promise; + beginValidateRestoreProperties(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersValidateRestorePropertiesOptionalParams): Promise, CloudHsmClustersValidateRestorePropertiesResponse>>; + beginValidateRestorePropertiesAndWait(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersValidateRestorePropertiesOptionalParams): Promise; get(resourceGroupName: string, cloudHsmClusterName: string, options?: CloudHsmClustersGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: CloudHsmClustersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: CloudHsmClustersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface CloudHsmClustersBackupHeaders { + xMsRequestId?: string; +} + +// @public +export interface CloudHsmClustersBackupOptionalParams extends coreClient.OperationOptions { + backupRequestProperties?: BackupRequestProperties; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudHsmClustersBackupResponse = CloudHsmClustersBackupHeaders & BackupResult; + // @public export interface CloudHsmClustersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - autoGeneratedDomainNameLabelScope?: string; - backupProperties?: BackupProperties; - hsms?: CloudHsmProperties[]; + autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; identity?: ManagedServiceIdentity; - privateEndpointConnections?: PrivateEndpointConnection[]; - provisioningState?: ProvisioningState; - publicNetworkAccess?: string; - restoreProperties?: RestoreProperties; + publicNetworkAccess?: PublicNetworkAccess; resumeFrom?: string; - securityDomain?: CloudHsmClusterSecurityDomainProperties; sku?: CloudHsmClusterSku; tags?: { [propertyName: string]: string; @@ -187,10 +293,7 @@ export interface CloudHsmClustersDeleteOptionalParams extends coreClient.Operati } // @public -export interface CloudHsmClusterSecurityDomainProperties { - activationStatus?: string; - fipsState?: number; -} +export type CloudHsmClustersDeleteResponse = CloudHsmClustersDeleteHeaders; // @public export interface CloudHsmClustersGetOptionalParams extends coreClient.OperationOptions { @@ -242,6 +345,20 @@ export interface CloudHsmClustersListBySubscriptionOptionalParams extends coreCl // @public export type CloudHsmClustersListBySubscriptionResponse = CloudHsmClusterListResult; +// @public +export interface CloudHsmClustersRestoreHeaders { + xMsRequestId?: string; +} + +// @public +export interface CloudHsmClustersRestoreOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudHsmClustersRestoreResponse = CloudHsmClustersRestoreHeaders & RestoreResult; + // @public export interface CloudHsmClustersUpdateHeaders { location?: string; @@ -249,10 +366,8 @@ export interface CloudHsmClustersUpdateHeaders { // @public export interface CloudHsmClustersUpdateOptionalParams extends coreClient.OperationOptions { - backupProperties?: BackupProperties; identity?: ManagedServiceIdentity; resumeFrom?: string; - sku?: CloudHsmClusterSku; tags?: { [propertyName: string]: string; }; @@ -262,6 +377,36 @@ export interface CloudHsmClustersUpdateOptionalParams extends coreClient.Operati // @public export type CloudHsmClustersUpdateResponse = CloudHsmCluster; +// @public +export interface CloudHsmClustersValidateBackupPropertiesHeaders { + xMsRequestId?: string; +} + +// @public +export interface CloudHsmClustersValidateBackupPropertiesOptionalParams extends coreClient.OperationOptions { + backupRequestProperties?: BackupRequestProperties; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudHsmClustersValidateBackupPropertiesResponse = CloudHsmClustersValidateBackupPropertiesHeaders & BackupResult; + +// @public +export interface CloudHsmClustersValidateRestorePropertiesHeaders { + xMsRequestId?: string; +} + +// @public +export interface CloudHsmClustersValidateRestorePropertiesOptionalParams extends coreClient.OperationOptions { + restoreRequestProperties?: RestoreRequestProperties; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudHsmClustersValidateRestorePropertiesResponse = CloudHsmClustersValidateRestorePropertiesHeaders & RestoreResult; + // @public export interface CloudHsmProperties { fqdn?: string; @@ -273,13 +418,14 @@ export interface CloudHsmProperties { export type CreatedByType = string; // @public -export interface DedicatedHsm extends DedicatedHsmResource { +export interface DedicatedHsm extends TrackedResource { managementNetworkProfile?: NetworkProfile; networkProfile?: NetworkProfile; readonly provisioningState?: JsonWebKeyType; + sku: Sku; stampId?: string; readonly statusMessage?: string; - readonly systemData?: SystemDataAutoGenerated; + zones?: string[]; } // @public @@ -291,12 +437,20 @@ export interface DedicatedHsmCreateOrUpdateOptionalParams extends coreClient.Ope // @public export type DedicatedHsmCreateOrUpdateResponse = DedicatedHsm; +// @public +export interface DedicatedHsmDeleteHeaders { + location?: string; +} + // @public export interface DedicatedHsmDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type DedicatedHsmDeleteResponse = DedicatedHsmDeleteHeaders; + // @public export interface DedicatedHsmError { readonly error?: ErrorModel; @@ -359,33 +513,12 @@ export interface DedicatedHsmListResult { value?: DedicatedHsm[]; } -// @public -export interface DedicatedHsmOperation { - display?: DedicatedHsmOperationDisplay; - readonly isDataAction?: boolean; - name?: string; - origin?: string; -} - -// @public -export interface DedicatedHsmOperationDisplay { - description?: string; - operation?: string; - provider?: string; - resource?: string; -} - -// @public -export interface DedicatedHsmOperationListResult { - value?: DedicatedHsmOperation[]; -} - // @public export interface DedicatedHsmOperations { beginCreateOrUpdate(resourceGroupName: string, name: string, parameters: DedicatedHsm, options?: DedicatedHsmCreateOrUpdateOptionalParams): Promise, DedicatedHsmCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, name: string, parameters: DedicatedHsm, options?: DedicatedHsmCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, name: string, options?: DedicatedHsmDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, name: string, options?: DedicatedHsmDeleteOptionalParams): Promise; + beginDelete(resourceGroupName: string, name: string, options?: DedicatedHsmDeleteOptionalParams): Promise, DedicatedHsmDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, name: string, options?: DedicatedHsmDeleteOptionalParams): Promise; beginUpdate(resourceGroupName: string, name: string, options?: DedicatedHsmUpdateOptionalParams): Promise, DedicatedHsmUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, name: string, options?: DedicatedHsmUpdateOptionalParams): Promise; get(resourceGroupName: string, name: string, options?: DedicatedHsmGetOptionalParams): Promise; @@ -402,16 +535,8 @@ export interface DedicatedHsmPatchParameters { } // @public -export interface DedicatedHsmResource { - readonly id?: string; - location: string; - readonly name?: string; - sku?: Sku; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; - zones?: string[]; +export interface DedicatedHsmUpdateHeaders { + location?: string; } // @public @@ -440,6 +565,21 @@ export interface EndpointDetail { protocol?: string; } +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + 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 ErrorModel { readonly code?: string; @@ -447,6 +587,11 @@ export interface ErrorModel { readonly message?: string; } +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + // @public export function getContinuationToken(page: unknown): string | undefined; @@ -456,6 +601,36 @@ export type IdentityType = string; // @public export type JsonWebKeyType = string; +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownActivationState { + Active = "Active", + Failed = "Failed", + NotActivated = "NotActivated", + NotDefined = "NotDefined", + Unknown = "Unknown" +} + +// @public +export enum KnownAutoGeneratedDomainNameLabelScope { + NoReuse = "NoReuse", + ResourceGroupReuse = "ResourceGroupReuse", + SubscriptionReuse = "SubscriptionReuse", + TenantReuse = "TenantReuse" +} + +// @public +export enum KnownBackupRestoreOperationStatus { + Cancelled = "Cancelled", + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + // @public export enum KnownCloudHsmClusterSkuFamily { // (undocumented) @@ -497,6 +672,13 @@ export enum KnownManagedServiceIdentityType { UserAssigned = "UserAssigned" } +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + // @public export enum KnownPrivateEndpointConnectionProvisioningState { Canceled = "Canceled", @@ -524,6 +706,11 @@ export enum KnownProvisioningState { Succeeded = "Succeeded" } +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled" +} + // @public export enum KnownSkuName { PayShield10KLMK1CPS250 = "payShield10K_LMK1_CPS250", @@ -550,8 +737,8 @@ export type ManagedServiceIdentityType = string; // @public export interface NetworkInterface { - readonly id?: string; privateIpAddress?: string; + readonly resourceId?: string; } // @public @@ -560,9 +747,32 @@ export interface NetworkProfile { subnet?: ApiEntityReference; } +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + // @public export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -570,7 +780,10 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption } // @public -export type OperationsListResponse = DedicatedHsmOperationListResult; +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; // @public export interface OutboundEnvironmentEndpoint { @@ -638,6 +851,7 @@ export interface PrivateLinkResource extends Resource { // @public export interface PrivateLinkResourceListResult { + readonly nextLink?: string; value?: PrivateLinkResource[]; } @@ -655,6 +869,9 @@ export type ProvisioningState = string; export interface ProxyResource extends Resource { } +// @public +export type PublicNetworkAccess = string; + // @public export interface Resource { readonly id?: string; @@ -664,15 +881,13 @@ export interface Resource { } // @public -export interface ResourceListResult { - nextLink?: string; - value?: DedicatedHsmResource[]; +export interface RestoreRequestProperties extends BackupRestoreRequestBaseProperties { + backupId: string; } // @public -export interface RestoreProperties { - azureStorageResourceUri?: string; - foldername?: string; +export interface RestoreResult { + properties?: BackupRestoreBaseResultProperties; } // @public @@ -693,16 +908,6 @@ export interface SystemData { lastModifiedByType?: CreatedByType; } -// @public -export interface SystemDataAutoGenerated { - createdAt?: Date; - createdBy?: string; - createdByType?: IdentityType; - lastModifiedAt?: Date; - lastModifiedBy?: string; - lastModifiedByType?: IdentityType; -} - // @public export interface TrackedResource extends Resource { location: string; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterBackupStatusGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterBackupStatusGetSample.ts new file mode 100644 index 000000000000..7cfee1b08405 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterBackupStatusGetSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureHSMResourceProvider } from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the backup operation status of the specified Cloud HSM Cluster + * + * @summary Gets the backup operation status of the specified Cloud HSM Cluster + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Backup_Pending_MaximumSet_Gen.json + */ +async function cloudHsmClusterGetBackupStatusMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const jobId = "572a45927fc240e1ac075de27371680b"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusterBackupStatus.get( + resourceGroupName, + cloudHsmClusterName, + jobId, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterGetBackupStatusMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts index f41ebf976f81..90a3d1d1db04 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { PrivateEndpointConnection, - AzureHSMResourceProvider + AzureHSMResourceProvider, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates or updates the private endpoint connection for the Cloud Hsm Cluster. * * @summary Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionCreateMaximumSetGen() { const subscriptionId = @@ -34,8 +34,8 @@ async function cloudHsmClusterPrivateEndpointConnectionCreateMaximumSetGen() { const properties: PrivateEndpointConnection = { privateLinkServiceConnectionState: { description: "My name is Joe and I'm approving this.", - status: "Approved" - } + status: "Approved", + }, }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); @@ -43,7 +43,7 @@ async function cloudHsmClusterPrivateEndpointConnectionCreateMaximumSetGen() { resourceGroupName, cloudHsmClusterName, peConnectionName, - properties + properties, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts index 12628ec7b9d5..2d827c54086c 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes the private endpoint connection for the Cloud Hsm Cluster. * * @summary Deletes the private endpoint connection for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionDeleteMaximumSetGen() { const subscriptionId = @@ -30,11 +30,12 @@ async function cloudHsmClusterPrivateEndpointConnectionDeleteMaximumSetGen() { const peConnectionName = "sample-pec"; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); - const result = await client.cloudHsmClusterPrivateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - cloudHsmClusterName, - peConnectionName - ); + const result = + await client.cloudHsmClusterPrivateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + cloudHsmClusterName, + peConnectionName, + ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsGetSample.ts index afd73be39e13..44e86bab1528 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsGetSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateEndpointConnectionsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the private endpoint connection for the Cloud Hsm Cluster. * * @summary Gets the private endpoint connection for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionGetMaximumSetGen() { const subscriptionId = @@ -33,7 +33,7 @@ async function cloudHsmClusterPrivateEndpointConnectionGetMaximumSetGen() { const result = await client.cloudHsmClusterPrivateEndpointConnections.get( resourceGroupName, cloudHsmClusterName, - peConnectionName + peConnectionName, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts index 4bb3383db7fd..1b959402d91f 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the private link resources supported for the Cloud Hsm Cluster. * * @summary Gets the private link resources supported for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen() { const subscriptionId = @@ -29,11 +29,14 @@ async function cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen() const cloudHsmClusterName = "chsm1"; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); - const result = await client.cloudHsmClusterPrivateLinkResources.listByCloudHsmCluster( + const resArray = new Array(); + for await (let item of client.cloudHsmClusterPrivateLinkResources.listByCloudHsmCluster( resourceGroupName, - cloudHsmClusterName - ); - console.log(result); + cloudHsmClusterName, + )) { + resArray.push(item); + } + console.log(resArray); } async function main() { diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterRestoreStatusGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterRestoreStatusGetSample.ts new file mode 100644 index 000000000000..caba331a773d --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClusterRestoreStatusGetSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureHSMResourceProvider } from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the restore operation status of the specified Cloud HSM Cluster + * + * @summary Gets the restore operation status of the specified Cloud HSM Cluster + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Restore_Pending_MaximumSet_Gen.json + */ +async function cloudHsmClusterGetRestoreStatusMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const jobId = "572a45927fc240e1ac075de27371680b"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusterRestoreStatus.get( + resourceGroupName, + cloudHsmClusterName, + jobId, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterGetRestoreStatusMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersBackupSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersBackupSample.ts new file mode 100644 index 000000000000..9d0f6d3d6651 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersBackupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureHSMResourceProvider } from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a backup of the Cloud HSM Cluster in the specified subscription + * + * @summary Create a backup of the Cloud HSM Cluster in the specified subscription + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json + */ +async function cloudHsmClusterCreateBackupMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusters.beginBackupAndWait( + resourceGroupName, + cloudHsmClusterName, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterCreateBackupMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersCreateOrUpdateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersCreateOrUpdateSample.ts index 4703402a8023..7875f1db417e 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersCreateOrUpdateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersCreateOrUpdateSample.ts @@ -11,7 +11,7 @@ import { CloudHsmClustersCreateOrUpdateOptionalParams, AzureHSMResourceProvider, - CloudHsmClusterSku + CloudHsmClusterSku, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -22,7 +22,7 @@ dotenv.config(); * This sample demonstrates how to Create or Update a Cloud HSM Cluster in the specified subscription. * * @summary Create or Update a Cloud HSM Cluster in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json */ async function cloudHsmClusterCreateOrUpdateMaximumSetGen() { const subscriptionId = @@ -33,17 +33,18 @@ async function cloudHsmClusterCreateOrUpdateMaximumSetGen() { const cloudHsmClusterName = "chsm1"; const tags = { dept: "hsm", environment: "dogfood" }; const location = "eastus2"; - const sku: CloudHsmClusterSku = { name: "Standard_B1", family: "B" }; const identity = { type: "UserAssigned", userAssignedIdentities: { - "/subscriptions/00000000000000000000000000000000/resourceGroups/contosoResources/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} - } + "/subscriptions/00000000000000000000000000000000/resourceGroups/contosoResources/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, }; + const sku: CloudHsmClusterSku = { name: "Standard_B1", family: "B" }; const options: CloudHsmClustersCreateOrUpdateOptionalParams = { tags, + identity, sku, - identity }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); @@ -51,7 +52,7 @@ async function cloudHsmClusterCreateOrUpdateMaximumSetGen() { resourceGroupName, cloudHsmClusterName, location, - options + options, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersDeleteSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersDeleteSample.ts index 354090618b17..3be5d135f712 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersDeleteSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes the specified Cloud HSM Cluster * * @summary Deletes the specified Cloud HSM Cluster - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json */ async function cloudHsmClusterDeleteMaximumSetGen() { const subscriptionId = @@ -31,7 +31,7 @@ async function cloudHsmClusterDeleteMaximumSetGen() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.cloudHsmClusters.beginDeleteAndWait( resourceGroupName, - cloudHsmClusterName + cloudHsmClusterName, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersGetSample.ts index 91311f57d238..809bb9ce1b79 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersGetSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the specified Cloud HSM Cluster * * @summary Gets the specified Cloud HSM Cluster - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json */ async function cloudHsmClusterGetMaximumSetGen() { const subscriptionId = @@ -31,7 +31,7 @@ async function cloudHsmClusterGetMaximumSetGen() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.cloudHsmClusters.get( resourceGroupName, - cloudHsmClusterName + cloudHsmClusterName, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersListByResourceGroupSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersListByResourceGroupSample.ts index fe78d379b24a..992050e527b4 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersListByResourceGroupSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersListByResourceGroupSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. * * @summary The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json */ async function cloudHsmClusterListByResourceGroupMaximumSetGen() { const subscriptionId = @@ -30,7 +30,7 @@ async function cloudHsmClusterListByResourceGroupMaximumSetGen() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const resArray = new Array(); for await (let item of client.cloudHsmClusters.listByResourceGroup( - resourceGroupName + resourceGroupName, )) { resArray.push(item); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersListBySubscriptionSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersListBySubscriptionSample.ts index dc79fb81adb4..ee4a43206afe 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersListBySubscriptionSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersListBySubscriptionSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the Cloud HSM Clusters associated with the subscription. * * @summary The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json */ async function cloudHsmClusterListBySubscriptionMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersRestoreSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersRestoreSample.ts new file mode 100644 index 000000000000..db2557e8db2d --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersRestoreSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RestoreRequestProperties, + AzureHSMResourceProvider, +} from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restores all key materials of a specified Cloud HSM Cluster + * + * @summary Restores all key materials of a specified Cloud HSM Cluster + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json + */ +async function cloudHsmClusterRestoreMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const restoreRequestProperties: RestoreRequestProperties = { + azureStorageBlobContainerUri: + "https://myaccount.blob.core.windows.net/sascontainer/sasContainer", + backupId: "backupId", + }; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusters.beginRestoreAndWait( + resourceGroupName, + cloudHsmClusterName, + restoreRequestProperties, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersUpdateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersUpdateSample.ts index 70a475a9e13f..5eaf3c2e886b 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersUpdateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersUpdateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { CloudHsmClustersUpdateOptionalParams, - AzureHSMResourceProvider + AzureHSMResourceProvider, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Update a Cloud HSM Cluster in the specified subscription. * * @summary Update a Cloud HSM Cluster in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json */ async function cloudHsmClusterUpdateMaximumSetGen() { const subscriptionId = @@ -34,8 +34,9 @@ async function cloudHsmClusterUpdateMaximumSetGen() { const identity = { type: "UserAssigned", userAssignedIdentities: { - "/subscriptions/00000000000000000000000000000000/resourceGroups/contosoResources/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} - } + "/subscriptions/00000000000000000000000000000000/resourceGroups/contosoResources/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, }; const options: CloudHsmClustersUpdateOptionalParams = { tags, identity }; const credential = new DefaultAzureCredential(); @@ -43,7 +44,7 @@ async function cloudHsmClusterUpdateMaximumSetGen() { const result = await client.cloudHsmClusters.beginUpdateAndWait( resourceGroupName, cloudHsmClusterName, - options + options, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersValidateBackupPropertiesSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersValidateBackupPropertiesSample.ts new file mode 100644 index 000000000000..51e06d582d5b --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersValidateBackupPropertiesSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureHSMResourceProvider } from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. + * + * @summary Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json + */ +async function cloudHsmClusterValidateBackupValidationMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = + await client.cloudHsmClusters.beginValidateBackupPropertiesAndWait( + resourceGroupName, + cloudHsmClusterName, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterValidateBackupValidationMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersValidateRestorePropertiesSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersValidateRestorePropertiesSample.ts new file mode 100644 index 000000000000..b71dbb905916 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/cloudHsmClustersValidateRestorePropertiesSample.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RestoreRequestProperties, + CloudHsmClustersValidateRestorePropertiesOptionalParams, + AzureHSMResourceProvider, +} from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Queued validating pre restore operation + * + * @summary Queued validating pre restore operation + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json + */ +async function cloudHsmClusterValidateRestoreMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const restoreRequestProperties: RestoreRequestProperties = { + azureStorageBlobContainerUri: + "https://myaccount.blob.core.windows.net/sascontainer/sasContainer", + backupId: "backupId", + }; + const options: CloudHsmClustersValidateRestorePropertiesOptionalParams = { + restoreRequestProperties, + }; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = + await client.cloudHsmClusters.beginValidateRestorePropertiesAndWait( + resourceGroupName, + cloudHsmClusterName, + options, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterValidateRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmCreateOrUpdateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmCreateOrUpdateSample.ts index 3f97b4ae7584..3a342427b738 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmCreateOrUpdateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmCreateOrUpdateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { DedicatedHsm, - AzureHSMResourceProvider + AzureHSMResourceProvider, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Create or Update a dedicated HSM in the specified subscription. * * @summary Create or Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_CreateOrUpdate.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_CreateOrUpdate.json */ async function createANewOrUpdateAnExistingDedicatedHsm() { const subscriptionId = @@ -35,20 +35,20 @@ async function createANewOrUpdateAnExistingDedicatedHsm() { networkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.1" }], subnet: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01" - } + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + }, }, sku: { name: "SafeNet Luna Network HSM A790" }, stampId: "stamp01", - tags: { dept: "hsm", environment: "dogfood" } + tags: { dept: "hsm", environment: "dogfood" }, }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.beginCreateOrUpdateAndWait( resourceGroupName, name, - parameters + parameters, ); console.log(result); } @@ -57,7 +57,7 @@ async function createANewOrUpdateAnExistingDedicatedHsm() { * This sample demonstrates how to Create or Update a dedicated HSM in the specified subscription. * * @summary Create or Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_CreateOrUpdate.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_CreateOrUpdate.json */ async function createANewOrUpdateAnExistingPaymentHsm() { const subscriptionId = @@ -71,20 +71,20 @@ async function createANewOrUpdateAnExistingPaymentHsm() { networkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.1" }], subnet: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01" - } + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + }, }, sku: { name: "payShield10K_LMK1_CPS60" }, stampId: "stamp01", - tags: { dept: "hsm", environment: "dogfood" } + tags: { dept: "hsm", environment: "dogfood" }, }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.beginCreateOrUpdateAndWait( resourceGroupName, name, - parameters + parameters, ); console.log(result); } @@ -93,7 +93,7 @@ async function createANewOrUpdateAnExistingPaymentHsm() { * This sample demonstrates how to Create or Update a dedicated HSM in the specified subscription. * * @summary Create or Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json */ async function createANewOrUpdateAnExistingPaymentHsmWithManagementProfile() { const subscriptionId = @@ -107,27 +107,27 @@ async function createANewOrUpdateAnExistingPaymentHsmWithManagementProfile() { managementNetworkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.2" }], subnet: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01" - } + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + }, }, networkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.1" }], subnet: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01" - } + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + }, }, sku: { name: "payShield10K_LMK1_CPS60" }, stampId: "stamp01", - tags: { dept: "hsm", environment: "dogfood" } + tags: { dept: "hsm", environment: "dogfood" }, }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.beginCreateOrUpdateAndWait( resourceGroupName, name, - parameters + parameters, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmDeleteSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmDeleteSample.ts index 0769b78971c9..f664b377abac 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmDeleteSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes the specified Azure Dedicated HSM. * * @summary Deletes the specified Azure Dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Delete.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Delete.json */ async function deleteADedicatedHsm() { const subscriptionId = @@ -31,7 +31,7 @@ async function deleteADedicatedHsm() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.beginDeleteAndWait( resourceGroupName, - name + name, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmGetSample.ts index 3de06c720b51..2df1b9876d10 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmGetSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the specified Azure dedicated HSM. * * @summary Gets the specified Azure dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Get.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Get.json */ async function getADedicatedHsm() { const subscriptionId = @@ -31,7 +31,7 @@ async function getADedicatedHsm() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.get( resourceGroupName, - name + name, ); console.log(result); } @@ -40,7 +40,7 @@ async function getADedicatedHsm() { * This sample demonstrates how to Gets the specified Azure dedicated HSM. * * @summary Gets the specified Azure dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Get.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Get.json */ async function getAPaymentHsm() { const subscriptionId = @@ -53,7 +53,7 @@ async function getAPaymentHsm() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.get( resourceGroupName, - name + name, ); console.log(result); } @@ -62,7 +62,7 @@ async function getAPaymentHsm() { * This sample demonstrates how to Gets the specified Azure dedicated HSM. * * @summary Gets the specified Azure dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json */ async function getAPaymentHsmWith20181031PreviewApiVersion() { const subscriptionId = @@ -75,7 +75,7 @@ async function getAPaymentHsmWith20181031PreviewApiVersion() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.get( resourceGroupName, - name + name, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListByResourceGroupSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListByResourceGroupSample.ts index 3616b82ed5f0..1a9bbaab95ec 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListByResourceGroupSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListByResourceGroupSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. * * @summary The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListByResourceGroup.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListByResourceGroup.json */ async function listDedicatedHsmDevicesInAResourceGroup() { const subscriptionId = @@ -30,7 +30,7 @@ async function listDedicatedHsmDevicesInAResourceGroup() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const resArray = new Array(); for await (let item of client.dedicatedHsmOperations.listByResourceGroup( - resourceGroupName + resourceGroupName, )) { resArray.push(item); } @@ -41,7 +41,7 @@ async function listDedicatedHsmDevicesInAResourceGroup() { * This sample demonstrates how to The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. * * @summary The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_ListByResourceGroup.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_ListByResourceGroup.json */ async function listDedicatedHsmDevicesInAResourceGroupIncludingPaymentHsm() { const subscriptionId = @@ -53,7 +53,7 @@ async function listDedicatedHsmDevicesInAResourceGroupIncludingPaymentHsm() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const resArray = new Array(); for await (let item of client.dedicatedHsmOperations.listByResourceGroup( - resourceGroupName + resourceGroupName, )) { resArray.push(item); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListBySubscriptionSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListBySubscriptionSample.ts index 8dbe9e692b59..f490109654e5 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListBySubscriptionSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListBySubscriptionSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the dedicated HSMs associated with the subscription. * * @summary The List operation gets information about the dedicated HSMs associated with the subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListBySubscription.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListBySubscription.json */ async function listDedicatedHsmDevicesInASubscription() { const subscriptionId = @@ -37,7 +37,7 @@ async function listDedicatedHsmDevicesInASubscription() { * This sample demonstrates how to The List operation gets information about the dedicated HSMs associated with the subscription. * * @summary The List operation gets information about the dedicated HSMs associated with the subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_ListBySubscription.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_ListBySubscription.json */ async function listDedicatedHsmDevicesInASubscriptionIncludingPaymentHsm() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts index ac7f75faca85..550d752071d0 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. * * @summary Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/GetOutboundNetworkDependenciesEndpointsList.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/GetOutboundNetworkDependenciesEndpointsList.json */ async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { const subscriptionId = @@ -32,7 +32,7 @@ async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { const resArray = new Array(); for await (let item of client.dedicatedHsmOperations.listOutboundNetworkDependenciesEndpoints( resourceGroupName, - name + name, )) { resArray.push(item); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmUpdateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmUpdateSample.ts index 0bc04cf0f6c8..a5ebb2c7cdb5 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmUpdateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/dedicatedHsmUpdateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { DedicatedHsmUpdateOptionalParams, - AzureHSMResourceProvider + AzureHSMResourceProvider, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Update a dedicated HSM in the specified subscription. * * @summary Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Update.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Update.json */ async function updateAnExistingDedicatedHsm() { const subscriptionId = @@ -37,7 +37,7 @@ async function updateAnExistingDedicatedHsm() { const result = await client.dedicatedHsmOperations.beginUpdateAndWait( resourceGroupName, name, - options + options, ); console.log(result); } @@ -46,7 +46,7 @@ async function updateAnExistingDedicatedHsm() { * This sample demonstrates how to Update a dedicated HSM in the specified subscription. * * @summary Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Update.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Update.json */ async function updateAnExistingPaymentHsm() { const subscriptionId = @@ -62,7 +62,7 @@ async function updateAnExistingPaymentHsm() { const result = await client.dedicatedHsmOperations.beginUpdateAndWait( resourceGroupName, name, - options + options, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/operationsListSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/operationsListSample.ts index d362324f525a..272191bacf6e 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/operationsListSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/operationsListSample.ts @@ -15,10 +15,10 @@ import * as dotenv from "dotenv"; dotenv.config(); /** - * This sample demonstrates how to Get a list of Dedicated HSM operations. + * This sample demonstrates how to Get a list of Hardware Security Modules operations. * - * @summary Get a list of Dedicated HSM operations. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_OperationsList.json + * @summary Get a list of Hardware Security Modules operations. + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/OperationsList.json */ async function getAListOfDedicatedHsmOperations() { const subscriptionId = @@ -34,10 +34,10 @@ async function getAListOfDedicatedHsmOperations() { } /** - * This sample demonstrates how to Get a list of Dedicated HSM operations. + * This sample demonstrates how to Get a list of Hardware Security Modules operations. * - * @summary Get a list of Dedicated HSM operations. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_OperationsList.json + * @summary Get a list of Hardware Security Modules operations. + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/OperationsList.json */ async function getAListOfPaymentHsmOperations() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/privateEndpointConnectionsListByCloudHsmClusterSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/privateEndpointConnectionsListByCloudHsmClusterSample.ts index cef91d6ca660..d03d392931e2 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/privateEndpointConnectionsListByCloudHsmClusterSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples-dev/privateEndpointConnectionsListByCloudHsmClusterSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster * * @summary The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionListByResourceMaximumSetGen() { const subscriptionId = @@ -32,7 +32,7 @@ async function cloudHsmClusterPrivateEndpointConnectionListByResourceMaximumSetG const resArray = new Array(); for await (let item of client.privateEndpointConnections.listByCloudHsmCluster( resourceGroupName, - cloudHsmClusterName + cloudHsmClusterName, )) { resArray.push(item); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/README.md b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/README.md index 112fe07ff7be..03c3db812c57 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/README.md +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/README.md @@ -2,27 +2,33 @@ These sample programs show how to use the JavaScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [cloudHsmClusterPrivateEndpointConnectionsCreateSample.js][cloudhsmclusterprivateendpointconnectionscreatesample] | Creates or updates the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json | -| [cloudHsmClusterPrivateEndpointConnectionsDeleteSample.js][cloudhsmclusterprivateendpointconnectionsdeletesample] | Deletes the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json | -| [cloudHsmClusterPrivateEndpointConnectionsGetSample.js][cloudhsmclusterprivateendpointconnectionsgetsample] | Gets the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json | -| [cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.js][cloudhsmclusterprivatelinkresourceslistbycloudhsmclustersample] | Gets the private link resources supported for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json | -| [cloudHsmClustersCreateOrUpdateSample.js][cloudhsmclusterscreateorupdatesample] | Create or Update a Cloud HSM Cluster in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json | -| [cloudHsmClustersDeleteSample.js][cloudhsmclustersdeletesample] | Deletes the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json | -| [cloudHsmClustersGetSample.js][cloudhsmclustersgetsample] | Gets the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json | -| [cloudHsmClustersListByResourceGroupSample.js][cloudhsmclusterslistbyresourcegroupsample] | The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json | -| [cloudHsmClustersListBySubscriptionSample.js][cloudhsmclusterslistbysubscriptionsample] | The List operation gets information about the Cloud HSM Clusters associated with the subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json | -| [cloudHsmClustersUpdateSample.js][cloudhsmclustersupdatesample] | Update a Cloud HSM Cluster in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json | -| [dedicatedHsmCreateOrUpdateSample.js][dedicatedhsmcreateorupdatesample] | Create or Update a dedicated HSM in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_CreateOrUpdate.json | -| [dedicatedHsmDeleteSample.js][dedicatedhsmdeletesample] | Deletes the specified Azure Dedicated HSM. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Delete.json | -| [dedicatedHsmGetSample.js][dedicatedhsmgetsample] | Gets the specified Azure dedicated HSM. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Get.json | -| [dedicatedHsmListByResourceGroupSample.js][dedicatedhsmlistbyresourcegroupsample] | The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListByResourceGroup.json | -| [dedicatedHsmListBySubscriptionSample.js][dedicatedhsmlistbysubscriptionsample] | The List operation gets information about the dedicated HSMs associated with the subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListBySubscription.json | -| [dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js][dedicatedhsmlistoutboundnetworkdependenciesendpointssample] | Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/GetOutboundNetworkDependenciesEndpointsList.json | -| [dedicatedHsmUpdateSample.js][dedicatedhsmupdatesample] | Update a dedicated HSM in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Update.json | -| [operationsListSample.js][operationslistsample] | Get a list of Dedicated HSM operations. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_OperationsList.json | -| [privateEndpointConnectionsListByCloudHsmClusterSample.js][privateendpointconnectionslistbycloudhsmclustersample] | The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [cloudHsmClusterBackupStatusGetSample.js][cloudhsmclusterbackupstatusgetsample] | Gets the backup operation status of the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Backup_Pending_MaximumSet_Gen.json | +| [cloudHsmClusterPrivateEndpointConnectionsCreateSample.js][cloudhsmclusterprivateendpointconnectionscreatesample] | Creates or updates the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json | +| [cloudHsmClusterPrivateEndpointConnectionsDeleteSample.js][cloudhsmclusterprivateendpointconnectionsdeletesample] | Deletes the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json | +| [cloudHsmClusterPrivateEndpointConnectionsGetSample.js][cloudhsmclusterprivateendpointconnectionsgetsample] | Gets the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json | +| [cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.js][cloudhsmclusterprivatelinkresourceslistbycloudhsmclustersample] | Gets the private link resources supported for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json | +| [cloudHsmClusterRestoreStatusGetSample.js][cloudhsmclusterrestorestatusgetsample] | Gets the restore operation status of the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Restore_Pending_MaximumSet_Gen.json | +| [cloudHsmClustersBackupSample.js][cloudhsmclustersbackupsample] | Create a backup of the Cloud HSM Cluster in the specified subscription x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json | +| [cloudHsmClustersCreateOrUpdateSample.js][cloudhsmclusterscreateorupdatesample] | Create or Update a Cloud HSM Cluster in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json | +| [cloudHsmClustersDeleteSample.js][cloudhsmclustersdeletesample] | Deletes the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json | +| [cloudHsmClustersGetSample.js][cloudhsmclustersgetsample] | Gets the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json | +| [cloudHsmClustersListByResourceGroupSample.js][cloudhsmclusterslistbyresourcegroupsample] | The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json | +| [cloudHsmClustersListBySubscriptionSample.js][cloudhsmclusterslistbysubscriptionsample] | The List operation gets information about the Cloud HSM Clusters associated with the subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json | +| [cloudHsmClustersRestoreSample.js][cloudhsmclustersrestoresample] | Restores all key materials of a specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json | +| [cloudHsmClustersUpdateSample.js][cloudhsmclustersupdatesample] | Update a Cloud HSM Cluster in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json | +| [cloudHsmClustersValidateBackupPropertiesSample.js][cloudhsmclustersvalidatebackuppropertiessample] | Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json | +| [cloudHsmClustersValidateRestorePropertiesSample.js][cloudhsmclustersvalidaterestorepropertiessample] | Queued validating pre restore operation x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json | +| [dedicatedHsmCreateOrUpdateSample.js][dedicatedhsmcreateorupdatesample] | Create or Update a dedicated HSM in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_CreateOrUpdate.json | +| [dedicatedHsmDeleteSample.js][dedicatedhsmdeletesample] | Deletes the specified Azure Dedicated HSM. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Delete.json | +| [dedicatedHsmGetSample.js][dedicatedhsmgetsample] | Gets the specified Azure dedicated HSM. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Get.json | +| [dedicatedHsmListByResourceGroupSample.js][dedicatedhsmlistbyresourcegroupsample] | The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListByResourceGroup.json | +| [dedicatedHsmListBySubscriptionSample.js][dedicatedhsmlistbysubscriptionsample] | The List operation gets information about the dedicated HSMs associated with the subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListBySubscription.json | +| [dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js][dedicatedhsmlistoutboundnetworkdependenciesendpointssample] | Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/GetOutboundNetworkDependenciesEndpointsList.json | +| [dedicatedHsmUpdateSample.js][dedicatedhsmupdatesample] | Update a dedicated HSM in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Update.json | +| [operationsListSample.js][operationslistsample] | Get a list of Hardware Security Modules operations. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/OperationsList.json | +| [privateEndpointConnectionsListByCloudHsmClusterSample.js][privateendpointconnectionslistbycloudhsmclustersample] | The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json | ## Prerequisites @@ -49,29 +55,35 @@ npm install 3. Run whichever samples you like (note that some samples may require additional setup, see the table above): ```bash -node cloudHsmClusterPrivateEndpointConnectionsCreateSample.js +node cloudHsmClusterBackupStatusGetSample.js ``` Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx dev-tool run vendored cross-env HARDWARESECURITYMODULES_SUBSCRIPTION_ID="" HARDWARESECURITYMODULES_RESOURCE_GROUP="" node cloudHsmClusterPrivateEndpointConnectionsCreateSample.js +npx dev-tool run vendored cross-env HARDWARESECURITYMODULES_SUBSCRIPTION_ID="" HARDWARESECURITYMODULES_RESOURCE_GROUP="" node cloudHsmClusterBackupStatusGetSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. +[cloudhsmclusterbackupstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterBackupStatusGetSample.js [cloudhsmclusterprivateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsCreateSample.js [cloudhsmclusterprivateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.js [cloudhsmclusterprivateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsGetSample.js [cloudhsmclusterprivatelinkresourceslistbycloudhsmclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.js +[cloudhsmclusterrestorestatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterRestoreStatusGetSample.js +[cloudhsmclustersbackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersBackupSample.js [cloudhsmclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersCreateOrUpdateSample.js [cloudhsmclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersDeleteSample.js [cloudhsmclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersGetSample.js [cloudhsmclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListByResourceGroupSample.js [cloudhsmclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListBySubscriptionSample.js +[cloudhsmclustersrestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersRestoreSample.js [cloudhsmclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersUpdateSample.js +[cloudhsmclustersvalidatebackuppropertiessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersValidateBackupPropertiesSample.js +[cloudhsmclustersvalidaterestorepropertiessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersValidateRestorePropertiesSample.js [dedicatedhsmcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmCreateOrUpdateSample.js [dedicatedhsmdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmDeleteSample.js [dedicatedhsmgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmGetSample.js diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterBackupStatusGetSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterBackupStatusGetSample.js new file mode 100644 index 000000000000..c4bc3d2310e6 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterBackupStatusGetSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureHSMResourceProvider } = require("@azure/arm-hardwaresecuritymodules"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the backup operation status of the specified Cloud HSM Cluster + * + * @summary Gets the backup operation status of the specified Cloud HSM Cluster + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Backup_Pending_MaximumSet_Gen.json + */ +async function cloudHsmClusterGetBackupStatusMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const jobId = "572a45927fc240e1ac075de27371680b"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusterBackupStatus.get( + resourceGroupName, + cloudHsmClusterName, + jobId, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterGetBackupStatusMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsCreateSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsCreateSample.js index 92d3c52e1371..28dfaba8cebf 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsCreateSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsCreateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Creates or updates the private endpoint connection for the Cloud Hsm Cluster. * * @summary Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionCreateMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.js index f7c8e116ecf5..87d488429d5e 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Deletes the private endpoint connection for the Cloud Hsm Cluster. * * @summary Deletes the private endpoint connection for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionDeleteMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsGetSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsGetSample.js index 7a5cfaf28df9..4d5ad960e10c 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsGetSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateEndpointConnectionsGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets the private endpoint connection for the Cloud Hsm Cluster. * * @summary Gets the private endpoint connection for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionGetMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.js index 2882e7b33342..1a5c1f1bb460 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets the private link resources supported for the Cloud Hsm Cluster. * * @summary Gets the private link resources supported for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen() { const subscriptionId = @@ -26,11 +26,14 @@ async function cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen() const cloudHsmClusterName = "chsm1"; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); - const result = await client.cloudHsmClusterPrivateLinkResources.listByCloudHsmCluster( + const resArray = new Array(); + for await (let item of client.cloudHsmClusterPrivateLinkResources.listByCloudHsmCluster( resourceGroupName, cloudHsmClusterName, - ); - console.log(result); + )) { + resArray.push(item); + } + console.log(resArray); } async function main() { diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterRestoreStatusGetSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterRestoreStatusGetSample.js new file mode 100644 index 000000000000..7eac68c0d0d2 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClusterRestoreStatusGetSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureHSMResourceProvider } = require("@azure/arm-hardwaresecuritymodules"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the restore operation status of the specified Cloud HSM Cluster + * + * @summary Gets the restore operation status of the specified Cloud HSM Cluster + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Restore_Pending_MaximumSet_Gen.json + */ +async function cloudHsmClusterGetRestoreStatusMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const jobId = "572a45927fc240e1ac075de27371680b"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusterRestoreStatus.get( + resourceGroupName, + cloudHsmClusterName, + jobId, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterGetRestoreStatusMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersBackupSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersBackupSample.js new file mode 100644 index 000000000000..3e41aeae7a51 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersBackupSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureHSMResourceProvider } = require("@azure/arm-hardwaresecuritymodules"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a backup of the Cloud HSM Cluster in the specified subscription + * + * @summary Create a backup of the Cloud HSM Cluster in the specified subscription + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json + */ +async function cloudHsmClusterCreateBackupMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusters.beginBackupAndWait( + resourceGroupName, + cloudHsmClusterName, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterCreateBackupMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersCreateOrUpdateSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersCreateOrUpdateSample.js index e0ec19e87013..535bfc7ce05d 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersCreateOrUpdateSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersCreateOrUpdateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Create or Update a Cloud HSM Cluster in the specified subscription. * * @summary Create or Update a Cloud HSM Cluster in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json */ async function cloudHsmClusterCreateOrUpdateMaximumSetGen() { const subscriptionId = @@ -26,7 +26,6 @@ async function cloudHsmClusterCreateOrUpdateMaximumSetGen() { const cloudHsmClusterName = "chsm1"; const tags = { dept: "hsm", environment: "dogfood" }; const location = "eastus2"; - const sku = { name: "Standard_B1", family: "B" }; const identity = { type: "UserAssigned", userAssignedIdentities: { @@ -34,10 +33,11 @@ async function cloudHsmClusterCreateOrUpdateMaximumSetGen() { {}, }, }; + const sku = { name: "Standard_B1", family: "B" }; const options = { tags, - sku, identity, + sku, }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersDeleteSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersDeleteSample.js index d753bd6d4d6c..3047aefcb6c7 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersDeleteSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersDeleteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Deletes the specified Cloud HSM Cluster * * @summary Deletes the specified Cloud HSM Cluster - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json */ async function cloudHsmClusterDeleteMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersGetSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersGetSample.js index 769ee245f8e7..db3039ffd091 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersGetSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets the specified Cloud HSM Cluster * * @summary Gets the specified Cloud HSM Cluster - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json */ async function cloudHsmClusterGetMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListByResourceGroupSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListByResourceGroupSample.js index afc547233d07..0b94860ea003 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListByResourceGroupSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListByResourceGroupSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. * * @summary The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json */ async function cloudHsmClusterListByResourceGroupMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListBySubscriptionSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListBySubscriptionSample.js index 37b2e03dc602..1e1500842000 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListBySubscriptionSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersListBySubscriptionSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to The List operation gets information about the Cloud HSM Clusters associated with the subscription. * * @summary The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json */ async function cloudHsmClusterListBySubscriptionMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersRestoreSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersRestoreSample.js new file mode 100644 index 000000000000..e5704fe76222 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersRestoreSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureHSMResourceProvider } = require("@azure/arm-hardwaresecuritymodules"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Restores all key materials of a specified Cloud HSM Cluster + * + * @summary Restores all key materials of a specified Cloud HSM Cluster + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json + */ +async function cloudHsmClusterRestoreMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const restoreRequestProperties = { + azureStorageBlobContainerUri: + "https://myaccount.blob.core.windows.net/sascontainer/sasContainer", + backupId: "backupId", + }; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusters.beginRestoreAndWait( + resourceGroupName, + cloudHsmClusterName, + restoreRequestProperties, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersUpdateSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersUpdateSample.js index 32feeb37f31d..076297eff1fb 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersUpdateSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersUpdateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Update a Cloud HSM Cluster in the specified subscription. * * @summary Update a Cloud HSM Cluster in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json */ async function cloudHsmClusterUpdateMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersValidateBackupPropertiesSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersValidateBackupPropertiesSample.js new file mode 100644 index 000000000000..2b6b6bc57a95 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersValidateBackupPropertiesSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureHSMResourceProvider } = require("@azure/arm-hardwaresecuritymodules"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. + * + * @summary Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json + */ +async function cloudHsmClusterValidateBackupValidationMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusters.beginValidateBackupPropertiesAndWait( + resourceGroupName, + cloudHsmClusterName, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterValidateBackupValidationMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersValidateRestorePropertiesSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersValidateRestorePropertiesSample.js new file mode 100644 index 000000000000..d4c8bf5a6631 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/cloudHsmClustersValidateRestorePropertiesSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureHSMResourceProvider } = require("@azure/arm-hardwaresecuritymodules"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Queued validating pre restore operation + * + * @summary Queued validating pre restore operation + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json + */ +async function cloudHsmClusterValidateRestoreMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const restoreRequestProperties = { + azureStorageBlobContainerUri: + "https://myaccount.blob.core.windows.net/sascontainer/sasContainer", + backupId: "backupId", + }; + const options = { + restoreRequestProperties, + }; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusters.beginValidateRestorePropertiesAndWait( + resourceGroupName, + cloudHsmClusterName, + options, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterValidateRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmCreateOrUpdateSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmCreateOrUpdateSample.js index 4407f4eeadc7..12d79b98708e 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmCreateOrUpdateSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmCreateOrUpdateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Create or Update a dedicated HSM in the specified subscription. * * @summary Create or Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_CreateOrUpdate.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_CreateOrUpdate.json */ async function createANewOrUpdateAnExistingDedicatedHsm() { const subscriptionId = @@ -29,7 +29,8 @@ async function createANewOrUpdateAnExistingDedicatedHsm() { networkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.1" }], subnet: { - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", }, }, sku: { name: "SafeNet Luna Network HSM A790" }, @@ -50,7 +51,7 @@ async function createANewOrUpdateAnExistingDedicatedHsm() { * This sample demonstrates how to Create or Update a dedicated HSM in the specified subscription. * * @summary Create or Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_CreateOrUpdate.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_CreateOrUpdate.json */ async function createANewOrUpdateAnExistingPaymentHsm() { const subscriptionId = @@ -63,7 +64,8 @@ async function createANewOrUpdateAnExistingPaymentHsm() { networkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.1" }], subnet: { - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", }, }, sku: { name: "payShield10K_LMK1_CPS60" }, @@ -84,7 +86,7 @@ async function createANewOrUpdateAnExistingPaymentHsm() { * This sample demonstrates how to Create or Update a dedicated HSM in the specified subscription. * * @summary Create or Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json */ async function createANewOrUpdateAnExistingPaymentHsmWithManagementProfile() { const subscriptionId = @@ -97,13 +99,15 @@ async function createANewOrUpdateAnExistingPaymentHsmWithManagementProfile() { managementNetworkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.2" }], subnet: { - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", }, }, networkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.1" }], subnet: { - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", }, }, sku: { name: "payShield10K_LMK1_CPS60" }, diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmDeleteSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmDeleteSample.js index 66d5e7864035..1f0302deae57 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmDeleteSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmDeleteSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Deletes the specified Azure Dedicated HSM. * * @summary Deletes the specified Azure Dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Delete.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Delete.json */ async function deleteADedicatedHsm() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmGetSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmGetSample.js index b99954e460b8..567237fae4b7 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmGetSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmGetSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets the specified Azure dedicated HSM. * * @summary Gets the specified Azure dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Get.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Get.json */ async function getADedicatedHsm() { const subscriptionId = @@ -34,7 +34,7 @@ async function getADedicatedHsm() { * This sample demonstrates how to Gets the specified Azure dedicated HSM. * * @summary Gets the specified Azure dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Get.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Get.json */ async function getAPaymentHsm() { const subscriptionId = @@ -52,7 +52,7 @@ async function getAPaymentHsm() { * This sample demonstrates how to Gets the specified Azure dedicated HSM. * * @summary Gets the specified Azure dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json */ async function getAPaymentHsmWith20181031PreviewApiVersion() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListByResourceGroupSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListByResourceGroupSample.js index 3f77d1120c05..09642d47faee 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListByResourceGroupSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListByResourceGroupSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. * * @summary The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListByResourceGroup.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListByResourceGroup.json */ async function listDedicatedHsmDevicesInAResourceGroup() { const subscriptionId = @@ -36,7 +36,7 @@ async function listDedicatedHsmDevicesInAResourceGroup() { * This sample demonstrates how to The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. * * @summary The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_ListByResourceGroup.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_ListByResourceGroup.json */ async function listDedicatedHsmDevicesInAResourceGroupIncludingPaymentHsm() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListBySubscriptionSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListBySubscriptionSample.js index 838d88986a10..c7a69640fe9f 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListBySubscriptionSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListBySubscriptionSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to The List operation gets information about the dedicated HSMs associated with the subscription. * * @summary The List operation gets information about the dedicated HSMs associated with the subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListBySubscription.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListBySubscription.json */ async function listDedicatedHsmDevicesInASubscription() { const subscriptionId = @@ -35,7 +35,7 @@ async function listDedicatedHsmDevicesInASubscription() { * This sample demonstrates how to The List operation gets information about the dedicated HSMs associated with the subscription. * * @summary The List operation gets information about the dedicated HSMs associated with the subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_ListBySubscription.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_ListBySubscription.json */ async function listDedicatedHsmDevicesInASubscriptionIncludingPaymentHsm() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js index bc505100b605..3ee74560d85e 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. * * @summary Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/GetOutboundNetworkDependenciesEndpointsList.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/GetOutboundNetworkDependenciesEndpointsList.json */ async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmUpdateSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmUpdateSample.js index 5227a75a3502..fbf83ade0a44 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmUpdateSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/dedicatedHsmUpdateSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to Update a dedicated HSM in the specified subscription. * * @summary Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Update.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Update.json */ async function updateAnExistingDedicatedHsm() { const subscriptionId = @@ -40,7 +40,7 @@ async function updateAnExistingDedicatedHsm() { * This sample demonstrates how to Update a dedicated HSM in the specified subscription. * * @summary Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Update.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Update.json */ async function updateAnExistingPaymentHsm() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/operationsListSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/operationsListSample.js index 46701b4547e0..8e775695a539 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/operationsListSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/operationsListSample.js @@ -13,10 +13,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); require("dotenv").config(); /** - * This sample demonstrates how to Get a list of Dedicated HSM operations. + * This sample demonstrates how to Get a list of Hardware Security Modules operations. * - * @summary Get a list of Dedicated HSM operations. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_OperationsList.json + * @summary Get a list of Hardware Security Modules operations. + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/OperationsList.json */ async function getAListOfDedicatedHsmOperations() { const subscriptionId = @@ -32,10 +32,10 @@ async function getAListOfDedicatedHsmOperations() { } /** - * This sample demonstrates how to Get a list of Dedicated HSM operations. + * This sample demonstrates how to Get a list of Hardware Security Modules operations. * - * @summary Get a list of Dedicated HSM operations. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_OperationsList.json + * @summary Get a list of Hardware Security Modules operations. + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/OperationsList.json */ async function getAListOfPaymentHsmOperations() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/privateEndpointConnectionsListByCloudHsmClusterSample.js b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/privateEndpointConnectionsListByCloudHsmClusterSample.js index 32e6cb214feb..e07d2422a746 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/privateEndpointConnectionsListByCloudHsmClusterSample.js +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/javascript/privateEndpointConnectionsListByCloudHsmClusterSample.js @@ -16,7 +16,7 @@ require("dotenv").config(); * This sample demonstrates how to The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster * * @summary The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionListByResourceMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/README.md b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/README.md index f7a7841231ce..a18df5d46080 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/README.md +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/README.md @@ -2,27 +2,33 @@ These sample programs show how to use the TypeScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts][cloudhsmclusterprivateendpointconnectionscreatesample] | Creates or updates the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json | -| [cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts][cloudhsmclusterprivateendpointconnectionsdeletesample] | Deletes the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json | -| [cloudHsmClusterPrivateEndpointConnectionsGetSample.ts][cloudhsmclusterprivateendpointconnectionsgetsample] | Gets the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json | -| [cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts][cloudhsmclusterprivatelinkresourceslistbycloudhsmclustersample] | Gets the private link resources supported for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json | -| [cloudHsmClustersCreateOrUpdateSample.ts][cloudhsmclusterscreateorupdatesample] | Create or Update a Cloud HSM Cluster in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json | -| [cloudHsmClustersDeleteSample.ts][cloudhsmclustersdeletesample] | Deletes the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json | -| [cloudHsmClustersGetSample.ts][cloudhsmclustersgetsample] | Gets the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json | -| [cloudHsmClustersListByResourceGroupSample.ts][cloudhsmclusterslistbyresourcegroupsample] | The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json | -| [cloudHsmClustersListBySubscriptionSample.ts][cloudhsmclusterslistbysubscriptionsample] | The List operation gets information about the Cloud HSM Clusters associated with the subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json | -| [cloudHsmClustersUpdateSample.ts][cloudhsmclustersupdatesample] | Update a Cloud HSM Cluster in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json | -| [dedicatedHsmCreateOrUpdateSample.ts][dedicatedhsmcreateorupdatesample] | Create or Update a dedicated HSM in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_CreateOrUpdate.json | -| [dedicatedHsmDeleteSample.ts][dedicatedhsmdeletesample] | Deletes the specified Azure Dedicated HSM. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Delete.json | -| [dedicatedHsmGetSample.ts][dedicatedhsmgetsample] | Gets the specified Azure dedicated HSM. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Get.json | -| [dedicatedHsmListByResourceGroupSample.ts][dedicatedhsmlistbyresourcegroupsample] | The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListByResourceGroup.json | -| [dedicatedHsmListBySubscriptionSample.ts][dedicatedhsmlistbysubscriptionsample] | The List operation gets information about the dedicated HSMs associated with the subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListBySubscription.json | -| [dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts][dedicatedhsmlistoutboundnetworkdependenciesendpointssample] | Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/GetOutboundNetworkDependenciesEndpointsList.json | -| [dedicatedHsmUpdateSample.ts][dedicatedhsmupdatesample] | Update a dedicated HSM in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Update.json | -| [operationsListSample.ts][operationslistsample] | Get a list of Dedicated HSM operations. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_OperationsList.json | -| [privateEndpointConnectionsListByCloudHsmClusterSample.ts][privateendpointconnectionslistbycloudhsmclustersample] | The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [cloudHsmClusterBackupStatusGetSample.ts][cloudhsmclusterbackupstatusgetsample] | Gets the backup operation status of the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Backup_Pending_MaximumSet_Gen.json | +| [cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts][cloudhsmclusterprivateendpointconnectionscreatesample] | Creates or updates the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json | +| [cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts][cloudhsmclusterprivateendpointconnectionsdeletesample] | Deletes the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json | +| [cloudHsmClusterPrivateEndpointConnectionsGetSample.ts][cloudhsmclusterprivateendpointconnectionsgetsample] | Gets the private endpoint connection for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json | +| [cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts][cloudhsmclusterprivatelinkresourceslistbycloudhsmclustersample] | Gets the private link resources supported for the Cloud Hsm Cluster. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json | +| [cloudHsmClusterRestoreStatusGetSample.ts][cloudhsmclusterrestorestatusgetsample] | Gets the restore operation status of the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Restore_Pending_MaximumSet_Gen.json | +| [cloudHsmClustersBackupSample.ts][cloudhsmclustersbackupsample] | Create a backup of the Cloud HSM Cluster in the specified subscription x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json | +| [cloudHsmClustersCreateOrUpdateSample.ts][cloudhsmclusterscreateorupdatesample] | Create or Update a Cloud HSM Cluster in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json | +| [cloudHsmClustersDeleteSample.ts][cloudhsmclustersdeletesample] | Deletes the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json | +| [cloudHsmClustersGetSample.ts][cloudhsmclustersgetsample] | Gets the specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json | +| [cloudHsmClustersListByResourceGroupSample.ts][cloudhsmclusterslistbyresourcegroupsample] | The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json | +| [cloudHsmClustersListBySubscriptionSample.ts][cloudhsmclusterslistbysubscriptionsample] | The List operation gets information about the Cloud HSM Clusters associated with the subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json | +| [cloudHsmClustersRestoreSample.ts][cloudhsmclustersrestoresample] | Restores all key materials of a specified Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json | +| [cloudHsmClustersUpdateSample.ts][cloudhsmclustersupdatesample] | Update a Cloud HSM Cluster in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json | +| [cloudHsmClustersValidateBackupPropertiesSample.ts][cloudhsmclustersvalidatebackuppropertiessample] | Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json | +| [cloudHsmClustersValidateRestorePropertiesSample.ts][cloudhsmclustersvalidaterestorepropertiessample] | Queued validating pre restore operation x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json | +| [dedicatedHsmCreateOrUpdateSample.ts][dedicatedhsmcreateorupdatesample] | Create or Update a dedicated HSM in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_CreateOrUpdate.json | +| [dedicatedHsmDeleteSample.ts][dedicatedhsmdeletesample] | Deletes the specified Azure Dedicated HSM. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Delete.json | +| [dedicatedHsmGetSample.ts][dedicatedhsmgetsample] | Gets the specified Azure dedicated HSM. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Get.json | +| [dedicatedHsmListByResourceGroupSample.ts][dedicatedhsmlistbyresourcegroupsample] | The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListByResourceGroup.json | +| [dedicatedHsmListBySubscriptionSample.ts][dedicatedhsmlistbysubscriptionsample] | The List operation gets information about the dedicated HSMs associated with the subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListBySubscription.json | +| [dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts][dedicatedhsmlistoutboundnetworkdependenciesendpointssample] | Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/GetOutboundNetworkDependenciesEndpointsList.json | +| [dedicatedHsmUpdateSample.ts][dedicatedhsmupdatesample] | Update a dedicated HSM in the specified subscription. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Update.json | +| [operationsListSample.ts][operationslistsample] | Get a list of Hardware Security Modules operations. x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/OperationsList.json | +| [privateEndpointConnectionsListByCloudHsmClusterSample.ts][privateendpointconnectionslistbycloudhsmclustersample] | The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json | ## Prerequisites @@ -61,29 +67,35 @@ npm run build 4. Run whichever samples you like (note that some samples may require additional setup, see the table above): ```bash -node dist/cloudHsmClusterPrivateEndpointConnectionsCreateSample.js +node dist/cloudHsmClusterBackupStatusGetSample.js ``` Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx dev-tool run vendored cross-env HARDWARESECURITYMODULES_SUBSCRIPTION_ID="" HARDWARESECURITYMODULES_RESOURCE_GROUP="" node dist/cloudHsmClusterPrivateEndpointConnectionsCreateSample.js +npx dev-tool run vendored cross-env HARDWARESECURITYMODULES_SUBSCRIPTION_ID="" HARDWARESECURITYMODULES_RESOURCE_GROUP="" node dist/cloudHsmClusterBackupStatusGetSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. +[cloudhsmclusterbackupstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterBackupStatusGetSample.ts [cloudhsmclusterprivateendpointconnectionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts [cloudhsmclusterprivateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts [cloudhsmclusterprivateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsGetSample.ts [cloudhsmclusterprivatelinkresourceslistbycloudhsmclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts +[cloudhsmclusterrestorestatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterRestoreStatusGetSample.ts +[cloudhsmclustersbackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersBackupSample.ts [cloudhsmclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersCreateOrUpdateSample.ts [cloudhsmclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersDeleteSample.ts [cloudhsmclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersGetSample.ts [cloudhsmclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListByResourceGroupSample.ts [cloudhsmclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListBySubscriptionSample.ts +[cloudhsmclustersrestoresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersRestoreSample.ts [cloudhsmclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersUpdateSample.ts +[cloudhsmclustersvalidatebackuppropertiessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersValidateBackupPropertiesSample.ts +[cloudhsmclustersvalidaterestorepropertiessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersValidateRestorePropertiesSample.ts [dedicatedhsmcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmCreateOrUpdateSample.ts [dedicatedhsmdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmDeleteSample.ts [dedicatedhsmgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmGetSample.ts diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterBackupStatusGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterBackupStatusGetSample.ts new file mode 100644 index 000000000000..7cfee1b08405 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterBackupStatusGetSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureHSMResourceProvider } from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the backup operation status of the specified Cloud HSM Cluster + * + * @summary Gets the backup operation status of the specified Cloud HSM Cluster + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Backup_Pending_MaximumSet_Gen.json + */ +async function cloudHsmClusterGetBackupStatusMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const jobId = "572a45927fc240e1ac075de27371680b"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusterBackupStatus.get( + resourceGroupName, + cloudHsmClusterName, + jobId, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterGetBackupStatusMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts index f41ebf976f81..90a3d1d1db04 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsCreateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { PrivateEndpointConnection, - AzureHSMResourceProvider + AzureHSMResourceProvider, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Creates or updates the private endpoint connection for the Cloud Hsm Cluster. * * @summary Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionCreateMaximumSetGen() { const subscriptionId = @@ -34,8 +34,8 @@ async function cloudHsmClusterPrivateEndpointConnectionCreateMaximumSetGen() { const properties: PrivateEndpointConnection = { privateLinkServiceConnectionState: { description: "My name is Joe and I'm approving this.", - status: "Approved" - } + status: "Approved", + }, }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); @@ -43,7 +43,7 @@ async function cloudHsmClusterPrivateEndpointConnectionCreateMaximumSetGen() { resourceGroupName, cloudHsmClusterName, peConnectionName, - properties + properties, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts index 12628ec7b9d5..2d827c54086c 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes the private endpoint connection for the Cloud Hsm Cluster. * * @summary Deletes the private endpoint connection for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionDeleteMaximumSetGen() { const subscriptionId = @@ -30,11 +30,12 @@ async function cloudHsmClusterPrivateEndpointConnectionDeleteMaximumSetGen() { const peConnectionName = "sample-pec"; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); - const result = await client.cloudHsmClusterPrivateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - cloudHsmClusterName, - peConnectionName - ); + const result = + await client.cloudHsmClusterPrivateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + cloudHsmClusterName, + peConnectionName, + ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsGetSample.ts index afd73be39e13..44e86bab1528 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsGetSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateEndpointConnectionsGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the private endpoint connection for the Cloud Hsm Cluster. * * @summary Gets the private endpoint connection for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionGetMaximumSetGen() { const subscriptionId = @@ -33,7 +33,7 @@ async function cloudHsmClusterPrivateEndpointConnectionGetMaximumSetGen() { const result = await client.cloudHsmClusterPrivateEndpointConnections.get( resourceGroupName, cloudHsmClusterName, - peConnectionName + peConnectionName, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts index 4bb3383db7fd..1b959402d91f 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the private link resources supported for the Cloud Hsm Cluster. * * @summary Gets the private link resources supported for the Cloud Hsm Cluster. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen() { const subscriptionId = @@ -29,11 +29,14 @@ async function cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen() const cloudHsmClusterName = "chsm1"; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); - const result = await client.cloudHsmClusterPrivateLinkResources.listByCloudHsmCluster( + const resArray = new Array(); + for await (let item of client.cloudHsmClusterPrivateLinkResources.listByCloudHsmCluster( resourceGroupName, - cloudHsmClusterName - ); - console.log(result); + cloudHsmClusterName, + )) { + resArray.push(item); + } + console.log(resArray); } async function main() { diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterRestoreStatusGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterRestoreStatusGetSample.ts new file mode 100644 index 000000000000..caba331a773d --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClusterRestoreStatusGetSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureHSMResourceProvider } from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the restore operation status of the specified Cloud HSM Cluster + * + * @summary Gets the restore operation status of the specified Cloud HSM Cluster + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Restore_Pending_MaximumSet_Gen.json + */ +async function cloudHsmClusterGetRestoreStatusMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const jobId = "572a45927fc240e1ac075de27371680b"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusterRestoreStatus.get( + resourceGroupName, + cloudHsmClusterName, + jobId, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterGetRestoreStatusMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersBackupSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersBackupSample.ts new file mode 100644 index 000000000000..9d0f6d3d6651 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersBackupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureHSMResourceProvider } from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a backup of the Cloud HSM Cluster in the specified subscription + * + * @summary Create a backup of the Cloud HSM Cluster in the specified subscription + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json + */ +async function cloudHsmClusterCreateBackupMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusters.beginBackupAndWait( + resourceGroupName, + cloudHsmClusterName, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterCreateBackupMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersCreateOrUpdateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersCreateOrUpdateSample.ts index 4703402a8023..7875f1db417e 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersCreateOrUpdateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersCreateOrUpdateSample.ts @@ -11,7 +11,7 @@ import { CloudHsmClustersCreateOrUpdateOptionalParams, AzureHSMResourceProvider, - CloudHsmClusterSku + CloudHsmClusterSku, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -22,7 +22,7 @@ dotenv.config(); * This sample demonstrates how to Create or Update a Cloud HSM Cluster in the specified subscription. * * @summary Create or Update a Cloud HSM Cluster in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json */ async function cloudHsmClusterCreateOrUpdateMaximumSetGen() { const subscriptionId = @@ -33,17 +33,18 @@ async function cloudHsmClusterCreateOrUpdateMaximumSetGen() { const cloudHsmClusterName = "chsm1"; const tags = { dept: "hsm", environment: "dogfood" }; const location = "eastus2"; - const sku: CloudHsmClusterSku = { name: "Standard_B1", family: "B" }; const identity = { type: "UserAssigned", userAssignedIdentities: { - "/subscriptions/00000000000000000000000000000000/resourceGroups/contosoResources/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} - } + "/subscriptions/00000000000000000000000000000000/resourceGroups/contosoResources/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, }; + const sku: CloudHsmClusterSku = { name: "Standard_B1", family: "B" }; const options: CloudHsmClustersCreateOrUpdateOptionalParams = { tags, + identity, sku, - identity }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); @@ -51,7 +52,7 @@ async function cloudHsmClusterCreateOrUpdateMaximumSetGen() { resourceGroupName, cloudHsmClusterName, location, - options + options, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersDeleteSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersDeleteSample.ts index 354090618b17..3be5d135f712 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersDeleteSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes the specified Cloud HSM Cluster * * @summary Deletes the specified Cloud HSM Cluster - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json */ async function cloudHsmClusterDeleteMaximumSetGen() { const subscriptionId = @@ -31,7 +31,7 @@ async function cloudHsmClusterDeleteMaximumSetGen() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.cloudHsmClusters.beginDeleteAndWait( resourceGroupName, - cloudHsmClusterName + cloudHsmClusterName, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersGetSample.ts index 91311f57d238..809bb9ce1b79 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersGetSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the specified Cloud HSM Cluster * * @summary Gets the specified Cloud HSM Cluster - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json */ async function cloudHsmClusterGetMaximumSetGen() { const subscriptionId = @@ -31,7 +31,7 @@ async function cloudHsmClusterGetMaximumSetGen() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.cloudHsmClusters.get( resourceGroupName, - cloudHsmClusterName + cloudHsmClusterName, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListByResourceGroupSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListByResourceGroupSample.ts index fe78d379b24a..992050e527b4 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListByResourceGroupSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListByResourceGroupSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. * * @summary The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json */ async function cloudHsmClusterListByResourceGroupMaximumSetGen() { const subscriptionId = @@ -30,7 +30,7 @@ async function cloudHsmClusterListByResourceGroupMaximumSetGen() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const resArray = new Array(); for await (let item of client.cloudHsmClusters.listByResourceGroup( - resourceGroupName + resourceGroupName, )) { resArray.push(item); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListBySubscriptionSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListBySubscriptionSample.ts index dc79fb81adb4..ee4a43206afe 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListBySubscriptionSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersListBySubscriptionSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the Cloud HSM Clusters associated with the subscription. * * @summary The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json */ async function cloudHsmClusterListBySubscriptionMaximumSetGen() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersRestoreSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersRestoreSample.ts new file mode 100644 index 000000000000..db2557e8db2d --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersRestoreSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RestoreRequestProperties, + AzureHSMResourceProvider, +} from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restores all key materials of a specified Cloud HSM Cluster + * + * @summary Restores all key materials of a specified Cloud HSM Cluster + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json + */ +async function cloudHsmClusterRestoreMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const restoreRequestProperties: RestoreRequestProperties = { + azureStorageBlobContainerUri: + "https://myaccount.blob.core.windows.net/sascontainer/sasContainer", + backupId: "backupId", + }; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = await client.cloudHsmClusters.beginRestoreAndWait( + resourceGroupName, + cloudHsmClusterName, + restoreRequestProperties, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersUpdateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersUpdateSample.ts index 70a475a9e13f..5eaf3c2e886b 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersUpdateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersUpdateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { CloudHsmClustersUpdateOptionalParams, - AzureHSMResourceProvider + AzureHSMResourceProvider, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Update a Cloud HSM Cluster in the specified subscription. * * @summary Update a Cloud HSM Cluster in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json */ async function cloudHsmClusterUpdateMaximumSetGen() { const subscriptionId = @@ -34,8 +34,9 @@ async function cloudHsmClusterUpdateMaximumSetGen() { const identity = { type: "UserAssigned", userAssignedIdentities: { - "/subscriptions/00000000000000000000000000000000/resourceGroups/contosoResources/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} - } + "/subscriptions/00000000000000000000000000000000/resourceGroups/contosoResources/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, }; const options: CloudHsmClustersUpdateOptionalParams = { tags, identity }; const credential = new DefaultAzureCredential(); @@ -43,7 +44,7 @@ async function cloudHsmClusterUpdateMaximumSetGen() { const result = await client.cloudHsmClusters.beginUpdateAndWait( resourceGroupName, cloudHsmClusterName, - options + options, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersValidateBackupPropertiesSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersValidateBackupPropertiesSample.ts new file mode 100644 index 000000000000..51e06d582d5b --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersValidateBackupPropertiesSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureHSMResourceProvider } from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. + * + * @summary Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json + */ +async function cloudHsmClusterValidateBackupValidationMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = + await client.cloudHsmClusters.beginValidateBackupPropertiesAndWait( + resourceGroupName, + cloudHsmClusterName, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterValidateBackupValidationMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersValidateRestorePropertiesSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersValidateRestorePropertiesSample.ts new file mode 100644 index 000000000000..b71dbb905916 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/cloudHsmClustersValidateRestorePropertiesSample.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RestoreRequestProperties, + CloudHsmClustersValidateRestorePropertiesOptionalParams, + AzureHSMResourceProvider, +} from "@azure/arm-hardwaresecuritymodules"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Queued validating pre restore operation + * + * @summary Queued validating pre restore operation + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json + */ +async function cloudHsmClusterValidateRestoreMaximumSetGen() { + const subscriptionId = + process.env["HARDWARESECURITYMODULES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["HARDWARESECURITYMODULES_RESOURCE_GROUP"] || "rgcloudhsm"; + const cloudHsmClusterName = "chsm1"; + const restoreRequestProperties: RestoreRequestProperties = { + azureStorageBlobContainerUri: + "https://myaccount.blob.core.windows.net/sascontainer/sasContainer", + backupId: "backupId", + }; + const options: CloudHsmClustersValidateRestorePropertiesOptionalParams = { + restoreRequestProperties, + }; + const credential = new DefaultAzureCredential(); + const client = new AzureHSMResourceProvider(credential, subscriptionId); + const result = + await client.cloudHsmClusters.beginValidateRestorePropertiesAndWait( + resourceGroupName, + cloudHsmClusterName, + options, + ); + console.log(result); +} + +async function main() { + cloudHsmClusterValidateRestoreMaximumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmCreateOrUpdateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmCreateOrUpdateSample.ts index 3f97b4ae7584..3a342427b738 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmCreateOrUpdateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmCreateOrUpdateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { DedicatedHsm, - AzureHSMResourceProvider + AzureHSMResourceProvider, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Create or Update a dedicated HSM in the specified subscription. * * @summary Create or Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_CreateOrUpdate.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_CreateOrUpdate.json */ async function createANewOrUpdateAnExistingDedicatedHsm() { const subscriptionId = @@ -35,20 +35,20 @@ async function createANewOrUpdateAnExistingDedicatedHsm() { networkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.1" }], subnet: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01" - } + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + }, }, sku: { name: "SafeNet Luna Network HSM A790" }, stampId: "stamp01", - tags: { dept: "hsm", environment: "dogfood" } + tags: { dept: "hsm", environment: "dogfood" }, }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.beginCreateOrUpdateAndWait( resourceGroupName, name, - parameters + parameters, ); console.log(result); } @@ -57,7 +57,7 @@ async function createANewOrUpdateAnExistingDedicatedHsm() { * This sample demonstrates how to Create or Update a dedicated HSM in the specified subscription. * * @summary Create or Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_CreateOrUpdate.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_CreateOrUpdate.json */ async function createANewOrUpdateAnExistingPaymentHsm() { const subscriptionId = @@ -71,20 +71,20 @@ async function createANewOrUpdateAnExistingPaymentHsm() { networkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.1" }], subnet: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01" - } + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + }, }, sku: { name: "payShield10K_LMK1_CPS60" }, stampId: "stamp01", - tags: { dept: "hsm", environment: "dogfood" } + tags: { dept: "hsm", environment: "dogfood" }, }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.beginCreateOrUpdateAndWait( resourceGroupName, name, - parameters + parameters, ); console.log(result); } @@ -93,7 +93,7 @@ async function createANewOrUpdateAnExistingPaymentHsm() { * This sample demonstrates how to Create or Update a dedicated HSM in the specified subscription. * * @summary Create or Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json */ async function createANewOrUpdateAnExistingPaymentHsmWithManagementProfile() { const subscriptionId = @@ -107,27 +107,27 @@ async function createANewOrUpdateAnExistingPaymentHsmWithManagementProfile() { managementNetworkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.2" }], subnet: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01" - } + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + }, }, networkProfile: { networkInterfaces: [{ privateIpAddress: "1.0.0.1" }], subnet: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01" - } + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01", + }, }, sku: { name: "payShield10K_LMK1_CPS60" }, stampId: "stamp01", - tags: { dept: "hsm", environment: "dogfood" } + tags: { dept: "hsm", environment: "dogfood" }, }; const credential = new DefaultAzureCredential(); const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.beginCreateOrUpdateAndWait( resourceGroupName, name, - parameters + parameters, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmDeleteSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmDeleteSample.ts index 0769b78971c9..f664b377abac 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmDeleteSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmDeleteSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Deletes the specified Azure Dedicated HSM. * * @summary Deletes the specified Azure Dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Delete.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Delete.json */ async function deleteADedicatedHsm() { const subscriptionId = @@ -31,7 +31,7 @@ async function deleteADedicatedHsm() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.beginDeleteAndWait( resourceGroupName, - name + name, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmGetSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmGetSample.ts index 3de06c720b51..2df1b9876d10 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmGetSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmGetSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets the specified Azure dedicated HSM. * * @summary Gets the specified Azure dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Get.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Get.json */ async function getADedicatedHsm() { const subscriptionId = @@ -31,7 +31,7 @@ async function getADedicatedHsm() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.get( resourceGroupName, - name + name, ); console.log(result); } @@ -40,7 +40,7 @@ async function getADedicatedHsm() { * This sample demonstrates how to Gets the specified Azure dedicated HSM. * * @summary Gets the specified Azure dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Get.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Get.json */ async function getAPaymentHsm() { const subscriptionId = @@ -53,7 +53,7 @@ async function getAPaymentHsm() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.get( resourceGroupName, - name + name, ); console.log(result); } @@ -62,7 +62,7 @@ async function getAPaymentHsm() { * This sample demonstrates how to Gets the specified Azure dedicated HSM. * * @summary Gets the specified Azure dedicated HSM. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json */ async function getAPaymentHsmWith20181031PreviewApiVersion() { const subscriptionId = @@ -75,7 +75,7 @@ async function getAPaymentHsmWith20181031PreviewApiVersion() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const result = await client.dedicatedHsmOperations.get( resourceGroupName, - name + name, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListByResourceGroupSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListByResourceGroupSample.ts index 3616b82ed5f0..1a9bbaab95ec 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListByResourceGroupSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListByResourceGroupSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. * * @summary The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListByResourceGroup.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListByResourceGroup.json */ async function listDedicatedHsmDevicesInAResourceGroup() { const subscriptionId = @@ -30,7 +30,7 @@ async function listDedicatedHsmDevicesInAResourceGroup() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const resArray = new Array(); for await (let item of client.dedicatedHsmOperations.listByResourceGroup( - resourceGroupName + resourceGroupName, )) { resArray.push(item); } @@ -41,7 +41,7 @@ async function listDedicatedHsmDevicesInAResourceGroup() { * This sample demonstrates how to The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. * * @summary The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_ListByResourceGroup.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_ListByResourceGroup.json */ async function listDedicatedHsmDevicesInAResourceGroupIncludingPaymentHsm() { const subscriptionId = @@ -53,7 +53,7 @@ async function listDedicatedHsmDevicesInAResourceGroupIncludingPaymentHsm() { const client = new AzureHSMResourceProvider(credential, subscriptionId); const resArray = new Array(); for await (let item of client.dedicatedHsmOperations.listByResourceGroup( - resourceGroupName + resourceGroupName, )) { resArray.push(item); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListBySubscriptionSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListBySubscriptionSample.ts index 8dbe9e692b59..f490109654e5 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListBySubscriptionSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListBySubscriptionSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the dedicated HSMs associated with the subscription. * * @summary The List operation gets information about the dedicated HSMs associated with the subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListBySubscription.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListBySubscription.json */ async function listDedicatedHsmDevicesInASubscription() { const subscriptionId = @@ -37,7 +37,7 @@ async function listDedicatedHsmDevicesInASubscription() { * This sample demonstrates how to The List operation gets information about the dedicated HSMs associated with the subscription. * * @summary The List operation gets information about the dedicated HSMs associated with the subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_ListBySubscription.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_ListBySubscription.json */ async function listDedicatedHsmDevicesInASubscriptionIncludingPaymentHsm() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts index ac7f75faca85..550d752071d0 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. * * @summary Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/GetOutboundNetworkDependenciesEndpointsList.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/GetOutboundNetworkDependenciesEndpointsList.json */ async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { const subscriptionId = @@ -32,7 +32,7 @@ async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { const resArray = new Array(); for await (let item of client.dedicatedHsmOperations.listOutboundNetworkDependenciesEndpoints( resourceGroupName, - name + name, )) { resArray.push(item); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmUpdateSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmUpdateSample.ts index 0bc04cf0f6c8..a5ebb2c7cdb5 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmUpdateSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/dedicatedHsmUpdateSample.ts @@ -10,7 +10,7 @@ // Licensed under the MIT License. import { DedicatedHsmUpdateOptionalParams, - AzureHSMResourceProvider + AzureHSMResourceProvider, } from "@azure/arm-hardwaresecuritymodules"; import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; @@ -21,7 +21,7 @@ dotenv.config(); * This sample demonstrates how to Update a dedicated HSM in the specified subscription. * * @summary Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Update.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Update.json */ async function updateAnExistingDedicatedHsm() { const subscriptionId = @@ -37,7 +37,7 @@ async function updateAnExistingDedicatedHsm() { const result = await client.dedicatedHsmOperations.beginUpdateAndWait( resourceGroupName, name, - options + options, ); console.log(result); } @@ -46,7 +46,7 @@ async function updateAnExistingDedicatedHsm() { * This sample demonstrates how to Update a dedicated HSM in the specified subscription. * * @summary Update a dedicated HSM in the specified subscription. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Update.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Update.json */ async function updateAnExistingPaymentHsm() { const subscriptionId = @@ -62,7 +62,7 @@ async function updateAnExistingPaymentHsm() { const result = await client.dedicatedHsmOperations.beginUpdateAndWait( resourceGroupName, name, - options + options, ); console.log(result); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/operationsListSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/operationsListSample.ts index d362324f525a..272191bacf6e 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/operationsListSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/operationsListSample.ts @@ -15,10 +15,10 @@ import * as dotenv from "dotenv"; dotenv.config(); /** - * This sample demonstrates how to Get a list of Dedicated HSM operations. + * This sample demonstrates how to Get a list of Hardware Security Modules operations. * - * @summary Get a list of Dedicated HSM operations. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_OperationsList.json + * @summary Get a list of Hardware Security Modules operations. + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/OperationsList.json */ async function getAListOfDedicatedHsmOperations() { const subscriptionId = @@ -34,10 +34,10 @@ async function getAListOfDedicatedHsmOperations() { } /** - * This sample demonstrates how to Get a list of Dedicated HSM operations. + * This sample demonstrates how to Get a list of Hardware Security Modules operations. * - * @summary Get a list of Dedicated HSM operations. - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_OperationsList.json + * @summary Get a list of Hardware Security Modules operations. + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/OperationsList.json */ async function getAListOfPaymentHsmOperations() { const subscriptionId = diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/privateEndpointConnectionsListByCloudHsmClusterSample.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/privateEndpointConnectionsListByCloudHsmClusterSample.ts index cef91d6ca660..d03d392931e2 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/privateEndpointConnectionsListByCloudHsmClusterSample.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/samples/v2-beta/typescript/src/privateEndpointConnectionsListByCloudHsmClusterSample.ts @@ -18,7 +18,7 @@ dotenv.config(); * This sample demonstrates how to The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster * * @summary The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster - * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2023-12-10-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json + * x-ms-original-file: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json */ async function cloudHsmClusterPrivateEndpointConnectionListByResourceMaximumSetGen() { const subscriptionId = @@ -32,7 +32,7 @@ async function cloudHsmClusterPrivateEndpointConnectionListByResourceMaximumSetG const resArray = new Array(); for await (let item of client.privateEndpointConnections.listByCloudHsmCluster( resourceGroupName, - cloudHsmClusterName + cloudHsmClusterName, )) { resArray.push(item); } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/azureHSMResourceProvider.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/azureHSMResourceProvider.ts index bad73d2c494f..7cd4695765d7 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/azureHSMResourceProvider.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/azureHSMResourceProvider.ts @@ -8,28 +8,38 @@ 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 { CloudHsmClustersImpl, CloudHsmClusterPrivateLinkResourcesImpl, CloudHsmClusterPrivateEndpointConnectionsImpl, PrivateEndpointConnectionsImpl, + CloudHsmClusterBackupStatusImpl, + CloudHsmClusterRestoreStatusImpl, + DedicatedHsmOperationsImpl, OperationsImpl, - DedicatedHsmOperationsImpl } from "./operations"; import { CloudHsmClusters, CloudHsmClusterPrivateLinkResources, CloudHsmClusterPrivateEndpointConnections, PrivateEndpointConnections, + CloudHsmClusterBackupStatus, + CloudHsmClusterRestoreStatus, + DedicatedHsmOperations, Operations, - DedicatedHsmOperations } from "./operationsInterfaces"; import { AzureHSMResourceProviderOptionalParams } from "./models"; export class AzureHSMResourceProvider extends coreClient.ServiceClient { $host: string; subscriptionId: string; + apiVersion: string; /** * Initializes a new instance of the AzureHSMResourceProvider class. @@ -40,7 +50,7 @@ export class AzureHSMResourceProvider extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: AzureHSMResourceProviderOptionalParams + options?: AzureHSMResourceProviderOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -55,7 +65,7 @@ export class AzureHSMResourceProvider extends coreClient.ServiceClient { } const defaults: AzureHSMResourceProviderOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; const packageDetails = `azsdk-js-arm-hardwaresecuritymodules/2.0.0-beta.2`; @@ -68,20 +78,21 @@ export class AzureHSMResourceProvider extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -91,7 +102,7 @@ export class AzureHSMResourceProvider extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -101,9 +112,9 @@ export class AzureHSMResourceProvider extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -111,22 +122,58 @@ export class AzureHSMResourceProvider extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2024-06-30-preview"; this.cloudHsmClusters = new CloudHsmClustersImpl(this); - this.cloudHsmClusterPrivateLinkResources = new CloudHsmClusterPrivateLinkResourcesImpl( - this + this.cloudHsmClusterPrivateLinkResources = + new CloudHsmClusterPrivateLinkResourcesImpl(this); + this.cloudHsmClusterPrivateEndpointConnections = + new CloudHsmClusterPrivateEndpointConnectionsImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.cloudHsmClusterBackupStatus = new CloudHsmClusterBackupStatusImpl( + this, ); - this.cloudHsmClusterPrivateEndpointConnections = new CloudHsmClusterPrivateEndpointConnectionsImpl( - this + this.cloudHsmClusterRestoreStatus = new CloudHsmClusterRestoreStatusImpl( + this, ); - this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); - this.operations = new OperationsImpl(this); this.dedicatedHsmOperations = new DedicatedHsmOperationsImpl(this); + this.operations = new OperationsImpl(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); } cloudHsmClusters: CloudHsmClusters; cloudHsmClusterPrivateLinkResources: CloudHsmClusterPrivateLinkResources; cloudHsmClusterPrivateEndpointConnections: CloudHsmClusterPrivateEndpointConnections; privateEndpointConnections: PrivateEndpointConnections; - operations: Operations; + cloudHsmClusterBackupStatus: CloudHsmClusterBackupStatus; + cloudHsmClusterRestoreStatus: CloudHsmClusterRestoreStatus; dedicatedHsmOperations: DedicatedHsmOperations; + operations: Operations; } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/lroImpl.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/lroImpl.ts index 52f6eaacfb83..5f88efab981b 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/lroImpl.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/lroImpl.ts @@ -28,15 +28,15 @@ export function createLroSpec(inputs: { sendInitialRequest: () => sendOperationFn(args, spec), sendPollRequest: ( path: string, - options?: { abortSignal?: AbortSignalLike } + options?: { abortSignal?: AbortSignalLike }, ) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, httpMethod: "GET", path, - abortSignal: options?.abortSignal + abortSignal: options?.abortSignal, }); - } + }, }; } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/index.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/index.ts index f07525ece8e6..2d89d7cbb839 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/index.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/index.ts @@ -8,19 +8,11 @@ import * as coreClient from "@azure/core-client"; -/** Security domain properties information for Cloud HSM cluster */ -export interface CloudHsmClusterSecurityDomainProperties { - /** FIPS state information for security domain */ - fipsState?: number; - /** status of security domain activation */ - activationStatus?: string; -} - /** The Cloud HSM Properties */ export interface CloudHsmProperties { /** FQDN of the Cloud HSM */ fqdn?: string; - /** The Cloud HSM State */ + /** The Cloud HSM State. Values are: Deploying, ConfiguringSlb, Starting, Starting, Failed, Failed, Deleting, DeletingSlbEntry, InitialProvisioning, Updating */ state?: string; /** The Cloud HSM State message */ stateMessage?: string; @@ -85,40 +77,6 @@ export interface SystemData { lastModifiedAt?: Date; } -/** Cloud Hsm Cluster restore information */ -export interface RestoreProperties { - /** Directory name in Azure Storage Blob where the backup is stored */ - foldername?: string; - /** Azure Blob storage container Uri */ - azureStorageResourceUri?: string; -} - -/** Cloud Hsm Cluster backup information */ -export interface BackupProperties { - /** Azure storage Resource Uri */ - azureStorageResourceUri?: string; - /** - * Last Date Time that Customer Enabled Backup was taken - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastBackupDateTime?: Date; - /** - * Status of last backup - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastBackupStatus?: string; -} - -/** Cloud Hsm Cluster SKU information */ -export interface CloudHsmClusterSku { - /** Sku family of the Cloud HSM Cluster */ - family: CloudHsmClusterSkuFamily; - /** Sku name of the Cloud HSM Cluster */ - name: CloudHsmClusterSkuName; - /** Sku capacity */ - capacity?: number; -} - /** Managed service identity (system assigned and/or user assigned identities) */ export interface ManagedServiceIdentity { /** @@ -153,14 +111,24 @@ export interface UserAssignedIdentity { readonly clientId?: string; } -/** The Cloud HSM Cluster error details */ -export interface CloudHsmClusterError { - /** Error details */ - error?: CHsmError; +/** Cloud Hsm Cluster SKU information */ +export interface CloudHsmClusterSku { + /** Sku family of the Cloud HSM Cluster */ + family: CloudHsmClusterSkuFamily; + /** Sku name of the Cloud HSM Cluster */ + name: CloudHsmClusterSkuName; + /** Sku capacity */ + capacity?: number; +} + +/** 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; } -/** Error details */ -export interface CHsmError { +/** The error detail. */ +export interface ErrorDetail { /** * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -171,18 +139,43 @@ export interface CHsmError { * 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; } /** Patchable properties of the Cloud HSM Cluster */ export interface CloudHsmClusterPatchParameters { /** The Cloud HSM Cluster's tags */ tags?: { [propertyName: string]: string }; - /** SKU details */ - sku?: CloudHsmClusterSku; /** Managed service identity (system assigned and/or user assigned identities) */ identity?: ManagedServiceIdentity; - /** Cloud Hsm Cluster backup information */ - backupProperties?: BackupProperties; } /** List of Cloud HSM Clusters */ @@ -197,6 +190,11 @@ export interface CloudHsmClusterListResult { export interface PrivateLinkResourceListResult { /** Array of private link resources */ value?: PrivateLinkResource[]; + /** + * 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; } /** List of private endpoint connections associated with the specified resource. */ @@ -207,81 +205,78 @@ export interface PrivateEndpointConnectionListResult { nextLink?: string; } -/** Result of the request to list Dedicated HSM Provider operations. It contains a list of operations. */ -export interface DedicatedHsmOperationListResult { - /** List of Dedicated HSM Resource Provider operations. */ - value?: DedicatedHsmOperation[]; +/** Backup and Restore Common properties */ +export interface BackupRestoreRequestBaseProperties { + /** The Azure blob storage container Uri which contains the backup */ + azureStorageBlobContainerUri: string; + /** The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service. */ + token?: string; } -/** REST API operation */ -export interface DedicatedHsmOperation { - /** The name of the Dedicated HSM Resource Provider Operation. */ - name?: string; +/** Backup operation Result */ +export interface BackupResult { /** - * Gets or sets a value indicating whether it is a data plane action + * Status of the backup/restore operation * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isDataAction?: boolean; - /** The origin of the operation */ - origin?: string; - /** The display string. */ - display?: DedicatedHsmOperationDisplay; -} - -/** The display string. */ -export interface DedicatedHsmOperationDisplay { - /** The Resource Provider of the operation */ - provider?: string; - /** Resource on which the operation is performed. */ - resource?: string; - /** Operation type: Read, write, delete, etc. */ - operation?: string; - /** The object that represents the operation. */ - description?: string; -} - -/** The error exception. */ -export interface DedicatedHsmError { + readonly status?: BackupRestoreOperationStatus; + /** The status details of backup/restore operation */ + statusDetails?: string; + /** Error encountered, if any, during the backup/restore operation. */ + error?: ErrorDetail; /** - * The error detail of the operation if any. + * The start time of the backup/restore operation in UTC * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly error?: ErrorModel; + readonly startTime?: Date; + /** + * The end time of the backup/restore operation in UTC + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endTime?: Date; + /** Identifier for the backup/restore operation. */ + jobId?: string; + /** The Azure blob storage container Uri which contains the backup */ + azureStorageBlobContainerUri?: string; + /** The ID of the backup. */ + backupId?: string; } -/** The key vault server error. */ -export interface ErrorModel { +/** Backup and Restore operation common properties */ +export interface BackupRestoreBaseResultProperties { /** - * The error code. + * Status of the backup/restore operation * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly status?: BackupRestoreOperationStatus; + /** The status details of backup/restore operation */ + statusDetails?: string; + /** Error encountered, if any, during the backup/restore operation. */ + error?: ErrorDetail; /** - * The error message. + * The start time of the backup/restore operation in UTC * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly startTime?: Date; /** - * Contains more specific error that narrows down the cause. May be null. + * The end time of the backup/restore operation in UTC * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly innerError?: ErrorModel; + readonly endTime?: Date; + /** Identifier for the backup/restore operation. */ + jobId?: string; } -/** Metadata pertaining to creation and last modification of dedicated hsm resource. */ -export interface SystemDataAutoGenerated { - /** The identity that created dedicated hsm resource. */ - createdBy?: string; - /** The type of identity that created dedicated hsm resource. */ - createdByType?: IdentityType; - /** The timestamp of dedicated hsm resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified dedicated hsm resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified dedicated hsm resource. */ - lastModifiedByType?: IdentityType; - /** The timestamp of dedicated hsm resource last modification (UTC). */ - lastModifiedAt?: Date; +/** Restore operation properties */ +export interface RestoreResult { + /** Backup and Restore operation common properties */ + properties?: BackupRestoreBaseResultProperties; +} + +/** SKU of the dedicated HSM */ +export interface Sku { + /** SKU of the dedicated HSM */ + name?: SkuName; } /** The network profile definition. */ @@ -294,52 +289,47 @@ export interface NetworkProfile { /** The API entity reference. */ export interface ApiEntityReference { - /** The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... */ - id?: string; + /** The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... */ + resourceId?: string; } /** The network interface definition. */ export interface NetworkInterface { /** - * The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly resourceId?: string; /** Private Ip address of the interface */ privateIpAddress?: string; } -/** Dedicated HSM resource */ -export interface DedicatedHsmResource { +/** The error exception. */ +export interface DedicatedHsmError { + /** + * The error detail of the operation if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: ErrorModel; +} + +/** The key vault server error. */ +export interface ErrorModel { /** - * The Azure Resource Manager resource ID for the dedicated HSM. + * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly code?: string; /** - * The name of the dedicated HSM. + * The error message. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly message?: string; /** - * The resource type of the dedicated HSM. + * Contains more specific error that narrows down the cause. May be null. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; - /** The supported Azure location where the dedicated HSM should be created. */ - location: string; - /** SKU details */ - sku?: Sku; - /** The Dedicated Hsm zones. */ - zones?: string[]; - /** Resource tags */ - tags?: { [propertyName: string]: string }; -} - -/** SKU of the dedicated HSM */ -export interface Sku { - /** SKU of the dedicated HSM */ - name?: SkuName; + readonly innerError?: ErrorModel; } /** Patchable properties of the dedicated HSM */ @@ -395,12 +385,68 @@ export interface EndpointDetail { description?: string; } -/** List of dedicated HSM resources. */ -export interface ResourceListResult { - /** The list of dedicated HSM resources. */ - value?: DedicatedHsmResource[]; - /** The URL to get the next set of dedicated HSM resources. */ - nextLink?: string; +/** 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; } /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ @@ -430,29 +476,24 @@ export interface PrivateLinkResource extends Resource { requiredZoneNames?: string[]; } -/** Resource information with extended details. */ -export interface DedicatedHsm extends DedicatedHsmResource { - /** - * Metadata pertaining to creation and last modification of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemDataAutoGenerated; - /** Specifies the network interfaces of the dedicated hsm. */ - networkProfile?: NetworkProfile; - /** Specifies the management network interfaces of the dedicated hsm. */ - managementNetworkProfile?: NetworkProfile; - /** This field will be used when RP does not support Availability zones. */ - stampId?: string; - /** - * Resource Status Message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statusMessage?: string; - /** - * Provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: JsonWebKeyType; +/** Backup properties */ +export interface BackupRequestProperties + extends BackupRestoreRequestBaseProperties {} + +/** Cloud Hsm Cluster restore information */ +export interface RestoreRequestProperties + extends BackupRestoreRequestBaseProperties { + /** An autogenerated unique string ID for labeling the backup. It contains both a UUID and a date timestamp. */ + backupId: string; +} + +/** Properties of the Cloud HSM Cluster */ +export interface BackupResultProperties + extends BackupRestoreBaseResultProperties { + /** The Azure blob storage container Uri which contains the backup */ + azureStorageBlobContainerUri?: string; + /** The ID of the backup. */ + backupId?: string; } /** The private endpoint connection resource. */ @@ -477,35 +518,67 @@ export interface PrivateEndpointConnection extends ProxyResource { /** Cloud HSM Cluster Resource */ export interface CloudHsmClusterResource extends TrackedResource { - /** SKU details */ - sku?: CloudHsmClusterSku; /** Managed service identity (system assigned and/or user assigned identities) */ identity?: ManagedServiceIdentity; + /** SKU details */ + sku?: CloudHsmClusterSku; +} + +/** Resource information with extended details. */ +export interface DedicatedHsm extends TrackedResource { + /** SKU details */ + sku: Sku; + /** The Dedicated Hsm zones. */ + zones?: string[]; + /** Specifies the network interfaces of the dedicated hsm. */ + networkProfile?: NetworkProfile; + /** Specifies the management network interfaces of the dedicated hsm. */ + managementNetworkProfile?: NetworkProfile; + /** This field will be used when RP does not support Availability zones. */ + stampId?: string; + /** + * Resource Status Message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusMessage?: string; + /** + * Provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: JsonWebKeyType; } /** Resource information with extended details. */ export interface CloudHsmCluster extends CloudHsmClusterResource { - /** The Cloud HSM Cluster's provisioningState */ - provisioningState?: ProvisioningState; + /** + * State of security domain activation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly activationState?: ActivationState; /** The Cloud HSM Cluster's auto-generated Domain Name Label Scope */ - autoGeneratedDomainNameLabelScope?: string; - /** Security domain properties information for Cloud HSM cluster */ - securityDomain?: CloudHsmClusterSecurityDomainProperties; - /** An array of Cloud HSM Cluster's HSMs */ - hsms?: CloudHsmProperties[]; + autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; + /** + * An array of Cloud HSM Cluster's HSMs + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hsms?: CloudHsmProperties[]; + /** + * List of private endpoint connection resources + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * The Cloud HSM Cluster's provisioningState + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; /** The Cloud HSM Cluster public network access */ - publicNetworkAccess?: string; - /** List of private endpoint connection resources */ - privateEndpointConnections?: PrivateEndpointConnection[]; + publicNetworkAccess?: PublicNetworkAccess; /** * Cloud HSM Cluster status message * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly statusMessage?: string; - /** Cloud Hsm Cluster restore information */ - restoreProperties?: RestoreProperties; - /** Cloud Hsm Cluster backup information */ - backupProperties?: BackupProperties; } /** Defines headers for CloudHsmClusters_update operation. */ @@ -520,38 +593,122 @@ export interface CloudHsmClustersDeleteHeaders { location?: string; } +/** Defines headers for CloudHsmClusters_validateBackupProperties operation. */ +export interface CloudHsmClustersValidateBackupPropertiesHeaders { + /** A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging. */ + xMsRequestId?: string; +} + +/** Defines headers for CloudHsmClusters_backup operation. */ +export interface CloudHsmClustersBackupHeaders { + /** A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging. */ + xMsRequestId?: string; +} + +/** Defines headers for CloudHsmClusters_validateRestoreProperties operation. */ +export interface CloudHsmClustersValidateRestorePropertiesHeaders { + /** A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging. */ + xMsRequestId?: string; +} + +/** Defines headers for CloudHsmClusters_restore operation. */ +export interface CloudHsmClustersRestoreHeaders { + /** A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging. */ + xMsRequestId?: string; +} + /** Defines headers for CloudHsmClusterPrivateEndpointConnections_delete operation. */ export interface CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders { /** The URI to poll for completion status. */ location?: string; } -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** Provisioning */ - Provisioning = "Provisioning", - /** Succeeded */ - Succeeded = "Succeeded", +/** Defines headers for CloudHsmClusterBackupStatus_get operation. */ +export interface CloudHsmClusterBackupStatusGetHeaders { + /** A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging. */ + xMsRequestId?: string; +} + +/** Defines headers for CloudHsmClusterBackupStatus_get operation. */ +export interface CloudHsmClusterBackupStatusGetExceptionHeaders { + /** A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging. */ + xMsRequestId?: string; +} + +/** Defines headers for CloudHsmClusterRestoreStatus_get operation. */ +export interface CloudHsmClusterRestoreStatusGetHeaders { + /** A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging. */ + xMsRequestId?: string; +} + +/** Defines headers for CloudHsmClusterRestoreStatus_get operation. */ +export interface CloudHsmClusterRestoreStatusGetExceptionHeaders { + /** A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging. */ + xMsRequestId?: string; +} + +/** Defines headers for DedicatedHsm_update operation. */ +export interface DedicatedHsmUpdateHeaders { + /** The URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for DedicatedHsm_delete operation. */ +export interface DedicatedHsmDeleteHeaders { + /** The URI to poll for completion status. */ + location?: string; +} + +/** Known values of {@link ActivationState} that the service accepts. */ +export enum KnownActivationState { + /** NotDefined */ + NotDefined = "NotDefined", + /** NotActivated */ + NotActivated = "NotActivated", + /** Active */ + Active = "Active", /** Failed */ Failed = "Failed", - /** Deleting */ - Deleting = "Deleting", - /** Canceled */ - Canceled = "Canceled" + /** Unknown */ + Unknown = "Unknown", } /** - * Defines values for ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * Defines values for ActivationState. \ + * {@link KnownActivationState} can be used interchangeably with ActivationState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Provisioning** \ - * **Succeeded** \ + * **NotDefined** \ + * **NotActivated** \ + * **Active** \ * **Failed** \ - * **Deleting** \ - * **Canceled** + * **Unknown** */ -export type ProvisioningState = string; +export type ActivationState = string; + +/** Known values of {@link AutoGeneratedDomainNameLabelScope} that the service accepts. */ +export enum KnownAutoGeneratedDomainNameLabelScope { + /** TenantReuse */ + TenantReuse = "TenantReuse", + /** SubscriptionReuse */ + SubscriptionReuse = "SubscriptionReuse", + /** ResourceGroupReuse */ + ResourceGroupReuse = "ResourceGroupReuse", + /** NoReuse */ + NoReuse = "NoReuse", +} + +/** + * Defines values for AutoGeneratedDomainNameLabelScope. \ + * {@link KnownAutoGeneratedDomainNameLabelScope} can be used interchangeably with AutoGeneratedDomainNameLabelScope, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **TenantReuse** \ + * **SubscriptionReuse** \ + * **ResourceGroupReuse** \ + * **NoReuse** + */ +export type AutoGeneratedDomainNameLabelScope = string; /** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ export enum KnownPrivateEndpointServiceConnectionStatus { @@ -560,7 +717,7 @@ export enum KnownPrivateEndpointServiceConnectionStatus { /** Approved */ Approved = "Approved", /** Rejected */ - Rejected = "Rejected" + Rejected = "Rejected", } /** @@ -589,7 +746,7 @@ export enum KnownPrivateEndpointConnectionProvisioningState { /** InternalError */ InternalError = "InternalError", /** Canceled */ - Canceled = "Canceled" + Canceled = "Canceled", } /** @@ -616,7 +773,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -631,20 +788,47 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; -/** Known values of {@link CloudHsmClusterSkuFamily} that the service accepts. */ -export enum KnownCloudHsmClusterSkuFamily { - /** B */ - B = "B" +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Provisioning */ + Provisioning = "Provisioning", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Deleting */ + Deleting = "Deleting", + /** Canceled */ + Canceled = "Canceled", } /** - * Defines values for CloudHsmClusterSkuFamily. \ - * {@link KnownCloudHsmClusterSkuFamily} can be used interchangeably with CloudHsmClusterSkuFamily, + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **B** + * **Provisioning** \ + * **Succeeded** \ + * **Failed** \ + * **Deleting** \ + * **Canceled** */ -export type CloudHsmClusterSkuFamily = string; +export type ProvisioningState = string; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** 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 + * **Disabled** + */ +export type PublicNetworkAccess = string; /** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ export enum KnownManagedServiceIdentityType { @@ -655,7 +839,7 @@ export enum KnownManagedServiceIdentityType { /** UserAssigned */ UserAssigned = "UserAssigned", /** SystemAssignedUserAssigned */ - SystemAssignedUserAssigned = "SystemAssigned,UserAssigned" + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", } /** @@ -670,62 +854,44 @@ export enum KnownManagedServiceIdentityType { */ export type ManagedServiceIdentityType = string; -/** Known values of {@link IdentityType} that the service accepts. */ -export enum KnownIdentityType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key" +/** Known values of {@link CloudHsmClusterSkuFamily} that the service accepts. */ +export enum KnownCloudHsmClusterSkuFamily { + /** B */ + B = "B", } /** - * Defines values for IdentityType. \ - * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * Defines values for CloudHsmClusterSkuFamily. \ + * {@link KnownCloudHsmClusterSkuFamily} can be used interchangeably with CloudHsmClusterSkuFamily, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** + * **B** */ -export type IdentityType = string; +export type CloudHsmClusterSkuFamily = string; -/** Known values of {@link JsonWebKeyType} that the service accepts. */ -export enum KnownJsonWebKeyType { - /** The dedicated HSM has been full provisioned. */ +/** Known values of {@link BackupRestoreOperationStatus} that the service accepts. */ +export enum KnownBackupRestoreOperationStatus { + /** InProgress */ + InProgress = "InProgress", + /** Succeeded */ Succeeded = "Succeeded", - /** The dedicated HSM is currently being provisioned. */ - Provisioning = "Provisioning", - /** A device is currently being allocated for the dedicated HSM resource. */ - Allocating = "Allocating", - /** The dedicated HSM is being connected to the virtual network. */ - Connecting = "Connecting", - /** Provisioning of the dedicated HSM has failed. */ + /** Failed */ Failed = "Failed", - /** Validating the subscription has sufficient quota to allocate a dedicated HSM device. */ - CheckingQuota = "CheckingQuota", - /** The dedicated HSM is currently being deleted. */ - Deleting = "Deleting" + /** Cancelled */ + Cancelled = "Cancelled", } /** - * Defines values for JsonWebKeyType. \ - * {@link KnownJsonWebKeyType} can be used interchangeably with JsonWebKeyType, + * Defines values for BackupRestoreOperationStatus. \ + * {@link KnownBackupRestoreOperationStatus} can be used interchangeably with BackupRestoreOperationStatus, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Succeeded**: The dedicated HSM has been full provisioned. \ - * **Provisioning**: The dedicated HSM is currently being provisioned. \ - * **Allocating**: A device is currently being allocated for the dedicated HSM resource. \ - * **Connecting**: The dedicated HSM is being connected to the virtual network. \ - * **Failed**: Provisioning of the dedicated HSM has failed. \ - * **CheckingQuota**: Validating the subscription has sufficient quota to allocate a dedicated HSM device. \ - * **Deleting**: The dedicated HSM is currently being deleted. + * **InProgress** \ + * **Succeeded** \ + * **Failed** \ + * **Cancelled** */ -export type JsonWebKeyType = string; +export type BackupRestoreOperationStatus = string; /** Known values of {@link SkuName} that the service accepts. */ export enum KnownSkuName { @@ -742,7 +908,7 @@ export enum KnownSkuName { /** The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 250 calls per second. */ PayShield10KLMK2CPS250 = "payShield10K_LMK2_CPS250", /** The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 2500 calls per second. */ - PayShield10KLMK2CPS2500 = "payShield10K_LMK2_CPS2500" + PayShield10KLMK2CPS2500 = "payShield10K_LMK2_CPS2500", } /** @@ -759,6 +925,99 @@ export enum KnownSkuName { * **payShield10K_LMK2_CPS2500**: The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 2500 calls per second. */ export type SkuName = string; + +/** Known values of {@link JsonWebKeyType} that the service accepts. */ +export enum KnownJsonWebKeyType { + /** The dedicated HSM has been fully provisioned. */ + Succeeded = "Succeeded", + /** The dedicated HSM is currently being provisioned. */ + Provisioning = "Provisioning", + /** A device is currently being allocated for the dedicated HSM resource. */ + Allocating = "Allocating", + /** The dedicated HSM is being connected to the virtual network. */ + Connecting = "Connecting", + /** Provisioning of the dedicated HSM has failed. */ + Failed = "Failed", + /** Validating the subscription has sufficient quota to allocate a dedicated HSM device. */ + CheckingQuota = "CheckingQuota", + /** The dedicated HSM is currently being deleted. */ + Deleting = "Deleting", +} + +/** + * Defines values for JsonWebKeyType. \ + * {@link KnownJsonWebKeyType} can be used interchangeably with JsonWebKeyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: The dedicated HSM has been fully provisioned. \ + * **Provisioning**: The dedicated HSM is currently being provisioned. \ + * **Allocating**: A device is currently being allocated for the dedicated HSM resource. \ + * **Connecting**: The dedicated HSM is being connected to the virtual network. \ + * **Failed**: Provisioning of the dedicated HSM has failed. \ + * **CheckingQuota**: Validating the subscription has sufficient quota to allocate a dedicated HSM device. \ + * **Deleting**: The dedicated HSM is currently being deleted. + */ +export type JsonWebKeyType = 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 IdentityType} that the service accepts. */ +export enum KnownIdentityType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * 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 + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type IdentityType = string; /** Defines values for CloudHsmClusterSkuName. */ export type CloudHsmClusterSkuName = "Standard_B1" | "Standard B10"; @@ -767,26 +1026,14 @@ export interface CloudHsmClustersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { /** Resource tags. */ tags?: { [propertyName: string]: string }; - /** SKU details */ - sku?: CloudHsmClusterSku; /** Managed service identity (system assigned and/or user assigned identities) */ identity?: ManagedServiceIdentity; - /** The Cloud HSM Cluster's provisioningState */ - provisioningState?: ProvisioningState; + /** SKU details */ + sku?: CloudHsmClusterSku; /** The Cloud HSM Cluster's auto-generated Domain Name Label Scope */ - autoGeneratedDomainNameLabelScope?: string; - /** Security domain properties information for Cloud HSM cluster */ - securityDomain?: CloudHsmClusterSecurityDomainProperties; - /** An array of Cloud HSM Cluster's HSMs */ - hsms?: CloudHsmProperties[]; + autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; /** The Cloud HSM Cluster public network access */ - publicNetworkAccess?: string; - /** List of private endpoint connection resources */ - privateEndpointConnections?: PrivateEndpointConnection[]; - /** Cloud Hsm Cluster restore information */ - restoreProperties?: RestoreProperties; - /** Cloud Hsm Cluster backup information */ - backupProperties?: BackupProperties; + publicNetworkAccess?: PublicNetworkAccess; /** 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. */ @@ -801,12 +1048,8 @@ export interface CloudHsmClustersUpdateOptionalParams extends coreClient.OperationOptions { /** The Cloud HSM Cluster's tags */ tags?: { [propertyName: string]: string }; - /** SKU details */ - sku?: CloudHsmClusterSku; /** Managed service identity (system assigned and/or user assigned identities) */ identity?: ManagedServiceIdentity; - /** Cloud Hsm Cluster backup information */ - backupProperties?: BackupProperties; /** 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. */ @@ -832,6 +1075,9 @@ export interface CloudHsmClustersDeleteOptionalParams resumeFrom?: string; } +/** Contains response data for the delete operation. */ +export type CloudHsmClustersDeleteResponse = CloudHsmClustersDeleteHeaders; + /** Optional parameters. */ export interface CloudHsmClustersListByResourceGroupOptionalParams extends coreClient.OperationOptions { @@ -840,7 +1086,8 @@ export interface CloudHsmClustersListByResourceGroupOptionalParams } /** Contains response data for the listByResourceGroup operation. */ -export type CloudHsmClustersListByResourceGroupResponse = CloudHsmClusterListResult; +export type CloudHsmClustersListByResourceGroupResponse = + CloudHsmClusterListResult; /** Optional parameters. */ export interface CloudHsmClustersListBySubscriptionOptionalParams @@ -850,35 +1097,106 @@ export interface CloudHsmClustersListBySubscriptionOptionalParams } /** Contains response data for the listBySubscription operation. */ -export type CloudHsmClustersListBySubscriptionResponse = CloudHsmClusterListResult; +export type CloudHsmClustersListBySubscriptionResponse = + CloudHsmClusterListResult; + +/** Optional parameters. */ +export interface CloudHsmClustersValidateBackupPropertiesOptionalParams + extends coreClient.OperationOptions { + /** Backup Operation Required properties */ + backupRequestProperties?: BackupRequestProperties; + /** 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 validateBackupProperties operation. */ +export type CloudHsmClustersValidateBackupPropertiesResponse = + CloudHsmClustersValidateBackupPropertiesHeaders & BackupResult; + +/** Optional parameters. */ +export interface CloudHsmClustersBackupOptionalParams + extends coreClient.OperationOptions { + /** Azure storage Resource Uri */ + backupRequestProperties?: BackupRequestProperties; + /** 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 backup operation. */ +export type CloudHsmClustersBackupResponse = CloudHsmClustersBackupHeaders & + BackupResult; + +/** Optional parameters. */ +export interface CloudHsmClustersValidateRestorePropertiesOptionalParams + extends coreClient.OperationOptions { + /** Optional Parameters to validate prior performing a restore operation. */ + restoreRequestProperties?: RestoreRequestProperties; + /** 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 validateRestoreProperties operation. */ +export type CloudHsmClustersValidateRestorePropertiesResponse = + CloudHsmClustersValidateRestorePropertiesHeaders & RestoreResult; + +/** Optional parameters. */ +export interface CloudHsmClustersRestoreOptionalParams + 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 restore operation. */ +export type CloudHsmClustersRestoreResponse = CloudHsmClustersRestoreHeaders & + RestoreResult; /** Optional parameters. */ export interface CloudHsmClustersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ -export type CloudHsmClustersListByResourceGroupNextResponse = CloudHsmClusterListResult; +export type CloudHsmClustersListByResourceGroupNextResponse = + CloudHsmClusterListResult; /** Optional parameters. */ export interface CloudHsmClustersListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ -export type CloudHsmClustersListBySubscriptionNextResponse = CloudHsmClusterListResult; +export type CloudHsmClustersListBySubscriptionNextResponse = + CloudHsmClusterListResult; /** Optional parameters. */ export interface CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByCloudHsmCluster operation. */ -export type CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse = PrivateLinkResourceListResult; +export type CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse = + PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCloudHsmClusterNext operation. */ +export type CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextResponse = + PrivateLinkResourceListResult; /** Optional parameters. */ export interface CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the create operation. */ -export type CloudHsmClusterPrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; +export type CloudHsmClusterPrivateEndpointConnectionsCreateResponse = + PrivateEndpointConnection; /** Optional parameters. */ export interface CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams @@ -889,33 +1207,49 @@ export interface CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams resumeFrom?: string; } +/** Contains response data for the delete operation. */ +export type CloudHsmClusterPrivateEndpointConnectionsDeleteResponse = + CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders; + /** Optional parameters. */ export interface CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type CloudHsmClusterPrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; +export type CloudHsmClusterPrivateEndpointConnectionsGetResponse = + PrivateEndpointConnection; /** Optional parameters. */ export interface PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByCloudHsmCluster operation. */ -export type PrivateEndpointConnectionsListByCloudHsmClusterResponse = PrivateEndpointConnectionListResult; +export type PrivateEndpointConnectionsListByCloudHsmClusterResponse = + PrivateEndpointConnectionListResult; /** Optional parameters. */ export interface PrivateEndpointConnectionsListByCloudHsmClusterNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByCloudHsmClusterNext operation. */ -export type PrivateEndpointConnectionsListByCloudHsmClusterNextResponse = PrivateEndpointConnectionListResult; +export type PrivateEndpointConnectionsListByCloudHsmClusterNextResponse = + PrivateEndpointConnectionListResult; /** Optional parameters. */ -export interface OperationsListOptionalParams +export interface CloudHsmClusterBackupStatusGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type OperationsListResponse = DedicatedHsmOperationListResult; +/** Contains response data for the get operation. */ +export type CloudHsmClusterBackupStatusGetResponse = + CloudHsmClusterBackupStatusGetHeaders & BackupResult; + +/** Optional parameters. */ +export interface CloudHsmClusterRestoreStatusGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CloudHsmClusterRestoreStatusGetResponse = + CloudHsmClusterRestoreStatusGetHeaders & RestoreResult; /** Optional parameters. */ export interface DedicatedHsmCreateOrUpdateOptionalParams @@ -952,6 +1286,9 @@ export interface DedicatedHsmDeleteOptionalParams resumeFrom?: string; } +/** Contains response data for the delete operation. */ +export type DedicatedHsmDeleteResponse = DedicatedHsmDeleteHeaders; + /** Optional parameters. */ export interface DedicatedHsmGetOptionalParams extends coreClient.OperationOptions {} @@ -984,14 +1321,16 @@ export interface DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalPar extends coreClient.OperationOptions {} /** Contains response data for the listOutboundNetworkDependenciesEndpoints operation. */ -export type DedicatedHsmListOutboundNetworkDependenciesEndpointsResponse = OutboundEnvironmentEndpointCollection; +export type DedicatedHsmListOutboundNetworkDependenciesEndpointsResponse = + OutboundEnvironmentEndpointCollection; /** Optional parameters. */ export interface DedicatedHsmListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ -export type DedicatedHsmListByResourceGroupNextResponse = DedicatedHsmListResult; +export type DedicatedHsmListByResourceGroupNextResponse = + DedicatedHsmListResult; /** Optional parameters. */ export interface DedicatedHsmListBySubscriptionNextOptionalParams @@ -1005,13 +1344,23 @@ export interface DedicatedHsmListOutboundNetworkDependenciesEndpointsNextOptiona extends coreClient.OperationOptions {} /** Contains response data for the listOutboundNetworkDependenciesEndpointsNext operation. */ -export type DedicatedHsmListOutboundNetworkDependenciesEndpointsNextResponse = OutboundEnvironmentEndpointCollection; +export type DedicatedHsmListOutboundNetworkDependenciesEndpointsNextResponse = + OutboundEnvironmentEndpointCollection; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; /** Optional parameters. */ export interface AzureHSMResourceProviderOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; + /** Api Version */ + apiVersion?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/mappers.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/mappers.ts index 57b8f5212316..32b229e44863 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/mappers.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/mappers.ts @@ -8,27 +8,6 @@ import * as coreClient from "@azure/core-client"; -export const CloudHsmClusterSecurityDomainProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudHsmClusterSecurityDomainProperties", - modelProperties: { - fipsState: { - serializedName: "fipsState", - type: { - name: "Number" - } - }, - activationStatus: { - serializedName: "activationStatus", - type: { - name: "String" - } - } - } - } -}; - export const CloudHsmProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -37,23 +16,23 @@ export const CloudHsmProperties: coreClient.CompositeMapper = { fqdn: { serializedName: "fqdn", type: { - name: "String" - } + name: "String", + }, }, state: { serializedName: "state", type: { - name: "String" - } + name: "String", + }, }, stateMessage: { serializedName: "stateMessage", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PrivateEndpoint: coreClient.CompositeMapper = { @@ -65,11 +44,11 @@ export const PrivateEndpoint: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { @@ -80,23 +59,23 @@ export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { status: { serializedName: "status", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", type: { - name: "String" - } + name: "String", + }, }, actionsRequired: { serializedName: "actionsRequired", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -108,32 +87,32 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } - } - } - } + className: "SystemData", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -144,121 +123,41 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } -}; - -export const RestoreProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestoreProperties", - modelProperties: { - foldername: { - serializedName: "foldername", - type: { - name: "String" - } - }, - azureStorageResourceUri: { - serializedName: "azureStorageResourceUri", - type: { - name: "String" - } - } - } - } -}; - -export const BackupProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BackupProperties", - modelProperties: { - azureStorageResourceUri: { - serializedName: "azureStorageResourceUri", - type: { - name: "String" - } - }, - lastBackupDateTime: { - serializedName: "lastBackupDateTime", - readOnly: true, - type: { - name: "DateTime" - } + name: "DateTime", + }, }, - lastBackupStatus: { - serializedName: "lastBackupStatus", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const CloudHsmClusterSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudHsmClusterSku", - modelProperties: { - family: { - serializedName: "family", - required: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - required: true, - type: { - name: "Enum", - allowedValues: ["Standard_B1", "Standard B10"] - } - }, - capacity: { - serializedName: "capacity", - type: { - name: "Number" - } - } - } - } + }, + }, }; export const ManagedServiceIdentity: coreClient.CompositeMapper = { @@ -270,34 +169,34 @@ export const ManagedServiceIdentity: coreClient.CompositeMapper = { serializedName: "principalId", readOnly: true, type: { - name: "Uuid" - } + name: "Uuid", + }, }, tenantId: { serializedName: "tenantId", readOnly: true, type: { - name: "Uuid" - } + name: "Uuid", + }, }, type: { serializedName: "type", required: true, type: { - name: "String" - } + name: "String", + }, }, userAssignedIdentities: { serializedName: "userAssignedIdentities", type: { name: "Dictionary", value: { - type: { name: "Composite", className: "UserAssignedIdentity" } - } - } - } - } - } + type: { name: "Composite", className: "UserAssignedIdentity" }, + }, + }, + }, + }, + }, }; export const UserAssignedIdentity: coreClient.CompositeMapper = { @@ -309,57 +208,144 @@ export const UserAssignedIdentity: coreClient.CompositeMapper = { serializedName: "principalId", readOnly: true, type: { - name: "Uuid" - } + name: "Uuid", + }, }, clientId: { serializedName: "clientId", readOnly: true, type: { - name: "Uuid" - } - } - } - } + name: "Uuid", + }, + }, + }, + }, +}; + +export const CloudHsmClusterSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudHsmClusterSku", + modelProperties: { + family: { + serializedName: "family", + required: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + required: true, + type: { + name: "Enum", + allowedValues: ["Standard_B1", "Standard B10"], + }, + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number", + }, + }, + }, + }, }; -export const CloudHsmClusterError: coreClient.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudHsmClusterError", + className: "ErrorResponse", modelProperties: { error: { serializedName: "error", type: { name: "Composite", - className: "CHsmError" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; -export const CHsmError: coreClient.CompositeMapper = { +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CHsmError", + className: "ErrorDetail", modelProperties: { code: { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } - } - } - } + 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 CloudHsmClusterPatchParameters: coreClient.CompositeMapper = { @@ -371,32 +357,18 @@ export const CloudHsmClusterPatchParameters: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "CloudHsmClusterSku" - } + value: { type: { name: "String" } }, + }, }, identity: { serializedName: "identity", type: { name: "Composite", - className: "ManagedServiceIdentity" - } + className: "ManagedServiceIdentity", + }, }, - backupProperties: { - serializedName: "properties.backupProperties", - type: { - name: "Composite", - className: "BackupProperties" - } - } - } - } + }, + }, }; export const CloudHsmClusterListResult: coreClient.CompositeMapper = { @@ -411,19 +383,19 @@ export const CloudHsmClusterListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "CloudHsmCluster" - } - } - } + className: "CloudHsmCluster", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { @@ -438,13 +410,20 @@ export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateLinkResource" - } - } - } - } - } - } + className: "PrivateLinkResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { @@ -459,199 +438,184 @@ export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateEndpointConnection" - } - } - } + className: "PrivateEndpointConnection", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DedicatedHsmOperationListResult: coreClient.CompositeMapper = { +export const BackupRestoreRequestBaseProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedHsmOperationListResult", + className: "BackupRestoreRequestBaseProperties", modelProperties: { - value: { - serializedName: "value", + azureStorageBlobContainerUri: { + serializedName: "azureStorageBlobContainerUri", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DedicatedHsmOperation" - } - } - } - } - } - } + name: "String", + }, + }, + token: { + serializedName: "token", + type: { + name: "String", + }, + }, + }, + }, }; -export const DedicatedHsmOperation: coreClient.CompositeMapper = { +export const BackupResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedHsmOperation", + className: "BackupResult", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - isDataAction: { - serializedName: "isDataAction", + status: { + serializedName: "properties.status", readOnly: true, type: { - name: "Boolean" - } + name: "String", + }, }, - origin: { - serializedName: "origin", + statusDetails: { + serializedName: "properties.statusDetails", type: { - name: "String" - } + name: "String", + }, }, - display: { - serializedName: "display", + error: { + serializedName: "properties.error", type: { name: "Composite", - className: "DedicatedHsmOperationDisplay" - } - } - } - } -}; - -export const DedicatedHsmOperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHsmOperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", + className: "ErrorDetail", + }, + }, + startTime: { + serializedName: "properties.startTime", + readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - resource: { - serializedName: "resource", + endTime: { + serializedName: "properties.endTime", + readOnly: true, + nullable: true, type: { - name: "String" - } + name: "DateTime", + }, }, - operation: { - serializedName: "operation", + jobId: { + serializedName: "properties.jobId", type: { - name: "String" - } + name: "String", + }, }, - description: { - serializedName: "description", + azureStorageBlobContainerUri: { + serializedName: "properties.azureStorageBlobContainerUri", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + backupId: { + serializedName: "properties.backupId", + type: { + name: "String", + }, + }, + }, + }, }; -export const DedicatedHsmError: coreClient.CompositeMapper = { +export const BackupRestoreBaseResultProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedHsmError", + className: "BackupRestoreBaseResultProperties", modelProperties: { + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String", + }, + }, + statusDetails: { + serializedName: "statusDetails", + type: { + name: "String", + }, + }, error: { serializedName: "error", type: { name: "Composite", - className: "ErrorModel" - } - } - } - } -}; - -export const ErrorModel: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorModel", - modelProperties: { - code: { - serializedName: "code", + className: "ErrorDetail", + }, + }, + startTime: { + serializedName: "startTime", readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - message: { - serializedName: "message", + endTime: { + serializedName: "endTime", readOnly: true, + nullable: true, type: { - name: "String" - } + name: "DateTime", + }, }, - innerError: { - serializedName: "innererror", + jobId: { + serializedName: "jobId", type: { - name: "Composite", - className: "ErrorModel" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const SystemDataAutoGenerated: coreClient.CompositeMapper = { +export const RestoreResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemDataAutoGenerated", + className: "RestoreResult", modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String" - } - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String" - } - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime" - } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "BackupRestoreBaseResultProperties", + }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + }, + }, +}; + +export const Sku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } + }, + }, }; export const NetworkProfile: coreClient.CompositeMapper = { @@ -663,8 +627,8 @@ export const NetworkProfile: coreClient.CompositeMapper = { serializedName: "subnet", type: { name: "Composite", - className: "ApiEntityReference" - } + className: "ApiEntityReference", + }, }, networkInterfaces: { serializedName: "networkInterfaces", @@ -673,13 +637,13 @@ export const NetworkProfile: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "NetworkInterface" - } - } - } - } - } - } + className: "NetworkInterface", + }, + }, + }, + }, + }, + }, }; export const ApiEntityReference: coreClient.CompositeMapper = { @@ -687,14 +651,14 @@ export const ApiEntityReference: coreClient.CompositeMapper = { name: "Composite", className: "ApiEntityReference", modelProperties: { - id: { - serializedName: "id", + resourceId: { + serializedName: "resourceId", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const NetworkInterface: coreClient.CompositeMapper = { @@ -702,98 +666,67 @@ export const NetworkInterface: coreClient.CompositeMapper = { name: "Composite", className: "NetworkInterface", modelProperties: { - id: { - serializedName: "id", + resourceId: { + serializedName: "resourceId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, privateIpAddress: { serializedName: "privateIpAddress", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DedicatedHsmResource: coreClient.CompositeMapper = { +export const DedicatedHsmError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedHsmResource", + className: "DedicatedHsmError", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + error: { + serializedName: "error", type: { - name: "String" - } + name: "Composite", + className: "ErrorModel", + }, }, - name: { - serializedName: "name", + }, + }, +}; + +export const ErrorModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - type: { - serializedName: "type", + message: { + serializedName: "message", readOnly: true, type: { - name: "String" - } - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String" - } + name: "String", + }, }, - sku: { - serializedName: "sku", + innerError: { + serializedName: "innererror", type: { name: "Composite", - className: "Sku" - } - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + className: "ErrorModel", + }, }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } -}; - -export const Sku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Sku", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - } - } - } + }, + }, }; export const DedicatedHsmPatchParameters: coreClient.CompositeMapper = { @@ -805,11 +738,11 @@ export const DedicatedHsmPatchParameters: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const DedicatedHsmListResult: coreClient.CompositeMapper = { @@ -824,50 +757,51 @@ export const DedicatedHsmListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "DedicatedHsm" - } - } - } + className: "DedicatedHsm", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } -}; - -export const OutboundEnvironmentEndpointCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OutboundEnvironmentEndpointCollection", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OutboundEnvironmentEndpoint" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; +export const OutboundEnvironmentEndpointCollection: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "OutboundEnvironmentEndpointCollection", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OutboundEnvironmentEndpoint", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + export const OutboundEnvironmentEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", @@ -876,8 +810,8 @@ export const OutboundEnvironmentEndpoint: coreClient.CompositeMapper = { category: { serializedName: "category", type: { - name: "String" - } + name: "String", + }, }, endpoints: { serializedName: "endpoints", @@ -886,13 +820,13 @@ export const OutboundEnvironmentEndpoint: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "EndpointDependency" - } - } - } - } - } - } + className: "EndpointDependency", + }, + }, + }, + }, + }, + }, }; export const EndpointDependency: coreClient.CompositeMapper = { @@ -903,8 +837,8 @@ export const EndpointDependency: coreClient.CompositeMapper = { domainName: { serializedName: "domainName", type: { - name: "String" - } + name: "String", + }, }, endpointDetails: { serializedName: "endpointDetails", @@ -913,13 +847,13 @@ export const EndpointDependency: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "EndpointDetail" - } - } - } - } - } - } + className: "EndpointDetail", + }, + }, + }, + }, + }, + }, }; export const EndpointDetail: coreClient.CompositeMapper = { @@ -930,56 +864,139 @@ export const EndpointDetail: coreClient.CompositeMapper = { ipAddress: { serializedName: "ipAddress", type: { - name: "String" - } + name: "String", + }, }, port: { serializedName: "port", type: { - name: "Number" - } + name: "Number", + }, }, protocol: { serializedName: "protocol", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const ResourceListResult: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceListResult", + className: "OperationListResult", modelProperties: { value: { serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "DedicatedHsmResource" - } - } - } + 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" - } - } - } - } + 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 ProxyResource: coreClient.CompositeMapper = { @@ -987,9 +1004,9 @@ export const ProxyResource: coreClient.CompositeMapper = { name: "Composite", className: "ProxyResource", modelProperties: { - ...Resource.type.modelProperties - } - } + ...Resource.type.modelProperties, + }, + }, }; export const TrackedResource: coreClient.CompositeMapper = { @@ -1002,18 +1019,18 @@ export const TrackedResource: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, location: { serializedName: "location", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PrivateLinkResource: coreClient.CompositeMapper = { @@ -1026,8 +1043,8 @@ export const PrivateLinkResource: coreClient.CompositeMapper = { serializedName: "properties.groupId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, requiredMembers: { serializedName: "properties.requiredMembers", @@ -1036,10 +1053,10 @@ export const PrivateLinkResource: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, requiredZoneNames: { serializedName: "properties.requiredZoneNames", @@ -1047,64 +1064,62 @@ export const PrivateLinkResource: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; -export const DedicatedHsm: coreClient.CompositeMapper = { +export const BackupRequestProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DedicatedHsm", + className: "BackupRequestProperties", modelProperties: { - ...DedicatedHsmResource.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemDataAutoGenerated" - } - }, - networkProfile: { - serializedName: "properties.networkProfile", - type: { - name: "Composite", - className: "NetworkProfile" - } - }, - managementNetworkProfile: { - serializedName: "properties.managementNetworkProfile", + ...BackupRestoreRequestBaseProperties.type.modelProperties, + }, + }, +}; + +export const RestoreRequestProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestoreRequestProperties", + modelProperties: { + ...BackupRestoreRequestBaseProperties.type.modelProperties, + backupId: { + serializedName: "backupId", + required: true, type: { - name: "Composite", - className: "NetworkProfile" - } + name: "String", + }, }, - stampId: { - serializedName: "properties.stampId", + }, + }, +}; + +export const BackupResultProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupResultProperties", + modelProperties: { + ...BackupRestoreBaseResultProperties.type.modelProperties, + azureStorageBlobContainerUri: { + serializedName: "azureStorageBlobContainerUri", type: { - name: "String" - } + name: "String", + }, }, - statusMessage: { - serializedName: "properties.statusMessage", - readOnly: true, + backupId: { + serializedName: "backupId", type: { - name: "String" - } + name: "String", + }, }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; export const PrivateEndpointConnection: coreClient.CompositeMapper = { @@ -1116,29 +1131,29 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { etag: { serializedName: "etag", type: { - name: "String" - } + name: "String", + }, }, privateEndpoint: { serializedName: "properties.privateEndpoint", type: { name: "Composite", - className: "PrivateEndpoint" - } + className: "PrivateEndpoint", + }, }, privateLinkServiceConnectionState: { serializedName: "properties.privateLinkServiceConnectionState", type: { name: "Composite", - className: "PrivateLinkServiceConnectionState" - } + className: "PrivateLinkServiceConnectionState", + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, groupIds: { serializedName: "properties.groupIds", @@ -1147,13 +1162,13 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const CloudHsmClusterResource: coreClient.CompositeMapper = { @@ -1162,22 +1177,84 @@ export const CloudHsmClusterResource: coreClient.CompositeMapper = { className: "CloudHsmClusterResource", modelProperties: { ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity", + }, + }, sku: { serializedName: "sku", type: { name: "Composite", - className: "CloudHsmClusterSku" - } + className: "CloudHsmClusterSku", + }, }, - identity: { - serializedName: "identity", + }, + }, +}; + +export const DedicatedHsm: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DedicatedHsm", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + zones: { + serializedName: "zones", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + networkProfile: { + serializedName: "properties.networkProfile", type: { name: "Composite", - className: "ManagedServiceIdentity" - } - } - } - } + className: "NetworkProfile", + }, + }, + managementNetworkProfile: { + serializedName: "properties.managementNetworkProfile", + type: { + name: "Composite", + className: "NetworkProfile", + }, + }, + stampId: { + serializedName: "properties.stampId", + type: { + name: "String", + }, + }, + statusMessage: { + serializedName: "properties.statusMessage", + readOnly: true, + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; export const CloudHsmCluster: coreClient.CompositeMapper = { @@ -1186,78 +1263,67 @@ export const CloudHsmCluster: coreClient.CompositeMapper = { className: "CloudHsmCluster", modelProperties: { ...CloudHsmClusterResource.type.modelProperties, - provisioningState: { - serializedName: "properties.provisioningState", + activationState: { + serializedName: "properties.activationState", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, autoGeneratedDomainNameLabelScope: { serializedName: "properties.autoGeneratedDomainNameLabelScope", type: { - name: "String" - } - }, - securityDomain: { - serializedName: "properties.securityDomain", - type: { - name: "Composite", - className: "CloudHsmClusterSecurityDomainProperties" - } + name: "String", + }, }, hsms: { serializedName: "properties.hsms", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "CloudHsmProperties" - } - } - } - }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", - type: { - name: "String" - } + className: "CloudHsmProperties", + }, + }, + }, }, privateEndpointConnections: { serializedName: "properties.privateEndpointConnections", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "PrivateEndpointConnection" - } - } - } + className: "PrivateEndpointConnection", + }, + }, + }, }, - statusMessage: { - serializedName: "properties.statusMessage", + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - restoreProperties: { - serializedName: "properties.restoreProperties", + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", type: { - name: "Composite", - className: "RestoreProperties" - } + name: "String", + }, }, - backupProperties: { - serializedName: "properties.backupProperties", + statusMessage: { + serializedName: "properties.statusMessage", + readOnly: true, type: { - name: "Composite", - className: "BackupProperties" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CloudHsmClustersUpdateHeaders: coreClient.CompositeMapper = { @@ -1268,11 +1334,11 @@ export const CloudHsmClustersUpdateHeaders: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CloudHsmClustersDeleteHeaders: coreClient.CompositeMapper = { @@ -1283,24 +1349,181 @@ export const CloudHsmClustersDeleteHeaders: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, +}; + +export const CloudHsmClustersValidateBackupPropertiesHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CloudHsmClustersValidateBackupPropertiesHeaders", + modelProperties: { + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const CloudHsmClustersBackupHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudHsmClustersBackupHeaders", + modelProperties: { + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CloudHsmClustersValidateRestorePropertiesHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CloudHsmClustersValidateRestorePropertiesHeaders", + modelProperties: { + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const CloudHsmClustersRestoreHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudHsmClustersRestoreHeaders", + modelProperties: { + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const CloudHsmClusterBackupStatusGetHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CloudHsmClusterBackupStatusGetHeaders", + modelProperties: { + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const CloudHsmClusterBackupStatusGetExceptionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CloudHsmClusterBackupStatusGetExceptionHeaders", + modelProperties: { + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const CloudHsmClusterRestoreStatusGetHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CloudHsmClusterRestoreStatusGetHeaders", + modelProperties: { + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const CloudHsmClusterRestoreStatusGetExceptionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CloudHsmClusterRestoreStatusGetExceptionHeaders", + modelProperties: { + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const DedicatedHsmUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DedicatedHsmUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, }; -export const CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = { +export const DedicatedHsmDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders", + className: "DedicatedHsmDeleteHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/parameters.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/parameters.ts index 81712175b553..c475f999c35d 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/parameters.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/models/parameters.ts @@ -9,14 +9,16 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { CloudHsmCluster as CloudHsmClusterMapper, CloudHsmClusterPatchParameters as CloudHsmClusterPatchParametersMapper, + BackupRequestProperties as BackupRequestPropertiesMapper, + RestoreRequestProperties as RestoreRequestPropertiesMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, DedicatedHsm as DedicatedHsmMapper, - DedicatedHsmPatchParameters as DedicatedHsmPatchParametersMapper + DedicatedHsmPatchParameters as DedicatedHsmPatchParametersMapper, } from "../models/mappers"; export const contentType: OperationParameter = { @@ -26,9 +28,9 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const accept: OperationParameter = { @@ -38,69 +40,39 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const tags: OperationParameter = { parameterPath: ["options", "tags"], - mapper: CloudHsmClusterMapper + mapper: CloudHsmClusterMapper, }; export const location: OperationParameter = { parameterPath: "location", - mapper: CloudHsmClusterMapper -}; - -export const sku: OperationParameter = { - parameterPath: ["options", "sku"], - mapper: CloudHsmClusterMapper + mapper: CloudHsmClusterMapper, }; export const identity: OperationParameter = { parameterPath: ["options", "identity"], - mapper: CloudHsmClusterMapper + mapper: CloudHsmClusterMapper, }; -export const provisioningState: OperationParameter = { - parameterPath: ["options", "provisioningState"], - mapper: CloudHsmClusterMapper +export const sku: OperationParameter = { + parameterPath: ["options", "sku"], + mapper: CloudHsmClusterMapper, }; export const autoGeneratedDomainNameLabelScope: OperationParameter = { parameterPath: ["options", "autoGeneratedDomainNameLabelScope"], - mapper: CloudHsmClusterMapper -}; - -export const securityDomain: OperationParameter = { - parameterPath: ["options", "securityDomain"], - mapper: CloudHsmClusterMapper -}; - -export const hsms: OperationParameter = { - parameterPath: ["options", "hsms"], - mapper: CloudHsmClusterMapper + mapper: CloudHsmClusterMapper, }; export const publicNetworkAccess: OperationParameter = { parameterPath: ["options", "publicNetworkAccess"], - mapper: CloudHsmClusterMapper -}; - -export const privateEndpointConnections: OperationParameter = { - parameterPath: ["options", "privateEndpointConnections"], - mapper: CloudHsmClusterMapper -}; - -export const restoreProperties: OperationParameter = { - parameterPath: ["options", "restoreProperties"], - mapper: CloudHsmClusterMapper -}; - -export const backupProperties: OperationParameter = { - parameterPath: ["options", "backupProperties"], - mapper: CloudHsmClusterMapper + mapper: CloudHsmClusterMapper, }; export const $host: OperationURLParameter = { @@ -109,10 +81,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { @@ -121,9 +93,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "Uuid" - } - } + name: "Uuid", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -131,62 +103,52 @@ export const resourceGroupName: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const cloudHsmClusterName: OperationURLParameter = { parameterPath: "cloudHsmClusterName", mapper: { constraints: { - Pattern: new RegExp("^[a-zA-Z0-9-]{3,24}$"), - MaxLength: 24, - MinLength: 3 + Pattern: new RegExp("^[a-zA-Z0-9-]{3,23}$"), + MaxLength: 23, + MinLength: 3, }, serializedName: "cloudHsmClusterName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-12-10-preview", + defaultValue: "2024-06-30-preview", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const tags1: OperationParameter = { parameterPath: ["options", "tags"], - mapper: CloudHsmClusterPatchParametersMapper -}; - -export const sku1: OperationParameter = { - parameterPath: ["options", "sku"], - mapper: CloudHsmClusterPatchParametersMapper + mapper: CloudHsmClusterPatchParametersMapper, }; export const identity1: OperationParameter = { parameterPath: ["options", "identity"], - mapper: CloudHsmClusterPatchParametersMapper -}; - -export const backupProperties1: OperationParameter = { - parameterPath: ["options", "backupProperties"], - mapper: CloudHsmClusterPatchParametersMapper + mapper: CloudHsmClusterPatchParametersMapper, }; export const skiptoken: OperationQueryParameter = { @@ -194,9 +156,24 @@ export const skiptoken: OperationQueryParameter = { mapper: { serializedName: "$skiptoken", type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const backupRequestProperties: OperationParameter = { + parameterPath: ["options", "backupRequestProperties"], + mapper: BackupRequestPropertiesMapper, +}; + +export const restoreRequestProperties: OperationParameter = { + parameterPath: ["options", "restoreRequestProperties"], + mapper: RestoreRequestPropertiesMapper, +}; + +export const restoreRequestProperties1: OperationParameter = { + parameterPath: "restoreRequestProperties", + mapper: RestoreRequestPropertiesMapper, }; export const nextLink: OperationURLParameter = { @@ -205,15 +182,15 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const properties: OperationParameter = { parameterPath: "properties", - mapper: PrivateEndpointConnectionMapper + mapper: PrivateEndpointConnectionMapper, }; export const peConnectionName: OperationURLParameter = { @@ -222,72 +199,49 @@ export const peConnectionName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[a-zA-Z0-9-]{3,24}$"), MaxLength: 24, - MinLength: 3 + MinLength: 3, }, serializedName: "peConnectionName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const apiVersion1: OperationQueryParameter = { - parameterPath: "apiVersion", +export const jobId: OperationURLParameter = { + parameterPath: "jobId", mapper: { - defaultValue: "2021-11-30", - isConstant: true, - serializedName: "api-version", + serializedName: "jobId", + required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: DedicatedHsmMapper -}; - -export const resourceGroupName1: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - serializedName: "resourceGroupName", - required: true, - type: { - name: "String" - } - } + mapper: DedicatedHsmMapper, }; export const name: OperationURLParameter = { parameterPath: "name", mapper: { constraints: { - Pattern: new RegExp("^[a-zA-Z0-9-]{3,24}$") + Pattern: new RegExp("^[a-zA-Z0-9-]{3,24}$"), }, serializedName: "name", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const tags2: OperationParameter = { parameterPath: ["options", "tags"], - mapper: DedicatedHsmPatchParametersMapper -}; - -export const name1: OperationURLParameter = { - parameterPath: "name", - mapper: { - serializedName: "name", - required: true, - type: { - name: "String" - } - } + mapper: DedicatedHsmPatchParametersMapper, }; export const top: OperationQueryParameter = { @@ -295,7 +249,7 @@ export const top: OperationQueryParameter = { mapper: { serializedName: "$top", type: { - name: "Number" - } - } + name: "Number", + }, + }, }; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterBackupStatus.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterBackupStatus.ts new file mode 100644 index 000000000000..f38c1ddd51ae --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterBackupStatus.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { CloudHsmClusterBackupStatus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureHSMResourceProvider } from "../azureHSMResourceProvider"; +import { + CloudHsmClusterBackupStatusGetOptionalParams, + CloudHsmClusterBackupStatusGetResponse, +} from "../models"; + +/** Class containing CloudHsmClusterBackupStatus operations. */ +export class CloudHsmClusterBackupStatusImpl + implements CloudHsmClusterBackupStatus +{ + private readonly client: AzureHSMResourceProvider; + + /** + * Initialize a new instance of the class CloudHsmClusterBackupStatus class. + * @param client Reference to the service client + */ + constructor(client: AzureHSMResourceProvider) { + this.client = client; + } + + /** + * Gets the backup operation status of the specified Cloud HSM Cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param jobId The id returned as part of the backup request + * @param options The options parameters. + */ + get( + resourceGroupName: string, + cloudHsmClusterName: string, + jobId: string, + options?: CloudHsmClusterBackupStatusGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cloudHsmClusterName, jobId, options }, + getOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupResult, + headersMapper: Mappers.CloudHsmClusterBackupStatusGetHeaders, + }, + 202: { + headersMapper: Mappers.CloudHsmClusterBackupStatusGetHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.CloudHsmClusterBackupStatusGetExceptionHeaders, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudHsmClusterName, + Parameters.jobId, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterPrivateEndpointConnections.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterPrivateEndpointConnections.ts index 5f1aa7e35082..0614a145e9c8 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterPrivateEndpointConnections.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterPrivateEndpointConnections.ts @@ -14,7 +14,7 @@ import { AzureHSMResourceProvider } from "../azureHSMResourceProvider"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -22,13 +22,15 @@ import { CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams, CloudHsmClusterPrivateEndpointConnectionsCreateResponse, CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams, + CloudHsmClusterPrivateEndpointConnectionsDeleteResponse, CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams, - CloudHsmClusterPrivateEndpointConnectionsGetResponse + CloudHsmClusterPrivateEndpointConnectionsGetResponse, } from "../models"; /** Class containing CloudHsmClusterPrivateEndpointConnections operations. */ export class CloudHsmClusterPrivateEndpointConnectionsImpl - implements CloudHsmClusterPrivateEndpointConnections { + implements CloudHsmClusterPrivateEndpointConnections +{ private readonly client: AzureHSMResourceProvider; /** @@ -43,7 +45,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl * Creates or updates the private endpoint connection for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM * Cluster. * @param properties Parameters of the PrivateEndpointConnection @@ -54,7 +56,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl cloudHsmClusterName: string, peConnectionName: string, properties: PrivateEndpointConnection, - options?: CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams + options?: CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -62,9 +64,9 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl cloudHsmClusterName, peConnectionName, properties, - options + options, }, - createOperationSpec + createOperationSpec, ); } @@ -72,7 +74,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl * Deletes the private endpoint connection for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM * Cluster. * @param options The options parameters. @@ -81,25 +83,29 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, - options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams - ): Promise, void>> { + options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClusterPrivateEndpointConnectionsDeleteResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -108,8 +114,8 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -117,8 +123,8 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -128,14 +134,17 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl resourceGroupName, cloudHsmClusterName, peConnectionName, - options + options, }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); - const poller = await createHttpPoller>(lro, { + const poller = await createHttpPoller< + CloudHsmClusterPrivateEndpointConnectionsDeleteResponse, + OperationState + >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -145,7 +154,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl * Deletes the private endpoint connection for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM * Cluster. * @param options The options parameters. @@ -154,13 +163,13 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, - options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams - ): Promise { + options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams, + ): Promise { const poller = await this.beginDelete( resourceGroupName, cloudHsmClusterName, peConnectionName, - options + options, ); return poller.pollUntilDone(); } @@ -169,7 +178,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl * Gets the private endpoint connection for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM * Cluster. * @param options The options parameters. @@ -178,11 +187,11 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, - options?: CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams + options?: CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, cloudHsmClusterName, peConnectionName, options }, - getOperationSpec + getOperationSpec, ); } } @@ -190,16 +199,15 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.properties, queryParameters: [Parameters.apiVersion], @@ -208,24 +216,35 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.cloudHsmClusterName, - Parameters.peConnectionName + Parameters.peConnectionName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", httpMethod: "DELETE", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: + Mappers.CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders, + }, + 201: { + headersMapper: + Mappers.CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders, + }, + 202: { + headersMapper: + Mappers.CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders, + }, + 204: { + headersMapper: + Mappers.CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders, + }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -233,22 +252,21 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.cloudHsmClusterName, - Parameters.peConnectionName + Parameters.peConnectionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -256,8 +274,8 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.cloudHsmClusterName, - Parameters.peConnectionName + Parameters.peConnectionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterPrivateLinkResources.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterPrivateLinkResources.ts index d893995f9182..bc0fd6288e99 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterPrivateLinkResources.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterPrivateLinkResources.ts @@ -6,19 +6,26 @@ * 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 { CloudHsmClusterPrivateLinkResources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureHSMResourceProvider } from "../azureHSMResourceProvider"; import { + PrivateLinkResource, + CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextOptionalParams, CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams, - CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse + CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse, + CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextResponse, } from "../models"; +/// /** Class containing CloudHsmClusterPrivateLinkResources operations. */ export class CloudHsmClusterPrivateLinkResourcesImpl - implements CloudHsmClusterPrivateLinkResources { + implements CloudHsmClusterPrivateLinkResources +{ private readonly client: AzureHSMResourceProvider; /** @@ -33,17 +40,122 @@ export class CloudHsmClusterPrivateLinkResourcesImpl * Gets the private link resources supported for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ - listByCloudHsmCluster( + public listByCloudHsmCluster( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams + options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCloudHsmClusterPagingAll( + resourceGroupName, + cloudHsmClusterName, + 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.listByCloudHsmClusterPagingPage( + resourceGroupName, + cloudHsmClusterName, + options, + settings, + ); + }, + }; + } + + private async *listByCloudHsmClusterPagingPage( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCloudHsmCluster( + resourceGroupName, + cloudHsmClusterName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCloudHsmClusterNext( + resourceGroupName, + cloudHsmClusterName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCloudHsmClusterPagingAll( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCloudHsmClusterPagingPage( + resourceGroupName, + cloudHsmClusterName, + options, + )) { + yield* page; + } + } + + /** + * Gets the private link resources supported for the Cloud Hsm Cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + private _listByCloudHsmCluster( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, cloudHsmClusterName, options }, - listByCloudHsmClusterOperationSpec + listByCloudHsmClusterOperationSpec, + ); + } + + /** + * ListByCloudHsmClusterNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param nextLink The nextLink from the previous successful call to the ListByCloudHsmCluster method. + * @param options The options parameters. + */ + private _listByCloudHsmClusterNext( + resourceGroupName: string, + cloudHsmClusterName: string, + nextLink: string, + options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cloudHsmClusterName, nextLink, options }, + listByCloudHsmClusterNextOperationSpec, ); } } @@ -51,24 +163,44 @@ export class CloudHsmClusterPrivateLinkResourcesImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listByCloudHsmClusterOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateLinkResourceListResult + bodyMapper: Mappers.PrivateLinkResourceListResult, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.cloudHsmClusterName + Parameters.cloudHsmClusterName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCloudHsmClusterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudHsmClusterName, + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterRestoreStatus.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterRestoreStatus.ts new file mode 100644 index 000000000000..ab49dadbb9f2 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusterRestoreStatus.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { CloudHsmClusterRestoreStatus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureHSMResourceProvider } from "../azureHSMResourceProvider"; +import { + CloudHsmClusterRestoreStatusGetOptionalParams, + CloudHsmClusterRestoreStatusGetResponse, +} from "../models"; + +/** Class containing CloudHsmClusterRestoreStatus operations. */ +export class CloudHsmClusterRestoreStatusImpl + implements CloudHsmClusterRestoreStatus +{ + private readonly client: AzureHSMResourceProvider; + + /** + * Initialize a new instance of the class CloudHsmClusterRestoreStatus class. + * @param client Reference to the service client + */ + constructor(client: AzureHSMResourceProvider) { + this.client = client; + } + + /** + * Gets the restore operation status of the specified Cloud HSM Cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param jobId The id returned as part of the backup request + * @param options The options parameters. + */ + get( + resourceGroupName: string, + cloudHsmClusterName: string, + jobId: string, + options?: CloudHsmClusterRestoreStatusGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cloudHsmClusterName, jobId, options }, + getOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RestoreResult, + headersMapper: Mappers.CloudHsmClusterRestoreStatusGetHeaders, + }, + 202: { + headersMapper: Mappers.CloudHsmClusterRestoreStatusGetHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.CloudHsmClusterRestoreStatusGetExceptionHeaders, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudHsmClusterName, + Parameters.jobId, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusters.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusters.ts index 7f25b8124c50..129b326225af 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusters.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/cloudHsmClusters.ts @@ -16,7 +16,7 @@ import { AzureHSMResourceProvider } from "../azureHSMResourceProvider"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -34,8 +34,18 @@ import { CloudHsmClustersGetOptionalParams, CloudHsmClustersGetResponse, CloudHsmClustersDeleteOptionalParams, + CloudHsmClustersDeleteResponse, + CloudHsmClustersValidateBackupPropertiesOptionalParams, + CloudHsmClustersValidateBackupPropertiesResponse, + CloudHsmClustersBackupOptionalParams, + CloudHsmClustersBackupResponse, + CloudHsmClustersValidateRestorePropertiesOptionalParams, + CloudHsmClustersValidateRestorePropertiesResponse, + RestoreRequestProperties, + CloudHsmClustersRestoreOptionalParams, + CloudHsmClustersRestoreResponse, CloudHsmClustersListByResourceGroupNextResponse, - CloudHsmClustersListBySubscriptionNextResponse + CloudHsmClustersListBySubscriptionNextResponse, } from "../models"; /// @@ -59,7 +69,7 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { */ public listByResourceGroup( resourceGroupName: string, - options?: CloudHsmClustersListByResourceGroupOptionalParams + options?: CloudHsmClustersListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -76,16 +86,16 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: CloudHsmClustersListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CloudHsmClustersListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -100,7 +110,7 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -111,11 +121,11 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: CloudHsmClustersListByResourceGroupOptionalParams + options?: CloudHsmClustersListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -126,7 +136,7 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { * @param options The options parameters. */ public listBySubscription( - options?: CloudHsmClustersListBySubscriptionOptionalParams + options?: CloudHsmClustersListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -141,13 +151,13 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: CloudHsmClustersListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CloudHsmClustersListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -168,7 +178,7 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { } private async *listBySubscriptionPagingAll( - options?: CloudHsmClustersListBySubscriptionOptionalParams + options?: CloudHsmClustersListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -179,7 +189,7 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { * Create or Update a Cloud HSM Cluster in the specified subscription. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param location The geo-location where the resource lives * @param options The options parameters. */ @@ -187,7 +197,7 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { resourceGroupName: string, cloudHsmClusterName: string, location: string, - options?: CloudHsmClustersCreateOrUpdateOptionalParams + options?: CloudHsmClustersCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -196,21 +206,20 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -219,8 +228,8 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -228,15 +237,15 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, cloudHsmClusterName, location, options }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< CloudHsmClustersCreateOrUpdateResponse, @@ -244,7 +253,7 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "original-uri" + resourceLocationConfig: "original-uri", }); await poller.poll(); return poller; @@ -254,7 +263,7 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { * Create or Update a Cloud HSM Cluster in the specified subscription. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param location The geo-location where the resource lives * @param options The options parameters. */ @@ -262,13 +271,13 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { resourceGroupName: string, cloudHsmClusterName: string, location: string, - options?: CloudHsmClustersCreateOrUpdateOptionalParams + options?: CloudHsmClustersCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, cloudHsmClusterName, location, - options + options, ); return poller.pollUntilDone(); } @@ -277,13 +286,13 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { * Update a Cloud HSM Cluster in the specified subscription. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ async beginUpdate( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersUpdateOptionalParams + options?: CloudHsmClustersUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -292,21 +301,20 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -315,8 +323,8 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -324,15 +332,15 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, cloudHsmClusterName, options }, - spec: updateOperationSpec + spec: updateOperationSpec, }); const poller = await createHttpPoller< CloudHsmClustersUpdateResponse, @@ -340,7 +348,7 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -350,18 +358,18 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { * Update a Cloud HSM Cluster in the specified subscription. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ async beginUpdateAndWait( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersUpdateOptionalParams + options?: CloudHsmClustersUpdateOptionalParams, ): Promise { const poller = await this.beginUpdate( resourceGroupName, cloudHsmClusterName, - options + options, ); return poller.pollUntilDone(); } @@ -370,17 +378,17 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { * Gets the specified Cloud HSM Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ get( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersGetOptionalParams + options?: CloudHsmClustersGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, cloudHsmClusterName, options }, - getOperationSpec + getOperationSpec, ); } @@ -388,31 +396,35 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { * Deletes the specified Cloud HSM Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ async beginDelete( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersDeleteOptionalParams - ): Promise, void>> { + options?: CloudHsmClustersDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersDeleteResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -421,8 +433,8 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -430,20 +442,23 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, cloudHsmClusterName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); - const poller = await createHttpPoller>(lro, { + const poller = await createHttpPoller< + CloudHsmClustersDeleteResponse, + OperationState + >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -453,18 +468,18 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { * Deletes the specified Cloud HSM Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ async beginDeleteAndWait( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersDeleteOptionalParams - ): Promise { + options?: CloudHsmClustersDeleteOptionalParams, + ): Promise { const poller = await this.beginDelete( resourceGroupName, cloudHsmClusterName, - options + options, ); return poller.pollUntilDone(); } @@ -477,11 +492,11 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { */ private _listByResourceGroup( resourceGroupName: string, - options?: CloudHsmClustersListByResourceGroupOptionalParams + options?: CloudHsmClustersListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } @@ -490,14 +505,394 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { * @param options The options parameters. */ private _listBySubscription( - options?: CloudHsmClustersListBySubscriptionOptionalParams + options?: CloudHsmClustersListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } + /** + * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster + * resource in the specified subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + async beginValidateBackupProperties( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersValidateBackupPropertiesOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersValidateBackupPropertiesResponse + > + > { + 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, cloudHsmClusterName, options }, + spec: validateBackupPropertiesOperationSpec, + }); + const poller = await createHttpPoller< + CloudHsmClustersValidateBackupPropertiesResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster + * resource in the specified subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + async beginValidateBackupPropertiesAndWait( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersValidateBackupPropertiesOptionalParams, + ): Promise { + const poller = await this.beginValidateBackupProperties( + resourceGroupName, + cloudHsmClusterName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Create a backup of the Cloud HSM Cluster in the specified subscription + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + async beginBackup( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersBackupOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersBackupResponse + > + > { + 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, cloudHsmClusterName, options }, + spec: backupOperationSpec, + }); + const poller = await createHttpPoller< + CloudHsmClustersBackupResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a backup of the Cloud HSM Cluster in the specified subscription + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + async beginBackupAndWait( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersBackupOptionalParams, + ): Promise { + const poller = await this.beginBackup( + resourceGroupName, + cloudHsmClusterName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Queued validating pre restore operation + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + async beginValidateRestoreProperties( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersValidateRestorePropertiesOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersValidateRestorePropertiesResponse + > + > { + 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, cloudHsmClusterName, options }, + spec: validateRestorePropertiesOperationSpec, + }); + const poller = await createHttpPoller< + CloudHsmClustersValidateRestorePropertiesResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Queued validating pre restore operation + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + async beginValidateRestorePropertiesAndWait( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersValidateRestorePropertiesOptionalParams, + ): Promise { + const poller = await this.beginValidateRestoreProperties( + resourceGroupName, + cloudHsmClusterName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Restores all key materials of a specified Cloud HSM Cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param restoreRequestProperties Restore Operation Required properties + * @param options The options parameters. + */ + async beginRestore( + resourceGroupName: string, + cloudHsmClusterName: string, + restoreRequestProperties: RestoreRequestProperties, + options?: CloudHsmClustersRestoreOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersRestoreResponse + > + > { + 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, + cloudHsmClusterName, + restoreRequestProperties, + options, + }, + spec: restoreOperationSpec, + }); + const poller = await createHttpPoller< + CloudHsmClustersRestoreResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Restores all key materials of a specified Cloud HSM Cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param restoreRequestProperties Restore Operation Required properties + * @param options The options parameters. + */ + async beginRestoreAndWait( + resourceGroupName: string, + cloudHsmClusterName: string, + restoreRequestProperties: RestoreRequestProperties, + options?: CloudHsmClustersRestoreOptionalParams, + ): Promise { + const poller = await this.beginRestore( + resourceGroupName, + cloudHsmClusterName, + restoreRequestProperties, + options, + ); + return poller.pollUntilDone(); + } + /** * ListByResourceGroupNext * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -507,11 +902,11 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: CloudHsmClustersListByResourceGroupNextOptionalParams + options?: CloudHsmClustersListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } @@ -522,11 +917,11 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { */ private _listBySubscriptionNext( nextLink: string, - options?: CloudHsmClustersListBySubscriptionNextOptionalParams + options?: CloudHsmClustersListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } } @@ -534,217 +929,355 @@ export class CloudHsmClustersImpl implements CloudHsmClusters { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.CloudHsmCluster + bodyMapper: Mappers.CloudHsmCluster, }, 201: { - bodyMapper: Mappers.CloudHsmCluster + bodyMapper: Mappers.CloudHsmCluster, }, 202: { - bodyMapper: Mappers.CloudHsmCluster + bodyMapper: Mappers.CloudHsmCluster, }, 204: { - bodyMapper: Mappers.CloudHsmCluster + bodyMapper: Mappers.CloudHsmCluster, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: { parameterPath: { tags: ["options", "tags"], location: ["location"], - sku: ["options", "sku"], identity: ["options", "identity"], - provisioningState: ["options", "provisioningState"], + sku: ["options", "sku"], autoGeneratedDomainNameLabelScope: [ "options", - "autoGeneratedDomainNameLabelScope" + "autoGeneratedDomainNameLabelScope", ], - securityDomain: ["options", "securityDomain"], - hsms: ["options", "hsms"], publicNetworkAccess: ["options", "publicNetworkAccess"], - privateEndpointConnections: ["options", "privateEndpointConnections"], - restoreProperties: ["options", "restoreProperties"], - backupProperties: ["options", "backupProperties"] }, - mapper: { ...Mappers.CloudHsmCluster, required: true } + mapper: { ...Mappers.CloudHsmCluster, required: true }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.cloudHsmClusterName + Parameters.cloudHsmClusterName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.CloudHsmCluster + bodyMapper: Mappers.CloudHsmCluster, }, 201: { - bodyMapper: Mappers.CloudHsmCluster + bodyMapper: Mappers.CloudHsmCluster, }, 202: { - bodyMapper: Mappers.CloudHsmCluster + bodyMapper: Mappers.CloudHsmCluster, }, 204: { - bodyMapper: Mappers.CloudHsmCluster + bodyMapper: Mappers.CloudHsmCluster, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: { parameterPath: { tags: ["options", "tags"], - sku: ["options", "sku"], identity: ["options", "identity"], - backupProperties: ["options", "backupProperties"] }, - mapper: { ...Mappers.CloudHsmClusterPatchParameters, required: true } + mapper: { ...Mappers.CloudHsmClusterPatchParameters, required: true }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.cloudHsmClusterName + Parameters.cloudHsmClusterName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CloudHsmCluster + bodyMapper: Mappers.CloudHsmCluster, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.cloudHsmClusterName + Parameters.cloudHsmClusterName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", httpMethod: "DELETE", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: Mappers.CloudHsmClustersDeleteHeaders, + }, + 201: { + headersMapper: Mappers.CloudHsmClustersDeleteHeaders, + }, + 202: { + headersMapper: Mappers.CloudHsmClustersDeleteHeaders, + }, + 204: { + headersMapper: Mappers.CloudHsmClustersDeleteHeaders, + }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.cloudHsmClusterName + Parameters.cloudHsmClusterName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CloudHsmClusterListResult + bodyMapper: Mappers.CloudHsmClusterListResult, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.skiptoken], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CloudHsmClusterListResult + bodyMapper: Mappers.CloudHsmClusterListResult, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.skiptoken], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const validateBackupPropertiesOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BackupResult, + headersMapper: Mappers.CloudHsmClustersValidateBackupPropertiesHeaders, + }, + 201: { + bodyMapper: Mappers.BackupResult, + headersMapper: Mappers.CloudHsmClustersValidateBackupPropertiesHeaders, + }, + 202: { + bodyMapper: Mappers.BackupResult, + headersMapper: Mappers.CloudHsmClustersValidateBackupPropertiesHeaders, + }, + 204: { + bodyMapper: Mappers.BackupResult, + headersMapper: Mappers.CloudHsmClustersValidateBackupPropertiesHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.backupRequestProperties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudHsmClusterName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const backupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BackupResult, + headersMapper: Mappers.CloudHsmClustersBackupHeaders, + }, + 201: { + bodyMapper: Mappers.BackupResult, + headersMapper: Mappers.CloudHsmClustersBackupHeaders, + }, + 202: { + bodyMapper: Mappers.BackupResult, + headersMapper: Mappers.CloudHsmClustersBackupHeaders, + }, + 204: { + bodyMapper: Mappers.BackupResult, + headersMapper: Mappers.CloudHsmClustersBackupHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.backupRequestProperties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudHsmClusterName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const validateRestorePropertiesOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.RestoreResult, + headersMapper: Mappers.CloudHsmClustersValidateRestorePropertiesHeaders, + }, + 201: { + bodyMapper: Mappers.RestoreResult, + headersMapper: Mappers.CloudHsmClustersValidateRestorePropertiesHeaders, + }, + 202: { + bodyMapper: Mappers.RestoreResult, + headersMapper: Mappers.CloudHsmClustersValidateRestorePropertiesHeaders, + }, + 204: { + bodyMapper: Mappers.RestoreResult, + headersMapper: Mappers.CloudHsmClustersValidateRestorePropertiesHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.restoreRequestProperties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudHsmClusterName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const restoreOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.RestoreResult, + headersMapper: Mappers.CloudHsmClustersRestoreHeaders, + }, + 201: { + bodyMapper: Mappers.RestoreResult, + headersMapper: Mappers.CloudHsmClustersRestoreHeaders, + }, + 202: { + bodyMapper: Mappers.RestoreResult, + headersMapper: Mappers.CloudHsmClustersRestoreHeaders, + }, + 204: { + bodyMapper: Mappers.RestoreResult, + headersMapper: Mappers.CloudHsmClustersRestoreHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.restoreRequestProperties1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudHsmClusterName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CloudHsmClusterListResult + bodyMapper: Mappers.CloudHsmClusterListResult, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CloudHsmClusterListResult + bodyMapper: Mappers.CloudHsmClusterListResult, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/dedicatedHsmOperations.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/dedicatedHsmOperations.ts index 3f86e532ddb3..6899280f8ead 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/dedicatedHsmOperations.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/dedicatedHsmOperations.ts @@ -16,7 +16,7 @@ import { AzureHSMResourceProvider } from "../azureHSMResourceProvider"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -36,11 +36,12 @@ import { DedicatedHsmUpdateOptionalParams, DedicatedHsmUpdateResponse, DedicatedHsmDeleteOptionalParams, + DedicatedHsmDeleteResponse, DedicatedHsmGetOptionalParams, DedicatedHsmGetResponse, DedicatedHsmListByResourceGroupNextResponse, DedicatedHsmListBySubscriptionNextResponse, - DedicatedHsmListOutboundNetworkDependenciesEndpointsNextResponse + DedicatedHsmListOutboundNetworkDependenciesEndpointsNextResponse, } from "../models"; /// @@ -59,12 +60,12 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { /** * The List operation gets information about the dedicated hsms associated with the subscription and * within the specified resource group. - * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ public listByResourceGroup( resourceGroupName: string, - options?: DedicatedHsmListByResourceGroupOptionalParams + options?: DedicatedHsmListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -81,16 +82,16 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: DedicatedHsmListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DedicatedHsmListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -105,7 +106,7 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -116,11 +117,11 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: DedicatedHsmListByResourceGroupOptionalParams + options?: DedicatedHsmListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -131,7 +132,7 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { * @param options The options parameters. */ public listBySubscription( - options?: DedicatedHsmListBySubscriptionOptionalParams + options?: DedicatedHsmListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -146,13 +147,13 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: DedicatedHsmListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DedicatedHsmListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -173,7 +174,7 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { } private async *listBySubscriptionPagingAll( - options?: DedicatedHsmListBySubscriptionOptionalParams + options?: DedicatedHsmListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -183,19 +184,19 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { /** * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified * dedicated hsm resource. The operation returns properties of each egress endpoint. - * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. - * @param name The name of the dedicated HSM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ public listOutboundNetworkDependenciesEndpoints( resourceGroupName: string, name: string, - options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams + options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listOutboundNetworkDependenciesEndpointsPagingAll( resourceGroupName, name, - options + options, ); return { next() { @@ -212,9 +213,9 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { resourceGroupName, name, options, - settings + settings, ); - } + }, }; } @@ -222,7 +223,7 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { resourceGroupName: string, name: string, options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DedicatedHsmListOutboundNetworkDependenciesEndpointsResponse; let continuationToken = settings?.continuationToken; @@ -230,7 +231,7 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { result = await this._listOutboundNetworkDependenciesEndpoints( resourceGroupName, name, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -242,7 +243,7 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { resourceGroupName, name, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -254,12 +255,12 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { private async *listOutboundNetworkDependenciesEndpointsPagingAll( resourceGroupName: string, name: string, - options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams + options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listOutboundNetworkDependenciesEndpointsPagingPage( resourceGroupName, name, - options + options, )) { yield* page; } @@ -267,7 +268,7 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { /** * Create or Update a dedicated HSM in the specified subscription. - * @param resourceGroupName The name of the Resource Group to which the resource belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name Name of the dedicated Hsm * @param parameters Parameters to create or update the dedicated hsm * @param options The options parameters. @@ -276,7 +277,7 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { resourceGroupName: string, name: string, parameters: DedicatedHsm, - options?: DedicatedHsmCreateOrUpdateOptionalParams + options?: DedicatedHsmCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -285,21 +286,20 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -308,8 +308,8 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -317,22 +317,22 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, name, parameters, options }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< DedicatedHsmCreateOrUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -340,7 +340,7 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { /** * Create or Update a dedicated HSM in the specified subscription. - * @param resourceGroupName The name of the Resource Group to which the resource belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name Name of the dedicated Hsm * @param parameters Parameters to create or update the dedicated hsm * @param options The options parameters. @@ -349,27 +349,27 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { resourceGroupName: string, name: string, parameters: DedicatedHsm, - options?: DedicatedHsmCreateOrUpdateOptionalParams + options?: DedicatedHsmCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, name, parameters, - options + options, ); return poller.pollUntilDone(); } /** * Update a dedicated HSM in the specified subscription. - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param name Name of the dedicated HSM + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ async beginUpdate( resourceGroupName: string, name: string, - options?: DedicatedHsmUpdateOptionalParams + options?: DedicatedHsmUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -378,21 +378,20 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -401,8 +400,8 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -410,22 +409,22 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, name, options }, - spec: updateOperationSpec + spec: updateOperationSpec, }); const poller = await createHttpPoller< DedicatedHsmUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -433,14 +432,14 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { /** * Update a dedicated HSM in the specified subscription. - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param name Name of the dedicated HSM + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ async beginUpdateAndWait( resourceGroupName: string, name: string, - options?: DedicatedHsmUpdateOptionalParams + options?: DedicatedHsmUpdateOptionalParams, ): Promise { const poller = await this.beginUpdate(resourceGroupName, name, options); return poller.pollUntilDone(); @@ -448,32 +447,36 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { /** * Deletes the specified Azure Dedicated HSM. - * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. - * @param name The name of the dedicated HSM to delete + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ async beginDelete( resourceGroupName: string, name: string, - options?: DedicatedHsmDeleteOptionalParams - ): Promise, void>> { + options?: DedicatedHsmDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DedicatedHsmDeleteResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -482,8 +485,8 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -491,19 +494,22 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, name, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); - const poller = await createHttpPoller>(lro, { + const poller = await createHttpPoller< + DedicatedHsmDeleteResponse, + OperationState + >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -511,49 +517,49 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { /** * Deletes the specified Azure Dedicated HSM. - * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. - * @param name The name of the dedicated HSM to delete + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ async beginDeleteAndWait( resourceGroupName: string, name: string, - options?: DedicatedHsmDeleteOptionalParams - ): Promise { + options?: DedicatedHsmDeleteOptionalParams, + ): Promise { const poller = await this.beginDelete(resourceGroupName, name, options); return poller.pollUntilDone(); } /** * Gets the specified Azure dedicated HSM. - * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. - * @param name The name of the dedicated HSM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ get( resourceGroupName: string, name: string, - options?: DedicatedHsmGetOptionalParams + options?: DedicatedHsmGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, name, options }, - getOperationSpec + getOperationSpec, ); } /** * The List operation gets information about the dedicated hsms associated with the subscription and * within the specified resource group. - * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ private _listByResourceGroup( resourceGroupName: string, - options?: DedicatedHsmListByResourceGroupOptionalParams + options?: DedicatedHsmListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } @@ -562,46 +568,46 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { * @param options The options parameters. */ private _listBySubscription( - options?: DedicatedHsmListBySubscriptionOptionalParams + options?: DedicatedHsmListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } /** * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified * dedicated hsm resource. The operation returns properties of each egress endpoint. - * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. - * @param name The name of the dedicated HSM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ private _listOutboundNetworkDependenciesEndpoints( resourceGroupName: string, name: string, - options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams + options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, name, options }, - listOutboundNetworkDependenciesEndpointsOperationSpec + listOutboundNetworkDependenciesEndpointsOperationSpec, ); } /** * ListByResourceGroupNext - * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @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?: DedicatedHsmListByResourceGroupNextOptionalParams + options?: DedicatedHsmListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } @@ -612,18 +618,18 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { */ private _listBySubscriptionNext( nextLink: string, - options?: DedicatedHsmListBySubscriptionNextOptionalParams + options?: DedicatedHsmListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } /** * ListOutboundNetworkDependenciesEndpointsNext - * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. - * @param name The name of the dedicated HSM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param nextLink The nextLink from the previous successful call to the * ListOutboundNetworkDependenciesEndpoints method. * @param options The options parameters. @@ -632,11 +638,11 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { resourceGroupName: string, name: string, nextLink: string, - options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsNextOptionalParams + options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, name, nextLink, options }, - listOutboundNetworkDependenciesEndpointsNextOperationSpec + listOutboundNetworkDependenciesEndpointsNextOperationSpec, ); } } @@ -644,236 +650,239 @@ export class DedicatedHsmOperationsImpl implements DedicatedHsmOperations { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DedicatedHsm + bodyMapper: Mappers.DedicatedHsm, }, 201: { - bodyMapper: Mappers.DedicatedHsm + bodyMapper: Mappers.DedicatedHsm, }, 202: { - bodyMapper: Mappers.DedicatedHsm + bodyMapper: Mappers.DedicatedHsm, }, 204: { - bodyMapper: Mappers.DedicatedHsm + bodyMapper: Mappers.DedicatedHsm, }, default: { - bodyMapper: Mappers.DedicatedHsmError - } + bodyMapper: Mappers.DedicatedHsmError, + }, }, requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.name + Parameters.resourceGroupName, + Parameters.name, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.DedicatedHsm + bodyMapper: Mappers.DedicatedHsm, }, 201: { - bodyMapper: Mappers.DedicatedHsm + bodyMapper: Mappers.DedicatedHsm, }, 202: { - bodyMapper: Mappers.DedicatedHsm + bodyMapper: Mappers.DedicatedHsm, }, 204: { - bodyMapper: Mappers.DedicatedHsm + bodyMapper: Mappers.DedicatedHsm, }, default: { - bodyMapper: Mappers.DedicatedHsmError - } + bodyMapper: Mappers.DedicatedHsmError, + }, }, requestBody: { parameterPath: { tags: ["options", "tags"] }, - mapper: { ...Mappers.DedicatedHsmPatchParameters, required: true } + mapper: { ...Mappers.DedicatedHsmPatchParameters, required: true }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.name + Parameters.resourceGroupName, + Parameters.name, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", httpMethod: "DELETE", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: Mappers.DedicatedHsmDeleteHeaders, + }, + 201: { + headersMapper: Mappers.DedicatedHsmDeleteHeaders, + }, + 202: { + headersMapper: Mappers.DedicatedHsmDeleteHeaders, + }, + 204: { + headersMapper: Mappers.DedicatedHsmDeleteHeaders, + }, default: { - bodyMapper: Mappers.DedicatedHsmError - } + bodyMapper: Mappers.DedicatedHsmError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.name1 + Parameters.resourceGroupName, + Parameters.name, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedHsm + bodyMapper: Mappers.DedicatedHsm, }, default: { - bodyMapper: Mappers.DedicatedHsmError - } + bodyMapper: Mappers.DedicatedHsmError, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.name1 + Parameters.resourceGroupName, + Parameters.name, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedHsmListResult + bodyMapper: Mappers.DedicatedHsmListResult, }, default: { - bodyMapper: Mappers.DedicatedHsmError - } + bodyMapper: Mappers.DedicatedHsmError, + }, }, - queryParameters: [Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName1 + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedHsmListResult + bodyMapper: Mappers.DedicatedHsmListResult, }, default: { - bodyMapper: Mappers.DedicatedHsmError - } + bodyMapper: Mappers.DedicatedHsmError, + }, }, - queryParameters: [Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listOutboundNetworkDependenciesEndpointsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OutboundEnvironmentEndpointCollection +const listOutboundNetworkDependenciesEndpointsOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OutboundEnvironmentEndpointCollection, + }, + default: { + bodyMapper: Mappers.DedicatedHsmError, + }, }, - default: { - bodyMapper: Mappers.DedicatedHsmError - } - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.name1 - ], - headerParameters: [Parameters.accept], - serializer -}; + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name, + ], + headerParameters: [Parameters.accept], + serializer, + }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedHsmListResult + bodyMapper: Mappers.DedicatedHsmListResult, }, default: { - bodyMapper: Mappers.DedicatedHsmError - } + bodyMapper: Mappers.DedicatedHsmError, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink, - Parameters.resourceGroupName1 ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedHsmListResult + bodyMapper: Mappers.DedicatedHsmListResult, }, default: { - bodyMapper: Mappers.DedicatedHsmError - } - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; -const listOutboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OutboundEnvironmentEndpointCollection + bodyMapper: Mappers.DedicatedHsmError, }, - default: { - bodyMapper: Mappers.DedicatedHsmError - } }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.nextLink, - Parameters.resourceGroupName1, - Parameters.name1 ], headerParameters: [Parameters.accept], - serializer + serializer, }; +const listOutboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.OperationSpec = + { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OutboundEnvironmentEndpointCollection, + }, + default: { + bodyMapper: Mappers.DedicatedHsmError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.name, + ], + headerParameters: [Parameters.accept], + serializer, + }; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/index.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/index.ts index 73ae14b8ccdc..2ac0975795d8 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/index.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/index.ts @@ -10,5 +10,7 @@ export * from "./cloudHsmClusters"; export * from "./cloudHsmClusterPrivateLinkResources"; export * from "./cloudHsmClusterPrivateEndpointConnections"; export * from "./privateEndpointConnections"; -export * from "./operations"; +export * from "./cloudHsmClusterBackupStatus"; +export * from "./cloudHsmClusterRestoreStatus"; export * from "./dedicatedHsmOperations"; +export * from "./operations"; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/operations.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/operations.ts index 2a65d0a86623..8f37b43dea56 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/operations.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/operations.ts @@ -13,9 +13,9 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureHSMResourceProvider } from "../azureHSMResourceProvider"; import { - DedicatedHsmOperation, + Operation, OperationsListOptionalParams, - OperationsListResponse + OperationsListResponse, } from "../models"; /// @@ -32,12 +32,12 @@ export class OperationsImpl implements Operations { } /** - * Get a list of Dedicated HSM operations. + * Get a list of Hardware Security Modules operations. * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { + options?: OperationsListOptionalParams, + ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -51,33 +51,33 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - _settings?: PageSettings - ): AsyncIterableIterator { + _settings?: PageSettings, + ): AsyncIterableIterator { let result: OperationsListResponse; result = await this._list(options); yield result.value || []; } private async *listPagingAll( - options?: OperationsListOptionalParams - ): AsyncIterableIterator { + options?: OperationsListOptionalParams, + ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; } } /** - * Get a list of Dedicated HSM operations. + * Get a list of Hardware Security Modules operations. * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -90,14 +90,14 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DedicatedHsmOperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.DedicatedHsmError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/privateEndpointConnections.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/privateEndpointConnections.ts index d05cf9fc2892..12e67fcc1839 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/privateEndpointConnections.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operations/privateEndpointConnections.ts @@ -18,13 +18,14 @@ import { PrivateEndpointConnectionsListByCloudHsmClusterNextOptionalParams, PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams, PrivateEndpointConnectionsListByCloudHsmClusterResponse, - PrivateEndpointConnectionsListByCloudHsmClusterNextResponse + PrivateEndpointConnectionsListByCloudHsmClusterNextResponse, } from "../models"; /// /** Class containing PrivateEndpointConnections operations. */ export class PrivateEndpointConnectionsImpl - implements PrivateEndpointConnections { + implements PrivateEndpointConnections +{ private readonly client: AzureHSMResourceProvider; /** @@ -40,18 +41,18 @@ export class PrivateEndpointConnectionsImpl * HSM Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ public listByCloudHsmCluster( resourceGroupName: string, cloudHsmClusterName: string, - options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams + options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByCloudHsmClusterPagingAll( resourceGroupName, cloudHsmClusterName, - options + options, ); return { next() { @@ -68,9 +69,9 @@ export class PrivateEndpointConnectionsImpl resourceGroupName, cloudHsmClusterName, options, - settings + settings, ); - } + }, }; } @@ -78,7 +79,7 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, cloudHsmClusterName: string, options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PrivateEndpointConnectionsListByCloudHsmClusterResponse; let continuationToken = settings?.continuationToken; @@ -86,7 +87,7 @@ export class PrivateEndpointConnectionsImpl result = await this._listByCloudHsmCluster( resourceGroupName, cloudHsmClusterName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -98,7 +99,7 @@ export class PrivateEndpointConnectionsImpl resourceGroupName, cloudHsmClusterName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -110,12 +111,12 @@ export class PrivateEndpointConnectionsImpl private async *listByCloudHsmClusterPagingAll( resourceGroupName: string, cloudHsmClusterName: string, - options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams + options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByCloudHsmClusterPagingPage( resourceGroupName, cloudHsmClusterName, - options + options, )) { yield* page; } @@ -126,17 +127,17 @@ export class PrivateEndpointConnectionsImpl * HSM Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ private _listByCloudHsmCluster( resourceGroupName: string, cloudHsmClusterName: string, - options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams + options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, cloudHsmClusterName, options }, - listByCloudHsmClusterOperationSpec + listByCloudHsmClusterOperationSpec, ); } @@ -144,7 +145,7 @@ export class PrivateEndpointConnectionsImpl * ListByCloudHsmClusterNext * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param nextLink The nextLink from the previous successful call to the ListByCloudHsmCluster method. * @param options The options parameters. */ @@ -152,11 +153,11 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, cloudHsmClusterName: string, nextLink: string, - options?: PrivateEndpointConnectionsListByCloudHsmClusterNextOptionalParams + options?: PrivateEndpointConnectionsListByCloudHsmClusterNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, cloudHsmClusterName, nextLink, options }, - listByCloudHsmClusterNextOperationSpec + listByCloudHsmClusterNextOperationSpec, ); } } @@ -164,45 +165,44 @@ export class PrivateEndpointConnectionsImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listByCloudHsmClusterOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult + bodyMapper: Mappers.PrivateEndpointConnectionListResult, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.cloudHsmClusterName + Parameters.cloudHsmClusterName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByCloudHsmClusterNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult + bodyMapper: Mappers.PrivateEndpointConnectionListResult, }, default: { - bodyMapper: Mappers.CloudHsmClusterError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.cloudHsmClusterName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterBackupStatus.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterBackupStatus.ts new file mode 100644 index 000000000000..c8c3a5a70240 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterBackupStatus.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + CloudHsmClusterBackupStatusGetOptionalParams, + CloudHsmClusterBackupStatusGetResponse, +} from "../models"; + +/** Interface representing a CloudHsmClusterBackupStatus. */ +export interface CloudHsmClusterBackupStatus { + /** + * Gets the backup operation status of the specified Cloud HSM Cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param jobId The id returned as part of the backup request + * @param options The options parameters. + */ + get( + resourceGroupName: string, + cloudHsmClusterName: string, + jobId: string, + options?: CloudHsmClusterBackupStatusGetOptionalParams, + ): Promise; +} diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterPrivateEndpointConnections.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterPrivateEndpointConnections.ts index b8d9ef12a073..bf0ff9a6656c 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterPrivateEndpointConnections.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterPrivateEndpointConnections.ts @@ -12,8 +12,9 @@ import { CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams, CloudHsmClusterPrivateEndpointConnectionsCreateResponse, CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams, + CloudHsmClusterPrivateEndpointConnectionsDeleteResponse, CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams, - CloudHsmClusterPrivateEndpointConnectionsGetResponse + CloudHsmClusterPrivateEndpointConnectionsGetResponse, } from "../models"; /** Interface representing a CloudHsmClusterPrivateEndpointConnections. */ @@ -22,7 +23,7 @@ export interface CloudHsmClusterPrivateEndpointConnections { * Creates or updates the private endpoint connection for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM * Cluster. * @param properties Parameters of the PrivateEndpointConnection @@ -33,13 +34,13 @@ export interface CloudHsmClusterPrivateEndpointConnections { cloudHsmClusterName: string, peConnectionName: string, properties: PrivateEndpointConnection, - options?: CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams + options?: CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams, ): Promise; /** * Deletes the private endpoint connection for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM * Cluster. * @param options The options parameters. @@ -48,13 +49,18 @@ export interface CloudHsmClusterPrivateEndpointConnections { resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, - options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams - ): Promise, void>>; + options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClusterPrivateEndpointConnectionsDeleteResponse + > + >; /** * Deletes the private endpoint connection for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM * Cluster. * @param options The options parameters. @@ -63,13 +69,13 @@ export interface CloudHsmClusterPrivateEndpointConnections { resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, - options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams - ): Promise; + options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams, + ): Promise; /** * Gets the private endpoint connection for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM * Cluster. * @param options The options parameters. @@ -78,6 +84,6 @@ export interface CloudHsmClusterPrivateEndpointConnections { resourceGroupName: string, cloudHsmClusterName: string, peConnectionName: string, - options?: CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams + options?: CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams, ): Promise; } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterPrivateLinkResources.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterPrivateLinkResources.ts index e91d4852e300..4707f25553c8 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterPrivateLinkResources.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterPrivateLinkResources.ts @@ -6,23 +6,25 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { + PrivateLinkResource, CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams, - CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse } from "../models"; +/// /** Interface representing a CloudHsmClusterPrivateLinkResources. */ export interface CloudHsmClusterPrivateLinkResources { /** * Gets the private link resources supported for the Cloud Hsm Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ listByCloudHsmCluster( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams - ): Promise; + options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams, + ): PagedAsyncIterableIterator; } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterRestoreStatus.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterRestoreStatus.ts new file mode 100644 index 000000000000..e322ec783dd2 --- /dev/null +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusterRestoreStatus.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + CloudHsmClusterRestoreStatusGetOptionalParams, + CloudHsmClusterRestoreStatusGetResponse, +} from "../models"; + +/** Interface representing a CloudHsmClusterRestoreStatus. */ +export interface CloudHsmClusterRestoreStatus { + /** + * Gets the restore operation status of the specified Cloud HSM Cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param jobId The id returned as part of the backup request + * @param options The options parameters. + */ + get( + resourceGroupName: string, + cloudHsmClusterName: string, + jobId: string, + options?: CloudHsmClusterRestoreStatusGetOptionalParams, + ): Promise; +} diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusters.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusters.ts index 3f50074713d8..b6df4f20239e 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusters.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/cloudHsmClusters.ts @@ -18,7 +18,17 @@ import { CloudHsmClustersUpdateResponse, CloudHsmClustersGetOptionalParams, CloudHsmClustersGetResponse, - CloudHsmClustersDeleteOptionalParams + CloudHsmClustersDeleteOptionalParams, + CloudHsmClustersDeleteResponse, + CloudHsmClustersValidateBackupPropertiesOptionalParams, + CloudHsmClustersValidateBackupPropertiesResponse, + CloudHsmClustersBackupOptionalParams, + CloudHsmClustersBackupResponse, + CloudHsmClustersValidateRestorePropertiesOptionalParams, + CloudHsmClustersValidateRestorePropertiesResponse, + RestoreRequestProperties, + CloudHsmClustersRestoreOptionalParams, + CloudHsmClustersRestoreResponse, } from "../models"; /// @@ -32,20 +42,20 @@ export interface CloudHsmClusters { */ listByResourceGroup( resourceGroupName: string, - options?: CloudHsmClustersListByResourceGroupOptionalParams + options?: CloudHsmClustersListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * The List operation gets information about the Cloud HSM Clusters associated with the subscription. * @param options The options parameters. */ listBySubscription( - options?: CloudHsmClustersListBySubscriptionOptionalParams + options?: CloudHsmClustersListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Create or Update a Cloud HSM Cluster in the specified subscription. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param location The geo-location where the resource lives * @param options The options parameters. */ @@ -53,7 +63,7 @@ export interface CloudHsmClusters { resourceGroupName: string, cloudHsmClusterName: string, location: string, - options?: CloudHsmClustersCreateOrUpdateOptionalParams + options?: CloudHsmClustersCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -64,7 +74,7 @@ export interface CloudHsmClusters { * Create or Update a Cloud HSM Cluster in the specified subscription. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param location The geo-location where the resource lives * @param options The options parameters. */ @@ -72,19 +82,19 @@ export interface CloudHsmClusters { resourceGroupName: string, cloudHsmClusterName: string, location: string, - options?: CloudHsmClustersCreateOrUpdateOptionalParams + options?: CloudHsmClustersCreateOrUpdateOptionalParams, ): Promise; /** * Update a Cloud HSM Cluster in the specified subscription. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ beginUpdate( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersUpdateOptionalParams + options?: CloudHsmClustersUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -95,48 +105,175 @@ export interface CloudHsmClusters { * Update a Cloud HSM Cluster in the specified subscription. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ beginUpdateAndWait( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersUpdateOptionalParams + options?: CloudHsmClustersUpdateOptionalParams, ): Promise; /** * Gets the specified Cloud HSM Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ get( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersGetOptionalParams + options?: CloudHsmClustersGetOptionalParams, ): Promise; /** * Deletes the specified Cloud HSM Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ beginDelete( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersDeleteOptionalParams - ): Promise, void>>; + options?: CloudHsmClustersDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersDeleteResponse + > + >; /** * Deletes the specified Cloud HSM Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ beginDeleteAndWait( resourceGroupName: string, cloudHsmClusterName: string, - options?: CloudHsmClustersDeleteOptionalParams - ): Promise; + options?: CloudHsmClustersDeleteOptionalParams, + ): Promise; + /** + * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster + * resource in the specified subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + beginValidateBackupProperties( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersValidateBackupPropertiesOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersValidateBackupPropertiesResponse + > + >; + /** + * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster + * resource in the specified subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + beginValidateBackupPropertiesAndWait( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersValidateBackupPropertiesOptionalParams, + ): Promise; + /** + * Create a backup of the Cloud HSM Cluster in the specified subscription + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + beginBackup( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersBackupOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersBackupResponse + > + >; + /** + * Create a backup of the Cloud HSM Cluster in the specified subscription + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + beginBackupAndWait( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersBackupOptionalParams, + ): Promise; + /** + * Queued validating pre restore operation + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + beginValidateRestoreProperties( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersValidateRestorePropertiesOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersValidateRestorePropertiesResponse + > + >; + /** + * Queued validating pre restore operation + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param options The options parameters. + */ + beginValidateRestorePropertiesAndWait( + resourceGroupName: string, + cloudHsmClusterName: string, + options?: CloudHsmClustersValidateRestorePropertiesOptionalParams, + ): Promise; + /** + * Restores all key materials of a specified Cloud HSM Cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param restoreRequestProperties Restore Operation Required properties + * @param options The options parameters. + */ + beginRestore( + resourceGroupName: string, + cloudHsmClusterName: string, + restoreRequestProperties: RestoreRequestProperties, + options?: CloudHsmClustersRestoreOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CloudHsmClustersRestoreResponse + > + >; + /** + * Restores all key materials of a specified Cloud HSM Cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. + * @param restoreRequestProperties Restore Operation Required properties + * @param options The options parameters. + */ + beginRestoreAndWait( + resourceGroupName: string, + cloudHsmClusterName: string, + restoreRequestProperties: RestoreRequestProperties, + options?: CloudHsmClustersRestoreOptionalParams, + ): Promise; } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/dedicatedHsmOperations.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/dedicatedHsmOperations.ts index 640c1a5978d3..fe772a3539e5 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/dedicatedHsmOperations.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/dedicatedHsmOperations.ts @@ -19,8 +19,9 @@ import { DedicatedHsmUpdateOptionalParams, DedicatedHsmUpdateResponse, DedicatedHsmDeleteOptionalParams, + DedicatedHsmDeleteResponse, DedicatedHsmGetOptionalParams, - DedicatedHsmGetResponse + DedicatedHsmGetResponse, } from "../models"; /// @@ -29,35 +30,35 @@ export interface DedicatedHsmOperations { /** * The List operation gets information about the dedicated hsms associated with the subscription and * within the specified resource group. - * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ listByResourceGroup( resourceGroupName: string, - options?: DedicatedHsmListByResourceGroupOptionalParams + options?: DedicatedHsmListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * The List operation gets information about the dedicated HSMs associated with the subscription. * @param options The options parameters. */ listBySubscription( - options?: DedicatedHsmListBySubscriptionOptionalParams + options?: DedicatedHsmListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified * dedicated hsm resource. The operation returns properties of each egress endpoint. - * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. - * @param name The name of the dedicated HSM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ listOutboundNetworkDependenciesEndpoints( resourceGroupName: string, name: string, - options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams + options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams, ): PagedAsyncIterableIterator; /** * Create or Update a dedicated HSM in the specified subscription. - * @param resourceGroupName The name of the Resource Group to which the resource belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name Name of the dedicated Hsm * @param parameters Parameters to create or update the dedicated hsm * @param options The options parameters. @@ -66,7 +67,7 @@ export interface DedicatedHsmOperations { resourceGroupName: string, name: string, parameters: DedicatedHsm, - options?: DedicatedHsmCreateOrUpdateOptionalParams + options?: DedicatedHsmCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -75,7 +76,7 @@ export interface DedicatedHsmOperations { >; /** * Create or Update a dedicated HSM in the specified subscription. - * @param resourceGroupName The name of the Resource Group to which the resource belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name Name of the dedicated Hsm * @param parameters Parameters to create or update the dedicated hsm * @param options The options parameters. @@ -84,18 +85,18 @@ export interface DedicatedHsmOperations { resourceGroupName: string, name: string, parameters: DedicatedHsm, - options?: DedicatedHsmCreateOrUpdateOptionalParams + options?: DedicatedHsmCreateOrUpdateOptionalParams, ): Promise; /** * Update a dedicated HSM in the specified subscription. - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param name Name of the dedicated HSM + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ beginUpdate( resourceGroupName: string, name: string, - options?: DedicatedHsmUpdateOptionalParams + options?: DedicatedHsmUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -104,46 +105,51 @@ export interface DedicatedHsmOperations { >; /** * Update a dedicated HSM in the specified subscription. - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param name Name of the dedicated HSM + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ beginUpdateAndWait( resourceGroupName: string, name: string, - options?: DedicatedHsmUpdateOptionalParams + options?: DedicatedHsmUpdateOptionalParams, ): Promise; /** * Deletes the specified Azure Dedicated HSM. - * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. - * @param name The name of the dedicated HSM to delete + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ beginDelete( resourceGroupName: string, name: string, - options?: DedicatedHsmDeleteOptionalParams - ): Promise, void>>; + options?: DedicatedHsmDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DedicatedHsmDeleteResponse + > + >; /** * Deletes the specified Azure Dedicated HSM. - * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. - * @param name The name of the dedicated HSM to delete + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ beginDeleteAndWait( resourceGroupName: string, name: string, - options?: DedicatedHsmDeleteOptionalParams - ): Promise; + options?: DedicatedHsmDeleteOptionalParams, + ): Promise; /** * Gets the specified Azure dedicated HSM. - * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. - * @param name The name of the dedicated HSM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the dedicated Hsm * @param options The options parameters. */ get( resourceGroupName: string, name: string, - options?: DedicatedHsmGetOptionalParams + options?: DedicatedHsmGetOptionalParams, ): Promise; } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/index.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/index.ts index 73ae14b8ccdc..2ac0975795d8 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/index.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/index.ts @@ -10,5 +10,7 @@ export * from "./cloudHsmClusters"; export * from "./cloudHsmClusterPrivateLinkResources"; export * from "./cloudHsmClusterPrivateEndpointConnections"; export * from "./privateEndpointConnections"; -export * from "./operations"; +export * from "./cloudHsmClusterBackupStatus"; +export * from "./cloudHsmClusterRestoreStatus"; export * from "./dedicatedHsmOperations"; +export * from "./operations"; diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/operations.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/operations.ts index 0ea412b95083..f8c3fad6e826 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/operations.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/operations.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { DedicatedHsmOperation, OperationsListOptionalParams } from "../models"; +import { Operation, OperationsListOptionalParams } from "../models"; /// /** Interface representing a Operations. */ export interface Operations { /** - * Get a list of Dedicated HSM operations. + * Get a list of Hardware Security Modules operations. * @param options The options parameters. */ list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; + options?: OperationsListOptionalParams, + ): PagedAsyncIterableIterator; } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/privateEndpointConnections.ts index 25643dad8bbc..493c987168dc 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/operationsInterfaces/privateEndpointConnections.ts @@ -9,7 +9,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { PrivateEndpointConnection, - PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams + PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams, } from "../models"; /// @@ -20,12 +20,12 @@ export interface PrivateEndpointConnections { * HSM Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. - * Cloud HSM Cluster names must be between 3 and 24 characters in length. + * Cloud HSM Cluster names must be between 3 and 23 characters in length. * @param options The options parameters. */ listByCloudHsmCluster( resourceGroupName: string, cloudHsmClusterName: string, - options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams + options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/pagingHelper.ts b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/pagingHelper.ts +++ b/sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return;