azure_mgmt_resources_management 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/azure_mgmt_resources_management.rb +7 -0
- data/lib/generated/azure_mgmt_resources_management.rb +43 -0
- data/lib/generated/azure_mgmt_resources_management/management_groups.rb +349 -0
- data/lib/generated/azure_mgmt_resources_management/management_groups_api.rb +134 -0
- data/lib/generated/azure_mgmt_resources_management/models/error_details.rb +64 -0
- data/lib/generated/azure_mgmt_resources_management/models/error_response.rb +45 -0
- data/lib/generated/azure_mgmt_resources_management/models/management_group.rb +102 -0
- data/lib/generated/azure_mgmt_resources_management/models/management_group_child_info.rb +78 -0
- data/lib/generated/azure_mgmt_resources_management/models/management_group_details_properties.rb +87 -0
- data/lib/generated/azure_mgmt_resources_management/models/management_group_info.rb +91 -0
- data/lib/generated/azure_mgmt_resources_management/models/management_group_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_resources_management/models/management_group_recursive_child_info.rb +97 -0
- data/lib/generated/azure_mgmt_resources_management/models/management_group_with_children.rb +120 -0
- data/lib/generated/azure_mgmt_resources_management/models/management_group_with_hierarchy.rb +121 -0
- data/lib/generated/azure_mgmt_resources_management/models/operation.rb +56 -0
- data/lib/generated/azure_mgmt_resources_management/models/operation_display.rb +68 -0
- data/lib/generated/azure_mgmt_resources_management/models/operation_list_result.rb +99 -0
- data/lib/generated/azure_mgmt_resources_management/models/parent_group_info.rb +55 -0
- data/lib/generated/azure_mgmt_resources_management/module_definition.rb +8 -0
- data/lib/generated/azure_mgmt_resources_management/operations.rb +217 -0
- data/lib/generated/azure_mgmt_resources_management/version.rb +8 -0
- metadata +135 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 858ed9177a581e85738abc5f38781802e9ebfe54
|
4
|
+
data.tar.gz: 7383a57cf6689b8fe85f90a81ce8bd7eb91fda34
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4207fd3e3b4697b56bc3f95c62aacc331199d7ba5f4c45013119e77b16308546e0e41a501df264bdb85573e5311c4136d2b6377c5b21c9d5105e2331ba08fe8e
|
7
|
+
data.tar.gz: 3a598ea194f04931e022f7c7affb37ade807e8b6bae6bf24f9e89c947367be2f3a8a06f03a7952bb6f0acd6be825e82957ea98d84bd5e3adc7d1db54efed8aa6
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Microsoft Corporation
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,43 @@
|
|
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
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require 'generated/azure_mgmt_resources_management/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::ARM::ResourcesManagement
|
23
|
+
autoload :ManagementGroups, 'generated/azure_mgmt_resources_management/management_groups.rb'
|
24
|
+
autoload :Operations, 'generated/azure_mgmt_resources_management/operations.rb'
|
25
|
+
autoload :ManagementGroupsAPI, 'generated/azure_mgmt_resources_management/management_groups_api.rb'
|
26
|
+
|
27
|
+
module Models
|
28
|
+
autoload :ParentGroupInfo, 'generated/azure_mgmt_resources_management/models/parent_group_info.rb'
|
29
|
+
autoload :ErrorDetails, 'generated/azure_mgmt_resources_management/models/error_details.rb'
|
30
|
+
autoload :ManagementGroupDetailsProperties, 'generated/azure_mgmt_resources_management/models/management_group_details_properties.rb'
|
31
|
+
autoload :OperationDisplay, 'generated/azure_mgmt_resources_management/models/operation_display.rb'
|
32
|
+
autoload :ManagementGroup, 'generated/azure_mgmt_resources_management/models/management_group.rb'
|
33
|
+
autoload :OperationListResult, 'generated/azure_mgmt_resources_management/models/operation_list_result.rb'
|
34
|
+
autoload :ManagementGroupChildInfo, 'generated/azure_mgmt_resources_management/models/management_group_child_info.rb'
|
35
|
+
autoload :ManagementGroupListResult, 'generated/azure_mgmt_resources_management/models/management_group_list_result.rb'
|
36
|
+
autoload :ManagementGroupWithChildren, 'generated/azure_mgmt_resources_management/models/management_group_with_children.rb'
|
37
|
+
autoload :Operation, 'generated/azure_mgmt_resources_management/models/operation.rb'
|
38
|
+
autoload :ManagementGroupRecursiveChildInfo, 'generated/azure_mgmt_resources_management/models/management_group_recursive_child_info.rb'
|
39
|
+
autoload :ErrorResponse, 'generated/azure_mgmt_resources_management/models/error_response.rb'
|
40
|
+
autoload :ManagementGroupWithHierarchy, 'generated/azure_mgmt_resources_management/models/management_group_with_hierarchy.rb'
|
41
|
+
autoload :ManagementGroupInfo, 'generated/azure_mgmt_resources_management/models/management_group_info.rb'
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,349 @@
|
|
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::ARM::ResourcesManagement
|
7
|
+
#
|
8
|
+
# The Azure Management Groups API enables consolidation of multiple
|
9
|
+
# subscriptions/resources into an organizational hierarchy and centrally
|
10
|
+
# manage access control, policies, alerting and reporting for those
|
11
|
+
# resources.
|
12
|
+
#
|
13
|
+
#
|
14
|
+
class ManagementGroups
|
15
|
+
include MsRestAzure
|
16
|
+
|
17
|
+
#
|
18
|
+
# Creates and initializes a new instance of the ManagementGroups class.
|
19
|
+
# @param client service class for accessing basic functionality.
|
20
|
+
#
|
21
|
+
def initialize(client)
|
22
|
+
@client = client
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [ManagementGroupsAPI] reference to the ManagementGroupsAPI
|
26
|
+
attr_reader :client
|
27
|
+
|
28
|
+
#
|
29
|
+
# List management groups for the authenticated user.
|
30
|
+
#
|
31
|
+
#
|
32
|
+
# @param skiptoken [String] Page continuation token is only used if a previous
|
33
|
+
# operation returned a partial result.
|
34
|
+
# If a previous response contains a nextLink element, the value of the nextLink
|
35
|
+
# element will include a token parameter that specifies a starting point to use
|
36
|
+
# for subsequent calls.
|
37
|
+
#
|
38
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
39
|
+
# will be added to the HTTP request.
|
40
|
+
#
|
41
|
+
# @return [Array<ManagementGroupInfo>] operation results.
|
42
|
+
#
|
43
|
+
def list(skiptoken = nil, custom_headers = nil)
|
44
|
+
first_page = list_as_lazy(skiptoken, custom_headers)
|
45
|
+
first_page.get_all_items
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# List management groups for the authenticated user.
|
50
|
+
#
|
51
|
+
#
|
52
|
+
# @param skiptoken [String] Page continuation token is only used if a previous
|
53
|
+
# operation returned a partial result.
|
54
|
+
# If a previous response contains a nextLink element, the value of the nextLink
|
55
|
+
# element will include a token parameter that specifies a starting point to use
|
56
|
+
# for subsequent calls.
|
57
|
+
#
|
58
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
59
|
+
# will be added to the HTTP request.
|
60
|
+
#
|
61
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
62
|
+
#
|
63
|
+
def list_with_http_info(skiptoken = nil, custom_headers = nil)
|
64
|
+
list_async(skiptoken, custom_headers).value!
|
65
|
+
end
|
66
|
+
|
67
|
+
#
|
68
|
+
# List management groups for the authenticated user.
|
69
|
+
#
|
70
|
+
#
|
71
|
+
# @param skiptoken [String] Page continuation token is only used if a previous
|
72
|
+
# operation returned a partial result.
|
73
|
+
# If a previous response contains a nextLink element, the value of the nextLink
|
74
|
+
# element will include a token parameter that specifies a starting point to use
|
75
|
+
# for subsequent calls.
|
76
|
+
#
|
77
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
78
|
+
# to the HTTP request.
|
79
|
+
#
|
80
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
81
|
+
#
|
82
|
+
def list_async(skiptoken = nil, custom_headers = nil)
|
83
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
84
|
+
|
85
|
+
|
86
|
+
request_headers = {}
|
87
|
+
|
88
|
+
# Set Headers
|
89
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
90
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
91
|
+
path_template = 'providers/Microsoft.Management/managementGroups'
|
92
|
+
|
93
|
+
request_url = @base_url || @client.base_url
|
94
|
+
|
95
|
+
options = {
|
96
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
97
|
+
query_params: {'api-version' => @client.api_version,'$skiptoken' => skiptoken},
|
98
|
+
headers: request_headers.merge(custom_headers || {}),
|
99
|
+
base_url: request_url
|
100
|
+
}
|
101
|
+
promise = @client.make_request_async(:get, path_template, options)
|
102
|
+
|
103
|
+
promise = promise.then do |result|
|
104
|
+
http_response = result.response
|
105
|
+
status_code = http_response.status
|
106
|
+
response_content = http_response.body
|
107
|
+
unless status_code == 200
|
108
|
+
error_model = JSON.load(response_content)
|
109
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
110
|
+
end
|
111
|
+
|
112
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
113
|
+
# Deserialize Response
|
114
|
+
if status_code == 200
|
115
|
+
begin
|
116
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
117
|
+
result_mapper = Azure::ARM::ResourcesManagement::Models::ManagementGroupListResult.mapper()
|
118
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
119
|
+
rescue Exception => e
|
120
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
result
|
125
|
+
end
|
126
|
+
|
127
|
+
promise.execute
|
128
|
+
end
|
129
|
+
|
130
|
+
#
|
131
|
+
# Get the details of the management group.
|
132
|
+
#
|
133
|
+
#
|
134
|
+
# @param expand [Enum] The $expand=children query string parameter allows
|
135
|
+
# clients to request inclusion of children in the response payload. Possible
|
136
|
+
# values include: 'children'
|
137
|
+
# @param recurse [Boolean] The $recurse=true query string parameter allows
|
138
|
+
# clients to request inclusion of entire hierarchy in the response payload.
|
139
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
140
|
+
# will be added to the HTTP request.
|
141
|
+
#
|
142
|
+
# @return [ManagementGroupWithHierarchy] operation results.
|
143
|
+
#
|
144
|
+
def get(expand = nil, recurse = nil, custom_headers = nil)
|
145
|
+
response = get_async(expand, recurse, custom_headers).value!
|
146
|
+
response.body unless response.nil?
|
147
|
+
end
|
148
|
+
|
149
|
+
#
|
150
|
+
# Get the details of the management group.
|
151
|
+
#
|
152
|
+
#
|
153
|
+
# @param expand [Enum] The $expand=children query string parameter allows
|
154
|
+
# clients to request inclusion of children in the response payload. Possible
|
155
|
+
# values include: 'children'
|
156
|
+
# @param recurse [Boolean] The $recurse=true query string parameter allows
|
157
|
+
# clients to request inclusion of entire hierarchy in the response payload.
|
158
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
159
|
+
# will be added to the HTTP request.
|
160
|
+
#
|
161
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
162
|
+
#
|
163
|
+
def get_with_http_info(expand = nil, recurse = nil, custom_headers = nil)
|
164
|
+
get_async(expand, recurse, custom_headers).value!
|
165
|
+
end
|
166
|
+
|
167
|
+
#
|
168
|
+
# Get the details of the management group.
|
169
|
+
#
|
170
|
+
#
|
171
|
+
# @param expand [Enum] The $expand=children query string parameter allows
|
172
|
+
# clients to request inclusion of children in the response payload. Possible
|
173
|
+
# values include: 'children'
|
174
|
+
# @param recurse [Boolean] The $recurse=true query string parameter allows
|
175
|
+
# clients to request inclusion of entire hierarchy in the response payload.
|
176
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
177
|
+
# to the HTTP request.
|
178
|
+
#
|
179
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
180
|
+
#
|
181
|
+
def get_async(expand = nil, recurse = nil, custom_headers = nil)
|
182
|
+
fail ArgumentError, '@client.group_id is nil' if @client.group_id.nil?
|
183
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
184
|
+
|
185
|
+
|
186
|
+
request_headers = {}
|
187
|
+
|
188
|
+
# Set Headers
|
189
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
190
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
191
|
+
path_template = 'providers/Microsoft.Management/managementGroups/{groupId}'
|
192
|
+
|
193
|
+
request_url = @base_url || @client.base_url
|
194
|
+
|
195
|
+
options = {
|
196
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
197
|
+
path_params: {'groupId' => @client.group_id},
|
198
|
+
query_params: {'api-version' => @client.api_version,'$expand' => expand,'$recurse' => recurse},
|
199
|
+
headers: request_headers.merge(custom_headers || {}),
|
200
|
+
base_url: request_url
|
201
|
+
}
|
202
|
+
promise = @client.make_request_async(:get, path_template, options)
|
203
|
+
|
204
|
+
promise = promise.then do |result|
|
205
|
+
http_response = result.response
|
206
|
+
status_code = http_response.status
|
207
|
+
response_content = http_response.body
|
208
|
+
unless status_code == 200
|
209
|
+
error_model = JSON.load(response_content)
|
210
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
211
|
+
end
|
212
|
+
|
213
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
214
|
+
# Deserialize Response
|
215
|
+
if status_code == 200
|
216
|
+
begin
|
217
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
218
|
+
result_mapper = Azure::ARM::ResourcesManagement::Models::ManagementGroupWithHierarchy.mapper()
|
219
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
220
|
+
rescue Exception => e
|
221
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
result
|
226
|
+
end
|
227
|
+
|
228
|
+
promise.execute
|
229
|
+
end
|
230
|
+
|
231
|
+
#
|
232
|
+
# List management groups for the authenticated user.
|
233
|
+
#
|
234
|
+
#
|
235
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
236
|
+
# to List operation.
|
237
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
238
|
+
# will be added to the HTTP request.
|
239
|
+
#
|
240
|
+
# @return [ManagementGroupListResult] operation results.
|
241
|
+
#
|
242
|
+
def list_next(next_page_link, custom_headers = nil)
|
243
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
244
|
+
response.body unless response.nil?
|
245
|
+
end
|
246
|
+
|
247
|
+
#
|
248
|
+
# List management groups for the authenticated user.
|
249
|
+
#
|
250
|
+
#
|
251
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
252
|
+
# to List operation.
|
253
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
254
|
+
# will be added to the HTTP request.
|
255
|
+
#
|
256
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
257
|
+
#
|
258
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
259
|
+
list_next_async(next_page_link, custom_headers).value!
|
260
|
+
end
|
261
|
+
|
262
|
+
#
|
263
|
+
# List management groups for the authenticated user.
|
264
|
+
#
|
265
|
+
#
|
266
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
267
|
+
# to List operation.
|
268
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
269
|
+
# to the HTTP request.
|
270
|
+
#
|
271
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
272
|
+
#
|
273
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
274
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
275
|
+
|
276
|
+
|
277
|
+
request_headers = {}
|
278
|
+
|
279
|
+
# Set Headers
|
280
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
281
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
282
|
+
path_template = '{nextLink}'
|
283
|
+
|
284
|
+
request_url = @base_url || @client.base_url
|
285
|
+
|
286
|
+
options = {
|
287
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
288
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
289
|
+
headers: request_headers.merge(custom_headers || {}),
|
290
|
+
base_url: request_url
|
291
|
+
}
|
292
|
+
promise = @client.make_request_async(:get, path_template, options)
|
293
|
+
|
294
|
+
promise = promise.then do |result|
|
295
|
+
http_response = result.response
|
296
|
+
status_code = http_response.status
|
297
|
+
response_content = http_response.body
|
298
|
+
unless status_code == 200
|
299
|
+
error_model = JSON.load(response_content)
|
300
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
301
|
+
end
|
302
|
+
|
303
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
304
|
+
# Deserialize Response
|
305
|
+
if status_code == 200
|
306
|
+
begin
|
307
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
308
|
+
result_mapper = Azure::ARM::ResourcesManagement::Models::ManagementGroupListResult.mapper()
|
309
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
310
|
+
rescue Exception => e
|
311
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
result
|
316
|
+
end
|
317
|
+
|
318
|
+
promise.execute
|
319
|
+
end
|
320
|
+
|
321
|
+
#
|
322
|
+
# List management groups for the authenticated user.
|
323
|
+
#
|
324
|
+
#
|
325
|
+
# @param skiptoken [String] Page continuation token is only used if a previous
|
326
|
+
# operation returned a partial result.
|
327
|
+
# If a previous response contains a nextLink element, the value of the nextLink
|
328
|
+
# element will include a token parameter that specifies a starting point to use
|
329
|
+
# for subsequent calls.
|
330
|
+
#
|
331
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
332
|
+
# will be added to the HTTP request.
|
333
|
+
#
|
334
|
+
# @return [ManagementGroupListResult] which provide lazy access to pages of the
|
335
|
+
# response.
|
336
|
+
#
|
337
|
+
def list_as_lazy(skiptoken = nil, custom_headers = nil)
|
338
|
+
response = list_async(skiptoken, custom_headers).value!
|
339
|
+
unless response.nil?
|
340
|
+
page = response.body
|
341
|
+
page.next_method = Proc.new do |next_page_link|
|
342
|
+
list_next_async(next_page_link, custom_headers)
|
343
|
+
end
|
344
|
+
page
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
end
|
349
|
+
end
|
@@ -0,0 +1,134 @@
|
|
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::ARM::ResourcesManagement
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class ManagementGroupsAPI < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_accessor :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials
|
19
|
+
|
20
|
+
# @return Management Group ID.
|
21
|
+
attr_accessor :group_id
|
22
|
+
|
23
|
+
# @return [String] Version of the API to be used with the client request.
|
24
|
+
# The current version is 2017-08-31-preview.
|
25
|
+
attr_reader :api_version
|
26
|
+
|
27
|
+
# @return [String] Gets or sets the preferred language for the response.
|
28
|
+
attr_accessor :accept_language
|
29
|
+
|
30
|
+
# @return [Integer] Gets or sets the retry timeout in seconds for Long
|
31
|
+
# Running Operations. Default value is 30.
|
32
|
+
attr_accessor :long_running_operation_retry_timeout
|
33
|
+
|
34
|
+
# @return [Boolean] When set to true a unique x-ms-client-request-id value
|
35
|
+
# is generated and included in each request. Default is true.
|
36
|
+
attr_accessor :generate_client_request_id
|
37
|
+
|
38
|
+
# @return [ManagementGroups] management_groups
|
39
|
+
attr_reader :management_groups
|
40
|
+
|
41
|
+
# @return [Operations] operations
|
42
|
+
attr_reader :operations
|
43
|
+
|
44
|
+
#
|
45
|
+
# Creates initializes a new instance of the ManagementGroupsAPI class.
|
46
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
47
|
+
# @param base_url [String] the base URI of the service.
|
48
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
49
|
+
#
|
50
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
51
|
+
super(credentials, options)
|
52
|
+
@base_url = base_url || 'https://management.azure.com'
|
53
|
+
|
54
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
55
|
+
@credentials = credentials
|
56
|
+
|
57
|
+
@management_groups = ManagementGroups.new(self)
|
58
|
+
@operations = Operations.new(self)
|
59
|
+
@api_version = '2017-08-31-preview'
|
60
|
+
@accept_language = 'en-US'
|
61
|
+
@long_running_operation_retry_timeout = 30
|
62
|
+
@generate_client_request_id = true
|
63
|
+
add_telemetry
|
64
|
+
end
|
65
|
+
|
66
|
+
#
|
67
|
+
# Makes a request and returns the body of the response.
|
68
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
69
|
+
# @param path [String] the path, relative to {base_url}.
|
70
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
71
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
72
|
+
# Example:
|
73
|
+
#
|
74
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
75
|
+
# path = "/path"
|
76
|
+
# options = {
|
77
|
+
# body: request_content,
|
78
|
+
# query_params: {'api-version' => '2016-02-01'}
|
79
|
+
# }
|
80
|
+
# result = @client.make_request(:put, path, options)
|
81
|
+
#
|
82
|
+
def make_request(method, path, options = {})
|
83
|
+
result = make_request_with_http_info(method, path, options)
|
84
|
+
result.body unless result.nil?
|
85
|
+
end
|
86
|
+
|
87
|
+
#
|
88
|
+
# Makes a request and returns the operation response.
|
89
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
90
|
+
# @param path [String] the path, relative to {base_url}.
|
91
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
92
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
93
|
+
#
|
94
|
+
def make_request_with_http_info(method, path, options = {})
|
95
|
+
result = make_request_async(method, path, options).value!
|
96
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
97
|
+
result
|
98
|
+
end
|
99
|
+
|
100
|
+
#
|
101
|
+
# Makes a request asynchronously.
|
102
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
103
|
+
# @param path [String] the path, relative to {base_url}.
|
104
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
105
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
106
|
+
#
|
107
|
+
def make_request_async(method, path, options = {})
|
108
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
109
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
110
|
+
|
111
|
+
request_url = options[:base_url] || @base_url
|
112
|
+
|
113
|
+
request_headers = @request_headers
|
114
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
115
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
116
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
117
|
+
|
118
|
+
super(request_url, method, path, options)
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
private
|
123
|
+
#
|
124
|
+
# Adds telemetry information.
|
125
|
+
#
|
126
|
+
def add_telemetry
|
127
|
+
sdk_information = 'azure_mgmt_resources_management'
|
128
|
+
if defined? Azure::ARM::ResourcesManagement::VERSION
|
129
|
+
sdk_information = "#{sdk_information}/#{Azure::ARM::ResourcesManagement::VERSION}"
|
130
|
+
end
|
131
|
+
add_user_agent_information(sdk_information)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|