Class: Azure::Resources::Mgmt::V2018_05_01::Deployments

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-05-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/2018-05-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/2018-05-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.



1933
1934
1935
1936
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1933

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.



1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1976

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::V2018_05_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::V2018_05_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::V2018_05_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(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.



1679
1680
1681
1682
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1679

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.



1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1716

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::V2018_05_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::V2018_05_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::V2018_05_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.



1698
1699
1700
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1698

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_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.



1955
1956
1957
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1955

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 to delete.

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

    A hash of custom headers that



1812
1813
1814
1815
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1812

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 to delete.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1865

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_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 to delete.

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

    A hash of custom headers that



1571
1572
1573
1574
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1571

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 to delete.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1618
1619
1620
1621
1622
1623
1624
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
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1618

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 to delete.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1595
1596
1597
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1595

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_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 to delete.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1839
1840
1841
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1839

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

#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.



1460
1461
1462
1463
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1460

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.



1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
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
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1487

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::V2018_05_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.



1474
1475
1476
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1474

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 to cancel.

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

    A hash of custom headers that



1018
1019
1020
1021
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1018

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 to cancel.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1059

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_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 to cancel.

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

    A hash of custom headers that



307
308
309
310
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 307

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 to cancel.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
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
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 344

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 to cancel.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



326
327
328
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 326

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_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 to cancel.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1039
1040
1041
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1039

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 to check.

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

    A hash of custom headers that

Returns:

  • (Boolean)

    operation results.



764
765
766
767
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 764

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 to check.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 795

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_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 to check.

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

    A hash of custom headers that

Returns:

  • (Boolean)

    operation results.



79
80
81
82
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 79

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 to check.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



106
107
108
109
110
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
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 106

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 to check.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



93
94
95
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 93

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_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 to check.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



780
781
782
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 780

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.



864
865
866
867
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 864

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



882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 882

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::V2018_05_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.



168
169
170
171
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 168

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



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 183

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::V2018_05_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 to delete.

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

    A hash of custom headers that



722
723
724
725
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 722

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 to delete.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 737

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_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 to delete.

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

    A hash of custom headers that



41
42
43
44
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 41

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 to delete.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 54

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

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

Exports the template used for specified deployment.

is case insensitive. the template. 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 from which to get

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

    A hash of custom headers that

Returns:

  • (DeploymentExportResult)

    operation results.



1249
1250
1251
1252
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1249

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. the template. 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 from which to get

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1282

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::V2018_05_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(deployment_name, custom_headers: nil) ⇒ DeploymentExportResult

Exports the template used for specified deployment.

the template. will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment from which to get

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

    A hash of custom headers that

Returns:

  • (DeploymentExportResult)

    operation results.



518
519
520
521
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 518

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.

the template. to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment from which to get

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 547

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::V2018_05_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.

the template. will be added to the HTTP request.

Parameters:

  • deployment_name (String)

    The name of the deployment from which to get

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



533
534
535
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 533

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_with_http_info(resource_group_name, deployment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Exports the template used for specified deployment.

is case insensitive. the template. 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 from which to get

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1266
1267
1268
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1266

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 to get.

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

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



911
912
913
914
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 911

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 to get.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
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
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 942

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::V2018_05_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(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 to get.

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

    A hash of custom headers that

Returns:

  • (DeploymentExtended)

    operation results.



210
211
212
213
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 210

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 to get.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



237
238
239
240
241
242
243
244
245
246
247
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
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 237

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::V2018_05_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 to get.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



224
225
226
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 224

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_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 to get.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



927
928
929
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 927

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_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.



616
617
618
619
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 616

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



2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 2248

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.



649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 649

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::V2018_05_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.



2065
2066
2067
2068
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 2065

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.



2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 2094

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::V2018_05_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.



2080
2081
2082
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 2080

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.



633
634
635
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 633

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_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.



1357
1358
1359
1360
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1357

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



2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 2274

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.



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
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1394

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::V2018_05_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.



2155
2156
2157
2158
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 2155

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.



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/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 2184

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::V2018_05_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.



2170
2171
2172
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 2170

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.



1376
1377
1378
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1376

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.



1123
1124
1125
1126
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1123

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

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.



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
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1158

def 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::V2018_05_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 == 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::V2018_05_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::V2018_05_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

#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.



402
403
404
405
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 402

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

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.



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 433

def 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::V2018_05_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 == 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::V2018_05_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::V2018_05_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

#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.



418
419
420
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 418

def validate_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
  validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
end

#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.



1141
1142
1143
# File 'lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb', line 1141

def validate_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
  validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
end