Class: Azure::Resources::Mgmt::V2019_10_01::Deployments

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb

Overview

Provides operations for working with resources and resource groups.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Deployments

Creates and initializes a new instance of the Deployments class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientResourceManagementClient (readonly)

Returns reference to the ResourceManagementClient.

Returns:



22
23
24
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources to a resource group.

You can provide the template and parameters directly in the request or link to JSON files.

the resources to. The name is case insensitive. The resource group must already exist. operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to deploy

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



5335
5336
5337
5338
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5335

def begin_create_or_update(resource_group_name, deployment_name, parameters, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Deploys resources to a resource group.

You can provide the template and parameters directly in the request or link to JSON files.

the resources to. The name is case insensitive. The resource group must already exist. operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to deploy

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5378

def begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Deployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_at_management_group_scope(group_id, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources at management group scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



4381
4382
4383
4384
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4381

def begin_create_or_update_at_management_group_scope(group_id, deployment_name, parameters, custom_headers:nil)
  response = begin_create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Deploys resources at management group scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4420

def begin_create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'group_id is nil' if group_id.nil?
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ScopedDeployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_at_management_group_scope_with_http_info(group_id, deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deploys resources at management group scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4401
4402
4403
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4401

def begin_create_or_update_at_management_group_scope_with_http_info(group_id, deployment_name, parameters, custom_headers:nil)
  begin_create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_create_or_update_at_scope(scope, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources at a given scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



3555
3556
3557
3558
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3555

def begin_create_or_update_at_scope(scope, deployment_name, parameters, custom_headers:nil)
  response = begin_create_or_update_at_scope_async(scope, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_at_scope_async(scope, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Deploys resources at a given scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3594

def begin_create_or_update_at_scope_async(scope, deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'scope is nil' if scope.nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Deployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      skip_encoding_path_params: {'scope' => scope},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_at_scope_with_http_info(scope, deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deploys resources at a given scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3575
3576
3577
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3575

def begin_create_or_update_at_scope_with_http_info(scope, deployment_name, parameters, custom_headers:nil)
  begin_create_or_update_at_scope_async(scope, deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_create_or_update_at_subscription_scope(deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources at subscription scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



4857
4858
4859
4860
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4857

def begin_create_or_update_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
  response = begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Deploys resources at subscription scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4894

def begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Deployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deploys resources at subscription scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4876
4877
4878
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4876

def begin_create_or_update_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
  begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_create_or_update_at_tenant_scope(deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources at tenant scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



3916
3917
3918
3919
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3916

def begin_create_or_update_at_tenant_scope(deployment_name, parameters, custom_headers:nil)
  response = begin_create_or_update_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_at_tenant_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Deploys resources at tenant scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3953

def begin_create_or_update_at_tenant_scope_async(deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ScopedDeployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_at_tenant_scope_with_http_info(deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deploys resources at tenant scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3935
3936
3937
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3935

def begin_create_or_update_at_tenant_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
  begin_create_or_update_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_create_or_update_with_http_info(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deploys resources to a resource group.

You can provide the template and parameters directly in the request or link to JSON files.

the resources to. The name is case insensitive. The resource group must already exist. operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to deploy

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5357
5358
5359
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5357

def begin_create_or_update_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_delete(resource_group_name, deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. Deleting a template deployment does not affect the state of the resource group. 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.

deployment to delete. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



5214
5215
5216
5217
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5214

def begin_delete(resource_group_name, deployment_name, custom_headers:nil)
  response = begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_async(resource_group_name, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a deployment from the deployment history.

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. Deleting a template deployment does not affect the state of the resource group. 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.

deployment to delete. The name is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5267

def begin_delete_async(resource_group_name, deployment_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_at_management_group_scope(group_id, deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



4268
4269
4270
4271
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4268

def begin_delete_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
  response = begin_delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_at_management_group_scope_async(group_id, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a deployment from the deployment history.

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.

to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4317

def begin_delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
  fail ArgumentError, 'group_id is nil' if group_id.nil?
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4293
4294
4295
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4293

def begin_delete_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
  begin_delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
end

#begin_delete_at_scope(scope, deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



3443
3444
3445
3446
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3443

def begin_delete_at_scope(scope, deployment_name, custom_headers:nil)
  response = begin_delete_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_at_scope_async(scope, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a deployment from the deployment history.

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.

to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3492

def begin_delete_at_scope_async(scope, deployment_name, custom_headers:nil)
  fail ArgumentError, 'scope is nil' if scope.nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      skip_encoding_path_params: {'scope' => scope},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_at_scope_with_http_info(scope, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3468
3469
3470
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3468

def begin_delete_at_scope_with_http_info(scope, deployment_name, custom_headers:nil)
  begin_delete_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
end

#begin_delete_at_subscription_scope(deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



4749
4750
4751
4752
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4749

def begin_delete_at_subscription_scope(deployment_name, custom_headers:nil)
  response = begin_delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_at_subscription_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a deployment from the deployment history.

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.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4796

def begin_delete_at_subscription_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_at_subscription_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4773
4774
4775
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4773

def begin_delete_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
  begin_delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#begin_delete_at_tenant_scope(deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



3809
3810
3811
3812
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3809

def begin_delete_at_tenant_scope(deployment_name, custom_headers:nil)
  response = begin_delete_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_at_tenant_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a deployment from the deployment history.

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.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3856

def begin_delete_at_tenant_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_at_tenant_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3833
3834
3835
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3833

def begin_delete_at_tenant_scope_with_http_info(deployment_name, custom_headers:nil)
  begin_delete_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#begin_delete_with_http_info(resource_group_name, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a deployment from the deployment history.

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. Deleting a template deployment does not affect the state of the resource group. 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.

deployment to delete. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5241
5242
5243
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5241

def begin_delete_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
  begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
end

#begin_validate(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

template will be deployed to. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



5470
5471
5472
5473
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5470

def begin_validate(resource_group_name, deployment_name, parameters, custom_headers:nil)
  response = begin_validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_validate_async(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

template will be deployed to. The name is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5505

def begin_validate_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Deployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202 || status_code == 400
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 400
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_validate_at_management_group_scope(group_id, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



4509
4510
4511
4512
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4509

def begin_validate_at_management_group_scope(group_id, deployment_name, parameters, custom_headers:nil)
  response = begin_validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4542

def begin_validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'group_id is nil' if group_id.nil?
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ScopedDeployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202 || status_code == 400
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 400
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_validate_at_management_group_scope_with_http_info(group_id, deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4526
4527
4528
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4526

def begin_validate_at_management_group_scope_with_http_info(group_id, deployment_name, parameters, custom_headers:nil)
  begin_validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_validate_at_scope(scope, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



3682
3683
3684
3685
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3682

def begin_validate_at_scope(scope, deployment_name, parameters, custom_headers:nil)
  response = begin_validate_at_scope_async(scope, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_validate_at_scope_async(scope, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3715

def begin_validate_at_scope_async(scope, deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'scope is nil' if scope.nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Deployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      skip_encoding_path_params: {'scope' => scope},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202 || status_code == 400
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 400
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_validate_at_scope_with_http_info(scope, deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3699
3700
3701
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3699

def begin_validate_at_scope_with_http_info(scope, deployment_name, parameters, custom_headers:nil)
  begin_validate_at_scope_async(scope, deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_validate_at_subscription_scope(deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



4980
4981
4982
4983
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4980

def begin_validate_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
  response = begin_validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_validate_at_subscription_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5011

def begin_validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Deployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202 || status_code == 400
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 400
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_validate_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4996
4997
4998
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4996

def begin_validate_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
  begin_validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_validate_at_tenant_scope(deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



4038
4039
4040
4041
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4038

def begin_validate_at_tenant_scope(deployment_name, parameters, custom_headers:nil)
  response = begin_validate_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_validate_at_tenant_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4069

def begin_validate_at_tenant_scope_async(deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ScopedDeployment.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Resources/deployments/{deploymentName}/validate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202 || status_code == 400
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 400
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_validate_at_tenant_scope_with_http_info(deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4054
4055
4056
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4054

def begin_validate_at_tenant_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
  begin_validate_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_validate_with_http_info(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

template will be deployed to. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5488
5489
5490
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5488

def begin_validate_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
  begin_validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_what_if(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ WhatIfOperationResult

Returns changes that will be made by the deployment if executed at the scope of the resource group.

template will be deployed to. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (WhatIfOperationResult)

    operation results.



5597
5598
5599
5600
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5597

def begin_what_if(resource_group_name, deployment_name, parameters, custom_headers:nil)
  response = begin_what_if_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_what_if_async(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Returns changes that will be made by the deployment if executed at the scope of the resource group.

template will be deployed to. The name is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to validate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5632

def begin_what_if_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentWhatIf.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::WhatIfOperationResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_what_if_at_management_group_scope(group_id, deployment_name, parameters, custom_headers: nil) ⇒ WhatIfOperationResult

Returns changes that will be made by the deployment if executed at the scope of the management group.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (WhatIfOperationResult)

    operation results.



4631
4632
4633
4634
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4631

def begin_what_if_at_management_group_scope(group_id, deployment_name, parameters, custom_headers:nil)
  response = begin_what_if_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_what_if_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Returns changes that will be made by the deployment if executed at the scope of the management group.

to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4664

def begin_what_if_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'group_id is nil' if group_id.nil?
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ScopedDeploymentWhatIf.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::WhatIfOperationResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_what_if_at_management_group_scope_with_http_info(group_id, deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns changes that will be made by the deployment if executed at the scope of the management group.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4648
4649
4650
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4648

def begin_what_if_at_management_group_scope_with_http_info(group_id, deployment_name, parameters, custom_headers:nil)
  begin_what_if_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_what_if_at_subscription_scope(deployment_name, parameters, custom_headers: nil) ⇒ WhatIfOperationResult

Returns changes that will be made by the deployment if executed at the scope of the subscription.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to What If.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (WhatIfOperationResult)

    operation results.



5097
5098
5099
5100
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5097

def begin_what_if_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
  response = begin_what_if_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_what_if_at_subscription_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Returns changes that will be made by the deployment if executed at the scope of the subscription.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to What If.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5128

def begin_what_if_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentWhatIf.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::WhatIfOperationResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_what_if_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns changes that will be made by the deployment if executed at the scope of the subscription.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to What If.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5113
5114
5115
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5113

def begin_what_if_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
  begin_what_if_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_what_if_at_tenant_scope(deployment_name, parameters, custom_headers: nil) ⇒ WhatIfOperationResult

Returns changes that will be made by the deployment if executed at the scope of the tenant group.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (WhatIfOperationResult)

    operation results.



4154
4155
4156
4157
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4154

def begin_what_if_at_tenant_scope(deployment_name, parameters, custom_headers:nil)
  response = begin_what_if_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_what_if_at_tenant_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Returns changes that will be made by the deployment if executed at the scope of the tenant group.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4185

def begin_what_if_at_tenant_scope_async(deployment_name, parameters, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ScopedDeploymentWhatIf.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::WhatIfOperationResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_what_if_at_tenant_scope_with_http_info(deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns changes that will be made by the deployment if executed at the scope of the tenant group.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4170
4171
4172
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 4170

def begin_what_if_at_tenant_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
  begin_what_if_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
end

#begin_what_if_with_http_info(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns changes that will be made by the deployment if executed at the scope of the resource group.

template will be deployed to. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5615
5616
5617
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5615

def begin_what_if_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
  begin_what_if_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
end

#calculate_template_hash(template, custom_headers: nil) ⇒ TemplateHashResult

Calculate the hash of the given template.

will be added to the HTTP request.

Parameters:

  • template

    The template provided to calculate hash.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (TemplateHashResult)

    operation results.



3331
3332
3333
3334
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3331

def calculate_template_hash(template, custom_headers:nil)
  response = calculate_template_hash_async(template, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#calculate_template_hash_async(template, custom_headers: nil) ⇒ Concurrent::Promise

Calculate the hash of the given template.

to the HTTP request.

Parameters:

  • template

    The template provided to calculate hash.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3358

def calculate_template_hash_async(template, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'template is nil' if template.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = {
    client_side_validation: true,
    required: true,
    serialized_name: 'template',
    type: {
      name: 'Object'
    }
  }
  request_content = @client.serialize(request_mapper,  template)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Resources/calculateTemplateHash'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::TemplateHashResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#calculate_template_hash_with_http_info(template, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Calculate the hash of the given template.

will be added to the HTTP request.

Parameters:

  • template

    The template provided to calculate hash.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3345
3346
3347
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3345

def calculate_template_hash_with_http_info(template, custom_headers:nil)
  calculate_template_hash_async(template, custom_headers:custom_headers).value!
end

#cancel(resource_group_name, deployment_name, custom_headers: nil) ⇒ Object

Cancels a currently running template deployment.

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 resource group partially deployed.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



2925
2926
2927
2928
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2925

def cancel(resource_group_name, deployment_name, custom_headers:nil)
  response = cancel_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
  nil
end

#cancel_async(resource_group_name, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Cancels a currently running template deployment.

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 resource group partially deployed.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2966

def cancel_async(resource_group_name, deployment_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#cancel_at_management_group_scope(group_id, deployment_name, custom_headers: nil) ⇒ Object

Cancels a currently running template deployment.

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.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1586
1587
1588
1589
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1586

def cancel_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
  response = cancel_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
  nil
end

#cancel_at_management_group_scope_async(group_id, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Cancels a currently running template deployment.

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.

to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1625

def cancel_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
  fail ArgumentError, 'group_id is nil' if group_id.nil?
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#cancel_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Cancels a currently running template deployment.

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.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1606
1607
1608
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1606

def cancel_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
  cancel_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
end

#cancel_at_scope(scope, deployment_name, custom_headers: nil) ⇒ Object

Cancels a currently running template deployment.

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.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



320
321
322
323
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 320

def cancel_at_scope(scope, deployment_name, custom_headers:nil)
  response = cancel_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
  nil
end

#cancel_at_scope_async(scope, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Cancels a currently running template deployment.

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.

to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 359

def cancel_at_scope_async(scope, deployment_name, custom_headers:nil)
  fail ArgumentError, 'scope is nil' if scope.nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      skip_encoding_path_params: {'scope' => scope},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#cancel_at_scope_with_http_info(scope, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Cancels a currently running template deployment.

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.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



340
341
342
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 340

def cancel_at_scope_with_http_info(scope, deployment_name, custom_headers:nil)
  cancel_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
end

#cancel_at_subscription_scope(deployment_name, custom_headers: nil) ⇒ Object

Cancels a currently running template deployment.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



2248
2249
2250
2251
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2248

def cancel_at_subscription_scope(deployment_name, custom_headers:nil)
  response = cancel_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
  nil
end

#cancel_at_subscription_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Cancels a currently running template deployment.

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.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2285

def cancel_at_subscription_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#cancel_at_subscription_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Cancels a currently running template deployment.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2267
2268
2269
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2267

def cancel_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
  cancel_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#cancel_at_tenant_scope(deployment_name, custom_headers: nil) ⇒ Object

Cancels a currently running template deployment.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



931
932
933
934
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 931

def cancel_at_tenant_scope(deployment_name, custom_headers:nil)
  response = cancel_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
  nil
end

#cancel_at_tenant_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Cancels a currently running template deployment.

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.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 968

def cancel_at_tenant_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Resources/deployments/{deploymentName}/cancel'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#cancel_at_tenant_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Cancels a currently running template deployment.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



950
951
952
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 950

def cancel_at_tenant_scope_with_http_info(deployment_name, custom_headers:nil)
  cancel_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#cancel_with_http_info(resource_group_name, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Cancels a currently running template deployment.

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 resource group partially deployed.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2946
2947
2948
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2946

def cancel_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
  cancel_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
end

#check_existence(resource_group_name, deployment_name, custom_headers: nil) ⇒ Boolean

Checks whether the deployment exists.

deployment to check. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Boolean)

    operation results.



2671
2672
2673
2674
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2671

def check_existence(resource_group_name, deployment_name, custom_headers:nil)
  response = check_existence_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_existence_async(resource_group_name, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Checks whether the deployment exists.

deployment to check. The name is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2702

def check_existence_async(resource_group_name, deployment_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:head, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.body = (status_code == 204)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#check_existence_at_management_group_scope(group_id, deployment_name, custom_headers: nil) ⇒ Boolean

Checks whether the deployment exists.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Boolean)

    operation results.



1346
1347
1348
1349
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1346

def check_existence_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
  response = check_existence_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_existence_at_management_group_scope_async(group_id, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Checks whether the deployment exists.

to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1375

def check_existence_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
  fail ArgumentError, 'group_id is nil' if group_id.nil?
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:head, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.body = (status_code == 204)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#check_existence_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks whether the deployment exists.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1361
1362
1363
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1361

def check_existence_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
  check_existence_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
end

#check_existence_at_scope(scope, deployment_name, custom_headers: nil) ⇒ Boolean

Checks whether the deployment exists.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Boolean)

    operation results.



82
83
84
85
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 82

def check_existence_at_scope(scope, deployment_name, custom_headers:nil)
  response = check_existence_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_existence_at_scope_async(scope, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Checks whether the deployment exists.

to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 111

def check_existence_at_scope_async(scope, deployment_name, custom_headers:nil)
  fail ArgumentError, 'scope is nil' if scope.nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      skip_encoding_path_params: {'scope' => scope},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:head, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.body = (status_code == 204)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#check_existence_at_scope_with_http_info(scope, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks whether the deployment exists.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



97
98
99
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 97

def check_existence_at_scope_with_http_info(scope, deployment_name, custom_headers:nil)
  check_existence_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
end

#check_existence_at_subscription_scope(deployment_name, custom_headers: nil) ⇒ Boolean

Checks whether the deployment exists.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Boolean)

    operation results.



2020
2021
2022
2023
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2020

def check_existence_at_subscription_scope(deployment_name, custom_headers:nil)
  response = check_existence_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_existence_at_subscription_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Checks whether the deployment exists.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2047

def check_existence_at_subscription_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:head, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.body = (status_code == 204)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#check_existence_at_subscription_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks whether the deployment exists.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2034
2035
2036
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2034

def check_existence_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
  check_existence_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#check_existence_at_tenant_scope(deployment_name, custom_headers: nil) ⇒ Boolean

Checks whether the deployment exists.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Boolean)

    operation results.



705
706
707
708
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 705

def check_existence_at_tenant_scope(deployment_name, custom_headers:nil)
  response = check_existence_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_existence_at_tenant_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Checks whether the deployment exists.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 732

def check_existence_at_tenant_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:head, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.body = (status_code == 204)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#check_existence_at_tenant_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks whether the deployment exists.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



719
720
721
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 719

def check_existence_at_tenant_scope_with_http_info(deployment_name, custom_headers:nil)
  check_existence_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#check_existence_with_http_info(resource_group_name, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks whether the deployment exists.

deployment to check. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2687
2688
2689
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2687

def check_existence_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
  check_existence_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources to a resource group.

You can provide the template and parameters directly in the request or link to JSON files.

the resources to. The name is case insensitive. The resource group must already exist. operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to deploy

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



2771
2772
2773
2774
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2771

def create_or_update(resource_group_name, deployment_name, parameters, custom_headers:nil)
  response = create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

the resources to. The name is case insensitive. The resource group must already exist. operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group to deploy

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2789

def create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#create_or_update_at_management_group_scope(group_id, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources at management group scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



1440
1441
1442
1443
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1440

def create_or_update_at_management_group_scope(group_id, deployment_name, parameters, custom_headers:nil)
  response = create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

operation. will be added to the HTTP request.

response.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1456

def create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#create_or_update_at_scope(scope, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources at a given scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



175
176
177
178
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 175

def create_or_update_at_scope(scope, deployment_name, parameters, custom_headers:nil)
  response = create_or_update_at_scope_async(scope, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_at_scope_async(scope, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

operation. will be added to the HTTP request.

response.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 191

def create_or_update_at_scope_async(scope, deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_at_scope_async(scope, deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#create_or_update_at_subscription_scope(deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources at subscription scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



2109
2110
2111
2112
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2109

def create_or_update_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
  response = create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

operation. will be added to the HTTP request.

response.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2124

def create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#create_or_update_at_tenant_scope(deployment_name, parameters, custom_headers: nil) ⇒ DeploymentExtended

Deploys resources at tenant scope.

You can provide the template and parameters directly in the request or link to JSON files.

operation. will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



793
794
795
796
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 793

def create_or_update_at_tenant_scope(deployment_name, parameters, custom_headers:nil)
  response = create_or_update_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_at_tenant_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

operation. will be added to the HTTP request.

response.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Additional parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 808

def create_or_update_at_tenant_scope_async(deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete(resource_group_name, deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. Deleting a template deployment does not affect the state of the resource group. 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.

deployment to delete. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



2629
2630
2631
2632
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2629

def delete(resource_group_name, deployment_name, custom_headers:nil)
  response = delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

deployment to delete. The name is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2644

def delete_async(resource_group_name, deployment_name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete_at_management_group_scope(group_id, deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1306
1307
1308
1309
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1306

def delete_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
  response = delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
  nil
end

#delete_at_management_group_scope_async(group_id, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1320

def delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
  # Send request
  promise = begin_delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete_at_scope(scope, deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



42
43
44
45
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 42

def delete_at_scope(scope, deployment_name, custom_headers:nil)
  response = delete_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
  nil
end

#delete_at_scope_async(scope, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 56

def delete_at_scope_async(scope, deployment_name, custom_headers:nil)
  # Send request
  promise = begin_delete_at_scope_async(scope, deployment_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete_at_subscription_scope(deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1982
1983
1984
1985
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1982

def delete_at_subscription_scope(deployment_name, custom_headers:nil)
  response = delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
  nil
end

#delete_at_subscription_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1995

def delete_at_subscription_scope_async(deployment_name, custom_headers:nil)
  # Send request
  promise = begin_delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete_at_tenant_scope(deployment_name, custom_headers: nil) ⇒ Object

Deletes a deployment from the deployment history.

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.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



667
668
669
670
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 667

def delete_at_tenant_scope(deployment_name, custom_headers:nil)
  response = delete_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
  nil
end

#delete_at_tenant_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 680

def delete_at_tenant_scope_async(deployment_name, custom_headers:nil)
  # Send request
  promise = begin_delete_at_tenant_scope_async(deployment_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#export_template(resource_group_name, deployment_name, custom_headers: nil) ⇒ DeploymentExportResult

Exports the template used for specified deployment.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExportResult)

    operation results.



3122
3123
3124
3125
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3122

def export_template(resource_group_name, deployment_name, custom_headers:nil)
  response = export_template_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#export_template_async(resource_group_name, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Exports the template used for specified deployment.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3153

def export_template_async(resource_group_name, deployment_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExportResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#export_template_at_management_group_scope(group_id, deployment_name, custom_headers: nil) ⇒ DeploymentExportResult

Exports the template used for specified deployment.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExportResult)

    operation results.



1774
1775
1776
1777
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1774

def export_template_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
  response = export_template_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#export_template_at_management_group_scope_async(group_id, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Exports the template used for specified deployment.

to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1803

def export_template_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
  fail ArgumentError, 'group_id is nil' if group_id.nil?
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExportResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#export_template_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Exports the template used for specified deployment.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1789
1790
1791
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1789

def export_template_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
  export_template_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
end

#export_template_at_scope(scope, deployment_name, custom_headers: nil) ⇒ DeploymentExportResult

Exports the template used for specified deployment.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExportResult)

    operation results.



462
463
464
465
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 462

def export_template_at_scope(scope, deployment_name, custom_headers:nil)
  response = export_template_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#export_template_at_scope_async(scope, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Exports the template used for specified deployment.

to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 491

def export_template_at_scope_async(scope, deployment_name, custom_headers:nil)
  fail ArgumentError, 'scope is nil' if scope.nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      skip_encoding_path_params: {'scope' => scope},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExportResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#export_template_at_scope_with_http_info(scope, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Exports the template used for specified deployment.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



477
478
479
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 477

def export_template_at_scope_with_http_info(scope, deployment_name, custom_headers:nil)
  export_template_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
end

#export_template_at_subscription_scope(deployment_name, custom_headers: nil) ⇒ DeploymentExportResult

Exports the template used for specified deployment.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExportResult)

    operation results.



2427
2428
2429
2430
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2427

def export_template_at_subscription_scope(deployment_name, custom_headers:nil)
  response = export_template_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#export_template_at_subscription_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Exports the template used for specified deployment.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2454

def export_template_at_subscription_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExportResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#export_template_at_subscription_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Exports the template used for specified deployment.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2441
2442
2443
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2441

def export_template_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
  export_template_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#export_template_at_tenant_scope(deployment_name, custom_headers: nil) ⇒ DeploymentExportResult

Exports the template used for specified deployment.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExportResult)

    operation results.



1109
1110
1111
1112
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1109

def export_template_at_tenant_scope(deployment_name, custom_headers:nil)
  response = export_template_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#export_template_at_tenant_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Exports the template used for specified deployment.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1136

def export_template_at_tenant_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExportResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#export_template_at_tenant_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Exports the template used for specified deployment.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1123
1124
1125
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1123

def export_template_at_tenant_scope_with_http_info(deployment_name, custom_headers:nil)
  export_template_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#export_template_with_http_info(resource_group_name, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Exports the template used for specified deployment.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3138
3139
3140
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3138

def export_template_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
  export_template_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
end

#get(resource_group_name, deployment_name, custom_headers: nil) ⇒ DeploymentExtended

Gets a deployment.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



2818
2819
2820
2821
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2818

def get(resource_group_name, deployment_name, custom_headers:nil)
  response = get_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets a deployment.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2849

def get_async(resource_group_name, deployment_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_at_management_group_scope(group_id, deployment_name, custom_headers: nil) ⇒ DeploymentExtended

Gets a deployment.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



1484
1485
1486
1487
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1484

def get_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
  response = get_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_at_management_group_scope_async(group_id, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets a deployment.

to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1513

def get_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
  fail ArgumentError, 'group_id is nil' if group_id.nil?
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a deployment.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1499
1500
1501
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1499

def get_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
  get_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
end

#get_at_scope(scope, deployment_name, custom_headers: nil) ⇒ DeploymentExtended

Gets a deployment.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



219
220
221
222
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 219

def get_at_scope(scope, deployment_name, custom_headers:nil)
  response = get_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_at_scope_async(scope, deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets a deployment.

to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 248

def get_at_scope_async(scope, deployment_name, custom_headers:nil)
  fail ArgumentError, 'scope is nil' if scope.nil?
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      skip_encoding_path_params: {'scope' => scope},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_at_scope_with_http_info(scope, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a deployment.

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



234
235
236
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 234

def get_at_scope_with_http_info(scope, deployment_name, custom_headers:nil)
  get_at_scope_async(scope, deployment_name, custom_headers:custom_headers).value!
end

#get_at_subscription_scope(deployment_name, custom_headers: nil) ⇒ DeploymentExtended

Gets a deployment.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



2151
2152
2153
2154
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2151

def get_at_subscription_scope(deployment_name, custom_headers:nil)
  response = get_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_at_subscription_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets a deployment.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2178

def get_at_subscription_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_at_subscription_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a deployment.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2165
2166
2167
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2165

def get_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
  get_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#get_at_tenant_scope(deployment_name, custom_headers: nil) ⇒ DeploymentExtended

Gets a deployment.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



835
836
837
838
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 835

def get_at_tenant_scope(deployment_name, custom_headers:nil)
  response = get_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_at_tenant_scope_async(deployment_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets a deployment.

to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 862

def get_at_tenant_scope_async(deployment_name, custom_headers:nil)
  fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
  fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Resources/deployments/{deploymentName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'deploymentName' => deployment_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentExtended.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_at_tenant_scope_with_http_info(deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a deployment.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



849
850
851
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 849

def get_at_tenant_scope_with_http_info(deployment_name, custom_headers:nil)
  get_at_tenant_scope_async(deployment_name, custom_headers:custom_headers).value!
end

#get_with_http_info(resource_group_name, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a deployment.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • deployment_name (String)

    The name of the deployment.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2834
2835
2836
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2834

def get_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
  get_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
end

#list_at_management_group_scope(group_id, filter: nil, top: nil, custom_headers: nil) ⇒ Array<DeploymentExtended>

Get all the deployments for a management group.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<DeploymentExtended>)

    operation results.



1875
1876
1877
1878
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1875

def list_at_management_group_scope(group_id, filter:nil, top:nil, custom_headers:nil)
  first_page = list_at_management_group_scope_as_lazy(group_id, filter:filter, top:top, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_at_management_group_scope_as_lazy(group_id, filter: nil, top: nil, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments for a management group.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

response.

Parameters:

  • group_id (String)

    The management group ID.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    which provide lazy access to pages of the



6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 6214

def list_at_management_group_scope_as_lazy(group_id, filter:nil, top:nil, custom_headers:nil)
  response = list_at_management_group_scope_async(group_id, filter:filter, top:top, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_at_management_group_scope_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_at_management_group_scope_async(group_id, filter: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments for a management group.

can use $filter=provisioningState eq ‘state’. all deployments. to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1910

def list_at_management_group_scope_async(group_id, filter:nil, top:nil, custom_headers:nil)
  fail ArgumentError, 'group_id is nil' if group_id.nil?
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
  fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'groupId' => group_id},
      query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_at_management_group_scope_next(next_page_link, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments for a management group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    operation results.



5891
5892
5893
5894
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5891

def list_at_management_group_scope_next(next_page_link, custom_headers:nil)
  response = list_at_management_group_scope_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_at_management_group_scope_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments for a management group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5920

def list_at_management_group_scope_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_at_management_group_scope_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments for a management group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5906
5907
5908
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5906

def list_at_management_group_scope_next_with_http_info(next_page_link, custom_headers:nil)
  list_at_management_group_scope_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_at_management_group_scope_with_http_info(group_id, filter: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments for a management group.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1893
1894
1895
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1893

def list_at_management_group_scope_with_http_info(group_id, filter:nil, top:nil, custom_headers:nil)
  list_at_management_group_scope_async(group_id, filter:filter, top:top, custom_headers:custom_headers).value!
end

#list_at_scope(scope, filter: nil, top: nil, custom_headers: nil) ⇒ Array<DeploymentExtended>

Get all the deployments at the given scope.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<DeploymentExtended>)

    operation results.



562
563
564
565
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 562

def list_at_scope(scope, filter:nil, top:nil, custom_headers:nil)
  first_page = list_at_scope_as_lazy(scope, filter:filter, top:top, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_at_scope_as_lazy(scope, filter: nil, top: nil, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments at the given scope.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

response.

Parameters:

  • scope (String)

    The resource scope.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    which provide lazy access to pages of the



6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 6165

def list_at_scope_as_lazy(scope, filter:nil, top:nil, custom_headers:nil)
  response = list_at_scope_async(scope, filter:filter, top:top, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_at_scope_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_at_scope_async(scope, filter: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments at the given scope.

can use $filter=provisioningState eq ‘state’. all deployments. to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 597

def list_at_scope_async(scope, filter:nil, top:nil, custom_headers:nil)
  fail ArgumentError, 'scope is nil' if scope.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{scope}/providers/Microsoft.Resources/deployments/'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'scope' => scope},
      query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_at_scope_next(next_page_link, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments at the given scope.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    operation results.



5711
5712
5713
5714
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5711

def list_at_scope_next(next_page_link, custom_headers:nil)
  response = list_at_scope_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_at_scope_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments at the given scope.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5740

def list_at_scope_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_at_scope_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments at the given scope.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5726
5727
5728
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5726

def list_at_scope_next_with_http_info(next_page_link, custom_headers:nil)
  list_at_scope_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_at_scope_with_http_info(scope, filter: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments at the given scope.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



580
581
582
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 580

def list_at_scope_with_http_info(scope, filter:nil, top:nil, custom_headers:nil)
  list_at_scope_async(scope, filter:filter, top:top, custom_headers:custom_headers).value!
end

#list_at_subscription_scope(filter: nil, top: nil, custom_headers: nil) ⇒ Array<DeploymentExtended>

Get all the deployments for a subscription.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<DeploymentExtended>)

    operation results.



2523
2524
2525
2526
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2523

def list_at_subscription_scope(filter:nil, top:nil, custom_headers:nil)
  first_page = list_at_subscription_scope_as_lazy(filter:filter, top:top, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_at_subscription_scope_as_lazy(filter: nil, top: nil, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments for a subscription.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

response.

Parameters:

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    which provide lazy access to pages of the



6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 6238

def list_at_subscription_scope_as_lazy(filter:nil, top:nil, custom_headers:nil)
  response = list_at_subscription_scope_async(filter:filter, top:top, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_at_subscription_scope_async(filter: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments for a subscription.

can use $filter=provisioningState eq ‘state’. all deployments. to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2556

def list_at_subscription_scope_async(filter:nil, top:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_at_subscription_scope_next(next_page_link, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments for a subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    operation results.



5981
5982
5983
5984
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5981

def list_at_subscription_scope_next(next_page_link, custom_headers:nil)
  response = list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_at_subscription_scope_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments for a subscription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 6010

def list_at_subscription_scope_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_at_subscription_scope_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments for a subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5996
5997
5998
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5996

def list_at_subscription_scope_next_with_http_info(next_page_link, custom_headers:nil)
  list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_at_subscription_scope_with_http_info(filter: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments for a subscription.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2540
2541
2542
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2540

def list_at_subscription_scope_with_http_info(filter:nil, top:nil, custom_headers:nil)
  list_at_subscription_scope_async(filter:filter, top:top, custom_headers:custom_headers).value!
end

#list_at_tenant_scope(filter: nil, top: nil, custom_headers: nil) ⇒ Array<DeploymentExtended>

Get all the deployments at the tenant scope.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<DeploymentExtended>)

    operation results.



1204
1205
1206
1207
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1204

def list_at_tenant_scope(filter:nil, top:nil, custom_headers:nil)
  first_page = list_at_tenant_scope_as_lazy(filter:filter, top:top, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_at_tenant_scope_as_lazy(filter: nil, top: nil, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments at the tenant scope.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

response.

Parameters:

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    which provide lazy access to pages of the



6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 6189

def list_at_tenant_scope_as_lazy(filter:nil, top:nil, custom_headers:nil)
  response = list_at_tenant_scope_async(filter:filter, top:top, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_at_tenant_scope_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_at_tenant_scope_async(filter: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments at the tenant scope.

can use $filter=provisioningState eq ‘state’. all deployments. to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1237

def list_at_tenant_scope_async(filter:nil, top:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'providers/Microsoft.Resources/deployments/'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_at_tenant_scope_next(next_page_link, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments at the tenant scope.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    operation results.



5801
5802
5803
5804
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5801

def list_at_tenant_scope_next(next_page_link, custom_headers:nil)
  response = list_at_tenant_scope_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_at_tenant_scope_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments at the tenant scope.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5830

def list_at_tenant_scope_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_at_tenant_scope_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments at the tenant scope.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5816
5817
5818
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 5816

def list_at_tenant_scope_next_with_http_info(next_page_link, custom_headers:nil)
  list_at_tenant_scope_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_at_tenant_scope_with_http_info(filter: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments at the tenant scope.

can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1221
1222
1223
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1221

def list_at_tenant_scope_with_http_info(filter:nil, top:nil, custom_headers:nil)
  list_at_tenant_scope_async(filter:filter, top:top, custom_headers:custom_headers).value!
end

#list_by_resource_group(resource_group_name, filter: nil, top: nil, custom_headers: nil) ⇒ Array<DeploymentExtended>

Get all the deployments for a resource group.

deployments to get. The name is case insensitive. can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<DeploymentExtended>)

    operation results.



3228
3229
3230
3231
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3228

def list_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, filter: nil, top: nil, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments for a resource group.

deployments to get. The name is case insensitive. can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    which provide lazy access to pages of the



6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 6264

def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, filter: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments for a resource group.

deployments to get. The name is case insensitive. can use $filter=provisioningState eq ‘state’. all deployments. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3265

def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ DeploymentListResult

Get all the deployments for a resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentListResult)

    operation results.



6071
6072
6073
6074
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 6071

def list_by_resource_group_next(next_page_link, custom_headers:nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all the deployments for a resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 6100

def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments for a resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6086
6087
6088
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 6086

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, filter: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the deployments for a resource group.

deployments to get. The name is case insensitive. can use $filter=provisioningState eq ‘state’. all deployments. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group with the

  • filter (String) (defaults to: nil)

    The filter to apply on the operation. For example, you

  • top (Integer) (defaults to: nil)

    The number of results to get. If null is passed, returns

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3247
3248
3249
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3247

def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
end

#validate(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

template will be deployed to. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



3030
3031
3032
3033
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3030

def validate(resource_group_name, deployment_name, parameters, custom_headers:nil)
  response = validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#validate_async(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

template will be deployed to. The name is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3046

def validate_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#validate_at_management_group_scope(group_id, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



1686
1687
1688
1689
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1686

def validate_at_management_group_scope(group_id, deployment_name, parameters, custom_headers:nil)
  response = validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1701

def validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#validate_at_scope(scope, deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



419
420
421
422
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 419

def validate_at_scope(scope, deployment_name, parameters, custom_headers:nil)
  response = validate_at_scope_async(scope, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#validate_at_scope_async(scope, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • scope (String)

    The resource scope.

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 434

def validate_at_scope_async(scope, deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_validate_at_scope_async(scope, deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#validate_at_subscription_scope(deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



2343
2344
2345
2346
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2343

def validate_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
  response = validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#validate_at_subscription_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (Deployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2357

def validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#validate_at_tenant_scope(deployment_name, parameters, custom_headers: nil) ⇒ DeploymentValidateResult

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DeploymentValidateResult)

    operation results.



1025
1026
1027
1028
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1025

def validate_at_tenant_scope(deployment_name, parameters, custom_headers:nil)
  response = validate_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#validate_at_tenant_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeployment)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1039

def validate_at_tenant_scope_async(deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_validate_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::DeploymentValidateResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#what_if(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ WhatIfOperationResult

Returns changes that will be made by the deployment if executed at the scope of the resource group.

template will be deployed to. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (WhatIfOperationResult)

    operation results.



3077
3078
3079
3080
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3077

def what_if(resource_group_name, deployment_name, parameters, custom_headers:nil)
  response = what_if_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#what_if_async(resource_group_name, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

template will be deployed to. The name is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group the

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 3093

def what_if_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_what_if_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::WhatIfOperationResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
  end

  promise
end

#what_if_at_management_group_scope(group_id, deployment_name, parameters, custom_headers: nil) ⇒ WhatIfOperationResult

Returns changes that will be made by the deployment if executed at the scope of the management group.

will be added to the HTTP request.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (WhatIfOperationResult)

    operation results.



1731
1732
1733
1734
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1731

def what_if_at_management_group_scope(group_id, deployment_name, parameters, custom_headers:nil)
  response = what_if_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#what_if_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • group_id (String)

    The management group ID.

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1746

def what_if_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_what_if_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::WhatIfOperationResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
  end

  promise
end

#what_if_at_subscription_scope(deployment_name, parameters, custom_headers: nil) ⇒ WhatIfOperationResult

Returns changes that will be made by the deployment if executed at the scope of the subscription.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to What If.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (WhatIfOperationResult)

    operation results.



2386
2387
2388
2389
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2386

def what_if_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
  response = what_if_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#what_if_at_subscription_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (DeploymentWhatIf)

    Parameters to What If.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 2400

def what_if_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_what_if_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::WhatIfOperationResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
  end

  promise
end

#what_if_at_tenant_scope(deployment_name, parameters, custom_headers: nil) ⇒ WhatIfOperationResult

Returns changes that will be made by the deployment if executed at the scope of the tenant group.

will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (WhatIfOperationResult)

    operation results.



1068
1069
1070
1071
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1068

def what_if_at_tenant_scope(deployment_name, parameters, custom_headers:nil)
  response = what_if_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#what_if_at_tenant_scope_async(deployment_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • deployment_name (String)

    The name of the deployment.

  • parameters (ScopedDeploymentWhatIf)

    Parameters to validate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
# File 'lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb', line 1082

def what_if_at_tenant_scope_async(deployment_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_what_if_at_tenant_scope_async(deployment_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::WhatIfOperationResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
  end

  promise
end