azure_mgmt_deployment_manager 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager.rb +70 -0
  4. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/artifact_sources.rb +339 -0
  5. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/azure_deployment_manager.rb +157 -0
  6. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/artifact_source.rb +130 -0
  7. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/artifact_source_properties_model.rb +79 -0
  8. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/authentication.rb +46 -0
  9. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/azure_entity_resource.rb +75 -0
  10. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/cloud_error_body.rb +90 -0
  11. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/deployment_mode.rb +16 -0
  12. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/identity.rb +65 -0
  13. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/message.rb +59 -0
  14. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/operation.rb +80 -0
  15. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/operation_detail.rb +80 -0
  16. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/pre_post_step.rb +46 -0
  17. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/proxy_resource.rb +63 -0
  18. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/resource.rb +83 -0
  19. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/resource_operation.rb +111 -0
  20. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/rollout.rb +214 -0
  21. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/rollout_operation_info.rb +102 -0
  22. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/rollout_properties_model.rb +95 -0
  23. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/rollout_request.rb +154 -0
  24. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/rollout_step.rb +127 -0
  25. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/sas_authentication.rb +64 -0
  26. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/service.rb +83 -0
  27. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/service_properties.rb +59 -0
  28. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/service_resource.rb +110 -0
  29. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/service_topology_properties.rb +47 -0
  30. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/service_topology_resource.rb +98 -0
  31. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/service_unit.rb +92 -0
  32. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/service_unit_artifacts.rb +83 -0
  33. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/service_unit_properties.rb +73 -0
  34. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/service_unit_resource.rb +124 -0
  35. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/step.rb +121 -0
  36. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/step_operation_info.rb +109 -0
  37. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/step_properties.rb +46 -0
  38. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/step_resource.rb +100 -0
  39. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/tracked_resource.rb +92 -0
  40. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/wait_step_attributes.rb +47 -0
  41. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/models/wait_step_properties.rb +62 -0
  42. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/module_definition.rb +9 -0
  43. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/operations.rb +130 -0
  44. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb +626 -0
  45. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/service_topologies.rb +340 -0
  46. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/service_units.rb +419 -0
  47. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/services.rb +346 -0
  48. data/lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/steps.rb +333 -0
  49. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager.rb +84 -0
  50. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/artifact_sources.rb +451 -0
  51. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/azure_deployment_manager.rb +157 -0
  52. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/api_key_authentication.rb +86 -0
  53. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/artifact_source.rb +130 -0
  54. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/artifact_source_properties_model.rb +79 -0
  55. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/authentication.rb +46 -0
  56. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/azure_entity_resource.rb +75 -0
  57. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/cloud_error_body.rb +90 -0
  58. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/deployment_mode.rb +16 -0
  59. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/health_check_step_attributes.rb +86 -0
  60. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/health_check_step_properties.rb +64 -0
  61. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/identity.rb +65 -0
  62. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/message.rb +59 -0
  63. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/operation.rb +80 -0
  64. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/operation_detail.rb +80 -0
  65. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/operations_list.rb +47 -0
  66. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/pre_post_step.rb +46 -0
  67. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/proxy_resource.rb +63 -0
  68. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/resource.rb +83 -0
  69. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/resource_operation.rb +111 -0
  70. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rest_auth_location.rb +16 -0
  71. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rest_health_check.rb +72 -0
  72. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rest_health_check_step_attributes.rb +95 -0
  73. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rest_match_quantifier.rb +16 -0
  74. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rest_request.rb +74 -0
  75. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rest_request_authentication.rb +48 -0
  76. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rest_request_method.rb +16 -0
  77. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rest_response.rb +70 -0
  78. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rest_response_regex.rb +68 -0
  79. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rollout.rb +214 -0
  80. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rollout_identity_authentication.rb +51 -0
  81. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rollout_operation_info.rb +102 -0
  82. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rollout_properties_model.rb +95 -0
  83. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rollout_request.rb +154 -0
  84. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/rollout_step.rb +127 -0
  85. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/sas_authentication.rb +64 -0
  86. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/service.rb +83 -0
  87. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/service_properties.rb +59 -0
  88. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/service_resource.rb +110 -0
  89. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/service_topology_properties.rb +47 -0
  90. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/service_topology_resource.rb +98 -0
  91. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/service_unit.rb +92 -0
  92. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/service_unit_artifacts.rb +83 -0
  93. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/service_unit_properties.rb +73 -0
  94. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/service_unit_resource.rb +124 -0
  95. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/step_group.rb +121 -0
  96. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/step_operation_info.rb +109 -0
  97. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/step_properties.rb +47 -0
  98. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/step_resource.rb +100 -0
  99. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/tracked_resource.rb +92 -0
  100. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/wait_step_attributes.rb +47 -0
  101. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/models/wait_step_properties.rb +62 -0
  102. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/module_definition.rb +9 -0
  103. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/operations.rb +112 -0
  104. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb +738 -0
  105. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/service_topologies.rb +452 -0
  106. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/service_units.rb +539 -0
  107. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/services.rb +462 -0
  108. data/lib/2019-11-01-preview/generated/azure_mgmt_deployment_manager/steps.rb +445 -0
  109. data/lib/azure_mgmt_deployment_manager.rb +7 -0
  110. data/lib/module_definition.rb +7 -0
  111. data/lib/profiles/latest/deploymentmanager_latest_profile_client.rb +40 -0
  112. data/lib/profiles/latest/deploymentmanager_module_definition.rb +8 -0
  113. data/lib/profiles/latest/modules/deploymentmanager_profile_module.rb +273 -0
  114. data/lib/version.rb +7 -0
  115. metadata +230 -0
@@ -0,0 +1,47 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::DeploymentManager::Mgmt::V2018_09_01_preview
7
+ module Models
8
+ #
9
+ # The parameters for the wait step.
10
+ #
11
+ class WaitStepAttributes
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The duration in ISO 8601 format of how long the wait
16
+ # should be.
17
+ attr_accessor :duration
18
+
19
+
20
+ #
21
+ # Mapper for WaitStepAttributes class as Ruby Hash.
22
+ # This will be used for serialization/deserialization.
23
+ #
24
+ def self.mapper()
25
+ {
26
+ client_side_validation: true,
27
+ required: false,
28
+ serialized_name: 'WaitStepAttributes',
29
+ type: {
30
+ name: 'Composite',
31
+ class_name: 'WaitStepAttributes',
32
+ model_properties: {
33
+ duration: {
34
+ client_side_validation: true,
35
+ required: true,
36
+ serialized_name: 'duration',
37
+ type: {
38
+ name: 'String'
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,62 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::DeploymentManager::Mgmt::V2018_09_01_preview
7
+ module Models
8
+ #
9
+ # Defines the properties of a Wait step.
10
+ #
11
+ class WaitStepProperties < StepProperties
12
+
13
+ include MsRestAzure
14
+
15
+
16
+ def initialize
17
+ @stepType = "Wait"
18
+ end
19
+
20
+ attr_accessor :stepType
21
+
22
+ # @return [WaitStepAttributes] The Wait attributes
23
+ attr_accessor :attributes
24
+
25
+
26
+ #
27
+ # Mapper for WaitStepProperties class as Ruby Hash.
28
+ # This will be used for serialization/deserialization.
29
+ #
30
+ def self.mapper()
31
+ {
32
+ client_side_validation: true,
33
+ required: false,
34
+ serialized_name: 'Wait',
35
+ type: {
36
+ name: 'Composite',
37
+ class_name: 'WaitStepProperties',
38
+ model_properties: {
39
+ stepType: {
40
+ client_side_validation: true,
41
+ required: true,
42
+ serialized_name: 'stepType',
43
+ type: {
44
+ name: 'String'
45
+ }
46
+ },
47
+ attributes: {
48
+ client_side_validation: true,
49
+ required: false,
50
+ serialized_name: 'attributes',
51
+ type: {
52
+ name: 'Composite',
53
+ class_name: 'WaitStepAttributes'
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure end
7
+ module Azure::DeploymentManager end
8
+ module Azure::DeploymentManager::Mgmt end
9
+ module Azure::DeploymentManager::Mgmt::V2018_09_01_preview end
@@ -0,0 +1,130 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::DeploymentManager::Mgmt::V2018_09_01_preview
7
+ #
8
+ # REST APIs for orchestrating deployments using the Azure Deployment Manager
9
+ # (ADM). See
10
+ # https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview
11
+ # for more information.
12
+ #
13
+ class Operations
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Operations class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [AzureDeploymentManager] reference to the AzureDeploymentManager
25
+ attr_reader :client
26
+
27
+ #
28
+ # Gets an operation resource.
29
+ #
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array] operation results.
34
+ #
35
+ def get(custom_headers:nil)
36
+ response = get_async(custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Gets an operation resource.
42
+ #
43
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
44
+ # will be added to the HTTP request.
45
+ #
46
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
47
+ #
48
+ def get_with_http_info(custom_headers:nil)
49
+ get_async(custom_headers:custom_headers).value!
50
+ end
51
+
52
+ #
53
+ # Gets an operation resource.
54
+ #
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def get_async(custom_headers:nil)
61
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
62
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
63
+
64
+
65
+ request_headers = {}
66
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
67
+
68
+ # Set Headers
69
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
70
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
71
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DeploymentManager/operations'
72
+
73
+ request_url = @base_url || @client.base_url
74
+
75
+ options = {
76
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
77
+ path_params: {'subscriptionId' => @client.subscription_id},
78
+ query_params: {'api-version' => @client.api_version},
79
+ headers: request_headers.merge(custom_headers || {}),
80
+ base_url: request_url
81
+ }
82
+ promise = @client.make_request_async(:get, path_template, options)
83
+
84
+ promise = promise.then do |result|
85
+ http_response = result.response
86
+ status_code = http_response.status
87
+ response_content = http_response.body
88
+ unless status_code == 200
89
+ error_model = JSON.load(response_content)
90
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
91
+ end
92
+
93
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
94
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
95
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
96
+ # Deserialize Response
97
+ if status_code == 200
98
+ begin
99
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
100
+ result_mapper = {
101
+ client_side_validation: true,
102
+ required: false,
103
+ serialized_name: 'parsed_response',
104
+ type: {
105
+ name: 'Sequence',
106
+ element: {
107
+ client_side_validation: true,
108
+ required: false,
109
+ serialized_name: 'OperationElementType',
110
+ type: {
111
+ name: 'Composite',
112
+ class_name: 'Operation'
113
+ }
114
+ }
115
+ }
116
+ }
117
+ result.body = @client.deserialize(result_mapper, parsed_response)
118
+ rescue Exception => e
119
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
120
+ end
121
+ end
122
+
123
+ result
124
+ end
125
+
126
+ promise.execute
127
+ end
128
+
129
+ end
130
+ end
@@ -0,0 +1,626 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::DeploymentManager::Mgmt::V2018_09_01_preview
7
+ #
8
+ # REST APIs for orchestrating deployments using the Azure Deployment Manager
9
+ # (ADM). See
10
+ # https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview
11
+ # for more information.
12
+ #
13
+ class Rollouts
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Rollouts class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [AzureDeploymentManager] reference to the AzureDeploymentManager
25
+ attr_reader :client
26
+
27
+ #
28
+ # Creates or updates a rollout.
29
+ #
30
+ # This is an asynchronous operation and can be polled to completion using the
31
+ # location header returned by this operation.
32
+ #
33
+ # @param resource_group_name [String] The name of the resource group. The name
34
+ # is case insensitive.
35
+ # @param rollout_name [String] The rollout name.
36
+ # @param rollout_request [RolloutRequest] Source rollout request object that
37
+ # defines the rollout.
38
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
+ # will be added to the HTTP request.
40
+ #
41
+ # @return [RolloutRequest] operation results.
42
+ #
43
+ def create_or_update(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
44
+ response = create_or_update_async(resource_group_name, rollout_name, rollout_request:rollout_request, custom_headers:custom_headers).value!
45
+ response.body unless response.nil?
46
+ end
47
+
48
+ #
49
+ # @param resource_group_name [String] The name of the resource group. The name
50
+ # is case insensitive.
51
+ # @param rollout_name [String] The rollout name.
52
+ # @param rollout_request [RolloutRequest] Source rollout request object that
53
+ # defines the rollout.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [Concurrent::Promise] promise which provides async access to http
58
+ # response.
59
+ #
60
+ def create_or_update_async(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
61
+ # Send request
62
+ promise = begin_create_or_update_async(resource_group_name, rollout_name, rollout_request:rollout_request, custom_headers:custom_headers)
63
+
64
+ promise = promise.then do |response|
65
+ # Defining deserialization method.
66
+ deserialize_method = lambda do |parsed_response|
67
+ result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::RolloutRequest.mapper()
68
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
69
+ end
70
+
71
+ # Waiting for response.
72
+ @client.get_long_running_operation_result(response, deserialize_method)
73
+ end
74
+
75
+ promise
76
+ end
77
+
78
+ #
79
+ # Gets detailed information of a rollout.
80
+ #
81
+ # @param resource_group_name [String] The name of the resource group. The name
82
+ # is case insensitive.
83
+ # @param rollout_name [String] The rollout name.
84
+ # @param retry_attempt [Integer] Rollout retry attempt ordinal to get the
85
+ # result of. If not specified, result of the latest attempt will be returned.
86
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
87
+ # will be added to the HTTP request.
88
+ #
89
+ # @return [Rollout] operation results.
90
+ #
91
+ def get(resource_group_name, rollout_name, retry_attempt:nil, custom_headers:nil)
92
+ response = get_async(resource_group_name, rollout_name, retry_attempt:retry_attempt, custom_headers:custom_headers).value!
93
+ response.body unless response.nil?
94
+ end
95
+
96
+ #
97
+ # Gets detailed information of a rollout.
98
+ #
99
+ # @param resource_group_name [String] The name of the resource group. The name
100
+ # is case insensitive.
101
+ # @param rollout_name [String] The rollout name.
102
+ # @param retry_attempt [Integer] Rollout retry attempt ordinal to get the
103
+ # result of. If not specified, result of the latest attempt will be returned.
104
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
105
+ # will be added to the HTTP request.
106
+ #
107
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
108
+ #
109
+ def get_with_http_info(resource_group_name, rollout_name, retry_attempt:nil, custom_headers:nil)
110
+ get_async(resource_group_name, rollout_name, retry_attempt:retry_attempt, custom_headers:custom_headers).value!
111
+ end
112
+
113
+ #
114
+ # Gets detailed information of a rollout.
115
+ #
116
+ # @param resource_group_name [String] The name of the resource group. The name
117
+ # is case insensitive.
118
+ # @param rollout_name [String] The rollout name.
119
+ # @param retry_attempt [Integer] Rollout retry attempt ordinal to get the
120
+ # result of. If not specified, result of the latest attempt will be returned.
121
+ # @param [Hash{String => String}] A hash of custom headers that will be added
122
+ # to the HTTP request.
123
+ #
124
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
125
+ #
126
+ def get_async(resource_group_name, rollout_name, retry_attempt:nil, custom_headers:nil)
127
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
128
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
129
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
130
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
131
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
132
+ fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
133
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
134
+
135
+
136
+ request_headers = {}
137
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
138
+
139
+ # Set Headers
140
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
141
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
142
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}'
143
+
144
+ request_url = @base_url || @client.base_url
145
+
146
+ options = {
147
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
148
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
149
+ query_params: {'api-version' => @client.api_version,'retryAttempt' => retry_attempt},
150
+ headers: request_headers.merge(custom_headers || {}),
151
+ base_url: request_url
152
+ }
153
+ promise = @client.make_request_async(:get, path_template, options)
154
+
155
+ promise = promise.then do |result|
156
+ http_response = result.response
157
+ status_code = http_response.status
158
+ response_content = http_response.body
159
+ unless status_code == 200
160
+ error_model = JSON.load(response_content)
161
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
162
+ end
163
+
164
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
165
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
166
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
167
+ # Deserialize Response
168
+ if status_code == 200
169
+ begin
170
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
171
+ result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::Rollout.mapper()
172
+ result.body = @client.deserialize(result_mapper, parsed_response)
173
+ rescue Exception => e
174
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
175
+ end
176
+ end
177
+
178
+ result
179
+ end
180
+
181
+ promise.execute
182
+ end
183
+
184
+ #
185
+ # Deletes a rollout resource.
186
+ #
187
+ # Only rollouts in terminal state can be deleted.
188
+ #
189
+ # @param resource_group_name [String] The name of the resource group. The name
190
+ # is case insensitive.
191
+ # @param rollout_name [String] The rollout name.
192
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
193
+ # will be added to the HTTP request.
194
+ #
195
+ #
196
+ def delete(resource_group_name, rollout_name, custom_headers:nil)
197
+ response = delete_async(resource_group_name, rollout_name, custom_headers:custom_headers).value!
198
+ nil
199
+ end
200
+
201
+ #
202
+ # Deletes a rollout resource.
203
+ #
204
+ # Only rollouts in terminal state can be deleted.
205
+ #
206
+ # @param resource_group_name [String] The name of the resource group. The name
207
+ # is case insensitive.
208
+ # @param rollout_name [String] The rollout name.
209
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
210
+ # will be added to the HTTP request.
211
+ #
212
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
213
+ #
214
+ def delete_with_http_info(resource_group_name, rollout_name, custom_headers:nil)
215
+ delete_async(resource_group_name, rollout_name, custom_headers:custom_headers).value!
216
+ end
217
+
218
+ #
219
+ # Deletes a rollout resource.
220
+ #
221
+ # Only rollouts in terminal state can be deleted.
222
+ #
223
+ # @param resource_group_name [String] The name of the resource group. The name
224
+ # is case insensitive.
225
+ # @param rollout_name [String] The rollout name.
226
+ # @param [Hash{String => String}] A hash of custom headers that will be added
227
+ # to the HTTP request.
228
+ #
229
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
230
+ #
231
+ def delete_async(resource_group_name, rollout_name, custom_headers:nil)
232
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
233
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
234
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
235
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
236
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
237
+ fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
238
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
239
+
240
+
241
+ request_headers = {}
242
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
243
+
244
+ # Set Headers
245
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
246
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
247
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}'
248
+
249
+ request_url = @base_url || @client.base_url
250
+
251
+ options = {
252
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
253
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
254
+ query_params: {'api-version' => @client.api_version},
255
+ headers: request_headers.merge(custom_headers || {}),
256
+ base_url: request_url
257
+ }
258
+ promise = @client.make_request_async(:delete, path_template, options)
259
+
260
+ promise = promise.then do |result|
261
+ http_response = result.response
262
+ status_code = http_response.status
263
+ response_content = http_response.body
264
+ unless status_code == 200 || status_code == 204
265
+ error_model = JSON.load(response_content)
266
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
267
+ end
268
+
269
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
270
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
271
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
272
+
273
+ result
274
+ end
275
+
276
+ promise.execute
277
+ end
278
+
279
+ #
280
+ # Stops a running rollout.
281
+ #
282
+ # Only running rollouts can be canceled.
283
+ #
284
+ # @param resource_group_name [String] The name of the resource group. The name
285
+ # is case insensitive.
286
+ # @param rollout_name [String] The rollout name.
287
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
288
+ # will be added to the HTTP request.
289
+ #
290
+ # @return [Rollout] operation results.
291
+ #
292
+ def cancel(resource_group_name, rollout_name, custom_headers:nil)
293
+ response = cancel_async(resource_group_name, rollout_name, custom_headers:custom_headers).value!
294
+ response.body unless response.nil?
295
+ end
296
+
297
+ #
298
+ # Stops a running rollout.
299
+ #
300
+ # Only running rollouts can be canceled.
301
+ #
302
+ # @param resource_group_name [String] The name of the resource group. The name
303
+ # is case insensitive.
304
+ # @param rollout_name [String] The rollout name.
305
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
306
+ # will be added to the HTTP request.
307
+ #
308
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
309
+ #
310
+ def cancel_with_http_info(resource_group_name, rollout_name, custom_headers:nil)
311
+ cancel_async(resource_group_name, rollout_name, custom_headers:custom_headers).value!
312
+ end
313
+
314
+ #
315
+ # Stops a running rollout.
316
+ #
317
+ # Only running rollouts can be canceled.
318
+ #
319
+ # @param resource_group_name [String] The name of the resource group. The name
320
+ # is case insensitive.
321
+ # @param rollout_name [String] The rollout name.
322
+ # @param [Hash{String => String}] A hash of custom headers that will be added
323
+ # to the HTTP request.
324
+ #
325
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
326
+ #
327
+ def cancel_async(resource_group_name, rollout_name, custom_headers:nil)
328
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
329
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
330
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
331
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
332
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
333
+ fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
334
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
335
+
336
+
337
+ request_headers = {}
338
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
339
+
340
+ # Set Headers
341
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
342
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
343
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}/cancel'
344
+
345
+ request_url = @base_url || @client.base_url
346
+
347
+ options = {
348
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
349
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
350
+ query_params: {'api-version' => @client.api_version},
351
+ headers: request_headers.merge(custom_headers || {}),
352
+ base_url: request_url
353
+ }
354
+ promise = @client.make_request_async(:post, path_template, options)
355
+
356
+ promise = promise.then do |result|
357
+ http_response = result.response
358
+ status_code = http_response.status
359
+ response_content = http_response.body
360
+ unless status_code == 200
361
+ error_model = JSON.load(response_content)
362
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
363
+ end
364
+
365
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
366
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
367
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
368
+ # Deserialize Response
369
+ if status_code == 200
370
+ begin
371
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
372
+ result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::Rollout.mapper()
373
+ result.body = @client.deserialize(result_mapper, parsed_response)
374
+ rescue Exception => e
375
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
376
+ end
377
+ end
378
+
379
+ result
380
+ end
381
+
382
+ promise.execute
383
+ end
384
+
385
+ #
386
+ # Restarts a failed rollout and optionally skips all succeeded steps.
387
+ #
388
+ # Only failed rollouts can be restarted.
389
+ #
390
+ # @param resource_group_name [String] The name of the resource group. The name
391
+ # is case insensitive.
392
+ # @param rollout_name [String] The rollout name.
393
+ # @param skip_succeeded [Boolean] If true, will skip all succeeded steps so far
394
+ # in the rollout. If false, will execute the entire rollout again regardless of
395
+ # the current state of individual resources. Defaults to false if not
396
+ # specified.
397
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
398
+ # will be added to the HTTP request.
399
+ #
400
+ # @return [Rollout] operation results.
401
+ #
402
+ def restart(resource_group_name, rollout_name, skip_succeeded:nil, custom_headers:nil)
403
+ response = restart_async(resource_group_name, rollout_name, skip_succeeded:skip_succeeded, custom_headers:custom_headers).value!
404
+ response.body unless response.nil?
405
+ end
406
+
407
+ #
408
+ # Restarts a failed rollout and optionally skips all succeeded steps.
409
+ #
410
+ # Only failed rollouts can be restarted.
411
+ #
412
+ # @param resource_group_name [String] The name of the resource group. The name
413
+ # is case insensitive.
414
+ # @param rollout_name [String] The rollout name.
415
+ # @param skip_succeeded [Boolean] If true, will skip all succeeded steps so far
416
+ # in the rollout. If false, will execute the entire rollout again regardless of
417
+ # the current state of individual resources. Defaults to false if not
418
+ # specified.
419
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
420
+ # will be added to the HTTP request.
421
+ #
422
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
423
+ #
424
+ def restart_with_http_info(resource_group_name, rollout_name, skip_succeeded:nil, custom_headers:nil)
425
+ restart_async(resource_group_name, rollout_name, skip_succeeded:skip_succeeded, custom_headers:custom_headers).value!
426
+ end
427
+
428
+ #
429
+ # Restarts a failed rollout and optionally skips all succeeded steps.
430
+ #
431
+ # Only failed rollouts can be restarted.
432
+ #
433
+ # @param resource_group_name [String] The name of the resource group. The name
434
+ # is case insensitive.
435
+ # @param rollout_name [String] The rollout name.
436
+ # @param skip_succeeded [Boolean] If true, will skip all succeeded steps so far
437
+ # in the rollout. If false, will execute the entire rollout again regardless of
438
+ # the current state of individual resources. Defaults to false if not
439
+ # specified.
440
+ # @param [Hash{String => String}] A hash of custom headers that will be added
441
+ # to the HTTP request.
442
+ #
443
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
444
+ #
445
+ def restart_async(resource_group_name, rollout_name, skip_succeeded:nil, custom_headers:nil)
446
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
447
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
448
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
449
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
450
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
451
+ fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
452
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
453
+
454
+
455
+ request_headers = {}
456
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
457
+
458
+ # Set Headers
459
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
460
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
461
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}/restart'
462
+
463
+ request_url = @base_url || @client.base_url
464
+
465
+ options = {
466
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
467
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
468
+ query_params: {'skipSucceeded' => skip_succeeded,'api-version' => @client.api_version},
469
+ headers: request_headers.merge(custom_headers || {}),
470
+ base_url: request_url
471
+ }
472
+ promise = @client.make_request_async(:post, path_template, options)
473
+
474
+ promise = promise.then do |result|
475
+ http_response = result.response
476
+ status_code = http_response.status
477
+ response_content = http_response.body
478
+ unless status_code == 200
479
+ error_model = JSON.load(response_content)
480
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
481
+ end
482
+
483
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
484
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
485
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
486
+ # Deserialize Response
487
+ if status_code == 200
488
+ begin
489
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
490
+ result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::Rollout.mapper()
491
+ result.body = @client.deserialize(result_mapper, parsed_response)
492
+ rescue Exception => e
493
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
494
+ end
495
+ end
496
+
497
+ result
498
+ end
499
+
500
+ promise.execute
501
+ end
502
+
503
+ #
504
+ # Creates or updates a rollout.
505
+ #
506
+ # This is an asynchronous operation and can be polled to completion using the
507
+ # location header returned by this operation.
508
+ #
509
+ # @param resource_group_name [String] The name of the resource group. The name
510
+ # is case insensitive.
511
+ # @param rollout_name [String] The rollout name.
512
+ # @param rollout_request [RolloutRequest] Source rollout request object that
513
+ # defines the rollout.
514
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
515
+ # will be added to the HTTP request.
516
+ #
517
+ # @return [RolloutRequest] operation results.
518
+ #
519
+ def begin_create_or_update(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
520
+ response = begin_create_or_update_async(resource_group_name, rollout_name, rollout_request:rollout_request, custom_headers:custom_headers).value!
521
+ response.body unless response.nil?
522
+ end
523
+
524
+ #
525
+ # Creates or updates a rollout.
526
+ #
527
+ # This is an asynchronous operation and can be polled to completion using the
528
+ # location header returned by this operation.
529
+ #
530
+ # @param resource_group_name [String] The name of the resource group. The name
531
+ # is case insensitive.
532
+ # @param rollout_name [String] The rollout name.
533
+ # @param rollout_request [RolloutRequest] Source rollout request object that
534
+ # defines the rollout.
535
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
536
+ # will be added to the HTTP request.
537
+ #
538
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
539
+ #
540
+ def begin_create_or_update_with_http_info(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
541
+ begin_create_or_update_async(resource_group_name, rollout_name, rollout_request:rollout_request, custom_headers:custom_headers).value!
542
+ end
543
+
544
+ #
545
+ # Creates or updates a rollout.
546
+ #
547
+ # This is an asynchronous operation and can be polled to completion using the
548
+ # location header returned by this operation.
549
+ #
550
+ # @param resource_group_name [String] The name of the resource group. The name
551
+ # is case insensitive.
552
+ # @param rollout_name [String] The rollout name.
553
+ # @param rollout_request [RolloutRequest] Source rollout request object that
554
+ # defines the rollout.
555
+ # @param [Hash{String => String}] A hash of custom headers that will be added
556
+ # to the HTTP request.
557
+ #
558
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
559
+ #
560
+ def begin_create_or_update_async(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
561
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
562
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
563
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
564
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
565
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
566
+ fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
567
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
568
+
569
+
570
+ request_headers = {}
571
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
572
+
573
+ # Set Headers
574
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
575
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
576
+
577
+ # Serialize Request
578
+ request_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::RolloutRequest.mapper()
579
+ request_content = @client.serialize(request_mapper, rollout_request)
580
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
581
+
582
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}'
583
+
584
+ request_url = @base_url || @client.base_url
585
+
586
+ options = {
587
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
588
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
589
+ query_params: {'api-version' => @client.api_version},
590
+ body: request_content,
591
+ headers: request_headers.merge(custom_headers || {}),
592
+ base_url: request_url
593
+ }
594
+ promise = @client.make_request_async(:put, path_template, options)
595
+
596
+ promise = promise.then do |result|
597
+ http_response = result.response
598
+ status_code = http_response.status
599
+ response_content = http_response.body
600
+ unless status_code == 201
601
+ error_model = JSON.load(response_content)
602
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
603
+ end
604
+
605
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
606
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
607
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
608
+ # Deserialize Response
609
+ if status_code == 201
610
+ begin
611
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
612
+ result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::RolloutRequest.mapper()
613
+ result.body = @client.deserialize(result_mapper, parsed_response)
614
+ rescue Exception => e
615
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
616
+ end
617
+ end
618
+
619
+ result
620
+ end
621
+
622
+ promise.execute
623
+ end
624
+
625
+ end
626
+ end