diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index 41a7f000224a..8e97ab4ef41e 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -812,6 +812,11 @@ export interface DeploymentOperationProperties { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly timestamp?: Date; + /** + * The duration of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly duration?: string; /** * Deployment operation service request id. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -950,6 +955,21 @@ export interface Operation { display?: OperationDisplay; } +/** + * Optional Parameters. + */ +export interface DeploymentsListAtManagementGroupScopeOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + */ + filter?: string; + /** + * The number of results to get. If null is passed, returns all deployments. + */ + top?: number; +} + /** * Optional Parameters. */ @@ -1085,6 +1105,16 @@ export interface ResourceGroupsListOptionalParams extends msRest.RequestOptionsB top?: number; } +/** + * Optional Parameters. + */ +export interface DeploymentOperationsListAtManagementGroupScopeOptionalParams extends msRest.RequestOptionsBase { + /** + * The number of results to return. + */ + top?: number; +} + /** * Optional Parameters. */ @@ -1268,6 +1298,131 @@ export type OperationsListNextResponse = OperationListResult & { }; }; +/** + * Contains response data for the checkExistenceAtManagementGroupScope operation. + */ +export type DeploymentsCheckExistenceAtManagementGroupScopeResponse = { + /** + * The parsed response body. + */ + body: boolean; + + /** + * 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: boolean; + }; +}; + +/** + * Contains response data for the createOrUpdateAtManagementGroupScope operation. + */ +export type DeploymentsCreateOrUpdateAtManagementGroupScopeResponse = DeploymentExtended & { + /** + * 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: DeploymentExtended; + }; +}; + +/** + * Contains response data for the getAtManagementGroupScope operation. + */ +export type DeploymentsGetAtManagementGroupScopeResponse = DeploymentExtended & { + /** + * 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: DeploymentExtended; + }; +}; + +/** + * Contains response data for the validateAtManagementGroupScope operation. + */ +export type DeploymentsValidateAtManagementGroupScopeResponse = DeploymentValidateResult & { + /** + * 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: DeploymentValidateResult; + }; +}; + +/** + * Contains response data for the exportTemplateAtManagementGroupScope operation. + */ +export type DeploymentsExportTemplateAtManagementGroupScopeResponse = DeploymentExportResult & { + /** + * 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: DeploymentExportResult; + }; +}; + +/** + * Contains response data for the listAtManagementGroupScope operation. + */ +export type DeploymentsListAtManagementGroupScopeResponse = DeploymentListResult & { + /** + * 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: DeploymentListResult; + }; +}; + /** * Contains response data for the checkExistenceAtSubscriptionScope operation. */ @@ -1518,6 +1673,26 @@ export type DeploymentsListByResourceGroupResponse = DeploymentListResult & { }; }; +/** + * Contains response data for the beginCreateOrUpdateAtManagementGroupScope operation. + */ +export type DeploymentsBeginCreateOrUpdateAtManagementGroupScopeResponse = DeploymentExtended & { + /** + * 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: DeploymentExtended; + }; +}; + /** * Contains response data for the beginCreateOrUpdateAtSubscriptionScope operation. */ @@ -1558,6 +1733,26 @@ export type DeploymentsBeginCreateOrUpdateResponse = DeploymentExtended & { }; }; +/** + * Contains response data for the listAtManagementGroupScopeNext operation. + */ +export type DeploymentsListAtManagementGroupScopeNextResponse = DeploymentListResult & { + /** + * 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: DeploymentListResult; + }; +}; + /** * Contains response data for the listAtSubscriptionScopeNext operation. */ @@ -2253,6 +2448,46 @@ export type TagsListNextResponse = TagsListResult & { }; }; +/** + * Contains response data for the getAtManagementGroupScope operation. + */ +export type DeploymentOperationsGetAtManagementGroupScopeResponse = DeploymentOperation & { + /** + * 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: DeploymentOperation; + }; +}; + +/** + * Contains response data for the listAtManagementGroupScope operation. + */ +export type DeploymentOperationsListAtManagementGroupScopeResponse = DeploymentOperationsListResult & { + /** + * 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: DeploymentOperationsListResult; + }; +}; + /** * Contains response data for the getAtSubscriptionScope operation. */ @@ -2333,6 +2568,26 @@ export type DeploymentOperationsListResponse = DeploymentOperationsListResult & }; }; +/** + * Contains response data for the listAtManagementGroupScopeNext operation. + */ +export type DeploymentOperationsListAtManagementGroupScopeNextResponse = DeploymentOperationsListResult & { + /** + * 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: DeploymentOperationsListResult; + }; +}; + /** * Contains response data for the listAtSubscriptionScopeNext operation. */ diff --git a/sdk/resources/arm-resources/src/models/mappers.ts b/sdk/resources/arm-resources/src/models/mappers.ts index 553478fff34a..3a2927b096ab 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -1353,6 +1353,13 @@ export const DeploymentOperationProperties: msRest.CompositeMapper = { name: "DateTime" } }, + duration: { + readOnly: true, + serializedName: "duration", + type: { + name: "String" + } + }, serviceRequestId: { readOnly: true, serializedName: "serviceRequestId", diff --git a/sdk/resources/arm-resources/src/models/parameters.ts b/sdk/resources/arm-resources/src/models/parameters.ts index 6cdb760d5157..1b4e8042a818 100644 --- a/sdk/resources/arm-resources/src/models/parameters.ts +++ b/sdk/resources/arm-resources/src/models/parameters.ts @@ -69,6 +69,20 @@ export const filter: msRest.OperationQueryParameter = { } } }; +export const groupId: msRest.OperationURLParameter = { + parameterPath: "groupId", + mapper: { + required: true, + serializedName: "groupId", + constraints: { + MaxLength: 90, + MinLength: 1 + }, + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { diff --git a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts index bd1b8fd5d95c..5d7fa983204b 100644 --- a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts +++ b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts @@ -26,6 +26,74 @@ export class DeploymentOperations { this.client = client; } + /** + * Gets a deployments operation. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param [options] The optional parameters + * @returns Promise + */ + getAtManagementGroupScope(groupId: string, deploymentName: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param callback The callback + */ + getAtManagementGroupScope(groupId: string, deploymentName: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param options The optional parameters + * @param callback The callback + */ + getAtManagementGroupScope(groupId: string, deploymentName: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtManagementGroupScope(groupId: string, deploymentName: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + deploymentName, + operationId, + options + }, + getAtManagementGroupScopeOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments operations for a deployment. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param [options] The optional parameters + * @returns Promise + */ + listAtManagementGroupScope(groupId: string, deploymentName: string, options?: Models.DeploymentOperationsListAtManagementGroupScopeOptionalParams): Promise; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param callback The callback + */ + listAtManagementGroupScope(groupId: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The optional parameters + * @param callback The callback + */ + listAtManagementGroupScope(groupId: string, deploymentName: string, options: Models.DeploymentOperationsListAtManagementGroupScopeOptionalParams, callback: msRest.ServiceCallback): void; + listAtManagementGroupScope(groupId: string, deploymentName: string, options?: Models.DeploymentOperationsListAtManagementGroupScopeOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + deploymentName, + options + }, + listAtManagementGroupScopeOperationSpec, + callback) as Promise; + } + /** * Gets a deployments operation. * @param deploymentName The name of the deployment. @@ -60,18 +128,18 @@ export class DeploymentOperations { /** * Gets all deployments operations for a deployment. - * @param deploymentName The name of the deployment with the operation to get. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ listAtSubscriptionScope(deploymentName: string, options?: Models.DeploymentOperationsListAtSubscriptionScopeOptionalParams): Promise; /** - * @param deploymentName The name of the deployment with the operation to get. + * @param deploymentName The name of the deployment. * @param callback The callback */ listAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param deploymentName The name of the deployment with the operation to get. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -125,20 +193,20 @@ export class DeploymentOperations { /** * Gets all deployments operations for a deployment. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment with the operation to get. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ list(resourceGroupName: string, deploymentName: string, options?: Models.DeploymentOperationsListOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment with the operation to get. + * @param deploymentName The name of the deployment. * @param callback The callback */ list(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment with the operation to get. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -154,6 +222,34 @@ export class DeploymentOperations { callback) as Promise; } + /** + * Gets all deployments operations for a deployment. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAtManagementGroupScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAtManagementGroupScopeNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listAtManagementGroupScopeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAtManagementGroupScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtManagementGroupScopeNextOperationSpec, + callback) as Promise; + } + /** * Gets all deployments operations for a deployment. * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -213,6 +309,56 @@ export class DeploymentOperations { // Operation Specifications const serializer = new msRest.Serializer(Mappers); +const getAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName, + Parameters.operationId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperation + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName + ], + queryParameters: [ + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const getAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", @@ -315,6 +461,27 @@ const listOperationSpec: msRest.OperationSpec = { serializer }; +const listAtManagementGroupScopeNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const listAtSubscriptionScopeNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", diff --git a/sdk/resources/arm-resources/src/operations/deployments.ts b/sdk/resources/arm-resources/src/operations/deployments.ts index 054bcaec8ae4..6fa13c2fc872 100644 --- a/sdk/resources/arm-resources/src/operations/deployments.ts +++ b/sdk/resources/arm-resources/src/operations/deployments.ts @@ -36,7 +36,237 @@ 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 deploymentName The name of the deployment to delete. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteAtManagementGroupScope(groupId,deploymentName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Checks whether the deployment exists. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param [options] The optional parameters + * @returns Promise + */ + checkExistenceAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param callback The callback + */ + checkExistenceAtManagementGroupScope(groupId: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The optional parameters + * @param callback The callback + */ + checkExistenceAtManagementGroupScope(groupId: string, deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkExistenceAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + deploymentName, + options + }, + checkExistenceAtManagementGroupScopeOperationSpec, + callback) as Promise; + } + + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @summary Deploys resources at management group scope. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdateAtManagementGroupScope(groupId,deploymentName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets a deployment. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param [options] The optional parameters + * @returns Promise + */ + getAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param callback The callback + */ + getAtManagementGroupScope(groupId: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The optional parameters + * @param callback The callback + */ + getAtManagementGroupScope(groupId: string, deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + deploymentName, + options + }, + getAtManagementGroupScopeOperationSpec, + callback) as Promise; + } + + /** + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template + * deployment stops the currently running template deployment and leaves the resources partially + * deployed. + * @summary Cancels a currently running template deployment. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param [options] The optional parameters + * @returns Promise + */ + cancelAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param callback The callback + */ + cancelAtManagementGroupScope(groupId: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The optional parameters + * @param callback The callback + */ + cancelAtManagementGroupScope(groupId: string, deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + cancelAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + deploymentName, + options + }, + cancelAtManagementGroupScopeOperationSpec, + callback); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @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 + */ + validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, 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; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @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 { + return this.client.sendOperationRequest( + { + groupId, + deploymentName, + parameters, + options + }, + validateAtManagementGroupScopeOperationSpec, + callback) as Promise; + } + + /** + * Exports the template used for specified deployment. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param [options] The optional parameters + * @returns Promise + */ + exportTemplateAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param callback The callback + */ + exportTemplateAtManagementGroupScope(groupId: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The optional parameters + * @param callback The callback + */ + exportTemplateAtManagementGroupScope(groupId: string, deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + exportTemplateAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + deploymentName, + options + }, + exportTemplateAtManagementGroupScopeOperationSpec, + callback) as Promise; + } + + /** + * Get all the deployments for a management group. + * @param groupId The management group ID. + * @param [options] The optional parameters + * @returns Promise + */ + listAtManagementGroupScope(groupId: string, options?: Models.DeploymentsListAtManagementGroupScopeOptionalParams): Promise; + /** + * @param groupId The management group ID. + * @param callback The callback + */ + listAtManagementGroupScope(groupId: string, callback: msRest.ServiceCallback): void; + /** + * @param groupId The management group ID. + * @param options The optional parameters + * @param callback The callback + */ + listAtManagementGroupScope(groupId: string, options: Models.DeploymentsListAtManagementGroupScopeOptionalParams, callback: msRest.ServiceCallback): void; + listAtManagementGroupScope(groupId: string, options?: Models.DeploymentsListAtManagementGroupScopeOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + groupId, + options + }, + listAtManagementGroupScopeOperationSpec, + callback) as Promise; + } + + /** + * 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 + * returns a status of 202 until the template deployment is successfully deleted. The Location + * response header contains the URI that is used to obtain the status of the process. While the + * process is running, a call to the URI in the Location header returns a status of 202. When the + * 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 deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ @@ -47,18 +277,18 @@ export class Deployments { /** * Checks whether the deployment exists. - * @param deploymentName The name of the deployment to check. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ checkExistenceAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param deploymentName The name of the deployment to check. + * @param deploymentName The name of the deployment. * @param callback The callback */ checkExistenceAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param deploymentName The name of the deployment to check. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -88,18 +318,18 @@ export class Deployments { /** * Gets a deployment. - * @param deploymentName The name of the deployment to get. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ getAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param deploymentName The name of the deployment to get. + * @param deploymentName The name of the deployment. * @param callback The callback */ getAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param deploymentName The name of the deployment to get. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -120,18 +350,18 @@ export class Deployments { * deployment stops the currently running template deployment and leaves the resources partially * deployed. * @summary Cancels a currently running template deployment. - * @param deploymentName The name of the deployment to cancel. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ cancelAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param deploymentName The name of the deployment to cancel. + * @param deploymentName The name of the deployment. * @param callback The callback */ cancelAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param deploymentName The name of the deployment to cancel. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -181,18 +411,18 @@ export class Deployments { /** * Exports the template used for specified deployment. - * @param deploymentName The name of the deployment from which to get the template. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ exportTemplateAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param deploymentName The name of the deployment from which to get the template. + * @param deploymentName The name of the deployment. * @param callback The callback */ exportTemplateAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param deploymentName The name of the deployment from which to get the template. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -243,7 +473,7 @@ export class Deployments { * @summary Deletes a deployment from the deployment history. * @param resourceGroupName The name of the resource group with the deployment to delete. The name * is case insensitive. - * @param deploymentName The name of the deployment to delete. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ @@ -256,7 +486,7 @@ export class Deployments { * Checks whether the deployment exists. * @param resourceGroupName The name of the resource group with the deployment to check. The name * is case insensitive. - * @param deploymentName The name of the deployment to check. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ @@ -264,14 +494,14 @@ export class Deployments { /** * @param resourceGroupName The name of the resource group with the deployment to check. The name * is case insensitive. - * @param deploymentName The name of the deployment to check. + * @param deploymentName The name of the deployment. * @param callback The callback */ checkExistence(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group with the deployment to check. The name * is case insensitive. - * @param deploymentName The name of the deployment to check. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -305,20 +535,20 @@ export class Deployments { /** * Gets a deployment. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment to get. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ get(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment to get. + * @param deploymentName The name of the deployment. * @param callback The callback */ get(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment to get. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -341,20 +571,20 @@ export class Deployments { * partially deployed. * @summary Cancels a currently running template deployment. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment to cancel. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ cancel(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment to cancel. + * @param deploymentName The name of the deployment. * @param callback The callback */ cancel(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment to cancel. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -413,20 +643,20 @@ export class Deployments { /** * Exports the template used for specified deployment. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment from which to get the template. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ exportTemplate(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment from which to get the template. + * @param deploymentName The name of the deployment. * @param callback The callback */ exportTemplate(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment from which to get the template. + * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback */ @@ -482,7 +712,53 @@ 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 deploymentName The name of the deployment to delete. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteAtManagementGroupScope(groupId: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + groupId, + deploymentName, + options + }, + beginDeleteAtManagementGroupScopeOperationSpec, + options); + } + + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @summary Deploys resources at management group scope. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + groupId, + deploymentName, + parameters, + options + }, + beginCreateOrUpdateAtManagementGroupScopeOperationSpec, + 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 + * returns a status of 202 until the template deployment is successfully deleted. The Location + * response header contains the URI that is used to obtain the status of the process. While the + * process is running, a call to the URI in the Location header returns a status of 202. When the + * 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 deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ @@ -527,7 +803,7 @@ export class Deployments { * @summary Deletes a deployment from the deployment history. * @param resourceGroupName The name of the resource group with the deployment to delete. The name * is case insensitive. - * @param deploymentName The name of the deployment to delete. + * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ @@ -564,6 +840,34 @@ export class Deployments { options); } + /** + * Get all the deployments for a management group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAtManagementGroupScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAtManagementGroupScopeNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listAtManagementGroupScopeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAtManagementGroupScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtManagementGroupScopeNextOperationSpec, + callback) as Promise; + } + /** * Get all the deployments for a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -623,6 +927,158 @@ export class Deployments { // Operation Specifications const serializer = new msRest.Serializer(Mappers); +const checkExistenceAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "HEAD", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const cancelAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const validateAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Deployment, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 400: { + bodyMapper: Mappers.DeploymentValidateResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const exportTemplateAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentExportResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/", + urlParameters: [ + Parameters.groupId + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const checkExistenceAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { httpMethod: "HEAD", path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", @@ -933,6 +1389,63 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { serializer }; +const beginDeleteAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.groupId, + Parameters.deploymentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Deployment, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended + }, + 201: { + bodyMapper: Mappers.DeploymentExtended + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const beginDeleteAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", @@ -1049,6 +1562,27 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { serializer }; +const listAtManagementGroupScopeNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const listAtSubscriptionScopeNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", diff --git a/sdk/resources/arm-resources/src/resourceManagementClientContext.ts b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts index 121eb9e6e1c8..31a9fd844814 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 = '2018-05-01'; + this.apiVersion = '2019-05-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";