diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md b/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md index 8ce89dbbad49..3c6fd2e57452 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md @@ -1,15 +1,20 @@ # Release History - -## 2.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 2.1.0 (2022-01-26) + +**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.0 (2021-12-16) The package of @azure/arm-resources-subscriptions is using our next generation design principles since version 2.0.0, which contains breaking changes. diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE b/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE index ccb63b166732..5d1d36e0af80 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json index 44e0b401977a..20c1a72f4fd4 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json @@ -1,7 +1,7 @@ { - "commit": "ea0f7b072ad3aaff203ea9003246b9e584b819ff", + "commit": "c74702dde0ad949a36475de734dc31906669b0a6", "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211207.1", + "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=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20211207.1" + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json b/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json index c8418c03f72e..e6ee8b9d231c 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-resources-subscriptions.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ 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 352c8267d3dd..e0a8b90e6f62 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.1", + "version": "2.1.0", "engines": { "node": ">=12.0.0" }, @@ -97,4 +97,4 @@ }, "sideEffects": false, "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 62f638d02aac..619f05081c6a 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts @@ -44,7 +44,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resources-subscriptions/2.0.0`; + const packageDetails = `azsdk-js-arm-resources-subscriptions/2.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json index 6e3251194117..3e6ae96443f3 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json @@ -9,11 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file