From 4a3463897ec0a4117e1ace4cc94fb1defbecebbb Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 7 Apr 2020 02:14:17 +0000 Subject: [PATCH] Generated from 1ff743fa6cbcc02e8fa7ec7e0ac9fa65f71a6f7b Merge branch 'master' into resources_update_for_m4 --- sdk/resources/arm-resources/LICENSE.txt | 2 +- sdk/resources/arm-resources/README.md | 2 +- .../src/models/deploymentsMappers.ts | 9 +- .../arm-resources/src/models/index.ts | 339 ++++++++++++++++-- .../arm-resources/src/models/mappers.ts | 318 +++++++++++++++- .../src/models/providersMappers.ts | 3 +- .../src/models/resourceGroupsMappers.ts | 8 +- .../src/models/resourcesMappers.ts | 8 +- ...agsMappers.ts => tagsOperationsMappers.ts} | 8 +- .../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 | 9 +- .../src/resourceManagementClientContext.ts | 10 +- 16 files changed, 1016 insertions(+), 164 deletions(-) rename sdk/resources/arm-resources/src/models/{tagsMappers.ts => tagsOperationsMappers.ts} (86%) 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..c6951a566e64 100644 --- a/sdk/resources/arm-resources/src/models/deploymentsMappers.ts +++ b/sdk/resources/arm-resources/src/models/deploymentsMappers.ts @@ -8,7 +8,8 @@ export { AliasPathType, - AliasType, + AliasPatternType1, + AliasType1, BaseResource, BasicDependency, CloudError, @@ -29,6 +30,7 @@ export { ErrorAdditionalInfo, ErrorResponse, GenericResource, + GenericResourceExpanded, Identity, IdentityUserAssignedIdentitiesValue, OnErrorDeployment, @@ -40,9 +42,14 @@ export { Resource, ResourceGroup, ResourceGroupProperties, + ResourceReference, + ScopedDeployment, Sku, SubResource, TagCount, + TagDetails, + 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..21411d840450 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -169,6 +169,28 @@ export interface Deployment { * The deployment properties. */ properties: DeploymentProperties; + /** + * Deployment tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Deployment operation parameters. + */ +export interface ScopedDeployment { + /** + * The location to store the deployment data. + */ + location: string; + /** + * The deployment properties. + */ + properties: DeploymentProperties; + /** + * Deployment tags + */ + tags?: { [propertyName: string]: string }; } /** @@ -263,6 +285,24 @@ export interface ErrorResponse { readonly additionalInfo?: ErrorAdditionalInfo[]; } +/** + * The type of the pattern for an alias path. + */ +export interface AliasPatternType1 { + /** + * The alias pattern phrase. + */ + phrase?: string; + /** + * The alias pattern variable. + */ + variable?: string; + /** + * The type of alias pattern. Possible values include: 'NotSpecified', 'Extract' + */ + type?: AliasPatternType; +} + /** * The type of the paths for alias. */ @@ -275,12 +315,16 @@ export interface AliasPathType { * The API versions. */ apiVersions?: string[]; + /** + * The pattern for an alias path. + */ + pattern?: AliasPatternType1; } /** * The alias type. */ -export interface AliasType { +export interface AliasType1 { /** * The alias name. */ @@ -289,6 +333,18 @@ export interface AliasType { * The paths for an alias. */ paths?: AliasPathType[]; + /** + * The type of the alias. Possible values include: 'NotSpecified', 'PlainText', 'Mask' + */ + type?: AliasType; + /** + * The default path for an alias. + */ + defaultPath?: string; + /** + * The default pattern for an alias. + */ + defaultPattern?: AliasPatternType1; } /** @@ -306,7 +362,7 @@ export interface ProviderResourceType { /** * The aliases that are supported by this resource type. */ - aliases?: AliasType[]; + aliases?: AliasType1[]; /** * The API version. */ @@ -411,6 +467,17 @@ export interface OnErrorDeploymentExtended { deploymentName?: string; } +/** + * The resource Id model. + */ +export interface ResourceReference { + /** + * The fully qualified resource Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; +} + /** * Deployment properties with additional details. */ @@ -437,45 +504,70 @@ export interface DeploymentPropertiesExtended { readonly duration?: string; /** * Key/value pairs that represent deployment output. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - outputs?: any; + readonly outputs?: any; /** * The list of resource providers needed for the deployment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - providers?: Provider[]; + readonly providers?: Provider[]; /** * The list of deployment dependencies. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - dependencies?: Dependency[]; - /** - * The template content. Use only one of Template or TemplateLink. - */ - template?: any; + readonly dependencies?: Dependency[]; /** - * The URI referencing the template. Use only one of Template or TemplateLink. + * The URI referencing the template. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - templateLink?: TemplateLink; + readonly templateLink?: TemplateLink; /** - * Deployment parameters. Use only one of Parameters or ParametersLink. + * Deployment parameters. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - parameters?: any; + readonly parameters?: any; /** - * The URI referencing the parameters. Use only one of Parameters or ParametersLink. + * The URI referencing the parameters. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - parametersLink?: ParametersLink; + readonly parametersLink?: ParametersLink; /** * The deployment mode. Possible values are Incremental and Complete. Possible values include: * 'Incremental', 'Complete' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - mode?: DeploymentMode; + readonly mode?: DeploymentMode; /** * The debug setting of the deployment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - debugSetting?: DebugSetting; + readonly debugSetting?: DebugSetting; /** * The deployment on error behavior. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly onErrorDeployment?: OnErrorDeploymentExtended; + /** + * The hash produced for the template. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly templateHash?: string; + /** + * Array of provisioned resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly outputResources?: ResourceReference[]; + /** + * Array of validated resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly validatedResources?: ResourceReference[]; + /** + * The deployment error. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - onErrorDeployment?: OnErrorDeploymentExtended; + readonly error?: ErrorResponse; } /** @@ -484,8 +576,9 @@ export interface DeploymentPropertiesExtended { export interface DeploymentValidateResult { /** * The deployment validation error. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - error?: ErrorResponse; + readonly error?: ErrorResponse; /** * The template deployment properties. */ @@ -519,6 +612,10 @@ export interface DeploymentExtended extends BaseResource { * Deployment properties. */ properties?: DeploymentPropertiesExtended; + /** + * Deployment tags + */ + tags?: { [propertyName: string]: string }; } /** @@ -679,6 +776,30 @@ export interface GenericResource extends Resource { identity?: Identity; } +/** + * Resource information. + */ +export interface GenericResourceExpanded extends GenericResource { + /** + * The created time of the resource. This is only present if requested via the $expand query + * parameter. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdTime?: Date; + /** + * The changed time of the resource. This is only present if requested via the $expand query + * parameter. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly changedTime?: Date; + /** + * The provisioning state of the resource. This is only present if requested via the $expand + * query parameter. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: string; +} + /** * The resource group properties. */ @@ -800,7 +921,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; @@ -817,9 +938,9 @@ export interface TagValue extends BaseResource { /** * Tag details. */ -export interface TagDetails { +export interface TagDetails extends BaseResource { /** - * 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 +1231,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,15 +1420,17 @@ 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. */ filter?: string; /** - * The $expand query parameter. You can expand createdTime and changedTime. For example, to - * expand both properties, use $expand=changedTime,createdTime + * Comma-separated list of additional properties to be included in the response. Valid values + * include `createdTime`, `changedTime` and `provisioningState`. For example, + * `$expand=createdTime,changedTime`. */ expand?: string; /** @@ -1284,15 +1453,17 @@ 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. */ filter?: string; /** - * The $expand query parameter. You can expand createdTime and changedTime. For example, to - * expand both properties, use $expand=changedTime,createdTime + * Comma-separated list of additional properties to be included in the response. Valid values + * include `createdTime`, `changedTime` and `provisioningState`. For example, + * `$expand=createdTime,changedTime`. */ expand?: string; /** @@ -1444,9 +1615,9 @@ export interface ProviderListResult extends Array { /** * @interface * List of resource groups. - * @extends Array + * @extends Array */ -export interface ResourceListResult extends Array { +export interface ResourceListResult extends Array { /** * The URL to use for getting the next set of results. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -1517,6 +1688,22 @@ export type OnErrorDeploymentType = 'LastSuccessful' | 'SpecificDeployment'; */ export type WhatIfResultFormat = 'ResourceIdOnly' | 'FullResourcePayloads'; +/** + * Defines values for AliasPatternType. + * Possible values include: 'NotSpecified', 'Extract' + * @readonly + * @enum {string} + */ +export type AliasPatternType = 'NotSpecified' | 'Extract'; + +/** + * Defines values for AliasType. + * Possible values include: 'NotSpecified', 'PlainText', 'Mask' + * @readonly + * @enum {string} + */ +export type AliasType = 'NotSpecified' | 'PlainText' | 'Mask'; + /** * Defines values for ResourceIdentityType. * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', @@ -1542,6 +1729,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 +3287,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 +3387,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..efd4119c15f9 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -246,6 +246,53 @@ export const Deployment: msRest.CompositeMapper = { name: "Composite", className: "DeploymentProperties" } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +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" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } } } } @@ -410,6 +457,38 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; +export const AliasPatternType1: msRest.CompositeMapper = { + serializedName: "AliasPatternType", + type: { + name: "Composite", + className: "AliasPatternType1", + modelProperties: { + phrase: { + serializedName: "phrase", + type: { + name: "String" + } + }, + variable: { + serializedName: "variable", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "NotSpecified", + "Extract" + ] + } + } + } + } +}; + export const AliasPathType: msRest.CompositeMapper = { serializedName: "AliasPathType", type: { @@ -432,16 +511,23 @@ export const AliasPathType: msRest.CompositeMapper = { } } } + }, + pattern: { + serializedName: "pattern", + type: { + name: "Composite", + className: "AliasPatternType1" + } } } } }; -export const AliasType: msRest.CompositeMapper = { +export const AliasType1: msRest.CompositeMapper = { serializedName: "AliasType", type: { name: "Composite", - className: "AliasType", + className: "AliasType1", modelProperties: { name: { serializedName: "name", @@ -460,6 +546,30 @@ export const AliasType: msRest.CompositeMapper = { } } } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "NotSpecified", + "PlainText", + "Mask" + ] + } + }, + defaultPath: { + serializedName: "defaultPath", + type: { + name: "String" + } + }, + defaultPattern: { + serializedName: "defaultPattern", + type: { + name: "Composite", + className: "AliasPatternType1" + } } } } @@ -495,7 +605,7 @@ export const ProviderResourceType: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "AliasType" + className: "AliasType1" } } } @@ -683,6 +793,23 @@ export const OnErrorDeploymentExtended: msRest.CompositeMapper = { } }; +export const ResourceReference: msRest.CompositeMapper = { + serializedName: "ResourceReference", + type: { + name: "Composite", + className: "ResourceReference", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + export const DeploymentPropertiesExtended: msRest.CompositeMapper = { serializedName: "DeploymentPropertiesExtended", type: { @@ -718,12 +845,14 @@ export const DeploymentPropertiesExtended: msRest.CompositeMapper = { } }, outputs: { + readOnly: true, serializedName: "outputs", type: { name: "Object" } }, providers: { + readOnly: true, serializedName: "providers", type: { name: "Sequence", @@ -736,6 +865,7 @@ export const DeploymentPropertiesExtended: msRest.CompositeMapper = { } }, dependencies: { + readOnly: true, serializedName: "dependencies", type: { name: "Sequence", @@ -747,13 +877,8 @@ export const DeploymentPropertiesExtended: msRest.CompositeMapper = { } } }, - template: { - serializedName: "template", - type: { - name: "Object" - } - }, templateLink: { + readOnly: true, serializedName: "templateLink", type: { name: "Composite", @@ -761,12 +886,14 @@ export const DeploymentPropertiesExtended: msRest.CompositeMapper = { } }, parameters: { + readOnly: true, serializedName: "parameters", type: { name: "Object" } }, parametersLink: { + readOnly: true, serializedName: "parametersLink", type: { name: "Composite", @@ -774,6 +901,7 @@ export const DeploymentPropertiesExtended: msRest.CompositeMapper = { } }, mode: { + readOnly: true, serializedName: "mode", type: { name: "Enum", @@ -784,6 +912,7 @@ export const DeploymentPropertiesExtended: msRest.CompositeMapper = { } }, debugSetting: { + readOnly: true, serializedName: "debugSetting", type: { name: "Composite", @@ -791,11 +920,53 @@ export const DeploymentPropertiesExtended: msRest.CompositeMapper = { } }, onErrorDeployment: { + readOnly: true, serializedName: "onErrorDeployment", type: { name: "Composite", className: "OnErrorDeploymentExtended" } + }, + templateHash: { + readOnly: true, + serializedName: "templateHash", + type: { + name: "String" + } + }, + outputResources: { + readOnly: true, + serializedName: "outputResources", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceReference" + } + } + } + }, + validatedResources: { + readOnly: true, + serializedName: "validatedResources", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceReference" + } + } + } + }, + error: { + readOnly: true, + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } } } } @@ -808,6 +979,7 @@ export const DeploymentValidateResult: msRest.CompositeMapper = { className: "DeploymentValidateResult", modelProperties: { error: { + readOnly: true, serializedName: "error", type: { name: "Composite", @@ -864,6 +1036,17 @@ export const DeploymentExtended: msRest.CompositeMapper = { name: "Composite", className: "DeploymentPropertiesExtended" } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } } } } @@ -1128,6 +1311,38 @@ export const GenericResource: msRest.CompositeMapper = { } }; +export const GenericResourceExpanded: msRest.CompositeMapper = { + serializedName: "GenericResourceExpanded", + type: { + name: "Composite", + className: "GenericResourceExpanded", + modelProperties: { + ...GenericResource.type.modelProperties, + createdTime: { + readOnly: true, + serializedName: "createdTime", + type: { + name: "DateTime" + } + }, + changedTime: { + readOnly: true, + serializedName: "changedTime", + type: { + name: "DateTime" + } + }, + provisioningState: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + } + } + } +}; + export const ResourceGroupProperties: msRest.CompositeMapper = { serializedName: "ResourceGroupProperties", type: { @@ -1849,6 +2064,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: { @@ -1992,7 +2290,7 @@ export const ResourceListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "GenericResource" + className: "GenericResourceExpanded" } } } diff --git a/sdk/resources/arm-resources/src/models/providersMappers.ts b/sdk/resources/arm-resources/src/models/providersMappers.ts index 73efdacde7a1..6ce2efb1500a 100644 --- a/sdk/resources/arm-resources/src/models/providersMappers.ts +++ b/sdk/resources/arm-resources/src/models/providersMappers.ts @@ -8,7 +8,8 @@ export { AliasPathType, - AliasType, + AliasPatternType1, + AliasType1, CloudError, ErrorAdditionalInfo, ErrorResponse, diff --git a/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts b/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts index eb263b58a93a..9a416b5a970c 100644 --- a/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts +++ b/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts @@ -8,7 +8,8 @@ export { AliasPathType, - AliasType, + AliasPatternType1, + AliasType1, BaseResource, BasicDependency, CloudError, @@ -20,6 +21,7 @@ export { ErrorResponse, ExportTemplateRequest, GenericResource, + GenericResourceExpanded, Identity, IdentityUserAssignedIdentitiesValue, OnErrorDeploymentExtended, @@ -33,9 +35,13 @@ export { ResourceGroupListResult, ResourceGroupPatchable, ResourceGroupProperties, + ResourceReference, Sku, SubResource, TagCount, + TagDetails, + 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..737741358566 100644 --- a/sdk/resources/arm-resources/src/models/resourcesMappers.ts +++ b/sdk/resources/arm-resources/src/models/resourcesMappers.ts @@ -8,7 +8,8 @@ export { AliasPathType, - AliasType, + AliasPatternType1, + AliasType1, BaseResource, BasicDependency, CloudError, @@ -19,6 +20,7 @@ export { ErrorAdditionalInfo, ErrorResponse, GenericResource, + GenericResourceExpanded, Identity, IdentityUserAssignedIdentitiesValue, OnErrorDeploymentExtended, @@ -30,10 +32,14 @@ export { ResourceGroup, ResourceGroupProperties, ResourceListResult, + ResourceReference, ResourcesMoveInfo, Sku, SubResource, TagCount, + TagDetails, + 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 86% rename from sdk/resources/arm-resources/src/models/tagsMappers.ts rename to sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts index ef9dcf708953..ef837225ccec 100644 --- a/sdk/resources/arm-resources/src/models/tagsMappers.ts +++ b/sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts @@ -8,7 +8,8 @@ export { AliasPathType, - AliasType, + AliasPatternType1, + AliasType1, BaseResource, BasicDependency, CloudError, @@ -19,6 +20,7 @@ export { ErrorAdditionalInfo, ErrorResponse, GenericResource, + GenericResourceExpanded, Identity, IdentityUserAssignedIdentitiesValue, OnErrorDeploymentExtended, @@ -29,11 +31,15 @@ export { Resource, ResourceGroup, ResourceGroupProperties, + ResourceReference, Sku, 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..97b9a4fdba1b 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -22,23 +22,24 @@ class ResourceManagementClient extends ResourceManagementClientContext { providers: operations.Providers; resources: operations.Resources; resourceGroups: operations.ResourceGroups; - tags: operations.Tags; + tags: operations.TagsOperations; deploymentOperations: operations.DeploymentOperations; /** * Initializes a new instance of the ResourceManagementClient class. * @param credentials Credentials needed for the client to connect to Azure. * @param subscriptionId The ID of the target subscription. + * @param subscriptionId1 The ID of the source subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ResourceManagementClientOptions) { - super(credentials, subscriptionId, options); + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, subscriptionId1: string, options?: Models.ResourceManagementClientOptions) { + super(credentials, subscriptionId, subscriptionId1, options); this.operations = new operations.Operations(this); this.deployments = new operations.Deployments(this); 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..348c879549dd 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClientContext.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts @@ -18,21 +18,26 @@ const packageVersion = "2.1.0"; export class ResourceManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; subscriptionId: string; + subscriptionId1: string; apiVersion?: string; /** * Initializes a new instance of the ResourceManagementClient class. * @param credentials Credentials needed for the client to connect to Azure. * @param subscriptionId The ID of the target subscription. + * @param subscriptionId1 The ID of the source subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ResourceManagementClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, subscriptionId1: string, options?: Models.ResourceManagementClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } if (subscriptionId == undefined) { throw new Error('\'subscriptionId\' cannot be null.'); } + if (subscriptionId1 == undefined) { + throw new Error('\'subscriptionId1\' cannot be null.'); + } if (!options) { options = {}; @@ -44,13 +49,14 @@ 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"; this.requestContentType = "application/json; charset=utf-8"; this.credentials = credentials; this.subscriptionId = subscriptionId; + this.subscriptionId1 = subscriptionId1; if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage;