From f61726167f153ff7cdea7f6f54a2d869e5c2bb05 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 23 Jul 2020 21:57:56 +0000 Subject: [PATCH] Update from master --- .../src/models/deploymentOperationsMappers.ts | 1 + .../src/models/deploymentsMappers.ts | 3 + .../arm-resources/src/models/index.ts | 154 ++++++++++++++++-- .../arm-resources/src/models/mappers.ts | 114 ++++++++++++- .../src/models/operationsMappers.ts | 2 +- .../src/operations/deployments.ts | 144 +++++++++++++++- .../src/resourceManagementClientContext.ts | 2 +- 7 files changed, 398 insertions(+), 22 deletions(-) diff --git a/sdk/resources/arm-resources/src/models/deploymentOperationsMappers.ts b/sdk/resources/arm-resources/src/models/deploymentOperationsMappers.ts index dc963f1e8398..000030dddb55 100644 --- a/sdk/resources/arm-resources/src/models/deploymentOperationsMappers.ts +++ b/sdk/resources/arm-resources/src/models/deploymentOperationsMappers.ts @@ -14,5 +14,6 @@ export { ErrorAdditionalInfo, ErrorResponse, HttpMessage, + StatusMessage, TargetResource } from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/deploymentsMappers.ts b/sdk/resources/arm-resources/src/models/deploymentsMappers.ts index 61286227b9da..08fa9cedc006 100644 --- a/sdk/resources/arm-resources/src/models/deploymentsMappers.ts +++ b/sdk/resources/arm-resources/src/models/deploymentsMappers.ts @@ -21,7 +21,9 @@ export { DeploymentListResult, DeploymentProperties, DeploymentPropertiesExtended, + DeploymentsWhatIfAtManagementGroupScopeHeaders, DeploymentsWhatIfAtSubscriptionScopeHeaders, + DeploymentsWhatIfAtTenantScopeHeaders, DeploymentsWhatIfHeaders, DeploymentValidateResult, DeploymentWhatIf, @@ -44,6 +46,7 @@ export { ResourceGroupProperties, ResourceReference, ScopedDeployment, + ScopedDeploymentWhatIf, Sku, SubResource, TagCount, diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index 0916795083fc..318d9c29d5c8 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -58,9 +58,18 @@ export interface ResourceGroupFilter { */ export interface TemplateLink { /** - * The URI of the template to deploy. + * The URI of the template to deploy. Use either the uri or id property, but not both. */ - uri: string; + uri?: string; + /** + * The resource id of a Template Spec. Use either the id or uri property, but not both. + */ + id?: string; + /** + * Applicable only if this template link references a Template Spec. This relativePath property + * can optionally be used to reference a Template Spec artifact by path. + */ + relativePath?: string; /** * If included, must match the ContentVersion in the template. */ @@ -238,6 +247,20 @@ export interface DeploymentWhatIf { properties: DeploymentWhatIfProperties; } +/** + * Deployment What-if operation parameters. + */ +export interface ScopedDeploymentWhatIf { + /** + * The location to store the deployment data. + */ + location: string; + /** + * The deployment properties. + */ + properties: DeploymentWhatIfProperties; +} + /** * The resource management error additional info. */ @@ -483,10 +506,12 @@ export interface ResourceReference { */ export interface DeploymentPropertiesExtended { /** - * The state of the provisioning. + * Denotes the state of provisioning. Possible values include: 'NotSpecified', 'Accepted', + * 'Running', 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + * 'Succeeded', 'Updating' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly provisioningState?: string; + readonly provisioningState?: ProvisioningState; /** * The correlation ID of the deployment. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -987,6 +1012,20 @@ export interface HttpMessage { content?: any; } +/** + * Operation status message object. + */ +export interface StatusMessage { + /** + * Status of the deployment operation. + */ + status?: string; + /** + * The error reported by the operation. + */ + error?: ErrorResponse; +} + /** * Deployment operation properties. */ @@ -1019,15 +1058,17 @@ export interface DeploymentOperationProperties { */ readonly serviceRequestId?: string; /** - * Operation status code. + * Operation status code from the resource provider. This property may not be set if a response + * has not yet been received. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly statusCode?: string; /** - * Operation status message. + * Operation status message from the resource provider. This property is optional. It will only + * be provided if an error was received from the resource provider. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly statusMessage?: any; + readonly statusMessage?: StatusMessage; /** * The target resource. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -1140,7 +1181,7 @@ export interface OperationDisplay { /** * Microsoft.Resources operation */ -export interface Operation { +export interface Operation1 { /** * Operation name: {provider}/{resource}/{operation} */ @@ -1252,7 +1293,7 @@ export interface TagsPatchResource { /** * The operation type for the patch API. Possible values include: 'Replace', 'Merge', 'Delete' */ - operation?: OperationEnum; + operation?: Operation; /** * The set of tags. */ @@ -1552,6 +1593,34 @@ export interface ResourceManagementClientOptions extends AzureServiceClientOptio baseUri?: string; } +/** + * Defines headers for WhatIfAtTenantScope operation. + */ +export interface DeploymentsWhatIfAtTenantScopeHeaders { + /** + * URL to get status of this long-running operation. + */ + location: string; + /** + * Number of seconds to wait before polling for status. + */ + retryAfter: string; +} + +/** + * Defines headers for WhatIfAtManagementGroupScope operation. + */ +export interface DeploymentsWhatIfAtManagementGroupScopeHeaders { + /** + * URL to get status of this long-running operation. + */ + location: string; + /** + * Number of seconds to wait before polling for status. + */ + retryAfter: string; +} + /** * Defines headers for WhatIfAtSubscriptionScope operation. */ @@ -1584,9 +1653,9 @@ export interface DeploymentsWhatIfHeaders { * @interface * Result of the request to list Microsoft.Resources operations. It contains a list of operations * and a URL link to get the next set of results. - * @extends Array + * @extends Array */ -export interface OperationListResult extends Array { +export interface OperationListResult extends Array { /** * URL to get the next set of operation list results if there are any. */ @@ -1711,6 +1780,15 @@ export type AliasPatternType = 'NotSpecified' | 'Extract'; */ export type AliasType = 'NotSpecified' | 'PlainText' | 'Mask'; +/** + * Defines values for ProvisioningState. + * Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', 'Created', + * 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'NotSpecified' | 'Accepted' | 'Running' | 'Ready' | 'Creating' | 'Created' | 'Deleting' | 'Deleted' | 'Canceled' | 'Failed' | 'Succeeded' | 'Updating'; + /** * Defines values for ResourceIdentityType. * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', @@ -1747,12 +1825,12 @@ export type PropertyChangeType = 'Create' | 'Delete' | 'Modify' | 'Array'; export type ChangeType = 'Create' | 'Delete' | 'Ignore' | 'Deploy' | 'NoChange' | 'Modify'; /** - * Defines values for OperationEnum. + * Defines values for Operation. * Possible values include: 'Replace', 'Merge', 'Delete' * @readonly * @enum {string} */ -export type OperationEnum = 'Replace' | 'Merge' | 'Delete'; +export type Operation = 'Replace' | 'Merge' | 'Delete'; /** * Contains response data for the list operation. @@ -2004,6 +2082,31 @@ export type DeploymentsValidateAtTenantScopeResponse = DeploymentValidateResult }; }; +/** + * Contains response data for the whatIfAtTenantScope operation. + */ +export type DeploymentsWhatIfAtTenantScopeResponse = WhatIfOperationResult & DeploymentsWhatIfAtTenantScopeHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: DeploymentsWhatIfAtTenantScopeHeaders; + + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WhatIfOperationResult; + }; +}; + /** * Contains response data for the exportTemplateAtTenantScope operation. */ @@ -2129,6 +2232,31 @@ export type DeploymentsValidateAtManagementGroupScopeResponse = DeploymentValida }; }; +/** + * Contains response data for the whatIfAtManagementGroupScope operation. + */ +export type DeploymentsWhatIfAtManagementGroupScopeResponse = WhatIfOperationResult & DeploymentsWhatIfAtManagementGroupScopeHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: DeploymentsWhatIfAtManagementGroupScopeHeaders; + + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WhatIfOperationResult; + }; +}; + /** * Contains response data for the exportTemplateAtManagementGroupScope operation. */ diff --git a/sdk/resources/arm-resources/src/models/mappers.ts b/sdk/resources/arm-resources/src/models/mappers.ts index 69a63e536f3f..1c16d36a2bfe 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -85,12 +85,23 @@ export const TemplateLink: msRest.CompositeMapper = { className: "TemplateLink", modelProperties: { uri: { - required: true, serializedName: "uri", type: { name: "String" } }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + relativePath: { + serializedName: "relativePath", + type: { + name: "String" + } + }, contentVersion: { serializedName: "contentVersion", type: { @@ -376,6 +387,31 @@ export const DeploymentWhatIf: msRest.CompositeMapper = { } }; +export const ScopedDeploymentWhatIf: msRest.CompositeMapper = { + serializedName: "ScopedDeploymentWhatIf", + type: { + name: "Composite", + className: "ScopedDeploymentWhatIf", + modelProperties: { + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentWhatIfProperties" + } + } + } + } +}; + export const ErrorAdditionalInfo: msRest.CompositeMapper = { serializedName: "ErrorAdditionalInfo", type: { @@ -1654,6 +1690,29 @@ export const HttpMessage: msRest.CompositeMapper = { } }; +export const StatusMessage: msRest.CompositeMapper = { + serializedName: "StatusMessage", + type: { + name: "Composite", + className: "StatusMessage", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + } +}; + export const DeploymentOperationProperties: msRest.CompositeMapper = { serializedName: "DeploymentOperationProperties", type: { @@ -1718,7 +1777,8 @@ export const DeploymentOperationProperties: msRest.CompositeMapper = { readOnly: true, serializedName: "statusMessage", type: { - name: "Object" + name: "Composite", + className: "StatusMessage" } }, targetResource: { @@ -1893,11 +1953,11 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { +export const Operation1: msRest.CompositeMapper = { serializedName: "Operation", type: { name: "Composite", - className: "Operation", + className: "Operation1", modelProperties: { name: { serializedName: "name", @@ -2166,6 +2226,50 @@ export const TagsResource: msRest.CompositeMapper = { } }; +export const DeploymentsWhatIfAtTenantScopeHeaders: msRest.CompositeMapper = { + serializedName: "deployments-whatifattenantscope-headers", + type: { + name: "Composite", + className: "DeploymentsWhatIfAtTenantScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentsWhatIfAtManagementGroupScopeHeaders: msRest.CompositeMapper = { + serializedName: "deployments-whatifatmanagementgroupscope-headers", + type: { + name: "Composite", + className: "DeploymentsWhatIfAtManagementGroupScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String" + } + } + } + } +}; + export const DeploymentsWhatIfAtSubscriptionScopeHeaders: msRest.CompositeMapper = { serializedName: "deployments-whatifatsubscriptionscope-headers", type: { @@ -2223,7 +2327,7 @@ export const OperationListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" + className: "Operation1" } } } diff --git a/sdk/resources/arm-resources/src/models/operationsMappers.ts b/sdk/resources/arm-resources/src/models/operationsMappers.ts index fb04a88e695f..7a144dbaf3be 100644 --- a/sdk/resources/arm-resources/src/models/operationsMappers.ts +++ b/sdk/resources/arm-resources/src/models/operationsMappers.ts @@ -10,7 +10,7 @@ export { CloudError, ErrorAdditionalInfo, ErrorResponse, - Operation, + Operation1, OperationDisplay, OperationListResult } from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/operations/deployments.ts b/sdk/resources/arm-resources/src/operations/deployments.ts index 571323f26ffd..6bcb9ee6f7b0 100644 --- a/sdk/resources/arm-resources/src/operations/deployments.ts +++ b/sdk/resources/arm-resources/src/operations/deployments.ts @@ -366,6 +366,19 @@ export class Deployments { .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant + * group. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param [options] The optional parameters + * @returns Promise + */ + whatIfAtTenantScope(deploymentName: string, parameters: Models.ScopedDeploymentWhatIf, options?: msRest.RequestOptionsBase): Promise { + return this.beginWhatIfAtTenantScope(deploymentName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + /** * Exports the template used for specified deployment. * @param deploymentName The name of the deployment. @@ -565,6 +578,20 @@ export class Deployments { .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } + /** + * Returns changes that will be made by the deployment if executed at the scope of the management + * group. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param [options] The optional parameters + * @returns Promise + */ + whatIfAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeploymentWhatIf, options?: msRest.RequestOptionsBase): Promise { + return this.beginWhatIfAtManagementGroupScope(groupId,deploymentName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + /** * Exports the template used for specified deployment. * @param groupId The management group ID. @@ -1210,6 +1237,25 @@ export class Deployments { options); } + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant + * group. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param [options] The optional parameters + * @returns Promise + */ + beginWhatIfAtTenantScope(deploymentName: string, parameters: Models.ScopedDeploymentWhatIf, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + deploymentName, + parameters, + options + }, + beginWhatIfAtTenantScopeOperationSpec, + options); + } + /** * A template deployment that is currently running cannot be deleted. Deleting a template * deployment removes the associated deployment operations. This is an asynchronous operation that @@ -1277,6 +1323,27 @@ export class Deployments { options); } + /** + * Returns changes that will be made by the deployment if executed at the scope of the management + * group. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param [options] The optional parameters + * @returns Promise + */ + beginWhatIfAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeploymentWhatIf, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + groupId, + deploymentName, + parameters, + options + }, + beginWhatIfAtManagementGroupScopeOperationSpec, + options); + } + /** * A template deployment that is currently running cannot be deleted. Deleting a template * deployment removes the associated deployment operations. This is an asynchronous operation that @@ -2392,6 +2459,41 @@ const beginValidateAtTenantScopeOperationSpec: msRest.OperationSpec = { serializer }; +const beginWhatIfAtTenantScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", + urlParameters: [ + Parameters.deploymentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ScopedDeploymentWhatIf, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.WhatIfOperationResult, + headersMapper: Mappers.DeploymentsWhatIfAtTenantScopeHeaders + }, + 202: { + headersMapper: Mappers.DeploymentsWhatIfAtTenantScopeHeaders + }, + default: { + bodyMapper: Mappers.CloudError, + headersMapper: Mappers.DeploymentsWhatIfAtTenantScopeHeaders + } + }, + serializer +}; + const beginDeleteAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", @@ -2484,6 +2586,42 @@ const beginValidateAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { serializer }; +const beginWhatIfAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ScopedDeploymentWhatIf, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.WhatIfOperationResult, + headersMapper: Mappers.DeploymentsWhatIfAtManagementGroupScopeHeaders + }, + 202: { + headersMapper: Mappers.DeploymentsWhatIfAtManagementGroupScopeHeaders + }, + default: { + bodyMapper: Mappers.CloudError, + headersMapper: Mappers.DeploymentsWhatIfAtManagementGroupScopeHeaders + } + }, + serializer +}; + const beginDeleteAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", @@ -2605,7 +2743,8 @@ const beginWhatIfAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.DeploymentsWhatIfAtSubscriptionScopeHeaders }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.CloudError, + headersMapper: Mappers.DeploymentsWhatIfAtSubscriptionScopeHeaders } }, serializer @@ -2736,7 +2875,8 @@ const beginWhatIfOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.DeploymentsWhatIfHeaders }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.CloudError, + headersMapper: Mappers.DeploymentsWhatIfHeaders } }, serializer diff --git a/sdk/resources/arm-resources/src/resourceManagementClientContext.ts b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts index 0259767defe2..153cf9aa9ff5 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-10-01'; + this.apiVersion = '2020-06-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";