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,346 @@
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 Services
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Services 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 service in the service topology.
29
+ #
30
+ # Synchronously creates a new service or updates an existing service.
31
+ #
32
+ # @param resource_group_name [String] The name of the resource group. The name
33
+ # is case insensitive.
34
+ # @param service_topology_name [String] The name of the service topology .
35
+ # @param service_name [String] The name of the service resource.
36
+ # @param service_info [ServiceResource] The service object
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [ServiceResource] operation results.
41
+ #
42
+ def create_or_update(resource_group_name, service_topology_name, service_name, service_info, custom_headers:nil)
43
+ response = create_or_update_async(resource_group_name, service_topology_name, service_name, service_info, custom_headers:custom_headers).value!
44
+ response.body unless response.nil?
45
+ end
46
+
47
+ #
48
+ # Creates or updates a service in the service topology.
49
+ #
50
+ # Synchronously creates a new service or updates an existing service.
51
+ #
52
+ # @param resource_group_name [String] The name of the resource group. The name
53
+ # is case insensitive.
54
+ # @param service_topology_name [String] The name of the service topology .
55
+ # @param service_name [String] The name of the service resource.
56
+ # @param service_info [ServiceResource] The service object
57
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
58
+ # will be added to the HTTP request.
59
+ #
60
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
61
+ #
62
+ def create_or_update_with_http_info(resource_group_name, service_topology_name, service_name, service_info, custom_headers:nil)
63
+ create_or_update_async(resource_group_name, service_topology_name, service_name, service_info, custom_headers:custom_headers).value!
64
+ end
65
+
66
+ #
67
+ # Creates or updates a service in the service topology.
68
+ #
69
+ # Synchronously creates a new service or updates an existing service.
70
+ #
71
+ # @param resource_group_name [String] The name of the resource group. The name
72
+ # is case insensitive.
73
+ # @param service_topology_name [String] The name of the service topology .
74
+ # @param service_name [String] The name of the service resource.
75
+ # @param service_info [ServiceResource] The service object
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def create_or_update_async(resource_group_name, service_topology_name, service_name, service_info, custom_headers:nil)
82
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
83
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
84
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
85
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
86
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
87
+ fail ArgumentError, 'service_topology_name is nil' if service_topology_name.nil?
88
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
89
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
90
+ fail ArgumentError, 'service_info is nil' if service_info.nil?
91
+
92
+
93
+ request_headers = {}
94
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
95
+
96
+ # Set Headers
97
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
98
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
99
+
100
+ # Serialize Request
101
+ request_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::ServiceResource.mapper()
102
+ request_content = @client.serialize(request_mapper, service_info)
103
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
104
+
105
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}'
106
+
107
+ request_url = @base_url || @client.base_url
108
+
109
+ options = {
110
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
111
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serviceTopologyName' => service_topology_name,'serviceName' => service_name},
112
+ query_params: {'api-version' => @client.api_version},
113
+ body: request_content,
114
+ headers: request_headers.merge(custom_headers || {}),
115
+ base_url: request_url
116
+ }
117
+ promise = @client.make_request_async(:put, path_template, options)
118
+
119
+ promise = promise.then do |result|
120
+ http_response = result.response
121
+ status_code = http_response.status
122
+ response_content = http_response.body
123
+ unless status_code == 201
124
+ error_model = JSON.load(response_content)
125
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
126
+ end
127
+
128
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
129
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
130
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
131
+ # Deserialize Response
132
+ if status_code == 201
133
+ begin
134
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
135
+ result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::ServiceResource.mapper()
136
+ result.body = @client.deserialize(result_mapper, parsed_response)
137
+ rescue Exception => e
138
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
139
+ end
140
+ end
141
+
142
+ result
143
+ end
144
+
145
+ promise.execute
146
+ end
147
+
148
+ #
149
+ # Gets the service.
150
+ #
151
+ # @param resource_group_name [String] The name of the resource group. The name
152
+ # is case insensitive.
153
+ # @param service_topology_name [String] The name of the service topology .
154
+ # @param service_name [String] The name of the service resource.
155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
+ # will be added to the HTTP request.
157
+ #
158
+ # @return [ServiceResource] operation results.
159
+ #
160
+ def get(resource_group_name, service_topology_name, service_name, custom_headers:nil)
161
+ response = get_async(resource_group_name, service_topology_name, service_name, custom_headers:custom_headers).value!
162
+ response.body unless response.nil?
163
+ end
164
+
165
+ #
166
+ # Gets the service.
167
+ #
168
+ # @param resource_group_name [String] The name of the resource group. The name
169
+ # is case insensitive.
170
+ # @param service_topology_name [String] The name of the service topology .
171
+ # @param service_name [String] The name of the service resource.
172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
173
+ # will be added to the HTTP request.
174
+ #
175
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
176
+ #
177
+ def get_with_http_info(resource_group_name, service_topology_name, service_name, custom_headers:nil)
178
+ get_async(resource_group_name, service_topology_name, service_name, custom_headers:custom_headers).value!
179
+ end
180
+
181
+ #
182
+ # Gets the service.
183
+ #
184
+ # @param resource_group_name [String] The name of the resource group. The name
185
+ # is case insensitive.
186
+ # @param service_topology_name [String] The name of the service topology .
187
+ # @param service_name [String] The name of the service resource.
188
+ # @param [Hash{String => String}] A hash of custom headers that will be added
189
+ # to the HTTP request.
190
+ #
191
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
192
+ #
193
+ def get_async(resource_group_name, service_topology_name, service_name, custom_headers:nil)
194
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
195
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
196
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
197
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
198
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
199
+ fail ArgumentError, 'service_topology_name is nil' if service_topology_name.nil?
200
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
201
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
202
+
203
+
204
+ request_headers = {}
205
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
206
+
207
+ # Set Headers
208
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
209
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
210
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}'
211
+
212
+ request_url = @base_url || @client.base_url
213
+
214
+ options = {
215
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
216
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serviceTopologyName' => service_topology_name,'serviceName' => service_name},
217
+ query_params: {'api-version' => @client.api_version},
218
+ headers: request_headers.merge(custom_headers || {}),
219
+ base_url: request_url
220
+ }
221
+ promise = @client.make_request_async(:get, path_template, options)
222
+
223
+ promise = promise.then do |result|
224
+ http_response = result.response
225
+ status_code = http_response.status
226
+ response_content = http_response.body
227
+ unless status_code == 200
228
+ error_model = JSON.load(response_content)
229
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
230
+ end
231
+
232
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
233
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
234
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
235
+ # Deserialize Response
236
+ if status_code == 200
237
+ begin
238
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
239
+ result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::ServiceResource.mapper()
240
+ result.body = @client.deserialize(result_mapper, parsed_response)
241
+ rescue Exception => e
242
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
243
+ end
244
+ end
245
+
246
+ result
247
+ end
248
+
249
+ promise.execute
250
+ end
251
+
252
+ #
253
+ # Deletes the service.
254
+ #
255
+ # @param resource_group_name [String] The name of the resource group. The name
256
+ # is case insensitive.
257
+ # @param service_topology_name [String] The name of the service topology .
258
+ # @param service_name [String] The name of the service resource.
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ #
263
+ def delete(resource_group_name, service_topology_name, service_name, custom_headers:nil)
264
+ response = delete_async(resource_group_name, service_topology_name, service_name, custom_headers:custom_headers).value!
265
+ nil
266
+ end
267
+
268
+ #
269
+ # Deletes the service.
270
+ #
271
+ # @param resource_group_name [String] The name of the resource group. The name
272
+ # is case insensitive.
273
+ # @param service_topology_name [String] The name of the service topology .
274
+ # @param service_name [String] The name of the service resource.
275
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
276
+ # will be added to the HTTP request.
277
+ #
278
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
279
+ #
280
+ def delete_with_http_info(resource_group_name, service_topology_name, service_name, custom_headers:nil)
281
+ delete_async(resource_group_name, service_topology_name, service_name, custom_headers:custom_headers).value!
282
+ end
283
+
284
+ #
285
+ # Deletes the service.
286
+ #
287
+ # @param resource_group_name [String] The name of the resource group. The name
288
+ # is case insensitive.
289
+ # @param service_topology_name [String] The name of the service topology .
290
+ # @param service_name [String] The name of the service resource.
291
+ # @param [Hash{String => String}] A hash of custom headers that will be added
292
+ # to the HTTP request.
293
+ #
294
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
295
+ #
296
+ def delete_async(resource_group_name, service_topology_name, service_name, custom_headers:nil)
297
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
298
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
299
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
300
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
301
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
302
+ fail ArgumentError, 'service_topology_name is nil' if service_topology_name.nil?
303
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
304
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
305
+
306
+
307
+ request_headers = {}
308
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
309
+
310
+ # Set Headers
311
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
312
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
313
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}'
314
+
315
+ request_url = @base_url || @client.base_url
316
+
317
+ options = {
318
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
319
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serviceTopologyName' => service_topology_name,'serviceName' => service_name},
320
+ query_params: {'api-version' => @client.api_version},
321
+ headers: request_headers.merge(custom_headers || {}),
322
+ base_url: request_url
323
+ }
324
+ promise = @client.make_request_async(:delete, path_template, options)
325
+
326
+ promise = promise.then do |result|
327
+ http_response = result.response
328
+ status_code = http_response.status
329
+ response_content = http_response.body
330
+ unless status_code == 200 || status_code == 204
331
+ error_model = JSON.load(response_content)
332
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
333
+ end
334
+
335
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
336
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
337
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
338
+
339
+ result
340
+ end
341
+
342
+ promise.execute
343
+ end
344
+
345
+ end
346
+ end
@@ -0,0 +1,333 @@
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 Steps
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Steps 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 step with the given step properties.
29
+ #
30
+ # Synchronously creates a new step or updates an existing step.
31
+ #
32
+ # @param resource_group_name [String] The name of the resource group. The name
33
+ # is case insensitive.
34
+ # @param step_name [String] The name of the deployment step.
35
+ # @param step_info [StepResource] The step object.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ # @return [StepResource] operation results.
40
+ #
41
+ def create_or_update(resource_group_name, step_name, step_info:nil, custom_headers:nil)
42
+ response = create_or_update_async(resource_group_name, step_name, step_info:step_info, custom_headers:custom_headers).value!
43
+ response.body unless response.nil?
44
+ end
45
+
46
+ #
47
+ # Creates or updates a rollout step with the given step properties.
48
+ #
49
+ # Synchronously creates a new step or updates an existing step.
50
+ #
51
+ # @param resource_group_name [String] The name of the resource group. The name
52
+ # is case insensitive.
53
+ # @param step_name [String] The name of the deployment step.
54
+ # @param step_info [StepResource] The step object.
55
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
56
+ # will be added to the HTTP request.
57
+ #
58
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
59
+ #
60
+ def create_or_update_with_http_info(resource_group_name, step_name, step_info:nil, custom_headers:nil)
61
+ create_or_update_async(resource_group_name, step_name, step_info:step_info, custom_headers:custom_headers).value!
62
+ end
63
+
64
+ #
65
+ # Creates or updates a rollout step with the given step properties.
66
+ #
67
+ # Synchronously creates a new step or updates an existing step.
68
+ #
69
+ # @param resource_group_name [String] The name of the resource group. The name
70
+ # is case insensitive.
71
+ # @param step_name [String] The name of the deployment step.
72
+ # @param step_info [StepResource] The step object.
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def create_or_update_async(resource_group_name, step_name, step_info:nil, custom_headers:nil)
79
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
81
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
82
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
83
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
84
+ fail ArgumentError, 'step_name is nil' if step_name.nil?
85
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
86
+
87
+
88
+ request_headers = {}
89
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
90
+
91
+ # Set Headers
92
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
93
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
94
+
95
+ # Serialize Request
96
+ request_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::StepResource.mapper()
97
+ request_content = @client.serialize(request_mapper, step_info)
98
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
99
+
100
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}'
101
+
102
+ request_url = @base_url || @client.base_url
103
+
104
+ options = {
105
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
106
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'stepName' => step_name},
107
+ query_params: {'api-version' => @client.api_version},
108
+ body: request_content,
109
+ headers: request_headers.merge(custom_headers || {}),
110
+ base_url: request_url
111
+ }
112
+ promise = @client.make_request_async(:put, path_template, options)
113
+
114
+ promise = promise.then do |result|
115
+ http_response = result.response
116
+ status_code = http_response.status
117
+ response_content = http_response.body
118
+ unless status_code == 201
119
+ error_model = JSON.load(response_content)
120
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
121
+ end
122
+
123
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
124
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
125
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
126
+ # Deserialize Response
127
+ if status_code == 201
128
+ begin
129
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
130
+ result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::StepResource.mapper()
131
+ result.body = @client.deserialize(result_mapper, parsed_response)
132
+ rescue Exception => e
133
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
134
+ end
135
+ end
136
+
137
+ result
138
+ end
139
+
140
+ promise.execute
141
+ end
142
+
143
+ #
144
+ # Gets the step.
145
+ #
146
+ # @param resource_group_name [String] The name of the resource group. The name
147
+ # is case insensitive.
148
+ # @param step_name [String] The name of the deployment step.
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ # @return [StepResource] operation results.
153
+ #
154
+ def get(resource_group_name, step_name, custom_headers:nil)
155
+ response = get_async(resource_group_name, step_name, custom_headers:custom_headers).value!
156
+ response.body unless response.nil?
157
+ end
158
+
159
+ #
160
+ # Gets the step.
161
+ #
162
+ # @param resource_group_name [String] The name of the resource group. The name
163
+ # is case insensitive.
164
+ # @param step_name [String] The name of the deployment step.
165
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
166
+ # will be added to the HTTP request.
167
+ #
168
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
169
+ #
170
+ def get_with_http_info(resource_group_name, step_name, custom_headers:nil)
171
+ get_async(resource_group_name, step_name, custom_headers:custom_headers).value!
172
+ end
173
+
174
+ #
175
+ # Gets the step.
176
+ #
177
+ # @param resource_group_name [String] The name of the resource group. The name
178
+ # is case insensitive.
179
+ # @param step_name [String] The name of the deployment step.
180
+ # @param [Hash{String => String}] A hash of custom headers that will be added
181
+ # to the HTTP request.
182
+ #
183
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
184
+ #
185
+ def get_async(resource_group_name, step_name, custom_headers:nil)
186
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
187
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
188
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
189
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
190
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
191
+ fail ArgumentError, 'step_name is nil' if step_name.nil?
192
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
193
+
194
+
195
+ request_headers = {}
196
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
197
+
198
+ # Set Headers
199
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
200
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
201
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}'
202
+
203
+ request_url = @base_url || @client.base_url
204
+
205
+ options = {
206
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
207
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'stepName' => step_name},
208
+ query_params: {'api-version' => @client.api_version},
209
+ headers: request_headers.merge(custom_headers || {}),
210
+ base_url: request_url
211
+ }
212
+ promise = @client.make_request_async(:get, path_template, options)
213
+
214
+ promise = promise.then do |result|
215
+ http_response = result.response
216
+ status_code = http_response.status
217
+ response_content = http_response.body
218
+ unless status_code == 200
219
+ error_model = JSON.load(response_content)
220
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
221
+ end
222
+
223
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
224
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
225
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
226
+ # Deserialize Response
227
+ if status_code == 200
228
+ begin
229
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
230
+ result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::StepResource.mapper()
231
+ result.body = @client.deserialize(result_mapper, parsed_response)
232
+ rescue Exception => e
233
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
234
+ end
235
+ end
236
+
237
+ result
238
+ end
239
+
240
+ promise.execute
241
+ end
242
+
243
+ #
244
+ # Deletes the step.
245
+ #
246
+ # @param resource_group_name [String] The name of the resource group. The name
247
+ # is case insensitive.
248
+ # @param step_name [String] The name of the deployment step.
249
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
250
+ # will be added to the HTTP request.
251
+ #
252
+ #
253
+ def delete(resource_group_name, step_name, custom_headers:nil)
254
+ response = delete_async(resource_group_name, step_name, custom_headers:custom_headers).value!
255
+ nil
256
+ end
257
+
258
+ #
259
+ # Deletes the step.
260
+ #
261
+ # @param resource_group_name [String] The name of the resource group. The name
262
+ # is case insensitive.
263
+ # @param step_name [String] The name of the deployment step.
264
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
265
+ # will be added to the HTTP request.
266
+ #
267
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
268
+ #
269
+ def delete_with_http_info(resource_group_name, step_name, custom_headers:nil)
270
+ delete_async(resource_group_name, step_name, custom_headers:custom_headers).value!
271
+ end
272
+
273
+ #
274
+ # Deletes the step.
275
+ #
276
+ # @param resource_group_name [String] The name of the resource group. The name
277
+ # is case insensitive.
278
+ # @param step_name [String] The name of the deployment step.
279
+ # @param [Hash{String => String}] A hash of custom headers that will be added
280
+ # to the HTTP request.
281
+ #
282
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
283
+ #
284
+ def delete_async(resource_group_name, step_name, custom_headers:nil)
285
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
286
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
287
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
288
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
289
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
290
+ fail ArgumentError, 'step_name is nil' if step_name.nil?
291
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
292
+
293
+
294
+ request_headers = {}
295
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
296
+
297
+ # Set Headers
298
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
299
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
300
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}'
301
+
302
+ request_url = @base_url || @client.base_url
303
+
304
+ options = {
305
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
306
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'stepName' => step_name},
307
+ query_params: {'api-version' => @client.api_version},
308
+ headers: request_headers.merge(custom_headers || {}),
309
+ base_url: request_url
310
+ }
311
+ promise = @client.make_request_async(:delete, path_template, options)
312
+
313
+ promise = promise.then do |result|
314
+ http_response = result.response
315
+ status_code = http_response.status
316
+ response_content = http_response.body
317
+ unless status_code == 200 || status_code == 204
318
+ error_model = JSON.load(response_content)
319
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
320
+ end
321
+
322
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
323
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
324
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
325
+
326
+ result
327
+ end
328
+
329
+ promise.execute
330
+ end
331
+
332
+ end
333
+ end