azure_mgmt_resources 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +13 -5
  2. data/README.md +1 -27
  3. data/azure_mgmt_resources.gemspec +1 -1
  4. data/lib/azure_mgmt_resources.rb +7 -10
  5. data/lib/azure_mgmt_resources/deployment_operations.rb +117 -16
  6. data/lib/azure_mgmt_resources/deployments.rb +416 -51
  7. data/lib/azure_mgmt_resources/models/basic_dependency.rb +1 -1
  8. data/lib/azure_mgmt_resources/models/debug_setting.rb +56 -0
  9. data/lib/azure_mgmt_resources/models/dependency.rb +1 -1
  10. data/lib/azure_mgmt_resources/models/deployment.rb +1 -1
  11. data/lib/azure_mgmt_resources/models/deployment_export_result.rb +56 -0
  12. data/lib/azure_mgmt_resources/models/deployment_extended.rb +1 -1
  13. data/lib/azure_mgmt_resources/models/deployment_extended_filter.rb +1 -1
  14. data/lib/azure_mgmt_resources/models/deployment_list_result.rb +1 -1
  15. data/lib/azure_mgmt_resources/models/deployment_mode.rb +1 -1
  16. data/lib/azure_mgmt_resources/models/deployment_operation.rb +1 -1
  17. data/lib/azure_mgmt_resources/models/deployment_operation_properties.rb +42 -1
  18. data/lib/azure_mgmt_resources/models/deployment_operations_list_result.rb +1 -1
  19. data/lib/azure_mgmt_resources/models/deployment_properties.rb +18 -1
  20. data/lib/azure_mgmt_resources/models/deployment_properties_extended.rb +18 -1
  21. data/lib/azure_mgmt_resources/models/deployment_validate_result.rb +1 -1
  22. data/lib/azure_mgmt_resources/models/export_template_request.rb +69 -0
  23. data/lib/azure_mgmt_resources/models/generic_resource.rb +1 -1
  24. data/lib/azure_mgmt_resources/models/generic_resource_filter.rb +1 -1
  25. data/lib/azure_mgmt_resources/models/http_message.rb +56 -0
  26. data/lib/azure_mgmt_resources/models/parameters_link.rb +1 -1
  27. data/lib/azure_mgmt_resources/models/plan.rb +1 -1
  28. data/lib/azure_mgmt_resources/models/provider.rb +1 -1
  29. data/lib/azure_mgmt_resources/models/provider_list_result.rb +1 -1
  30. data/lib/azure_mgmt_resources/models/provider_resource_type.rb +1 -1
  31. data/lib/azure_mgmt_resources/models/resource_group.rb +1 -1
  32. data/lib/azure_mgmt_resources/models/resource_group_export_result.rb +71 -0
  33. data/lib/azure_mgmt_resources/models/resource_group_filter.rb +1 -1
  34. data/lib/azure_mgmt_resources/models/resource_group_list_result.rb +1 -1
  35. data/lib/azure_mgmt_resources/models/resource_group_properties.rb +1 -1
  36. data/lib/azure_mgmt_resources/models/resource_list_result.rb +1 -1
  37. data/lib/azure_mgmt_resources/models/resource_management_error_with_details.rb +18 -5
  38. data/lib/azure_mgmt_resources/models/resource_provider_operation_definition.rb +1 -1
  39. data/lib/azure_mgmt_resources/models/resource_provider_operation_detail_list_result.rb +1 -1
  40. data/lib/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +1 -1
  41. data/lib/azure_mgmt_resources/models/resources_move_info.rb +1 -1
  42. data/lib/azure_mgmt_resources/models/tag_count.rb +1 -1
  43. data/lib/azure_mgmt_resources/models/tag_details.rb +1 -1
  44. data/lib/azure_mgmt_resources/models/tag_value.rb +1 -1
  45. data/lib/azure_mgmt_resources/models/tags_list_result.rb +1 -1
  46. data/lib/azure_mgmt_resources/models/target_resource.rb +1 -1
  47. data/lib/azure_mgmt_resources/models/template_link.rb +1 -1
  48. data/lib/azure_mgmt_resources/module_definition.rb +1 -1
  49. data/lib/azure_mgmt_resources/providers.rb +181 -26
  50. data/lib/azure_mgmt_resources/resource_groups.rb +461 -54
  51. data/lib/azure_mgmt_resources/resource_management_client.rb +2 -10
  52. data/lib/azure_mgmt_resources/resource_provider_operation_details.rb +73 -11
  53. data/lib/azure_mgmt_resources/resources.rb +306 -57
  54. data/lib/azure_mgmt_resources/tags.rb +207 -31
  55. data/lib/azure_mgmt_resources/version.rb +2 -2
  56. metadata +31 -29
  57. data/lib/azure_mgmt_resources/models/policy_assignment.rb +0 -72
  58. data/lib/azure_mgmt_resources/models/policy_assignment_list_result.rb +0 -86
  59. data/lib/azure_mgmt_resources/models/policy_assignment_properties.rb +0 -74
  60. data/lib/azure_mgmt_resources/models/policy_definition.rb +0 -72
  61. data/lib/azure_mgmt_resources/models/policy_definition_properties.rb +0 -74
  62. data/lib/azure_mgmt_resources/models/resource_management_error.rb +0 -76
  63. data/lib/azure_mgmt_resources/policy_assignments.rb +0 -922
  64. data/lib/azure_mgmt_resources/policy_definitions.rb +0 -208
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -61,12 +61,6 @@ module Azure::ARM::Resources
61
61
  # @return resource_provider_operation_details
62
62
  attr_reader :resource_provider_operation_details
63
63
 
64
- # @return policy_definitions
65
- attr_reader :policy_definitions
66
-
67
- # @return policy_assignments
68
- attr_reader :policy_assignments
69
-
70
64
  #
71
65
  # Creates initializes a new instance of the ResourceManagementClient class.
72
66
  # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
@@ -88,9 +82,7 @@ module Azure::ARM::Resources
88
82
  @tags = Tags.new(self)
89
83
  @deployment_operations = DeploymentOperations.new(self)
90
84
  @resource_provider_operation_details = ResourceProviderOperationDetails.new(self)
91
- @policy_definitions = PolicyDefinitions.new(self)
92
- @policy_assignments = PolicyAssignments.new(self)
93
- @api_version = '2015-11-01'
85
+ @api_version = '2016-02-01'
94
86
  @accept_language = 'en-US'
95
87
  @long_running_operation_retry_timeout = 30
96
88
  @generate_client_request_id = true
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -27,13 +27,41 @@ module Azure::ARM::Resources
27
27
  #
28
28
  # @param resource_provider_namespace [String] Resource identity.
29
29
  # @param api_version [String]
30
- # @param [Hash{String => String}] The hash of custom headers need to be
31
- # applied to HTTP request.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
32
  #
33
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
34
- # response.
33
+ # @return [ResourceProviderOperationDetailListResult] operation results.
35
34
  #
36
35
  def list(resource_provider_namespace, api_version, custom_headers = nil)
36
+ response = list_async(resource_provider_namespace, api_version, custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Gets a list of resource providers.
42
+ #
43
+ # @param resource_provider_namespace [String] Resource identity.
44
+ # @param api_version [String]
45
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
46
+ # will be added to the HTTP request.
47
+ #
48
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
49
+ #
50
+ def list_with_http_info(resource_provider_namespace, api_version, custom_headers = nil)
51
+ list_async(resource_provider_namespace, api_version, custom_headers).value!
52
+ end
53
+
54
+ #
55
+ # Gets a list of resource providers.
56
+ #
57
+ # @param resource_provider_namespace [String] Resource identity.
58
+ # @param api_version [String]
59
+ # @param [Hash{String => String}] A hash of custom headers that will be added
60
+ # to the HTTP request.
61
+ #
62
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
63
+ #
64
+ def list_async(resource_provider_namespace, api_version, custom_headers = nil)
37
65
  fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
38
66
  fail ArgumentError, 'api_version is nil' if api_version.nil?
39
67
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
@@ -49,7 +77,10 @@ module Azure::ARM::Resources
49
77
  query_params: {'api-version' => api_version},
50
78
  headers: request_headers.merge(custom_headers || {})
51
79
  }
52
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
80
+
81
+ request_url = @base_url || @client.base_url
82
+
83
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
53
84
  promise = request.run_promise do |req|
54
85
  @client.credentials.sign_request(req) unless @client.credentials.nil?
55
86
  end
@@ -101,13 +132,41 @@ module Azure::ARM::Resources
101
132
  #
102
133
  # @param next_page_link [String] The NextLink from the previous successful
103
134
  # call to List operation.
104
- # @param [Hash{String => String}] The hash of custom headers need to be
105
- # applied to HTTP request.
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
106
137
  #
107
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
108
- # response.
138
+ # @return [ResourceProviderOperationDetailListResult] operation results.
109
139
  #
110
140
  def list_next(next_page_link, custom_headers = nil)
141
+ response = list_next_async(next_page_link, custom_headers).value!
142
+ response.body unless response.nil?
143
+ end
144
+
145
+ #
146
+ # Gets a list of resource providers.
147
+ #
148
+ # @param next_page_link [String] The NextLink from the previous successful
149
+ # call to List operation.
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
154
+ #
155
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
156
+ list_next_async(next_page_link, custom_headers).value!
157
+ end
158
+
159
+ #
160
+ # Gets a list of resource providers.
161
+ #
162
+ # @param next_page_link [String] The NextLink from the previous successful
163
+ # call to List operation.
164
+ # @param [Hash{String => String}] A hash of custom headers that will be added
165
+ # to the HTTP request.
166
+ #
167
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
168
+ #
169
+ def list_next_async(next_page_link, custom_headers = nil)
111
170
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
112
171
  request_headers = {}
113
172
 
@@ -120,7 +179,10 @@ module Azure::ARM::Resources
120
179
  skip_encoding_path_params: {'nextLink' => next_page_link},
121
180
  headers: request_headers.merge(custom_headers || {})
122
181
  }
123
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
182
+
183
+ request_url = @base_url || @client.base_url
184
+
185
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
124
186
  promise = request.run_promise do |req|
125
187
  @client.credentials.sign_request(req) unless @client.credentials.nil?
126
188
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -23,8 +23,8 @@ module Azure::ARM::Resources
23
23
  attr_reader :client
24
24
 
25
25
  #
26
- # Begin moving resources.To determine whether the operation has finished
27
- # processing the request, call GetLongRunningOperationStatus.
26
+ # Move resources from one resource group to another. The resources being moved
27
+ # should all be in the same resource group.
28
28
  #
29
29
  # @param source_resource_group_name [String] Source resource group name.
30
30
  # @param parameters [ResourcesMoveInfo] move resources' parameters.
@@ -33,7 +33,7 @@ module Azure::ARM::Resources
33
33
  #
34
34
  def move_resources(source_resource_group_name, parameters, custom_headers = nil)
35
35
  # Send request
36
- promise = begin_move_resources(source_resource_group_name, parameters, custom_headers)
36
+ promise = begin_move_resources_async(source_resource_group_name, parameters, custom_headers)
37
37
 
38
38
  promise = promise.then do |response|
39
39
  # Defining deserialization method.
@@ -41,25 +41,54 @@ module Azure::ARM::Resources
41
41
  end
42
42
 
43
43
  # Waiting for response.
44
- @client.get_post_or_delete_operation_result(response, deserialize_method)
44
+ @client.get_long_running_operation_result(response, deserialize_method)
45
45
  end
46
46
 
47
47
  promise
48
48
  end
49
49
 
50
50
  #
51
- # Begin moving resources.To determine whether the operation has finished
52
- # processing the request, call GetLongRunningOperationStatus.
51
+ # Move resources from one resource group to another. The resources being moved
52
+ # should all be in the same resource group.
53
53
  #
54
54
  # @param source_resource_group_name [String] Source resource group name.
55
55
  # @param parameters [ResourcesMoveInfo] move resources' parameters.
56
- # @param [Hash{String => String}] The hash of custom headers need to be
57
- # applied to HTTP request.
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
58
  #
59
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
60
- # response.
61
59
  #
62
60
  def begin_move_resources(source_resource_group_name, parameters, custom_headers = nil)
61
+ response = begin_move_resources_async(source_resource_group_name, parameters, custom_headers).value!
62
+ nil
63
+ end
64
+
65
+ #
66
+ # Move resources from one resource group to another. The resources being moved
67
+ # should all be in the same resource group.
68
+ #
69
+ # @param source_resource_group_name [String] Source resource group name.
70
+ # @param parameters [ResourcesMoveInfo] move resources' parameters.
71
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
72
+ # will be added to the HTTP request.
73
+ #
74
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
75
+ #
76
+ def begin_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers = nil)
77
+ begin_move_resources_async(source_resource_group_name, parameters, custom_headers).value!
78
+ end
79
+
80
+ #
81
+ # Move resources from one resource group to another. The resources being moved
82
+ # should all be in the same resource group.
83
+ #
84
+ # @param source_resource_group_name [String] Source resource group name.
85
+ # @param parameters [ResourcesMoveInfo] move resources' parameters.
86
+ # @param [Hash{String => String}] A hash of custom headers that will be added
87
+ # to the HTTP request.
88
+ #
89
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
90
+ #
91
+ def begin_move_resources_async(source_resource_group_name, parameters, custom_headers = nil)
63
92
  fail ArgumentError, 'source_resource_group_name is nil' if source_resource_group_name.nil?
64
93
  fail ArgumentError, 'parameters is nil' if parameters.nil?
65
94
  parameters.validate unless parameters.nil?
@@ -76,7 +105,7 @@ module Azure::ARM::Resources
76
105
  unless parameters.nil?
77
106
  parameters = ResourcesMoveInfo.serialize_object(parameters)
78
107
  end
79
- request_content = JSON.generate(parameters, quirks_mode: true)
108
+ request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
80
109
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources'
81
110
  options = {
82
111
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -85,7 +114,10 @@ module Azure::ARM::Resources
85
114
  body: request_content,
86
115
  headers: request_headers.merge(custom_headers || {})
87
116
  }
88
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
117
+
118
+ request_url = @base_url || @client.base_url
119
+
120
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
89
121
  promise = request.run_promise do |req|
90
122
  @client.credentials.sign_request(req) unless @client.credentials.nil?
91
123
  end
@@ -114,13 +146,43 @@ module Azure::ARM::Resources
114
146
  # @param filter [String] The filter to apply on the operation.
115
147
  # @param top [Integer] Query parameters. If null is passed returns all
116
148
  # resource groups.
117
- # @param [Hash{String => String}] The hash of custom headers need to be
118
- # applied to HTTP request.
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
119
151
  #
120
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
121
- # response.
152
+ # @return [ResourceListResult] operation results.
122
153
  #
123
154
  def list(filter = nil, top = nil, custom_headers = nil)
155
+ response = list_async(filter, top, custom_headers).value!
156
+ response.body unless response.nil?
157
+ end
158
+
159
+ #
160
+ # Get all of the resources under a subscription.
161
+ #
162
+ # @param filter [String] The filter to apply on the operation.
163
+ # @param top [Integer] Query parameters. If null is passed returns all
164
+ # resource groups.
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 list_with_http_info(filter = nil, top = nil, custom_headers = nil)
171
+ list_async(filter, top, custom_headers).value!
172
+ end
173
+
174
+ #
175
+ # Get all of the resources under a subscription.
176
+ #
177
+ # @param filter [String] The filter to apply on the operation.
178
+ # @param top [Integer] Query parameters. If null is passed returns all
179
+ # resource groups.
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 list_async(filter = nil, top = nil, custom_headers = nil)
124
186
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
125
187
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
126
188
  request_headers = {}
@@ -135,7 +197,10 @@ module Azure::ARM::Resources
135
197
  query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
136
198
  headers: request_headers.merge(custom_headers || {})
137
199
  }
138
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
200
+
201
+ request_url = @base_url || @client.base_url
202
+
203
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
139
204
  promise = request.run_promise do |req|
140
205
  @client.credentials.sign_request(req) unless @client.credentials.nil?
141
206
  end
@@ -180,13 +245,51 @@ module Azure::ARM::Resources
180
245
  # @param resource_type [String] Resource identity.
181
246
  # @param resource_name [String] Resource identity.
182
247
  # @param api_version [String]
183
- # @param [Hash{String => String}] The hash of custom headers need to be
184
- # applied to HTTP request.
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
185
250
  #
186
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
187
- # response.
251
+ # @return [Boolean] operation results.
188
252
  #
189
253
  def check_existence(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
254
+ response = check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
255
+ response.body unless response.nil?
256
+ end
257
+
258
+ #
259
+ # Checks whether resource exists.
260
+ #
261
+ # @param resource_group_name [String] The name of the resource group. The name
262
+ # is case insensitive.
263
+ # @param resource_provider_namespace [String] Resource identity.
264
+ # @param parent_resource_path [String] Resource identity.
265
+ # @param resource_type [String] Resource identity.
266
+ # @param resource_name [String] Resource identity.
267
+ # @param api_version [String]
268
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
269
+ # will be added to the HTTP request.
270
+ #
271
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
272
+ #
273
+ def check_existence_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
274
+ check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
275
+ end
276
+
277
+ #
278
+ # Checks whether resource exists.
279
+ #
280
+ # @param resource_group_name [String] The name of the resource group. The name
281
+ # is case insensitive.
282
+ # @param resource_provider_namespace [String] Resource identity.
283
+ # @param parent_resource_path [String] Resource identity.
284
+ # @param resource_type [String] Resource identity.
285
+ # @param resource_name [String] Resource identity.
286
+ # @param api_version [String]
287
+ # @param [Hash{String => String}] A hash of custom headers that will be added
288
+ # to the HTTP request.
289
+ #
290
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
291
+ #
292
+ def check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
190
293
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
191
294
  fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
192
295
  fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
@@ -207,7 +310,10 @@ module Azure::ARM::Resources
207
310
  query_params: {'api-version' => api_version},
208
311
  headers: request_headers.merge(custom_headers || {})
209
312
  }
210
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :head, options)
313
+
314
+ request_url = @base_url || @client.base_url
315
+
316
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :head, options)
211
317
  promise = request.run_promise do |req|
212
318
  @client.credentials.sign_request(req) unless @client.credentials.nil?
213
319
  end
@@ -241,13 +347,50 @@ module Azure::ARM::Resources
241
347
  # @param resource_type [String] Resource identity.
242
348
  # @param resource_name [String] Resource identity.
243
349
  # @param api_version [String]
244
- # @param [Hash{String => String}] The hash of custom headers need to be
245
- # applied to HTTP request.
350
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
351
+ # will be added to the HTTP request.
246
352
  #
247
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
248
- # response.
249
353
  #
250
354
  def delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
355
+ response = delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
356
+ nil
357
+ end
358
+
359
+ #
360
+ # Delete resource and all of its resources.
361
+ #
362
+ # @param resource_group_name [String] The name of the resource group. The name
363
+ # is case insensitive.
364
+ # @param resource_provider_namespace [String] Resource identity.
365
+ # @param parent_resource_path [String] Resource identity.
366
+ # @param resource_type [String] Resource identity.
367
+ # @param resource_name [String] Resource identity.
368
+ # @param api_version [String]
369
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
370
+ # will be added to the HTTP request.
371
+ #
372
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
373
+ #
374
+ def delete_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
375
+ delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
376
+ end
377
+
378
+ #
379
+ # Delete resource and all of its resources.
380
+ #
381
+ # @param resource_group_name [String] The name of the resource group. The name
382
+ # is case insensitive.
383
+ # @param resource_provider_namespace [String] Resource identity.
384
+ # @param parent_resource_path [String] Resource identity.
385
+ # @param resource_type [String] Resource identity.
386
+ # @param resource_name [String] Resource identity.
387
+ # @param api_version [String]
388
+ # @param [Hash{String => String}] A hash of custom headers that will be added
389
+ # to the HTTP request.
390
+ #
391
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
392
+ #
393
+ def delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
251
394
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
252
395
  fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
253
396
  fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
@@ -268,7 +411,10 @@ module Azure::ARM::Resources
268
411
  query_params: {'api-version' => api_version},
269
412
  headers: request_headers.merge(custom_headers || {})
270
413
  }
271
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
414
+
415
+ request_url = @base_url || @client.base_url
416
+
417
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
272
418
  promise = request.run_promise do |req|
273
419
  @client.credentials.sign_request(req) unless @client.credentials.nil?
274
420
  end
@@ -302,13 +448,53 @@ module Azure::ARM::Resources
302
448
  # @param resource_name [String] Resource identity.
303
449
  # @param api_version [String]
304
450
  # @param parameters [GenericResource] Create or update resource parameters.
305
- # @param [Hash{String => String}] The hash of custom headers need to be
306
- # applied to HTTP request.
451
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
452
+ # will be added to the HTTP request.
307
453
  #
308
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
309
- # response.
454
+ # @return [GenericResource] operation results.
310
455
  #
311
456
  def create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers = nil)
457
+ response = create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers).value!
458
+ response.body unless response.nil?
459
+ end
460
+
461
+ #
462
+ # Create a resource.
463
+ #
464
+ # @param resource_group_name [String] The name of the resource group. The name
465
+ # is case insensitive.
466
+ # @param resource_provider_namespace [String] Resource identity.
467
+ # @param parent_resource_path [String] Resource identity.
468
+ # @param resource_type [String] Resource identity.
469
+ # @param resource_name [String] Resource identity.
470
+ # @param api_version [String]
471
+ # @param parameters [GenericResource] Create or update resource parameters.
472
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
473
+ # will be added to the HTTP request.
474
+ #
475
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
476
+ #
477
+ def create_or_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers = nil)
478
+ create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers).value!
479
+ end
480
+
481
+ #
482
+ # Create a resource.
483
+ #
484
+ # @param resource_group_name [String] The name of the resource group. The name
485
+ # is case insensitive.
486
+ # @param resource_provider_namespace [String] Resource identity.
487
+ # @param parent_resource_path [String] Resource identity.
488
+ # @param resource_type [String] Resource identity.
489
+ # @param resource_name [String] Resource identity.
490
+ # @param api_version [String]
491
+ # @param parameters [GenericResource] Create or update resource parameters.
492
+ # @param [Hash{String => String}] A hash of custom headers that will be added
493
+ # to the HTTP request.
494
+ #
495
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
496
+ #
497
+ def create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers = nil)
312
498
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
313
499
  fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
314
500
  fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
@@ -329,7 +515,7 @@ module Azure::ARM::Resources
329
515
  unless parameters.nil?
330
516
  parameters = GenericResource.serialize_object(parameters)
331
517
  end
332
- request_content = JSON.generate(parameters, quirks_mode: true)
518
+ request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
333
519
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
334
520
  options = {
335
521
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -339,7 +525,10 @@ module Azure::ARM::Resources
339
525
  body: request_content,
340
526
  headers: request_headers.merge(custom_headers || {})
341
527
  }
342
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
528
+
529
+ request_url = @base_url || @client.base_url
530
+
531
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
343
532
  promise = request.run_promise do |req|
344
533
  @client.credentials.sign_request(req) unless @client.credentials.nil?
345
534
  end
@@ -396,13 +585,51 @@ module Azure::ARM::Resources
396
585
  # @param resource_type [String] Resource identity.
397
586
  # @param resource_name [String] Resource identity.
398
587
  # @param api_version [String]
399
- # @param [Hash{String => String}] The hash of custom headers need to be
400
- # applied to HTTP request.
588
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
589
+ # will be added to the HTTP request.
401
590
  #
402
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
403
- # response.
591
+ # @return [GenericResource] operation results.
404
592
  #
405
593
  def get(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
594
+ response = get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
595
+ response.body unless response.nil?
596
+ end
597
+
598
+ #
599
+ # Returns a resource belonging to a resource group.
600
+ #
601
+ # @param resource_group_name [String] The name of the resource group. The name
602
+ # is case insensitive.
603
+ # @param resource_provider_namespace [String] Resource identity.
604
+ # @param parent_resource_path [String] Resource identity.
605
+ # @param resource_type [String] Resource identity.
606
+ # @param resource_name [String] Resource identity.
607
+ # @param api_version [String]
608
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
609
+ # will be added to the HTTP request.
610
+ #
611
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
612
+ #
613
+ def get_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
614
+ get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
615
+ end
616
+
617
+ #
618
+ # Returns a resource belonging to a resource group.
619
+ #
620
+ # @param resource_group_name [String] The name of the resource group. The name
621
+ # is case insensitive.
622
+ # @param resource_provider_namespace [String] Resource identity.
623
+ # @param parent_resource_path [String] Resource identity.
624
+ # @param resource_type [String] Resource identity.
625
+ # @param resource_name [String] Resource identity.
626
+ # @param api_version [String]
627
+ # @param [Hash{String => String}] A hash of custom headers that will be added
628
+ # to the HTTP request.
629
+ #
630
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
631
+ #
632
+ def get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
406
633
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
407
634
  fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
408
635
  fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
@@ -423,7 +650,10 @@ module Azure::ARM::Resources
423
650
  query_params: {'api-version' => api_version},
424
651
  headers: request_headers.merge(custom_headers || {})
425
652
  }
426
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
653
+
654
+ request_url = @base_url || @client.base_url
655
+
656
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
427
657
  promise = request.run_promise do |req|
428
658
  @client.credentials.sign_request(req) unless @client.credentials.nil?
429
659
  end
@@ -431,7 +661,7 @@ module Azure::ARM::Resources
431
661
  promise = promise.then do |http_response|
432
662
  status_code = http_response.status
433
663
  response_content = http_response.body
434
- unless status_code == 200 || status_code == 204
664
+ unless status_code == 200
435
665
  error_model = JSON.load(response_content)
436
666
  fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
437
667
  end
@@ -451,18 +681,6 @@ module Azure::ARM::Resources
451
681
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
452
682
  end
453
683
  end
454
- # Deserialize Response
455
- if status_code == 204
456
- begin
457
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
458
- unless parsed_response.nil?
459
- parsed_response = GenericResource.deserialize_object(parsed_response)
460
- end
461
- result.body = parsed_response
462
- rescue Exception => e
463
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
464
- end
465
- end
466
684
 
467
685
  result
468
686
  end
@@ -475,13 +693,41 @@ module Azure::ARM::Resources
475
693
  #
476
694
  # @param next_page_link [String] The NextLink from the previous successful
477
695
  # call to List operation.
478
- # @param [Hash{String => String}] The hash of custom headers need to be
479
- # applied to HTTP request.
696
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
697
+ # will be added to the HTTP request.
480
698
  #
481
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
482
- # response.
699
+ # @return [ResourceListResult] operation results.
483
700
  #
484
701
  def list_next(next_page_link, custom_headers = nil)
702
+ response = list_next_async(next_page_link, custom_headers).value!
703
+ response.body unless response.nil?
704
+ end
705
+
706
+ #
707
+ # Get all of the resources under a subscription.
708
+ #
709
+ # @param next_page_link [String] The NextLink from the previous successful
710
+ # call to List operation.
711
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
712
+ # will be added to the HTTP request.
713
+ #
714
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
715
+ #
716
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
717
+ list_next_async(next_page_link, custom_headers).value!
718
+ end
719
+
720
+ #
721
+ # Get all of the resources under a subscription.
722
+ #
723
+ # @param next_page_link [String] The NextLink from the previous successful
724
+ # call to List operation.
725
+ # @param [Hash{String => String}] A hash of custom headers that will be added
726
+ # to the HTTP request.
727
+ #
728
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
729
+ #
730
+ def list_next_async(next_page_link, custom_headers = nil)
485
731
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
486
732
  request_headers = {}
487
733
 
@@ -494,7 +740,10 @@ module Azure::ARM::Resources
494
740
  skip_encoding_path_params: {'nextLink' => next_page_link},
495
741
  headers: request_headers.merge(custom_headers || {})
496
742
  }
497
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
743
+
744
+ request_url = @base_url || @client.base_url
745
+
746
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
498
747
  promise = request.run_promise do |req|
499
748
  @client.credentials.sign_request(req) unless @client.credentials.nil?
500
749
  end