azure_mgmt_resources 0.1.0 → 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.
- checksums.yaml +13 -5
- data/README.md +1 -27
- data/azure_mgmt_resources.gemspec +2 -6
- data/lib/azure_mgmt_resources/deployment_operations.rb +161 -141
- data/lib/azure_mgmt_resources/deployments.rb +684 -310
- data/lib/azure_mgmt_resources/{Models → models}/basic_dependency.rb +1 -3
- data/lib/azure_mgmt_resources/models/debug_setting.rb +56 -0
- data/lib/azure_mgmt_resources/{Models → models}/dependency.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/deployment.rb +1 -3
- data/lib/azure_mgmt_resources/models/deployment_export_result.rb +56 -0
- data/lib/azure_mgmt_resources/{Models → models}/deployment_extended.rb +8 -9
- data/lib/azure_mgmt_resources/{Models → models}/deployment_extended_filter.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/deployment_list_result.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/deployment_mode.rb +2 -1
- data/lib/azure_mgmt_resources/{Models → models}/deployment_operation.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/deployment_operation_properties.rb +41 -2
- data/lib/azure_mgmt_resources/{Models → models}/deployment_operations_list_result.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/deployment_properties.rb +19 -4
- data/lib/azure_mgmt_resources/{Models → models}/deployment_properties_extended.rb +25 -10
- data/lib/azure_mgmt_resources/{Models → models}/deployment_validate_result.rb +1 -3
- data/lib/azure_mgmt_resources/models/export_template_request.rb +69 -0
- data/lib/azure_mgmt_resources/{Models → models}/generic_resource.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/generic_resource_filter.rb +1 -3
- data/lib/azure_mgmt_resources/models/http_message.rb +56 -0
- data/lib/azure_mgmt_resources/{Models → models}/parameters_link.rb +2 -4
- data/lib/azure_mgmt_resources/{Models → models}/plan.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/provider.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/provider_list_result.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/provider_resource_type.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resource_group.rb +8 -9
- data/lib/azure_mgmt_resources/models/resource_group_export_result.rb +71 -0
- data/lib/azure_mgmt_resources/{Models → models}/resource_group_filter.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resource_group_list_result.rb +11 -12
- data/lib/azure_mgmt_resources/{Models → models}/resource_group_properties.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resource_list_result.rb +11 -12
- data/lib/azure_mgmt_resources/{Models → models}/resource_management_error_with_details.rb +29 -28
- data/lib/azure_mgmt_resources/{Models → models}/resource_provider_operation_definition.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resource_provider_operation_detail_list_result.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/resource_provider_operation_display_properties.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resources_move_info.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/tag_count.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/tag_details.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/tag_value.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/tags_list_result.rb +11 -12
- data/lib/azure_mgmt_resources/{Models → models}/target_resource.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/template_link.rb +2 -4
- data/lib/azure_mgmt_resources/module_definition.rb +5 -3
- data/lib/azure_mgmt_resources/providers.rb +265 -239
- data/lib/azure_mgmt_resources/resource_groups.rb +604 -465
- data/lib/azure_mgmt_resources/resource_management_client.rb +18 -11
- data/lib/azure_mgmt_resources/resource_provider_operation_details.rb +154 -47
- data/lib/azure_mgmt_resources/resources.rb +425 -380
- data/lib/azure_mgmt_resources/tags.rb +310 -288
- data/lib/azure_mgmt_resources/version.rb +5 -3
- data/lib/azure_mgmt_resources.rb +20 -19
- metadata +68 -126
- data/.travis.yml +0 -3
- data/Gemfile +0 -14
- data/lib/azure_mgmt_resources/Models/resource_group_extended.rb +0 -113
- data/lib/azure_mgmt_resources/Models/resource_group_extended_filter.rb +0 -63
- data/lib/azure_mgmt_resources/Models/resource_group_format_resource_properties.rb +0 -54
- data/lib/azure_mgmt_resources/Models/resource_management_error.rb +0 -77
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 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
|
|
|
@@ -24,83 +24,88 @@ module Azure::ARM::Resources
|
|
|
24
24
|
|
|
25
25
|
#
|
|
26
26
|
# Unregisters provider from a subscription.
|
|
27
|
+
#
|
|
27
28
|
# @param resource_provider_namespace [String] Namespace of the resource
|
|
28
29
|
# provider.
|
|
29
|
-
# @param [Hash{String => String}]
|
|
30
|
-
#
|
|
30
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
31
|
+
# will be added to the HTTP request.
|
|
31
32
|
#
|
|
32
|
-
# @return [
|
|
33
|
-
# response.
|
|
33
|
+
# @return [Provider] operation results.
|
|
34
34
|
#
|
|
35
35
|
def unregister(resource_provider_namespace, custom_headers = nil)
|
|
36
|
+
response = unregister_async(resource_provider_namespace, custom_headers).value!
|
|
37
|
+
response.body unless response.nil?
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
#
|
|
41
|
+
# Unregisters provider from a subscription.
|
|
42
|
+
#
|
|
43
|
+
# @param resource_provider_namespace [String] Namespace of the resource
|
|
44
|
+
# provider.
|
|
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 unregister_with_http_info(resource_provider_namespace, custom_headers = nil)
|
|
51
|
+
unregister_async(resource_provider_namespace, custom_headers).value!
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
#
|
|
55
|
+
# Unregisters provider from a subscription.
|
|
56
|
+
#
|
|
57
|
+
# @param resource_provider_namespace [String] Namespace of the resource
|
|
58
|
+
# provider.
|
|
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 unregister_async(resource_provider_namespace, custom_headers = nil)
|
|
36
65
|
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
|
|
37
66
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
38
67
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
39
|
-
|
|
40
|
-
path = "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister"
|
|
41
|
-
path['{resourceProviderNamespace}'] = ERB::Util.url_encode(resource_provider_namespace) if path.include?('{resourceProviderNamespace}')
|
|
42
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
|
43
|
-
url = URI.join(@client.base_url, path)
|
|
44
|
-
properties = {}
|
|
45
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
|
46
|
-
unless url.query.nil?
|
|
47
|
-
url.query.split('&').each do |url_item|
|
|
48
|
-
url_items_parts = url_item.split('=')
|
|
49
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
properties.reject!{ |key, value| value.nil? }
|
|
53
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
|
54
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
|
55
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
|
56
|
-
url = URI.parse(corrected_url)
|
|
57
|
-
|
|
58
|
-
connection = Faraday.new(:url => url) do |faraday|
|
|
59
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
|
60
|
-
faraday.use :cookie_jar
|
|
61
|
-
faraday.adapter Faraday.default_adapter
|
|
62
|
-
end
|
|
63
|
-
request_headers = Hash.new
|
|
68
|
+
request_headers = {}
|
|
64
69
|
|
|
65
70
|
# Set Headers
|
|
66
71
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
67
|
-
request_headers[
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
73
|
+
path_template = '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister'
|
|
74
|
+
options = {
|
|
75
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
76
|
+
path_params: {'resourceProviderNamespace' => resource_provider_namespace,'subscriptionId' => @client.subscription_id},
|
|
77
|
+
query_params: {'api-version' => @client.api_version},
|
|
78
|
+
headers: request_headers.merge(custom_headers || {})
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
request_url = @base_url || @client.base_url
|
|
82
|
+
|
|
83
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
|
|
84
|
+
promise = request.run_promise do |req|
|
|
85
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
81
86
|
end
|
|
82
87
|
|
|
83
88
|
promise = promise.then do |http_response|
|
|
84
89
|
status_code = http_response.status
|
|
85
90
|
response_content = http_response.body
|
|
86
|
-
unless
|
|
91
|
+
unless status_code == 200
|
|
87
92
|
error_model = JSON.load(response_content)
|
|
88
|
-
fail MsRestAzure::AzureOperationError.new(
|
|
93
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
89
94
|
end
|
|
90
95
|
|
|
91
96
|
# Create Result
|
|
92
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
|
97
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
93
98
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
94
99
|
# Deserialize Response
|
|
95
100
|
if status_code == 200
|
|
96
101
|
begin
|
|
97
|
-
parsed_response = JSON.load(response_content)
|
|
102
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
98
103
|
unless parsed_response.nil?
|
|
99
104
|
parsed_response = Provider.deserialize_object(parsed_response)
|
|
100
105
|
end
|
|
101
106
|
result.body = parsed_response
|
|
102
107
|
rescue Exception => e
|
|
103
|
-
fail MsRest::DeserializationError.new(
|
|
108
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
104
109
|
end
|
|
105
110
|
end
|
|
106
111
|
|
|
@@ -112,83 +117,88 @@ module Azure::ARM::Resources
|
|
|
112
117
|
|
|
113
118
|
#
|
|
114
119
|
# Registers provider to be used with a subscription.
|
|
120
|
+
#
|
|
115
121
|
# @param resource_provider_namespace [String] Namespace of the resource
|
|
116
122
|
# provider.
|
|
117
|
-
# @param [Hash{String => String}]
|
|
118
|
-
#
|
|
123
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
124
|
+
# will be added to the HTTP request.
|
|
119
125
|
#
|
|
120
|
-
# @return [
|
|
121
|
-
# response.
|
|
126
|
+
# @return [Provider] operation results.
|
|
122
127
|
#
|
|
123
128
|
def register(resource_provider_namespace, custom_headers = nil)
|
|
129
|
+
response = register_async(resource_provider_namespace, custom_headers).value!
|
|
130
|
+
response.body unless response.nil?
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
#
|
|
134
|
+
# Registers provider to be used with a subscription.
|
|
135
|
+
#
|
|
136
|
+
# @param resource_provider_namespace [String] Namespace of the resource
|
|
137
|
+
# provider.
|
|
138
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
139
|
+
# will be added to the HTTP request.
|
|
140
|
+
#
|
|
141
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
142
|
+
#
|
|
143
|
+
def register_with_http_info(resource_provider_namespace, custom_headers = nil)
|
|
144
|
+
register_async(resource_provider_namespace, custom_headers).value!
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
#
|
|
148
|
+
# Registers provider to be used with a subscription.
|
|
149
|
+
#
|
|
150
|
+
# @param resource_provider_namespace [String] Namespace of the resource
|
|
151
|
+
# provider.
|
|
152
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
153
|
+
# to the HTTP request.
|
|
154
|
+
#
|
|
155
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
156
|
+
#
|
|
157
|
+
def register_async(resource_provider_namespace, custom_headers = nil)
|
|
124
158
|
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
|
|
125
159
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
126
160
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
127
|
-
|
|
128
|
-
path = "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register"
|
|
129
|
-
path['{resourceProviderNamespace}'] = ERB::Util.url_encode(resource_provider_namespace) if path.include?('{resourceProviderNamespace}')
|
|
130
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
|
131
|
-
url = URI.join(@client.base_url, path)
|
|
132
|
-
properties = {}
|
|
133
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
|
134
|
-
unless url.query.nil?
|
|
135
|
-
url.query.split('&').each do |url_item|
|
|
136
|
-
url_items_parts = url_item.split('=')
|
|
137
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
|
138
|
-
end
|
|
139
|
-
end
|
|
140
|
-
properties.reject!{ |key, value| value.nil? }
|
|
141
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
|
142
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
|
143
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
|
144
|
-
url = URI.parse(corrected_url)
|
|
145
|
-
|
|
146
|
-
connection = Faraday.new(:url => url) do |faraday|
|
|
147
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
|
148
|
-
faraday.use :cookie_jar
|
|
149
|
-
faraday.adapter Faraday.default_adapter
|
|
150
|
-
end
|
|
151
|
-
request_headers = Hash.new
|
|
161
|
+
request_headers = {}
|
|
152
162
|
|
|
153
163
|
# Set Headers
|
|
154
164
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
155
|
-
request_headers[
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
166
|
+
path_template = '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register'
|
|
167
|
+
options = {
|
|
168
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
169
|
+
path_params: {'resourceProviderNamespace' => resource_provider_namespace,'subscriptionId' => @client.subscription_id},
|
|
170
|
+
query_params: {'api-version' => @client.api_version},
|
|
171
|
+
headers: request_headers.merge(custom_headers || {})
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
request_url = @base_url || @client.base_url
|
|
175
|
+
|
|
176
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
|
|
177
|
+
promise = request.run_promise do |req|
|
|
178
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
169
179
|
end
|
|
170
180
|
|
|
171
181
|
promise = promise.then do |http_response|
|
|
172
182
|
status_code = http_response.status
|
|
173
183
|
response_content = http_response.body
|
|
174
|
-
unless
|
|
184
|
+
unless status_code == 200
|
|
175
185
|
error_model = JSON.load(response_content)
|
|
176
|
-
fail MsRestAzure::AzureOperationError.new(
|
|
186
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
177
187
|
end
|
|
178
188
|
|
|
179
189
|
# Create Result
|
|
180
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
|
190
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
181
191
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
182
192
|
# Deserialize Response
|
|
183
193
|
if status_code == 200
|
|
184
194
|
begin
|
|
185
|
-
parsed_response = JSON.load(response_content)
|
|
195
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
186
196
|
unless parsed_response.nil?
|
|
187
197
|
parsed_response = Provider.deserialize_object(parsed_response)
|
|
188
198
|
end
|
|
189
199
|
result.body = parsed_response
|
|
190
200
|
rescue Exception => e
|
|
191
|
-
fail MsRest::DeserializationError.new(
|
|
201
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
192
202
|
end
|
|
193
203
|
end
|
|
194
204
|
|
|
@@ -200,82 +210,87 @@ module Azure::ARM::Resources
|
|
|
200
210
|
|
|
201
211
|
#
|
|
202
212
|
# Gets a list of resource providers.
|
|
213
|
+
#
|
|
203
214
|
# @param top [Integer] Query parameters. If null is passed returns all
|
|
204
215
|
# deployments.
|
|
205
|
-
# @param [Hash{String => String}]
|
|
206
|
-
#
|
|
216
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
217
|
+
# will be added to the HTTP request.
|
|
207
218
|
#
|
|
208
|
-
# @return [
|
|
209
|
-
# response.
|
|
219
|
+
# @return [ProviderListResult] operation results.
|
|
210
220
|
#
|
|
211
221
|
def list(top = nil, custom_headers = nil)
|
|
222
|
+
response = list_async(top, custom_headers).value!
|
|
223
|
+
response.body unless response.nil?
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
#
|
|
227
|
+
# Gets a list of resource providers.
|
|
228
|
+
#
|
|
229
|
+
# @param top [Integer] Query parameters. If null is passed returns all
|
|
230
|
+
# deployments.
|
|
231
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
232
|
+
# will be added to the HTTP request.
|
|
233
|
+
#
|
|
234
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
235
|
+
#
|
|
236
|
+
def list_with_http_info(top = nil, custom_headers = nil)
|
|
237
|
+
list_async(top, custom_headers).value!
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
#
|
|
241
|
+
# Gets a list of resource providers.
|
|
242
|
+
#
|
|
243
|
+
# @param top [Integer] Query parameters. If null is passed returns all
|
|
244
|
+
# deployments.
|
|
245
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
246
|
+
# to the HTTP request.
|
|
247
|
+
#
|
|
248
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
249
|
+
#
|
|
250
|
+
def list_async(top = nil, custom_headers = nil)
|
|
212
251
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
213
252
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
214
|
-
|
|
215
|
-
path = "/subscriptions/{subscriptionId}/providers"
|
|
216
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
|
217
|
-
url = URI.join(@client.base_url, path)
|
|
218
|
-
properties = {}
|
|
219
|
-
properties['$top'] = ERB::Util.url_encode(top.to_s) unless top.nil?
|
|
220
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
|
221
|
-
unless url.query.nil?
|
|
222
|
-
url.query.split('&').each do |url_item|
|
|
223
|
-
url_items_parts = url_item.split('=')
|
|
224
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
|
225
|
-
end
|
|
226
|
-
end
|
|
227
|
-
properties.reject!{ |key, value| value.nil? }
|
|
228
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
|
229
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
|
230
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
|
231
|
-
url = URI.parse(corrected_url)
|
|
232
|
-
|
|
233
|
-
connection = Faraday.new(:url => url) do |faraday|
|
|
234
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
|
235
|
-
faraday.use :cookie_jar
|
|
236
|
-
faraday.adapter Faraday.default_adapter
|
|
237
|
-
end
|
|
238
|
-
request_headers = Hash.new
|
|
253
|
+
request_headers = {}
|
|
239
254
|
|
|
240
255
|
# Set Headers
|
|
241
256
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
242
|
-
request_headers[
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
257
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
258
|
+
path_template = '/subscriptions/{subscriptionId}/providers'
|
|
259
|
+
options = {
|
|
260
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
261
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
|
262
|
+
query_params: {'$top' => top,'api-version' => @client.api_version},
|
|
263
|
+
headers: request_headers.merge(custom_headers || {})
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
request_url = @base_url || @client.base_url
|
|
267
|
+
|
|
268
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
|
269
|
+
promise = request.run_promise do |req|
|
|
270
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
256
271
|
end
|
|
257
272
|
|
|
258
273
|
promise = promise.then do |http_response|
|
|
259
274
|
status_code = http_response.status
|
|
260
275
|
response_content = http_response.body
|
|
261
|
-
unless
|
|
276
|
+
unless status_code == 200
|
|
262
277
|
error_model = JSON.load(response_content)
|
|
263
|
-
fail MsRestAzure::AzureOperationError.new(
|
|
278
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
264
279
|
end
|
|
265
280
|
|
|
266
281
|
# Create Result
|
|
267
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
|
282
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
268
283
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
269
284
|
# Deserialize Response
|
|
270
285
|
if status_code == 200
|
|
271
286
|
begin
|
|
272
|
-
parsed_response = JSON.load(response_content)
|
|
287
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
273
288
|
unless parsed_response.nil?
|
|
274
289
|
parsed_response = ProviderListResult.deserialize_object(parsed_response)
|
|
275
290
|
end
|
|
276
291
|
result.body = parsed_response
|
|
277
292
|
rescue Exception => e
|
|
278
|
-
fail MsRest::DeserializationError.new(
|
|
293
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
279
294
|
end
|
|
280
295
|
end
|
|
281
296
|
|
|
@@ -287,83 +302,88 @@ module Azure::ARM::Resources
|
|
|
287
302
|
|
|
288
303
|
#
|
|
289
304
|
# Gets a resource provider.
|
|
305
|
+
#
|
|
290
306
|
# @param resource_provider_namespace [String] Namespace of the resource
|
|
291
307
|
# provider.
|
|
292
|
-
# @param [Hash{String => String}]
|
|
293
|
-
#
|
|
308
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
309
|
+
# will be added to the HTTP request.
|
|
294
310
|
#
|
|
295
|
-
# @return [
|
|
296
|
-
# response.
|
|
311
|
+
# @return [Provider] operation results.
|
|
297
312
|
#
|
|
298
313
|
def get(resource_provider_namespace, custom_headers = nil)
|
|
314
|
+
response = get_async(resource_provider_namespace, custom_headers).value!
|
|
315
|
+
response.body unless response.nil?
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
#
|
|
319
|
+
# Gets a resource provider.
|
|
320
|
+
#
|
|
321
|
+
# @param resource_provider_namespace [String] Namespace of the resource
|
|
322
|
+
# provider.
|
|
323
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
324
|
+
# will be added to the HTTP request.
|
|
325
|
+
#
|
|
326
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
327
|
+
#
|
|
328
|
+
def get_with_http_info(resource_provider_namespace, custom_headers = nil)
|
|
329
|
+
get_async(resource_provider_namespace, custom_headers).value!
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
#
|
|
333
|
+
# Gets a resource provider.
|
|
334
|
+
#
|
|
335
|
+
# @param resource_provider_namespace [String] Namespace of the resource
|
|
336
|
+
# provider.
|
|
337
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
338
|
+
# to the HTTP request.
|
|
339
|
+
#
|
|
340
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
341
|
+
#
|
|
342
|
+
def get_async(resource_provider_namespace, custom_headers = nil)
|
|
299
343
|
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
|
|
300
344
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
301
345
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
302
|
-
|
|
303
|
-
path = "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}"
|
|
304
|
-
path['{resourceProviderNamespace}'] = ERB::Util.url_encode(resource_provider_namespace) if path.include?('{resourceProviderNamespace}')
|
|
305
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
|
306
|
-
url = URI.join(@client.base_url, path)
|
|
307
|
-
properties = {}
|
|
308
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
|
309
|
-
unless url.query.nil?
|
|
310
|
-
url.query.split('&').each do |url_item|
|
|
311
|
-
url_items_parts = url_item.split('=')
|
|
312
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
|
313
|
-
end
|
|
314
|
-
end
|
|
315
|
-
properties.reject!{ |key, value| value.nil? }
|
|
316
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
|
317
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
|
318
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
|
319
|
-
url = URI.parse(corrected_url)
|
|
320
|
-
|
|
321
|
-
connection = Faraday.new(:url => url) do |faraday|
|
|
322
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
|
323
|
-
faraday.use :cookie_jar
|
|
324
|
-
faraday.adapter Faraday.default_adapter
|
|
325
|
-
end
|
|
326
|
-
request_headers = Hash.new
|
|
346
|
+
request_headers = {}
|
|
327
347
|
|
|
328
348
|
# Set Headers
|
|
329
349
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
330
|
-
request_headers[
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
350
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
351
|
+
path_template = '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}'
|
|
352
|
+
options = {
|
|
353
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
354
|
+
path_params: {'resourceProviderNamespace' => resource_provider_namespace,'subscriptionId' => @client.subscription_id},
|
|
355
|
+
query_params: {'api-version' => @client.api_version},
|
|
356
|
+
headers: request_headers.merge(custom_headers || {})
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
request_url = @base_url || @client.base_url
|
|
360
|
+
|
|
361
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
|
362
|
+
promise = request.run_promise do |req|
|
|
363
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
344
364
|
end
|
|
345
365
|
|
|
346
366
|
promise = promise.then do |http_response|
|
|
347
367
|
status_code = http_response.status
|
|
348
368
|
response_content = http_response.body
|
|
349
|
-
unless
|
|
369
|
+
unless status_code == 200
|
|
350
370
|
error_model = JSON.load(response_content)
|
|
351
|
-
fail MsRestAzure::AzureOperationError.new(
|
|
371
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
352
372
|
end
|
|
353
373
|
|
|
354
374
|
# Create Result
|
|
355
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
|
375
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
356
376
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
357
377
|
# Deserialize Response
|
|
358
378
|
if status_code == 200
|
|
359
379
|
begin
|
|
360
|
-
parsed_response = JSON.load(response_content)
|
|
380
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
361
381
|
unless parsed_response.nil?
|
|
362
382
|
parsed_response = Provider.deserialize_object(parsed_response)
|
|
363
383
|
end
|
|
364
384
|
result.body = parsed_response
|
|
365
385
|
rescue Exception => e
|
|
366
|
-
fail MsRest::DeserializationError.new(
|
|
386
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
367
387
|
end
|
|
368
388
|
end
|
|
369
389
|
|
|
@@ -375,79 +395,85 @@ module Azure::ARM::Resources
|
|
|
375
395
|
|
|
376
396
|
#
|
|
377
397
|
# Gets a list of resource providers.
|
|
398
|
+
#
|
|
378
399
|
# @param next_page_link [String] The NextLink from the previous successful
|
|
379
400
|
# call to List operation.
|
|
380
|
-
# @param [Hash{String => String}]
|
|
381
|
-
#
|
|
401
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
402
|
+
# will be added to the HTTP request.
|
|
382
403
|
#
|
|
383
|
-
# @return [
|
|
384
|
-
# response.
|
|
404
|
+
# @return [ProviderListResult] operation results.
|
|
385
405
|
#
|
|
386
406
|
def list_next(next_page_link, custom_headers = nil)
|
|
407
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
|
408
|
+
response.body unless response.nil?
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
#
|
|
412
|
+
# Gets a list of resource providers.
|
|
413
|
+
#
|
|
414
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
|
415
|
+
# call to List operation.
|
|
416
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
417
|
+
# will be added to the HTTP request.
|
|
418
|
+
#
|
|
419
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
420
|
+
#
|
|
421
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
|
422
|
+
list_next_async(next_page_link, custom_headers).value!
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
#
|
|
426
|
+
# Gets a list of resource providers.
|
|
427
|
+
#
|
|
428
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
|
429
|
+
# call to List operation.
|
|
430
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
431
|
+
# to the HTTP request.
|
|
432
|
+
#
|
|
433
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
434
|
+
#
|
|
435
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
|
387
436
|
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
388
|
-
|
|
389
|
-
path = "{nextLink}"
|
|
390
|
-
path['{nextLink}'] = next_page_link if path.include?('{nextLink}')
|
|
391
|
-
url = URI.parse(path)
|
|
392
|
-
properties = {}
|
|
393
|
-
unless url.query.nil?
|
|
394
|
-
url.query.split('&').each do |url_item|
|
|
395
|
-
url_items_parts = url_item.split('=')
|
|
396
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
|
397
|
-
end
|
|
398
|
-
end
|
|
399
|
-
properties.reject!{ |key, value| value.nil? }
|
|
400
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
|
401
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
|
402
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
|
403
|
-
url = URI.parse(corrected_url)
|
|
404
|
-
|
|
405
|
-
connection = Faraday.new(:url => url) do |faraday|
|
|
406
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
|
407
|
-
faraday.use :cookie_jar
|
|
408
|
-
faraday.adapter Faraday.default_adapter
|
|
409
|
-
end
|
|
410
|
-
request_headers = Hash.new
|
|
437
|
+
request_headers = {}
|
|
411
438
|
|
|
412
439
|
# Set Headers
|
|
413
440
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
414
|
-
request_headers[
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
end
|
|
441
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
442
|
+
path_template = '{nextLink}'
|
|
443
|
+
options = {
|
|
444
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
445
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
446
|
+
headers: request_headers.merge(custom_headers || {})
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
request_url = @base_url || @client.base_url
|
|
450
|
+
|
|
451
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
|
452
|
+
promise = request.run_promise do |req|
|
|
453
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
428
454
|
end
|
|
429
455
|
|
|
430
456
|
promise = promise.then do |http_response|
|
|
431
457
|
status_code = http_response.status
|
|
432
458
|
response_content = http_response.body
|
|
433
|
-
unless
|
|
459
|
+
unless status_code == 200
|
|
434
460
|
error_model = JSON.load(response_content)
|
|
435
|
-
fail MsRestAzure::AzureOperationError.new(
|
|
461
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
436
462
|
end
|
|
437
463
|
|
|
438
464
|
# Create Result
|
|
439
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
|
465
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
440
466
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
441
467
|
# Deserialize Response
|
|
442
468
|
if status_code == 200
|
|
443
469
|
begin
|
|
444
|
-
parsed_response = JSON.load(response_content)
|
|
470
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
445
471
|
unless parsed_response.nil?
|
|
446
472
|
parsed_response = ProviderListResult.deserialize_object(parsed_response)
|
|
447
473
|
end
|
|
448
474
|
result.body = parsed_response
|
|
449
475
|
rescue Exception => e
|
|
450
|
-
fail MsRest::DeserializationError.new(
|
|
476
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
451
477
|
end
|
|
452
478
|
end
|
|
453
479
|
|