azure_mgmt_resources_management 0.14.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 +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
@@ -0,0 +1,68 @@
|
|
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
|
+
module Models
|
8
|
+
#
|
9
|
+
# The object that represents the operation.
|
10
|
+
#
|
11
|
+
class OperationDisplay
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] Service provider: Microsoft.Management.
|
16
|
+
attr_accessor :provider
|
17
|
+
|
18
|
+
# @return [String] Resource on which the operation is performed: Invoice,
|
19
|
+
# etc.
|
20
|
+
attr_accessor :resource
|
21
|
+
|
22
|
+
# @return [String] Operation type: Read, write, delete, etc.
|
23
|
+
attr_accessor :operation
|
24
|
+
|
25
|
+
|
26
|
+
#
|
27
|
+
# Mapper for OperationDisplay class as Ruby Hash.
|
28
|
+
# This will be used for serialization/deserialization.
|
29
|
+
#
|
30
|
+
def self.mapper()
|
31
|
+
{
|
32
|
+
required: false,
|
33
|
+
serialized_name: 'Operation_display',
|
34
|
+
type: {
|
35
|
+
name: 'Composite',
|
36
|
+
class_name: 'OperationDisplay',
|
37
|
+
model_properties: {
|
38
|
+
provider: {
|
39
|
+
required: false,
|
40
|
+
read_only: true,
|
41
|
+
serialized_name: 'provider',
|
42
|
+
type: {
|
43
|
+
name: 'String'
|
44
|
+
}
|
45
|
+
},
|
46
|
+
resource: {
|
47
|
+
required: false,
|
48
|
+
read_only: true,
|
49
|
+
serialized_name: 'resource',
|
50
|
+
type: {
|
51
|
+
name: 'String'
|
52
|
+
}
|
53
|
+
},
|
54
|
+
operation: {
|
55
|
+
required: false,
|
56
|
+
read_only: true,
|
57
|
+
serialized_name: 'operation',
|
58
|
+
type: {
|
59
|
+
name: 'String'
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,99 @@
|
|
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
|
+
module Models
|
8
|
+
#
|
9
|
+
# Result listing operations. It contains a list of operations and a URL
|
10
|
+
# link to get the next set of results.
|
11
|
+
#
|
12
|
+
class OperationListResult
|
13
|
+
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
include MsRest::JSONable
|
17
|
+
# @return [Array<Operation>] List of management operations supported by
|
18
|
+
# the Microsoft.Management resource provider.
|
19
|
+
attr_accessor :value
|
20
|
+
|
21
|
+
# @return [String] URL to get the next set of operation list results if
|
22
|
+
# there are any.
|
23
|
+
attr_accessor :next_link
|
24
|
+
|
25
|
+
# return [Proc] with next page method call.
|
26
|
+
attr_accessor :next_method
|
27
|
+
|
28
|
+
#
|
29
|
+
# Gets the rest of the items for the request, enabling auto-pagination.
|
30
|
+
#
|
31
|
+
# @return [Array<Operation>] operation results.
|
32
|
+
#
|
33
|
+
def get_all_items
|
34
|
+
items = @value
|
35
|
+
page = self
|
36
|
+
while page.next_link != nil do
|
37
|
+
page = page.get_next_page
|
38
|
+
items.concat(page.value)
|
39
|
+
end
|
40
|
+
items
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# Gets the next page of results.
|
45
|
+
#
|
46
|
+
# @return [OperationListResult] with next page content.
|
47
|
+
#
|
48
|
+
def get_next_page
|
49
|
+
response = @next_method.call(@next_link).value! unless @next_method.nil?
|
50
|
+
unless response.nil?
|
51
|
+
@next_link = response.body.next_link
|
52
|
+
@value = response.body.value
|
53
|
+
self
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# Mapper for OperationListResult class as Ruby Hash.
|
59
|
+
# This will be used for serialization/deserialization.
|
60
|
+
#
|
61
|
+
def self.mapper()
|
62
|
+
{
|
63
|
+
required: false,
|
64
|
+
serialized_name: 'OperationListResult',
|
65
|
+
type: {
|
66
|
+
name: 'Composite',
|
67
|
+
class_name: 'OperationListResult',
|
68
|
+
model_properties: {
|
69
|
+
value: {
|
70
|
+
required: false,
|
71
|
+
read_only: true,
|
72
|
+
serialized_name: 'value',
|
73
|
+
type: {
|
74
|
+
name: 'Sequence',
|
75
|
+
element: {
|
76
|
+
required: false,
|
77
|
+
serialized_name: 'OperationElementType',
|
78
|
+
type: {
|
79
|
+
name: 'Composite',
|
80
|
+
class_name: 'Operation'
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
},
|
85
|
+
next_link: {
|
86
|
+
required: false,
|
87
|
+
read_only: true,
|
88
|
+
serialized_name: 'nextLink',
|
89
|
+
type: {
|
90
|
+
name: 'String'
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,55 @@
|
|
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
|
+
module Models
|
8
|
+
#
|
9
|
+
# (Optional) The ID of the parent management group.
|
10
|
+
#
|
11
|
+
class ParentGroupInfo
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] The ID of the parent management group. E.g.
|
16
|
+
# /providers/Microsoft.Management/managementGroups/30000000-0000-0000-0000-000000000000
|
17
|
+
attr_accessor :parent_id
|
18
|
+
|
19
|
+
# @return [String] The friendly name of the management group.
|
20
|
+
attr_accessor :display_name
|
21
|
+
|
22
|
+
|
23
|
+
#
|
24
|
+
# Mapper for ParentGroupInfo class as Ruby Hash.
|
25
|
+
# This will be used for serialization/deserialization.
|
26
|
+
#
|
27
|
+
def self.mapper()
|
28
|
+
{
|
29
|
+
required: false,
|
30
|
+
serialized_name: 'ParentGroupInfo',
|
31
|
+
type: {
|
32
|
+
name: 'Composite',
|
33
|
+
class_name: 'ParentGroupInfo',
|
34
|
+
model_properties: {
|
35
|
+
parent_id: {
|
36
|
+
required: false,
|
37
|
+
serialized_name: 'parentId',
|
38
|
+
type: {
|
39
|
+
name: 'String'
|
40
|
+
}
|
41
|
+
},
|
42
|
+
display_name: {
|
43
|
+
required: false,
|
44
|
+
serialized_name: 'displayName',
|
45
|
+
type: {
|
46
|
+
name: 'String'
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,217 @@
|
|
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 Operations
|
15
|
+
include MsRestAzure
|
16
|
+
|
17
|
+
#
|
18
|
+
# Creates and initializes a new instance of the Operations 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
|
+
# Lists all of the available management REST API operations.
|
30
|
+
#
|
31
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
32
|
+
# will be added to the HTTP request.
|
33
|
+
#
|
34
|
+
# @return [Array<Operation>] operation results.
|
35
|
+
#
|
36
|
+
def list(custom_headers = nil)
|
37
|
+
first_page = list_as_lazy(custom_headers)
|
38
|
+
first_page.get_all_items
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# Lists all of the available management REST API operations.
|
43
|
+
#
|
44
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
45
|
+
# will be added to the HTTP request.
|
46
|
+
#
|
47
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
48
|
+
#
|
49
|
+
def list_with_http_info(custom_headers = nil)
|
50
|
+
list_async(custom_headers).value!
|
51
|
+
end
|
52
|
+
|
53
|
+
#
|
54
|
+
# Lists all of the available management REST API operations.
|
55
|
+
#
|
56
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
57
|
+
# to the HTTP request.
|
58
|
+
#
|
59
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
60
|
+
#
|
61
|
+
def list_async(custom_headers = nil)
|
62
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
63
|
+
|
64
|
+
|
65
|
+
request_headers = {}
|
66
|
+
|
67
|
+
# Set Headers
|
68
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
69
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
70
|
+
path_template = 'providers/Microsoft.Management/operations'
|
71
|
+
|
72
|
+
request_url = @base_url || @client.base_url
|
73
|
+
|
74
|
+
options = {
|
75
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
76
|
+
query_params: {'api-version' => @client.api_version},
|
77
|
+
headers: request_headers.merge(custom_headers || {}),
|
78
|
+
base_url: request_url
|
79
|
+
}
|
80
|
+
promise = @client.make_request_async(:get, path_template, options)
|
81
|
+
|
82
|
+
promise = promise.then do |result|
|
83
|
+
http_response = result.response
|
84
|
+
status_code = http_response.status
|
85
|
+
response_content = http_response.body
|
86
|
+
unless status_code == 200
|
87
|
+
error_model = JSON.load(response_content)
|
88
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
89
|
+
end
|
90
|
+
|
91
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
92
|
+
# Deserialize Response
|
93
|
+
if status_code == 200
|
94
|
+
begin
|
95
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
96
|
+
result_mapper = Azure::ARM::ResourcesManagement::Models::OperationListResult.mapper()
|
97
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
98
|
+
rescue Exception => e
|
99
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
result
|
104
|
+
end
|
105
|
+
|
106
|
+
promise.execute
|
107
|
+
end
|
108
|
+
|
109
|
+
#
|
110
|
+
# Lists all of the available management REST API operations.
|
111
|
+
#
|
112
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
113
|
+
# to List operation.
|
114
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
115
|
+
# will be added to the HTTP request.
|
116
|
+
#
|
117
|
+
# @return [OperationListResult] operation results.
|
118
|
+
#
|
119
|
+
def list_next(next_page_link, custom_headers = nil)
|
120
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
121
|
+
response.body unless response.nil?
|
122
|
+
end
|
123
|
+
|
124
|
+
#
|
125
|
+
# Lists all of the available management REST API operations.
|
126
|
+
#
|
127
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
128
|
+
# to List operation.
|
129
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
130
|
+
# will be added to the HTTP request.
|
131
|
+
#
|
132
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
133
|
+
#
|
134
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
135
|
+
list_next_async(next_page_link, custom_headers).value!
|
136
|
+
end
|
137
|
+
|
138
|
+
#
|
139
|
+
# Lists all of the available management REST API operations.
|
140
|
+
#
|
141
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
142
|
+
# to List operation.
|
143
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
144
|
+
# to the HTTP request.
|
145
|
+
#
|
146
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
147
|
+
#
|
148
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
149
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
150
|
+
|
151
|
+
|
152
|
+
request_headers = {}
|
153
|
+
|
154
|
+
# Set Headers
|
155
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
156
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
157
|
+
path_template = '{nextLink}'
|
158
|
+
|
159
|
+
request_url = @base_url || @client.base_url
|
160
|
+
|
161
|
+
options = {
|
162
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
163
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
164
|
+
headers: request_headers.merge(custom_headers || {}),
|
165
|
+
base_url: request_url
|
166
|
+
}
|
167
|
+
promise = @client.make_request_async(:get, path_template, options)
|
168
|
+
|
169
|
+
promise = promise.then do |result|
|
170
|
+
http_response = result.response
|
171
|
+
status_code = http_response.status
|
172
|
+
response_content = http_response.body
|
173
|
+
unless status_code == 200
|
174
|
+
error_model = JSON.load(response_content)
|
175
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
176
|
+
end
|
177
|
+
|
178
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
179
|
+
# Deserialize Response
|
180
|
+
if status_code == 200
|
181
|
+
begin
|
182
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
183
|
+
result_mapper = Azure::ARM::ResourcesManagement::Models::OperationListResult.mapper()
|
184
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
185
|
+
rescue Exception => e
|
186
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
result
|
191
|
+
end
|
192
|
+
|
193
|
+
promise.execute
|
194
|
+
end
|
195
|
+
|
196
|
+
#
|
197
|
+
# Lists all of the available management REST API operations.
|
198
|
+
#
|
199
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
200
|
+
# will be added to the HTTP request.
|
201
|
+
#
|
202
|
+
# @return [OperationListResult] which provide lazy access to pages of the
|
203
|
+
# response.
|
204
|
+
#
|
205
|
+
def list_as_lazy(custom_headers = nil)
|
206
|
+
response = list_async(custom_headers).value!
|
207
|
+
unless response.nil?
|
208
|
+
page = response.body
|
209
|
+
page.next_method = Proc.new do |next_page_link|
|
210
|
+
list_next_async(next_page_link, custom_headers)
|
211
|
+
end
|
212
|
+
page
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
end
|
217
|
+
end
|