From d946301291d077b666489cdb0ce73d849eba6089 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 14 Feb 2020 03:32:18 +0000 Subject: [PATCH] Generated from b5202928605e36dfe6a8be699e0399a088073792 Add missing properties from list tenants API --- sdk/resources/arm-resources/LICENSE.txt | 2 +- sdk/resources/arm-resources/README.md | 2 +- .../src/models/deploymentsMappers.ts | 3 + .../arm-resources/src/models/index.ts | 162 ++++++++++- .../arm-resources/src/models/mappers.ts | 108 +++++++ .../src/models/resourceGroupsMappers.ts | 2 + .../src/models/resourcesMappers.ts | 2 + ...agsMappers.ts => tagsOperationsMappers.ts} | 3 + .../src/operations/deploymentOperations.ts | 12 +- .../src/operations/deployments.ts | 76 ++--- .../arm-resources/src/operations/index.ts | 2 +- .../src/operations/resourceGroups.ts | 99 ++++--- .../operations/{tags.ts => tagsOperations.ts} | 275 +++++++++++++++++- .../src/resourceManagementClient.ts | 4 +- .../src/resourceManagementClientContext.ts | 2 +- 15 files changed, 634 insertions(+), 120 deletions(-) rename sdk/resources/arm-resources/src/models/{tagsMappers.ts => tagsOperationsMappers.ts} (95%) rename sdk/resources/arm-resources/src/operations/{tags.ts => tagsOperations.ts} (51%) diff --git a/sdk/resources/arm-resources/LICENSE.txt b/sdk/resources/arm-resources/LICENSE.txt index b73b4a1293c3..ea8fb1516028 100644 --- a/sdk/resources/arm-resources/LICENSE.txt +++ b/sdk/resources/arm-resources/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Microsoft +Copyright (c) 2020 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/arm-resources/README.md b/sdk/resources/arm-resources/README.md index bcf213c43571..3db118a758f7 100644 --- a/sdk/resources/arm-resources/README.md +++ b/sdk/resources/arm-resources/README.md @@ -96,4 +96,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresources%2Farm-resources%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/resources/arm-resources/README.png) diff --git a/sdk/resources/arm-resources/src/models/deploymentsMappers.ts b/sdk/resources/arm-resources/src/models/deploymentsMappers.ts index 24da4cc917df..ab883592b99e 100644 --- a/sdk/resources/arm-resources/src/models/deploymentsMappers.ts +++ b/sdk/resources/arm-resources/src/models/deploymentsMappers.ts @@ -40,9 +40,12 @@ export { Resource, ResourceGroup, ResourceGroupProperties, + ScopedDeployment, Sku, SubResource, TagCount, + Tags, + TagsResource, TagValue, TemplateHashResult, TemplateLink, diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index f5faeb25a2e2..193ba8e57986 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -171,6 +171,20 @@ export interface Deployment { properties: DeploymentProperties; } +/** + * Deployment operation parameters. + */ +export interface ScopedDeployment { + /** + * The location to store the deployment data. + */ + location: string; + /** + * The deployment properties. + */ + properties: DeploymentProperties; +} + /** * The deployment export result. */ @@ -800,7 +814,7 @@ export interface TagCount { */ export interface TagValue extends BaseResource { /** - * The tag ID. + * The tag value ID. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; @@ -819,7 +833,7 @@ export interface TagValue extends BaseResource { */ export interface TagDetails { /** - * The tag ID. + * The tag name ID. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; @@ -1110,6 +1124,52 @@ export interface WhatIfOperationResult { error?: ErrorResponse; } +/** + * A dictionary of name and value pairs. + */ +export interface Tags { + tags?: { [propertyName: string]: string }; +} + +/** + * Wrapper resource for tags patch API request only. + */ +export interface TagsPatchResource { + /** + * The operation type for the patch API. Possible values include: 'Replace', 'Merge', 'Delete' + */ + operation?: OperationEnum; + /** + * The set of tags. + */ + properties?: Tags; +} + +/** + * Wrapper resource for tags API requests and responses. + */ +export interface TagsResource extends BaseResource { + /** + * The ID of the tags wrapper resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the tags wrapper resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the tags wrapper resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The set of tags. + */ + properties: Tags; +} + /** * Optional Parameters. */ @@ -1253,8 +1313,9 @@ export interface ResourcesListByResourceGroupOptionalParams extends msRest.Reque * and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, * use: $filter=substringof('demo', name)

You can link more than one substringof together * by adding and/or operators.

You can filter by tag names and values. For example, to - * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq - * 'Value1'

You can use some properties together when filtering. The combinations you can + * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When + * you filter by a tag name and value, the tags for each resource are not returned in the + * results.

You can use some properties together when filtering. The combinations you can * use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and * identity/principalId. */ @@ -1284,8 +1345,9 @@ export interface ResourcesListOptionalParams extends msRest.RequestOptionsBase { * and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, * use: $filter=substringof('demo', name)

You can link more than one substringof together * by adding and/or operators.

You can filter by tag names and values. For example, to - * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq - * 'Value1'

You can use some properties together when filtering. The combinations you can + * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When + * you filter by a tag name and value, the tags for each resource are not returned in the + * results.

You can use some properties together when filtering. The combinations you can * use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and * identity/principalId. */ @@ -1542,6 +1604,14 @@ export type PropertyChangeType = 'Create' | 'Delete' | 'Modify' | 'Array'; */ export type ChangeType = 'Create' | 'Delete' | 'Ignore' | 'Deploy' | 'NoChange' | 'Modify'; +/** + * Defines values for OperationEnum. + * Possible values include: 'Replace', 'Merge', 'Delete' + * @readonly + * @enum {string} + */ +export type OperationEnum = 'Replace' | 'Merge' | 'Delete'; + /** * Contains response data for the list operation. */ @@ -3092,6 +3162,26 @@ export type ResourceGroupsListResponse = ResourceGroupListResult & { }; }; +/** + * Contains response data for the beginExportTemplate operation. + */ +export type ResourceGroupsBeginExportTemplateResponse = ResourceGroupExportResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceGroupExportResult; + }; +}; + /** * Contains response data for the listNext operation. */ @@ -3172,6 +3262,66 @@ export type TagsListResponse = TagsListResult & { }; }; +/** + * Contains response data for the createOrUpdateAtScope operation. + */ +export type TagsCreateOrUpdateAtScopeResponse = TagsResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TagsResource; + }; +}; + +/** + * Contains response data for the updateAtScope operation. + */ +export type TagsUpdateAtScopeResponse = TagsResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TagsResource; + }; +}; + +/** + * Contains response data for the getAtScope operation. + */ +export type TagsGetAtScopeResponse = TagsResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TagsResource; + }; +}; + /** * Contains response data for the listNext operation. */ diff --git a/sdk/resources/arm-resources/src/models/mappers.ts b/sdk/resources/arm-resources/src/models/mappers.ts index e311aa0b456d..147623874e58 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -251,6 +251,31 @@ export const Deployment: msRest.CompositeMapper = { } }; +export const ScopedDeployment: msRest.CompositeMapper = { + serializedName: "ScopedDeployment", + type: { + name: "Composite", + className: "ScopedDeployment", + modelProperties: { + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentProperties" + } + } + } + } +}; + export const DeploymentExportResult: msRest.CompositeMapper = { serializedName: "DeploymentExportResult", type: { @@ -1849,6 +1874,89 @@ export const WhatIfOperationResult: msRest.CompositeMapper = { } }; +export const Tags: msRest.CompositeMapper = { + serializedName: "Tags", + type: { + name: "Composite", + className: "Tags", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const TagsPatchResource: msRest.CompositeMapper = { + serializedName: "TagsPatchResource", + type: { + name: "Composite", + className: "TagsPatchResource", + modelProperties: { + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "Tags" + } + } + } + } +}; + +export const TagsResource: msRest.CompositeMapper = { + serializedName: "TagsResource", + type: { + name: "Composite", + className: "TagsResource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "Tags" + } + } + } + } +}; + export const DeploymentsWhatIfAtSubscriptionScopeHeaders: msRest.CompositeMapper = { serializedName: "deployments-whatifatsubscriptionscope-headers", type: { diff --git a/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts b/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts index eb263b58a93a..c5a0fa36db86 100644 --- a/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts +++ b/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts @@ -36,6 +36,8 @@ export { Sku, SubResource, TagCount, + Tags, + TagsResource, TagValue, TemplateLink } from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/resourcesMappers.ts b/sdk/resources/arm-resources/src/models/resourcesMappers.ts index e660fb32bcc4..d30ca92f9356 100644 --- a/sdk/resources/arm-resources/src/models/resourcesMappers.ts +++ b/sdk/resources/arm-resources/src/models/resourcesMappers.ts @@ -34,6 +34,8 @@ export { Sku, SubResource, TagCount, + Tags, + TagsResource, TagValue, TemplateLink } from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/tagsMappers.ts b/sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts similarity index 95% rename from sdk/resources/arm-resources/src/models/tagsMappers.ts rename to sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts index ef9dcf708953..54b8dd998c53 100644 --- a/sdk/resources/arm-resources/src/models/tagsMappers.ts +++ b/sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts @@ -33,7 +33,10 @@ export { SubResource, TagCount, TagDetails, + Tags, TagsListResult, + TagsPatchResource, + TagsResource, TagValue, TemplateLink } from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts index ddb4d2cb4926..f7c968e55a0b 100644 --- a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts +++ b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts @@ -28,7 +28,7 @@ export class DeploymentOperations { /** * Gets a deployments operation. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @param [options] The optional parameters @@ -36,14 +36,14 @@ export class DeploymentOperations { */ getAtScope(scope: string, deploymentName: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @param callback The callback */ getAtScope(scope: string, deploymentName: string, operationId: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @param options The optional parameters @@ -64,20 +64,20 @@ export class DeploymentOperations { /** * Gets all deployments operations for a deployment. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ listAtScope(scope: string, deploymentName: string, options?: Models.DeploymentOperationsListAtScopeOptionalParams): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ listAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback diff --git a/sdk/resources/arm-resources/src/operations/deployments.ts b/sdk/resources/arm-resources/src/operations/deployments.ts index 96afac3143f8..0ba4558707b2 100644 --- a/sdk/resources/arm-resources/src/operations/deployments.ts +++ b/sdk/resources/arm-resources/src/operations/deployments.ts @@ -36,7 +36,7 @@ export class Deployments { * process finishes, the URI in the Location header returns a status of 204 on success. If the * asynchronous request failed, the URI in the Location header returns an error-level status code. * @summary Deletes a deployment from the deployment history. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise @@ -48,20 +48,20 @@ export class Deployments { /** * Checks whether the deployment exists. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ checkExistenceAtScope(scope: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ checkExistenceAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback @@ -81,7 +81,7 @@ export class Deployments { /** * You can provide the template and parameters directly in the request or link to JSON files. * @summary Deploys resources at a given scope. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param [options] The optional parameters @@ -94,20 +94,20 @@ export class Deployments { /** * Gets a deployment. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ getAtScope(scope: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ getAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback @@ -130,20 +130,20 @@ export class Deployments { * deployment stops the currently running template deployment and leaves the resources partially * deployed. * @summary Cancels a currently running template deployment. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ cancelAtScope(scope: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ cancelAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback @@ -163,7 +163,7 @@ export class Deployments { /** * Validates whether the specified template is syntactically correct and will be accepted by Azure * Resource Manager.. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param [options] The optional parameters @@ -171,14 +171,14 @@ export class Deployments { */ validateAtScope(scope: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param callback The callback */ validateAtScope(scope: string, deploymentName: string, parameters: Models.Deployment, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param options The optional parameters @@ -199,20 +199,20 @@ export class Deployments { /** * Exports the template used for specified deployment. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ exportTemplateAtScope(scope: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ exportTemplateAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback @@ -231,18 +231,18 @@ export class Deployments { /** * Get all the deployments at the given scope. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param [options] The optional parameters * @returns Promise */ listAtScope(scope: string, options?: Models.DeploymentsListAtScopeOptionalParams): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param callback The callback */ listAtScope(scope: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param options The optional parameters * @param callback The callback */ @@ -311,7 +311,7 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - createOrUpdateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + createOrUpdateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise { return this.beginCreateOrUpdateAtTenantScope(deploymentName,parameters,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -384,21 +384,21 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - validateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; + validateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise; /** * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param callback The callback */ - validateAtTenantScope(deploymentName: string, parameters: Models.Deployment, callback: msRest.ServiceCallback): void; + validateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, callback: msRest.ServiceCallback): void; /** * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param options The optional parameters * @param callback The callback */ - validateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - validateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + validateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { deploymentName, @@ -521,7 +521,7 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - createOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + createOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise { return this.beginCreateOrUpdateAtManagementGroupScope(groupId,deploymentName,parameters,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -603,14 +603,14 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; + validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise; /** * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param callback The callback */ - validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, callback: msRest.ServiceCallback): void; + validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, callback: msRest.ServiceCallback): void; /** * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -618,8 +618,8 @@ export class Deployments { * @param options The optional parameters * @param callback The callback */ - validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { groupId, @@ -1202,7 +1202,7 @@ export class Deployments { * process finishes, the URI in the Location header returns a status of 204 on success. If the * asynchronous request failed, the URI in the Location header returns an error-level status code. * @summary Deletes a deployment from the deployment history. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise @@ -1221,7 +1221,7 @@ export class Deployments { /** * You can provide the template and parameters directly in the request or link to JSON files. * @summary Deploys resources at a given scope. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param [options] The optional parameters @@ -1270,7 +1270,7 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - beginCreateOrUpdateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + beginCreateOrUpdateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { deploymentName, @@ -1315,7 +1315,7 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - beginCreateOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + beginCreateOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { groupId, @@ -1835,7 +1835,7 @@ const validateAtTenantScopeOperationSpec: msRest.OperationSpec = { requestBody: { parameterPath: "parameters", mapper: { - ...Mappers.Deployment, + ...Mappers.ScopedDeployment, required: true } }, @@ -1983,7 +1983,7 @@ const validateAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { requestBody: { parameterPath: "parameters", mapper: { - ...Mappers.Deployment, + ...Mappers.ScopedDeployment, required: true } }, @@ -2484,7 +2484,7 @@ const beginCreateOrUpdateAtTenantScopeOperationSpec: msRest.OperationSpec = { requestBody: { parameterPath: "parameters", mapper: { - ...Mappers.Deployment, + ...Mappers.ScopedDeployment, required: true } }, @@ -2541,7 +2541,7 @@ const beginCreateOrUpdateAtManagementGroupScopeOperationSpec: msRest.OperationSp requestBody: { parameterPath: "parameters", mapper: { - ...Mappers.Deployment, + ...Mappers.ScopedDeployment, required: true } }, diff --git a/sdk/resources/arm-resources/src/operations/index.ts b/sdk/resources/arm-resources/src/operations/index.ts index 542b40b96c2d..a7cec76246cd 100644 --- a/sdk/resources/arm-resources/src/operations/index.ts +++ b/sdk/resources/arm-resources/src/operations/index.ts @@ -13,5 +13,5 @@ export * from "./deployments"; export * from "./providers"; export * from "./resources"; export * from "./resourceGroups"; -export * from "./tags"; +export * from "./tagsOperations"; export * from "./deploymentOperations"; diff --git a/sdk/resources/arm-resources/src/operations/resourceGroups.ts b/sdk/resources/arm-resources/src/operations/resourceGroups.ts index 6411c09ca1ed..617190a57bc6 100644 --- a/sdk/resources/arm-resources/src/operations/resourceGroups.ts +++ b/sdk/resources/arm-resources/src/operations/resourceGroups.ts @@ -171,34 +171,14 @@ export class ResourceGroups { /** * Captures the specified resource group as a template. - * @param resourceGroupName The name of the resource group to export as a template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param parameters Parameters for exporting the template. * @param [options] The optional parameters * @returns Promise */ - exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group to export as a template. - * @param parameters Parameters for exporting the template. - * @param callback The callback - */ - exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group to export as a template. - * @param parameters Parameters for exporting the template. - * @param options The optional parameters - * @param callback The callback - */ - exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - parameters, - options - }, - exportTemplateOperationSpec, - callback) as Promise; + exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase): Promise { + return this.beginExportTemplate(resourceGroupName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } /** @@ -243,6 +223,24 @@ export class ResourceGroups { options); } + /** + * Captures the specified resource group as a template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param [options] The optional parameters + * @returns Promise + */ + beginExportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + parameters, + options + }, + beginExportTemplateOperationSpec, + options); + } + /** * Gets all the resource groups for a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -386,29 +384,23 @@ const updateOperationSpec: msRest.OperationSpec = { serializer }; -const exportTemplateOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups", urlParameters: [ - Parameters.resourceGroupName, Parameters.subscriptionId ], queryParameters: [ + Parameters.filter, + Parameters.top, Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ExportTemplateRequest, - required: true - } - }, responses: { 200: { - bodyMapper: Mappers.ResourceGroupExportResult + bodyMapper: Mappers.ResourceGroupListResult }, default: { bodyMapper: Mappers.CloudError @@ -417,24 +409,22 @@ const exportTemplateOperationSpec: msRest.OperationSpec = { serializer }; -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups", +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", urlParameters: [ + Parameters.resourceGroupName, Parameters.subscriptionId ], queryParameters: [ - Parameters.filter, - Parameters.top, Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { - 200: { - bodyMapper: Mappers.ResourceGroupListResult - }, + 200: {}, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -442,12 +432,12 @@ const listOperationSpec: msRest.OperationSpec = { serializer }; -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", +const beginExportTemplateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], queryParameters: [ Parameters.apiVersion @@ -455,8 +445,17 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ExportTemplateRequest, + required: true + } + }, responses: { - 200: {}, + 200: { + bodyMapper: Mappers.ResourceGroupExportResult + }, 202: {}, default: { bodyMapper: Mappers.CloudError diff --git a/sdk/resources/arm-resources/src/operations/tags.ts b/sdk/resources/arm-resources/src/operations/tagsOperations.ts similarity index 51% rename from sdk/resources/arm-resources/src/operations/tags.ts rename to sdk/resources/arm-resources/src/operations/tagsOperations.ts index ca365271243a..74aec7cd47e6 100644 --- a/sdk/resources/arm-resources/src/operations/tags.ts +++ b/sdk/resources/arm-resources/src/operations/tagsOperations.ts @@ -10,16 +10,16 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; -import * as Mappers from "../models/tagsMappers"; +import * as Mappers from "../models/tagsOperationsMappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClientContext } from "../resourceManagementClientContext"; -/** Class representing a Tags. */ -export class Tags { +/** Class representing a TagsOperations. */ +export class TagsOperations { private readonly client: ResourceManagementClientContext; /** - * Create a Tags. + * Create a TagsOperations. * @param {ResourceManagementClientContext} client Reference to the service client. */ constructor(client: ResourceManagementClientContext) { @@ -27,7 +27,10 @@ export class Tags { } /** - * Deletes a tag value. + * This operation allows deleting a value from the list of predefined values for an existing + * predefined tag name. The value being deleted must not be in use as a tag value for the given tag + * name for any resource. + * @summary Deletes a predefined tag value for a predefined tag name. * @param tagName The name of the tag. * @param tagValue The value of the tag to delete. * @param [options] The optional parameters @@ -59,7 +62,9 @@ export class Tags { } /** - * Creates a tag value. The name of the tag must already exist. + * This operation allows adding a value to the list of predefined values for an existing predefined + * tag name. A tag value can have a maximum of 256 characters. + * @summary Creates a predefined value for a predefined tag name. * @param tagName The name of the tag. * @param tagValue The value of the tag to create. * @param [options] The optional parameters @@ -91,10 +96,11 @@ export class Tags { } /** - * The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by - * Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these - * prefixes. - * @summary Creates a tag in the subscription. + * This operation allows adding a name to the list of predefined tag names for the given + * subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names + * cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', + * 'windows'. + * @summary Creates a predefined tag name. * @param tagName The name of the tag to create. * @param [options] The optional parameters * @returns Promise @@ -122,8 +128,10 @@ export class Tags { } /** - * You must remove all values from a resource tag before you can delete it. - * @summary Deletes a tag from the subscription. + * This operation allows deleting a name from the list of predefined tag names for the given + * subscription. The name being deleted must not be in use as a tag name for any resource. All + * predefined values for the given name must have already been deleted. + * @summary Deletes a predefined tag name. * @param tagName The name of the tag. * @param [options] The optional parameters * @returns Promise @@ -151,7 +159,11 @@ export class Tags { } /** - * Gets the names and values of all resource tags that are defined in a subscription. + * This operation performs a union of predefined tags, resource tags, resource group tags and + * subscription tags, and returns a summary of usage for each tag name and value under the given + * subscription. In case of a large number of tags, this operation may return a previously cached + * result. + * @summary Gets a summary of tag usage under the subscription. * @param [options] The optional parameters * @returns Promise */ @@ -175,7 +187,138 @@ export class Tags { } /** - * Gets the names and values of all resource tags that are defined in a subscription. + * This operation allows adding or replacing the entire set of tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags. + * @summary Creates or updates the entire set of tags on a resource or subscription. + * @param scope The resource scope. + * @param parameters + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtScope(scope: string, parameters: Models.TagsResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The resource scope. + * @param parameters + * @param callback The callback + */ + createOrUpdateAtScope(scope: string, parameters: Models.TagsResource, callback: msRest.ServiceCallback): void; + /** + * @param scope The resource scope. + * @param parameters + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtScope(scope: string, parameters: Models.TagsResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtScope(scope: string, parameters: Models.TagsResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + parameters, + options + }, + createOrUpdateAtScopeOperationSpec, + callback) as Promise; + } + + /** + * This operation allows replacing, merging or selectively deleting tags on the specified resource + * or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. + * The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option + * allows adding tags with new names and updating the values of tags with existing names. The + * 'delete' option allows selectively deleting tags based on given names or name/value pairs. + * @summary Selectively updates the set of tags on a resource or subscription. + * @param scope The resource scope. + * @param parameters + * @param [options] The optional parameters + * @returns Promise + */ + updateAtScope(scope: string, parameters: Models.TagsPatchResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The resource scope. + * @param parameters + * @param callback The callback + */ + updateAtScope(scope: string, parameters: Models.TagsPatchResource, callback: msRest.ServiceCallback): void; + /** + * @param scope The resource scope. + * @param parameters + * @param options The optional parameters + * @param callback The callback + */ + updateAtScope(scope: string, parameters: Models.TagsPatchResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateAtScope(scope: string, parameters: Models.TagsPatchResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + parameters, + options + }, + updateAtScopeOperationSpec, + callback) as Promise; + } + + /** + * @summary Gets the entire set of tags on a resource or subscription. + * @param scope The resource scope. + * @param [options] The optional parameters + * @returns Promise + */ + getAtScope(scope: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The resource scope. + * @param callback The callback + */ + getAtScope(scope: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The resource scope. + * @param options The optional parameters + * @param callback The callback + */ + getAtScope(scope: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtScope(scope: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + getAtScopeOperationSpec, + callback) as Promise; + } + + /** + * @summary Deletes the entire set of tags on a resource or subscription. + * @param scope The resource scope. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtScope(scope: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The resource scope. + * @param callback The callback + */ + deleteAtScope(scope: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The resource scope. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtScope(scope: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtScope(scope: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + deleteAtScopeOperationSpec, + callback); + } + + /** + * This operation performs a union of predefined tags, resource tags, resource group tags and + * subscription tags, and returns a summary of usage for each tag name and value under the given + * subscription. In case of a large number of tags, this operation may return a previously cached + * result. + * @summary Gets a summary of tag usage under the subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise @@ -330,6 +473,110 @@ const listOperationSpec: msRest.OperationSpec = { serializer }; +const createOrUpdateAtScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{scope}/providers/Microsoft.Resources/tags/default", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.TagsResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.TagsResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateAtScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "{scope}/providers/Microsoft.Resources/tags/default", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.TagsPatchResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.TagsResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getAtScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.Resources/tags/default", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TagsResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteAtScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{scope}/providers/Microsoft.Resources/tags/default", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index b712764c2a93..535cd08e4b20 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -22,7 +22,7 @@ class ResourceManagementClient extends ResourceManagementClientContext { providers: operations.Providers; resources: operations.Resources; resourceGroups: operations.ResourceGroups; - tags: operations.Tags; + tags: operations.TagsOperations; deploymentOperations: operations.DeploymentOperations; /** @@ -38,7 +38,7 @@ class ResourceManagementClient extends ResourceManagementClientContext { this.providers = new operations.Providers(this); this.resources = new operations.Resources(this); this.resourceGroups = new operations.ResourceGroups(this); - this.tags = new operations.Tags(this); + this.tags = new operations.TagsOperations(this); this.deploymentOperations = new operations.DeploymentOperations(this); } } diff --git a/sdk/resources/arm-resources/src/resourceManagementClientContext.ts b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts index 1dc03c3fa11f..8d25af9bb00c 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClientContext.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts @@ -44,7 +44,7 @@ export class ResourceManagementClientContext extends msRestAzure.AzureServiceCli super(credentials, options); - this.apiVersion = '2019-07-01'; + this.apiVersion = '2019-10-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";