diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index cabce816ec51..c8948fa301dc 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -30,6 +30,7 @@ specifiers: '@rush-temp/arm-botservice': file:./projects/arm-botservice.tgz '@rush-temp/arm-cdn': file:./projects/arm-cdn.tgz '@rush-temp/arm-changeanalysis': file:./projects/arm-changeanalysis.tgz + '@rush-temp/arm-changes': file:./projects/arm-changes.tgz '@rush-temp/arm-cognitiveservices': file:./projects/arm-cognitiveservices.tgz '@rush-temp/arm-commerce': file:./projects/arm-commerce.tgz '@rush-temp/arm-commerce-profile-2020-09-01-hybrid': file:./projects/arm-commerce-profile-2020-09-01-hybrid.tgz @@ -306,6 +307,7 @@ dependencies: '@rush-temp/arm-botservice': file:projects/arm-botservice.tgz '@rush-temp/arm-cdn': file:projects/arm-cdn.tgz '@rush-temp/arm-changeanalysis': file:projects/arm-changeanalysis.tgz + '@rush-temp/arm-changes': file:projects/arm-changes.tgz '@rush-temp/arm-cognitiveservices': file:projects/arm-cognitiveservices.tgz '@rush-temp/arm-commerce': file:projects/arm-commerce.tgz '@rush-temp/arm-commerce-profile-2020-09-01-hybrid': file:projects/arm-commerce-profile-2020-09-01-hybrid.tgz @@ -9235,7 +9237,7 @@ packages: dev: false file:projects/app-configuration.tgz: - resolution: {integrity: sha512-mgBqLgANN5GfvaBoC8b8M+0kupymQe4VEtqebrPmON2T7RjuaEy02HZ0BfAqC5Ag+ea8O9+ZC2TrjGHfE3DV5w==, tarball: file:projects/app-configuration.tgz} + resolution: {integrity: sha512-SzCn41YZ/BPyOG53bMpoU8tddmYMQSW9zTTvSd0356VPzGXj4UKzyUsV97dhpUclb9Ar5PuNdETNcaFP2KuBmA==, tarball: file:projects/app-configuration.tgz} name: '@rush-temp/app-configuration' version: 0.0.0 dependencies: @@ -9872,6 +9874,32 @@ packages: - supports-color dev: false + file:projects/arm-changes.tgz: + resolution: {integrity: sha512-hAWkEglZ8YdPNjjPQTmBPP8eFRXAvnWCviaK0eHuitAZyn8mM52FRDvEpWQVZsTLpRQXxWrpRWOvq7uLFbZOLQ==, tarball: file:projects/arm-changes.tgz} + name: '@rush-temp/arm-changes' + version: 0.0.0 + dependencies: + '@azure/identity': 2.0.4 + '@microsoft/api-extractor': 7.18.11 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.72.0 + '@rollup/plugin-json': 4.1.0_rollup@2.72.0 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.72.0 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.72.0 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 2.72.0 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.72.0 + tslib: 2.4.0 + typescript: 4.2.4 + uglify-js: 3.15.4 + transitivePeerDependencies: + - '@types/node' + - debug + - supports-color + dev: false + file:projects/arm-cognitiveservices.tgz: resolution: {integrity: sha512-qRWhhPLtY+lfmRCzhOu3ZmyHFqghatlowWp5E0tWr0ck8fae0/EqwGhJT2lmpRoyMD8GwPoj/c0Fy6wLaiblKg==, tarball: file:projects/arm-cognitiveservices.tgz} name: '@rush-temp/arm-cognitiveservices' @@ -10936,7 +10964,7 @@ packages: dev: false file:projects/arm-features.tgz: - resolution: {integrity: sha512-koQB0eiTj4i4mpQQo+oM4b7D4L/dLlBH5MVN4B+P6W+q+aZb2gJXnUtqsisvl+hqMHUP6hPxKN9MyuhACUZTng==, tarball: file:projects/arm-features.tgz} + resolution: {integrity: sha512-ZTMbr/NLhwbBbJK5JKJZBIl+jwh4hlVrbOzncM2ulgBDfHYhMgdUN9rNCnUvQ5MYbccs7NQM0iYZ/94qN0ODjQ==, tarball: file:projects/arm-features.tgz} name: '@rush-temp/arm-features' version: 0.0.0 dependencies: @@ -10959,7 +10987,6 @@ packages: transitivePeerDependencies: - '@types/node' - debug - - encoding - supports-color dev: false @@ -11441,7 +11468,7 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-aKiMEyhgNzp2uO6X9Axy3v8+I94B2o5DAa1v3+HWsDc8A/5XbBs3Jned7WOm/4ngqlziQA4vFywQ9QeEvtzQFQ==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-z4H6VBYEC6P9kbMmLO/iRn8N8XNnJfnkkjpjmRzkJCBLLCoubwQpq6n14uzWp+INM2X3dKJrG8lvkzudj1jFig==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: @@ -11464,7 +11491,6 @@ packages: transitivePeerDependencies: - '@types/node' - debug - - encoding - supports-color dev: false @@ -11525,7 +11551,7 @@ packages: dev: false file:projects/arm-locks.tgz: - resolution: {integrity: sha512-7KM4vQCCbyWcab2W8c20NoCTeCgCyUoFok1I1SHyiCbizm+tH6K46AD0tYHJM/kxmqudivJzxM247ESyo4odTg==, tarball: file:projects/arm-locks.tgz} + resolution: {integrity: sha512-Hc9ckZWAvxVV2U4Ma/6v+sh2eTyM1X9lxk1++qWNJjWqx2GyoRZOZ640dBN/5tHiztsIuo3RMWz/oIYdCuROcA==, tarball: file:projects/arm-locks.tgz} name: '@rush-temp/arm-locks' version: 0.0.0 dependencies: @@ -11548,7 +11574,6 @@ packages: transitivePeerDependencies: - '@types/node' - debug - - encoding - supports-color dev: false @@ -11664,7 +11689,7 @@ packages: dev: false file:projects/arm-managedapplications.tgz: - resolution: {integrity: sha512-Ae7b+w5w8IF29B7dfC1xaVlwO+1CLRSI1agwbPv2hBu/lchiHJuOmYKPS8/6myIM2MZltBqjLicn/chIzHXRgQ==, tarball: file:projects/arm-managedapplications.tgz} + resolution: {integrity: sha512-OMQr+YC1VcBFgzT6eMYW7nY14cRig1aFtVtrqpvVzq4JLH72jAoF5Wz4wrpL6EjjvDVwwQFeWgtGT0P3FL5FNg==, tarball: file:projects/arm-managedapplications.tgz} name: '@rush-temp/arm-managedapplications' version: 0.0.0 dependencies: @@ -11687,7 +11712,6 @@ packages: transitivePeerDependencies: - '@types/node' - debug - - encoding - supports-color dev: false @@ -12364,7 +12388,7 @@ packages: dev: false file:projects/arm-policy.tgz: - resolution: {integrity: sha512-iSUVJXAlWs5sKsoQ4uu0TcF3D9AjFq8Kf3m6SCxefLvh+j3wWPJ6vLcGE8rXgVoi5Pyl+pgJZ//n4YfNS5K4/w==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-iz/exStzjopkSVeES7MNYJ+9Z+Dne5hA4Ism2TIlHmxCO1BANHSn5ZGw9O6094CSyv+g40Vq31YIMkL/xRFf+w==, tarball: file:projects/arm-policy.tgz} name: '@rush-temp/arm-policy' version: 0.0.0 dependencies: @@ -12387,7 +12411,6 @@ packages: transitivePeerDependencies: - '@types/node' - debug - - encoding - supports-color dev: false @@ -12952,7 +12975,7 @@ packages: dev: false file:projects/arm-resources-subscriptions.tgz: - resolution: {integrity: sha512-ajIKIo1wNiuaRAE2pzPY8FkB6TfD2oQQyj5Lso9u3ccmqoJiFmIF4xEbOIYQ32rkBuAzWiVLfGoWgLNSVzHASQ==, tarball: file:projects/arm-resources-subscriptions.tgz} + resolution: {integrity: sha512-XGWyBJoIRVVUuocVb8WFbXHqFn3wiTBugLApz71oM66wq4eyAFnlhqmtafz8voQpsKyRg9hwf2HuOEftf3rroA==, tarball: file:projects/arm-resources-subscriptions.tgz} name: '@rush-temp/arm-resources-subscriptions' version: 0.0.0 dependencies: @@ -12975,12 +12998,11 @@ packages: transitivePeerDependencies: - '@types/node' - debug - - encoding - supports-color dev: false file:projects/arm-resources.tgz: - resolution: {integrity: sha512-epl4txrifrImepCL/xH7kk1Xo2X10yGZJOFBm0C6gRiuF7smFfbqqUQm+7aEbh3QC8f1FM6Wb97zESnQRwzqAA==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-KqeKEZXrZjtcG9kxzyLE/ON1lr5SSbyhc92OsfQON1c2+MhdFQn56bJBCRtnIEpSJpIBx9VYgjNg/gFil7tKcw==, tarball: file:projects/arm-resources.tgz} name: '@rush-temp/arm-resources' version: 0.0.0 dependencies: @@ -13003,7 +13025,6 @@ packages: transitivePeerDependencies: - '@types/node' - debug - - encoding - supports-color dev: false @@ -13707,7 +13728,7 @@ packages: dev: false file:projects/arm-templatespecs.tgz: - resolution: {integrity: sha512-nCCIxGrlUhe08M2vSmRUolW0g+aoL8z9UHPnVCbpCUm9/PT2rxbS3zkOC8uy3DZm6wqNXpMTvM8PET33BxH0UQ==, tarball: file:projects/arm-templatespecs.tgz} + resolution: {integrity: sha512-sU7nvfWuvP2x4ot5UDvNoIIiuGUcNAF8tu66yZKC8Xjw/UGNjzssFnV81rTQiJYg3DKE9D3WNSMUdTtgZI03jw==, tarball: file:projects/arm-templatespecs.tgz} name: '@rush-temp/arm-templatespecs' version: 0.0.0 dependencies: @@ -13730,7 +13751,6 @@ packages: transitivePeerDependencies: - '@types/node' - debug - - encoding - supports-color dev: false @@ -14397,7 +14417,7 @@ packages: dev: false file:projects/container-registry.tgz: - resolution: {integrity: sha512-V/p7+Cu1a49LybAJV+v1tUHitMbg1pVOSwQ6JAxkgH16EcQnohNFUpqf+QtvKXMpbI6BKVSx/9VQM5/AtUMAQw==, tarball: file:projects/container-registry.tgz} + resolution: {integrity: sha512-BLmLIgLI2MH9kI3aFjUoctL3DRWLA5JIZhrJkZNm4L4lWmBvXrmHmsa0PZiQccwCnkln+mTtEB1KE28sPwEVkg==, tarball: file:projects/container-registry.tgz} name: '@rush-temp/container-registry' version: 0.0.0 dependencies: @@ -15349,7 +15369,7 @@ packages: dev: false file:projects/eventhubs-checkpointstore-blob.tgz: - resolution: {integrity: sha512-fJ6cZn28kU24JmLoWiHPo3PAobLpDHVym2oH/wy9csf0xLJ1GhrPVFYHiBPxWpgYC5flNiH5OBe2DsF3XLTjxQ==, tarball: file:projects/eventhubs-checkpointstore-blob.tgz} + resolution: {integrity: sha512-o2cL07TelVeXEaU2wY2Y4BeA+eMaU/TnmxrCoFyEw3Op0a/F+cctdENNTDxm2tIDP9MNz0LspCktHFgf4NPFLg==, tarball: file:projects/eventhubs-checkpointstore-blob.tgz} name: '@rush-temp/eventhubs-checkpointstore-blob' version: 0.0.0 dependencies: @@ -15396,7 +15416,6 @@ packages: - '@swc/core' - '@swc/wasm' - bufferutil - - encoding - supports-color - utf-8-validate dev: false @@ -16736,7 +16755,7 @@ packages: dev: false file:projects/quantum-jobs.tgz: - resolution: {integrity: sha512-VxnLvyLqoZH49xy0s+rp9ctoU8vHvYNl+4ZHlV0kTIWs1m8Gum1j8KODVUJgTkQxkfen1ajFnJ6H70k8fzmdWA==, tarball: file:projects/quantum-jobs.tgz} + resolution: {integrity: sha512-3tDUSyC5067Lkl6sXvFfb/AmVxbl/T17baX535KAcbz1wmc+a77SxX0QJwnd0B60nhPYtxqGTV9jhS8n+FmS0Q==, tarball: file:projects/quantum-jobs.tgz} name: '@rush-temp/quantum-jobs' version: 0.0.0 dependencies: @@ -17008,7 +17027,7 @@ packages: dev: false file:projects/storage-blob-changefeed.tgz: - resolution: {integrity: sha512-b0ZQkTSDa8yRCYocVj6uJPULInje0y+srK1cj12YGNGCf3/7LvLyIr477AQMl6mH0LMKQqm5GGNy2QrzpS2ACQ==, tarball: file:projects/storage-blob-changefeed.tgz} + resolution: {integrity: sha512-SrCjeQtrzDJmR9Zt36InqNML4QReO6HcTs2/N/Pa4fvIX5WfkDW/vO9lXpUQYnrfXJVcKKatFAvc42WIanJaTg==, tarball: file:projects/storage-blob-changefeed.tgz} name: '@rush-temp/storage-blob-changefeed' version: 0.0.0 dependencies: @@ -17121,7 +17140,7 @@ packages: dev: false file:projects/storage-file-datalake.tgz: - resolution: {integrity: sha512-kKcBF5zuGkuic74HUG5FcmQj2CyY0vwQg9wosa+mCSlt/Ix88gpUyuKD/O+D8r1LuA3a76TmFjOsulUwdvhUKg==, tarball: file:projects/storage-file-datalake.tgz} + resolution: {integrity: sha512-nXm5s35Wfg8EJFNsOIDTkcIW5uWws1QHUGFGKuoWSJyHUEqY2pmtAAdO+3RZfaA10SrvCD3zNTwqFLYmxxZ37w==, tarball: file:projects/storage-file-datalake.tgz} name: '@rush-temp/storage-file-datalake' version: 0.0.0 dependencies: @@ -17177,7 +17196,7 @@ packages: dev: false file:projects/storage-file-share.tgz: - resolution: {integrity: sha512-uTsgr0VLUxHKZktJu5q3HFXhXpVPlAQ6i+QYCtRJ+H3S072thFQPmScED3nSXbG6sU6wudKC6MK6Odl7Y8qN/Q==, tarball: file:projects/storage-file-share.tgz} + resolution: {integrity: sha512-Jrb/nCljJ1JIrl0pYwCo6g7kp4d5qL8W3R/wAiFYHUgLwgRpF/4GaH8CtrfvlUwcGeuRhrkKJLp0+CFf1PEGKw==, tarball: file:projects/storage-file-share.tgz} name: '@rush-temp/storage-file-share' version: 0.0.0 dependencies: diff --git a/rush.json b/rush.json index f051c1fab022..76249727247b 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1690,6 +1690,11 @@ "packageName": "@azure/arm-servicelinker", "projectFolder": "sdk/servicelinker/arm-servicelinker", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-changes", + "projectFolder": "sdk/changes/arm-changes", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md b/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md index 86fdb5ecc2bb..7de46396430b 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md @@ -1,15 +1,19 @@ # Release History - -## 2.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 2.1.0 (2022-05-13) + +**Features** + + - Added operation Subscriptions.checkZonePeers + - Added Interface AvailabilityZonePeers + - Added Interface CheckZonePeersRequest + - Added Interface CheckZonePeersResult + - Added Interface ErrorDetail + - Added Interface ErrorResponseAutoGenerated + - Added Interface Peers + - Added Interface SubscriptionsCheckZonePeersOptionalParams + - Added Type Alias SubscriptionsCheckZonePeersResponse + ## 2.0.1 (2022-04-18) **features** diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json index c6765ba542bb..8d2b3e8cd8c1 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "readme": "specification\\resources\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "0db8f36115d2dfccc789e0d6d7e53746640664b8", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/package.json b/sdk/resources-subscriptions/arm-resources-subscriptions/package.json index 4d5b9a09cfd5..22d3a7a3e0a3 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/package.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SubscriptionClient.", - "version": "2.0.2", + "version": "2.1.0", "engines": { "node": ">=12.0.0" }, @@ -38,9 +38,11 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources-subscriptions/arm-resources-subscriptions", "repository": { @@ -91,7 +93,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -104,13 +106,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resources-subscriptions?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md b/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md index 0afb6b6639c5..b747c65f56ae 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/review/arm-resources-subscriptions.api.md @@ -8,6 +8,12 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; +// @public +export interface AvailabilityZonePeers { + readonly availabilityZone?: string; + peers?: Peers[]; +} + // @public export interface CheckResourceNameOptionalParams extends coreClient.OperationOptions { resourceNameDefinition?: ResourceName; @@ -23,6 +29,19 @@ export interface CheckResourceNameResult { type?: string; } +// @public +export interface CheckZonePeersRequest { + location?: string; + subscriptionIds?: string[]; +} + +// @public +export interface CheckZonePeersResult { + availabilityZonePeers?: AvailabilityZonePeers[]; + location?: string; + readonly subscriptionId?: string; +} + // @public export interface CloudError { error?: ErrorResponse; @@ -34,6 +53,15 @@ export interface ErrorAdditionalInfo { readonly type?: string; } +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + // @public export interface ErrorResponse { readonly additionalInfo?: ErrorAdditionalInfo[]; @@ -43,6 +71,11 @@ export interface ErrorResponse { readonly target?: string; } +// @public +export interface ErrorResponseAutoGenerated { + error?: ErrorDetail; +} + // @public export enum KnownRegionCategory { // (undocumented) @@ -133,6 +166,12 @@ export interface PairedRegion { readonly subscriptionId?: string; } +// @public +export interface Peers { + readonly availabilityZone?: string; + readonly subscriptionId?: string; +} + // @public export type RegionCategory = string; @@ -202,11 +241,19 @@ export interface SubscriptionPolicies { // @public export interface Subscriptions { + checkZonePeers(subscriptionId: string, parameters: CheckZonePeersRequest, options?: SubscriptionsCheckZonePeersOptionalParams): Promise; get(subscriptionId: string, options?: SubscriptionsGetOptionalParams): Promise; list(options?: SubscriptionsListOptionalParams): PagedAsyncIterableIterator; listLocations(subscriptionId: string, options?: SubscriptionsListLocationsOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface SubscriptionsCheckZonePeersOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubscriptionsCheckZonePeersResponse = CheckZonePeersResult; + // @public export interface SubscriptionsGetOptionalParams extends coreClient.OperationOptions { } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts index c80a2f35682e..6e0993dc1476 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts @@ -294,6 +294,87 @@ export interface TenantIdDescription { readonly tenantBrandingLogoUrl?: string; } +/** Check zone peers request parameters. */ +export interface CheckZonePeersRequest { + /** The Microsoft location. */ + location?: string; + /** The peer Microsoft Azure subscription ID. */ + subscriptionIds?: string[]; +} + +/** Result of the Check zone peers operation. */ +export interface CheckZonePeersResult { + /** + * The subscription ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** the location of the subscription. */ + location?: string; + /** The Availability Zones shared by the subscriptions. */ + availabilityZonePeers?: AvailabilityZonePeers[]; +} + +/** List of availability zones shared by the subscriptions. */ +export interface AvailabilityZonePeers { + /** + * The availabilityZone. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly availabilityZone?: string; + /** Details of shared availability zone. */ + peers?: Peers[]; +} + +/** Information about shared availability zone. */ +export interface Peers { + /** + * The subscription ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** + * The availabilityZone. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly availabilityZone?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponseAutoGenerated { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + /** Name and Type of the Resource */ export interface ResourceName { /** Name of the resource */ @@ -427,6 +508,13 @@ export interface SubscriptionsListOptionalParams /** Contains response data for the list operation. */ export type SubscriptionsListResponse = SubscriptionListResult; +/** Optional parameters. */ +export interface SubscriptionsCheckZonePeersOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkZonePeers operation. */ +export type SubscriptionsCheckZonePeersResponse = CheckZonePeersResult; + /** Optional parameters. */ export interface SubscriptionsListNextOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts index 3bc2da2a3652..f4eb5f5464c8 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts @@ -549,6 +549,189 @@ export const TenantIdDescription: coreClient.CompositeMapper = { } }; +export const CheckZonePeersRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckZonePeersRequest", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + subscriptionIds: { + serializedName: "subscriptionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CheckZonePeersResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckZonePeersResult", + modelProperties: { + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + availabilityZonePeers: { + serializedName: "availabilityZonePeers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AvailabilityZonePeers" + } + } + } + } + } + } +}; + +export const AvailabilityZonePeers: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailabilityZonePeers", + modelProperties: { + availabilityZone: { + serializedName: "availabilityZone", + readOnly: true, + type: { + name: "String" + } + }, + peers: { + serializedName: "peers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Peers" + } + } + } + } + } + } +}; + +export const Peers: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Peers", + modelProperties: { + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String" + } + }, + availabilityZone: { + serializedName: "availabilityZone", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + export const ResourceName: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts index 6ae1bccccf87..a9dc67106cd5 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts @@ -11,7 +11,10 @@ import { OperationURLParameter, OperationQueryParameter } from "@azure/core-client"; -import { ResourceName as ResourceNameMapper } from "../models/mappers"; +import { + CheckZonePeersRequest as CheckZonePeersRequestMapper, + ResourceName as ResourceNameMapper +} from "../models/mappers"; export const accept: OperationParameter = { parameterPath: "accept", @@ -70,18 +73,6 @@ export const includeExtendedLocations: OperationQueryParameter = { } }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - export const contentType: OperationParameter = { parameterPath: ["options", "contentType"], mapper: { @@ -94,6 +85,23 @@ export const contentType: OperationParameter = { } }; +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: CheckZonePeersRequestMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + export const resourceNameDefinition: OperationParameter = { parameterPath: ["options", "resourceNameDefinition"], mapper: ResourceNameMapper diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts index 14029e326139..a367389c6f1e 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts @@ -22,6 +22,9 @@ import { SubscriptionsGetOptionalParams, SubscriptionsGetResponse, SubscriptionsListResponse, + CheckZonePeersRequest, + SubscriptionsCheckZonePeersOptionalParams, + SubscriptionsCheckZonePeersResponse, SubscriptionsListNextResponse } from "../models"; @@ -165,6 +168,23 @@ export class SubscriptionsImpl implements Subscriptions { return this.client.sendOperationRequest({ options }, listOperationSpec); } + /** + * Compares a subscriptions logical zone mapping + * @param subscriptionId The ID of the target subscription. + * @param parameters Parameters for checking zone peers. + * @param options The options parameters. + */ + checkZonePeers( + subscriptionId: string, + parameters: CheckZonePeersRequest, + options?: SubscriptionsCheckZonePeersOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { subscriptionId, parameters, options }, + checkZonePeersOperationSpec + ); + } + /** * ListNext * @param nextLink The nextLink from the previous successful call to the List method. @@ -231,6 +251,25 @@ const listOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const checkZonePeersOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/checkZonePeers/", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckZonePeersResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts index 23e6c628c7a7..4142f4ea2482 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts @@ -13,7 +13,10 @@ import { Subscription, SubscriptionsListOptionalParams, SubscriptionsGetOptionalParams, - SubscriptionsGetResponse + SubscriptionsGetResponse, + CheckZonePeersRequest, + SubscriptionsCheckZonePeersOptionalParams, + SubscriptionsCheckZonePeersResponse } from "../models"; /// @@ -45,4 +48,15 @@ export interface Subscriptions { subscriptionId: string, options?: SubscriptionsGetOptionalParams ): Promise; + /** + * Compares a subscriptions logical zone mapping + * @param subscriptionId The ID of the target subscription. + * @param parameters Parameters for checking zone peers. + * @param options The options parameters. + */ + checkZonePeers( + subscriptionId: string, + parameters: CheckZonePeersRequest, + options?: SubscriptionsCheckZonePeersOptionalParams + ): Promise; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts index 00285ba19fe0..50d4cca99d60 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts @@ -8,6 +8,11 @@ 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 { SubscriptionsImpl, TenantsImpl } from "./operations"; import { Subscriptions, Tenants } from "./operationsInterfaces"; @@ -45,7 +50,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resources-subscriptions/2.0.2`; + const packageDetails = `azsdk-js-arm-resources-subscriptions/2.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -93,6 +98,35 @@ export class SubscriptionClient extends coreClient.ServiceClient { this.apiVersion = options.apiVersion || "2021-01-01"; this.subscriptions = new SubscriptionsImpl(this); this.tenants = new TenantsImpl(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 item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } /** diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json index a3108459456b..615e06592f2b 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json @@ -15,31 +15,18 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-resources-subscriptions": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"