azure_mgmt_resources_management 0.15.1 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/management_groups.rb +21 -18
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/management_groups_api.rb +10 -8
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/error_details.rb +4 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/error_response.rb +2 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/management_group.rb +7 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/management_group_child_info.rb +5 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/management_group_details_properties.rb +6 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/management_group_info.rb +6 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/management_group_list_result.rb +5 -1
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/management_group_recursive_child_info.rb +7 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/management_group_with_children.rb +9 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/management_group_with_hierarchy.rb +9 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/operation.rb +3 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/operation_display.rb +4 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/operation_list_result.rb +5 -1
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/models/parent_group_info.rb +3 -0
- data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/operations.rb +15 -13
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management.rb +42 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_group_subscriptions.rb +209 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups.rb +698 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups_api.rb +137 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_request.rb +59 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/error_details.rb +57 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/error_response.rb +47 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group.rb +130 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_child_info.rb +91 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_details.rb +81 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_info.rb +98 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_list_result.rb +99 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/operation.rb +59 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/operation_display.rb +83 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/operation_list_result.rb +103 -0
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/parent_group_info.rb +59 -0
- data/lib/{2017-08-31-preview/generated/azure_mgmt_resources_management/version.rb → 2017-11-01-preview/generated/azure_mgmt_resources_management/module_definition.rb} +4 -3
- data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/operations.rb +219 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management.rb +56 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/entities.rb +257 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/management_group_subscriptions.rb +209 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/management_groups.rb +793 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/management_groups_api.rb +254 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/check_name_availability_request.rb +60 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/check_name_availability_result.rb +83 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_child_info.rb +131 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_details.rb +84 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_request.rb +153 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/create_parent_group_info.rb +72 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/entity_hierarchy_item.rb +118 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/entity_info.rb +121 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/entity_list_result.rb +99 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/entity_parent_group_info.rb +48 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/error_details.rb +69 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/error_response.rb +47 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group.rb +150 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group_child_info.rb +125 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group_details.rb +81 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group_info.rb +98 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group_list_result.rb +99 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/operation.rb +59 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/operation_display_properties.rb +83 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/operation_list_result.rb +103 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/operation_results.rb +86 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/parent_group_info.rb +70 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/patch_management_group_request.rb +59 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/reason.rb +16 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/models/type.rb +15 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/module_definition.rb +9 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/operations.rb +219 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management.rb +58 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/entities.rb +381 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/management_group_subscriptions.rb +202 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/management_groups.rb +799 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/management_groups_api.rb +401 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/check_name_availability_request.rb +60 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/check_name_availability_result.rb +83 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_child_info.rb +131 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_details.rb +84 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_request.rb +153 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/create_parent_group_info.rb +72 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/entity_hierarchy_item.rb +118 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/entity_info.rb +210 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/entity_list_result.rb +111 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/entity_parent_group_info.rb +48 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/error_details.rb +69 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/error_response.rb +47 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/management_group.rb +150 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/management_group_child_info.rb +125 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/management_group_details.rb +81 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/management_group_info.rb +98 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/management_group_list_result.rb +99 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/operation.rb +59 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/operation_display_properties.rb +83 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/operation_list_result.rb +103 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/operation_results.rb +86 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/parent_group_info.rb +70 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/patch_management_group_request.rb +59 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/reason.rb +16 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/status.rb +20 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/tenant_backfill_status_result.rb +63 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/models/type.rb +15 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/module_definition.rb +9 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/operations.rb +218 -0
- data/lib/azure_mgmt_resources_management.rb +3 -0
- data/lib/profiles/latest/modules/resourcesmanagement_profile_module.rb +144 -69
- data/lib/profiles/latest/resourcesmanagement_latest_profile_client.rb +28 -11
- data/lib/profiles/latest/resourcesmanagement_module_definition.rb +0 -1
- data/lib/version.rb +1 -1
- metadata +95 -9
- data/lib/profiles/common/configurable.rb +0 -86
- data/lib/profiles/common/default.rb +0 -57
data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/parent_group_info.rb
ADDED
@@ -0,0 +1,59 @@
|
|
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::ResourcesManagement::Mgmt::V2017_11_01_preview
|
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 fully qualified ID for the parent management
|
16
|
+
# group. For example,
|
17
|
+
# /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
|
18
|
+
attr_accessor :parent_id
|
19
|
+
|
20
|
+
# @return [String] The friendly name of the parent management group.
|
21
|
+
attr_accessor :display_name
|
22
|
+
|
23
|
+
|
24
|
+
#
|
25
|
+
# Mapper for ParentGroupInfo class as Ruby Hash.
|
26
|
+
# This will be used for serialization/deserialization.
|
27
|
+
#
|
28
|
+
def self.mapper()
|
29
|
+
{
|
30
|
+
client_side_validation: true,
|
31
|
+
required: false,
|
32
|
+
serialized_name: 'ParentGroupInfo',
|
33
|
+
type: {
|
34
|
+
name: 'Composite',
|
35
|
+
class_name: 'ParentGroupInfo',
|
36
|
+
model_properties: {
|
37
|
+
parent_id: {
|
38
|
+
client_side_validation: true,
|
39
|
+
required: false,
|
40
|
+
serialized_name: 'parentId',
|
41
|
+
type: {
|
42
|
+
name: 'String'
|
43
|
+
}
|
44
|
+
},
|
45
|
+
display_name: {
|
46
|
+
client_side_validation: true,
|
47
|
+
required: false,
|
48
|
+
serialized_name: 'displayName',
|
49
|
+
type: {
|
50
|
+
name: 'String'
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
4
4
|
# regenerated.
|
5
5
|
|
6
|
-
module Azure
|
7
|
-
|
8
|
-
end
|
6
|
+
module Azure end
|
7
|
+
module Azure::ResourcesManagement end
|
8
|
+
module Azure::ResourcesManagement::Mgmt end
|
9
|
+
module Azure::ResourcesManagement::Mgmt::V2017_11_01_preview end
|
@@ -0,0 +1,219 @@
|
|
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::ResourcesManagement::Mgmt::V2017_11_01_preview
|
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: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: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
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
67
|
+
|
68
|
+
# Set Headers
|
69
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
70
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
71
|
+
path_template = 'providers/Microsoft.Management/operations'
|
72
|
+
|
73
|
+
request_url = @base_url || @client.base_url
|
74
|
+
|
75
|
+
options = {
|
76
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
77
|
+
query_params: {'api-version' => @client.api_version},
|
78
|
+
headers: request_headers.merge(custom_headers || {}),
|
79
|
+
base_url: request_url
|
80
|
+
}
|
81
|
+
promise = @client.make_request_async(:get, path_template, options)
|
82
|
+
|
83
|
+
promise = promise.then do |result|
|
84
|
+
http_response = result.response
|
85
|
+
status_code = http_response.status
|
86
|
+
response_content = http_response.body
|
87
|
+
unless status_code == 200
|
88
|
+
error_model = JSON.load(response_content)
|
89
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
90
|
+
end
|
91
|
+
|
92
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
93
|
+
# Deserialize Response
|
94
|
+
if status_code == 200
|
95
|
+
begin
|
96
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
97
|
+
result_mapper = Azure::ResourcesManagement::Mgmt::V2017_11_01_preview::Models::OperationListResult.mapper()
|
98
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
99
|
+
rescue Exception => e
|
100
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
result
|
105
|
+
end
|
106
|
+
|
107
|
+
promise.execute
|
108
|
+
end
|
109
|
+
|
110
|
+
#
|
111
|
+
# Lists all of the available Management REST API operations.
|
112
|
+
#
|
113
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
114
|
+
# to List operation.
|
115
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
116
|
+
# will be added to the HTTP request.
|
117
|
+
#
|
118
|
+
# @return [OperationListResult] operation results.
|
119
|
+
#
|
120
|
+
def list_next(next_page_link, custom_headers:nil)
|
121
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
122
|
+
response.body unless response.nil?
|
123
|
+
end
|
124
|
+
|
125
|
+
#
|
126
|
+
# Lists all of the available Management REST API operations.
|
127
|
+
#
|
128
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
129
|
+
# to List operation.
|
130
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
131
|
+
# will be added to the HTTP request.
|
132
|
+
#
|
133
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
134
|
+
#
|
135
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
136
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
137
|
+
end
|
138
|
+
|
139
|
+
#
|
140
|
+
# Lists all of the available Management REST API operations.
|
141
|
+
#
|
142
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
143
|
+
# to List operation.
|
144
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
145
|
+
# to the HTTP request.
|
146
|
+
#
|
147
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
148
|
+
#
|
149
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
150
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
151
|
+
|
152
|
+
|
153
|
+
request_headers = {}
|
154
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
155
|
+
|
156
|
+
# Set Headers
|
157
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
158
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
159
|
+
path_template = '{nextLink}'
|
160
|
+
|
161
|
+
request_url = @base_url || @client.base_url
|
162
|
+
|
163
|
+
options = {
|
164
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
165
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
166
|
+
headers: request_headers.merge(custom_headers || {}),
|
167
|
+
base_url: request_url
|
168
|
+
}
|
169
|
+
promise = @client.make_request_async(:get, path_template, options)
|
170
|
+
|
171
|
+
promise = promise.then do |result|
|
172
|
+
http_response = result.response
|
173
|
+
status_code = http_response.status
|
174
|
+
response_content = http_response.body
|
175
|
+
unless status_code == 200
|
176
|
+
error_model = JSON.load(response_content)
|
177
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
178
|
+
end
|
179
|
+
|
180
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
181
|
+
# Deserialize Response
|
182
|
+
if status_code == 200
|
183
|
+
begin
|
184
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
185
|
+
result_mapper = Azure::ResourcesManagement::Mgmt::V2017_11_01_preview::Models::OperationListResult.mapper()
|
186
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
187
|
+
rescue Exception => e
|
188
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
result
|
193
|
+
end
|
194
|
+
|
195
|
+
promise.execute
|
196
|
+
end
|
197
|
+
|
198
|
+
#
|
199
|
+
# Lists all of the available Management REST API operations.
|
200
|
+
#
|
201
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
202
|
+
# will be added to the HTTP request.
|
203
|
+
#
|
204
|
+
# @return [OperationListResult] which provide lazy access to pages of the
|
205
|
+
# response.
|
206
|
+
#
|
207
|
+
def list_as_lazy(custom_headers:nil)
|
208
|
+
response = list_async(custom_headers:custom_headers).value!
|
209
|
+
unless response.nil?
|
210
|
+
page = response.body
|
211
|
+
page.next_method = Proc.new do |next_page_link|
|
212
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
213
|
+
end
|
214
|
+
page
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
end
|
219
|
+
end
|
@@ -0,0 +1,56 @@
|
|
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 '2018-01-01-preview/generated/azure_mgmt_resources_management/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::ResourcesManagement::Mgmt::V2018_01_01_preview
|
23
|
+
autoload :ManagementGroups, '2018-01-01-preview/generated/azure_mgmt_resources_management/management_groups.rb'
|
24
|
+
autoload :ManagementGroupSubscriptions, '2018-01-01-preview/generated/azure_mgmt_resources_management/management_group_subscriptions.rb'
|
25
|
+
autoload :Operations, '2018-01-01-preview/generated/azure_mgmt_resources_management/operations.rb'
|
26
|
+
autoload :Entities, '2018-01-01-preview/generated/azure_mgmt_resources_management/entities.rb'
|
27
|
+
autoload :ManagementGroupsAPI, '2018-01-01-preview/generated/azure_mgmt_resources_management/management_groups_api.rb'
|
28
|
+
|
29
|
+
module Models
|
30
|
+
autoload :ManagementGroup, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group.rb'
|
31
|
+
autoload :OperationResults, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/operation_results.rb'
|
32
|
+
autoload :ErrorResponse, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/error_response.rb'
|
33
|
+
autoload :EntityParentGroupInfo, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/entity_parent_group_info.rb'
|
34
|
+
autoload :Operation, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/operation.rb'
|
35
|
+
autoload :EntityInfo, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/entity_info.rb'
|
36
|
+
autoload :CheckNameAvailabilityResult, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/check_name_availability_result.rb'
|
37
|
+
autoload :EntityListResult, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/entity_list_result.rb'
|
38
|
+
autoload :ManagementGroupListResult, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group_list_result.rb'
|
39
|
+
autoload :EntityHierarchyItem, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/entity_hierarchy_item.rb'
|
40
|
+
autoload :ManagementGroupDetails, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group_details.rb'
|
41
|
+
autoload :PatchManagementGroupRequest, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/patch_management_group_request.rb'
|
42
|
+
autoload :ErrorDetails, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/error_details.rb'
|
43
|
+
autoload :CreateParentGroupInfo, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/create_parent_group_info.rb'
|
44
|
+
autoload :OperationListResult, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/operation_list_result.rb'
|
45
|
+
autoload :CreateManagementGroupDetails, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_details.rb'
|
46
|
+
autoload :ParentGroupInfo, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/parent_group_info.rb'
|
47
|
+
autoload :CreateManagementGroupChildInfo, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_child_info.rb'
|
48
|
+
autoload :OperationDisplayProperties, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/operation_display_properties.rb'
|
49
|
+
autoload :CreateManagementGroupRequest, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/create_management_group_request.rb'
|
50
|
+
autoload :ManagementGroupChildInfo, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group_child_info.rb'
|
51
|
+
autoload :CheckNameAvailabilityRequest, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/check_name_availability_request.rb'
|
52
|
+
autoload :ManagementGroupInfo, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/management_group_info.rb'
|
53
|
+
autoload :Reason, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/reason.rb'
|
54
|
+
autoload :Type, '2018-01-01-preview/generated/azure_mgmt_resources_management/models/type.rb'
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,257 @@
|
|
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::ResourcesManagement::Mgmt::V2018_01_01_preview
|
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 Entities
|
15
|
+
include MsRestAzure
|
16
|
+
|
17
|
+
#
|
18
|
+
# Creates and initializes a new instance of the Entities 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 all entities (Management Groups, Subscriptions, etc.) for the
|
30
|
+
# authenticated user.
|
31
|
+
#
|
32
|
+
#
|
33
|
+
# @param group_name [String] A filter which allows the call to be filtered for
|
34
|
+
# a specific group.
|
35
|
+
# @param cache_control [String] Indicates that the request shouldn't utilize
|
36
|
+
# any caches.
|
37
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
38
|
+
# will be added to the HTTP request.
|
39
|
+
#
|
40
|
+
# @return [Array<EntityInfo>] operation results.
|
41
|
+
#
|
42
|
+
def list(group_name:nil, cache_control:'no-cache', custom_headers:nil)
|
43
|
+
first_page = list_as_lazy(group_name:group_name, cache_control:cache_control, custom_headers:custom_headers)
|
44
|
+
first_page.get_all_items
|
45
|
+
end
|
46
|
+
|
47
|
+
#
|
48
|
+
# List all entities (Management Groups, Subscriptions, etc.) for the
|
49
|
+
# authenticated user.
|
50
|
+
#
|
51
|
+
#
|
52
|
+
# @param group_name [String] A filter which allows the call to be filtered for
|
53
|
+
# a specific group.
|
54
|
+
# @param cache_control [String] Indicates that the request shouldn't utilize
|
55
|
+
# any caches.
|
56
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
57
|
+
# will be added to the HTTP request.
|
58
|
+
#
|
59
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
60
|
+
#
|
61
|
+
def list_with_http_info(group_name:nil, cache_control:'no-cache', custom_headers:nil)
|
62
|
+
list_async(group_name:group_name, cache_control:cache_control, custom_headers:custom_headers).value!
|
63
|
+
end
|
64
|
+
|
65
|
+
#
|
66
|
+
# List all entities (Management Groups, Subscriptions, etc.) for the
|
67
|
+
# authenticated user.
|
68
|
+
#
|
69
|
+
#
|
70
|
+
# @param group_name [String] A filter which allows the call to be filtered for
|
71
|
+
# a specific group.
|
72
|
+
# @param cache_control [String] Indicates that the request shouldn't utilize
|
73
|
+
# any caches.
|
74
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
75
|
+
# to the HTTP request.
|
76
|
+
#
|
77
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
78
|
+
#
|
79
|
+
def list_async(group_name:nil, cache_control:'no-cache', custom_headers:nil)
|
80
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
81
|
+
|
82
|
+
|
83
|
+
request_headers = {}
|
84
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
85
|
+
|
86
|
+
# Set Headers
|
87
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
88
|
+
request_headers['Cache-Control'] = cache_control unless cache_control.nil?
|
89
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
90
|
+
path_template = 'providers/Microsoft.Management/getEntities'
|
91
|
+
|
92
|
+
request_url = @base_url || @client.base_url
|
93
|
+
|
94
|
+
options = {
|
95
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
96
|
+
query_params: {'api-version' => @client.api_version,'$skiptoken' => @client.skiptoken,'groupName' => group_name},
|
97
|
+
headers: request_headers.merge(custom_headers || {}),
|
98
|
+
base_url: request_url
|
99
|
+
}
|
100
|
+
promise = @client.make_request_async(:post, path_template, options)
|
101
|
+
|
102
|
+
promise = promise.then do |result|
|
103
|
+
http_response = result.response
|
104
|
+
status_code = http_response.status
|
105
|
+
response_content = http_response.body
|
106
|
+
unless status_code == 200
|
107
|
+
error_model = JSON.load(response_content)
|
108
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
109
|
+
end
|
110
|
+
|
111
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
112
|
+
# Deserialize Response
|
113
|
+
if status_code == 200
|
114
|
+
begin
|
115
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
116
|
+
result_mapper = Azure::ResourcesManagement::Mgmt::V2018_01_01_preview::Models::EntityListResult.mapper()
|
117
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
118
|
+
rescue Exception => e
|
119
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
result
|
124
|
+
end
|
125
|
+
|
126
|
+
promise.execute
|
127
|
+
end
|
128
|
+
|
129
|
+
#
|
130
|
+
# List all entities (Management Groups, Subscriptions, etc.) for the
|
131
|
+
# authenticated user.
|
132
|
+
#
|
133
|
+
#
|
134
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
135
|
+
# to List operation.
|
136
|
+
# @param cache_control [String] Indicates that the request shouldn't utilize
|
137
|
+
# any caches.
|
138
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
139
|
+
# will be added to the HTTP request.
|
140
|
+
#
|
141
|
+
# @return [EntityListResult] operation results.
|
142
|
+
#
|
143
|
+
def list_next(next_page_link, cache_control:'no-cache', custom_headers:nil)
|
144
|
+
response = list_next_async(next_page_link, cache_control:cache_control, custom_headers:custom_headers).value!
|
145
|
+
response.body unless response.nil?
|
146
|
+
end
|
147
|
+
|
148
|
+
#
|
149
|
+
# List all entities (Management Groups, Subscriptions, etc.) for the
|
150
|
+
# authenticated user.
|
151
|
+
#
|
152
|
+
#
|
153
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
154
|
+
# to List operation.
|
155
|
+
# @param cache_control [String] Indicates that the request shouldn't utilize
|
156
|
+
# any caches.
|
157
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
158
|
+
# will be added to the HTTP request.
|
159
|
+
#
|
160
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
161
|
+
#
|
162
|
+
def list_next_with_http_info(next_page_link, cache_control:'no-cache', custom_headers:nil)
|
163
|
+
list_next_async(next_page_link, cache_control:cache_control, custom_headers:custom_headers).value!
|
164
|
+
end
|
165
|
+
|
166
|
+
#
|
167
|
+
# List all entities (Management Groups, Subscriptions, etc.) for the
|
168
|
+
# authenticated user.
|
169
|
+
#
|
170
|
+
#
|
171
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
172
|
+
# to List operation.
|
173
|
+
# @param cache_control [String] Indicates that the request shouldn't utilize
|
174
|
+
# any caches.
|
175
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
176
|
+
# to the HTTP request.
|
177
|
+
#
|
178
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
179
|
+
#
|
180
|
+
def list_next_async(next_page_link, cache_control:'no-cache', custom_headers:nil)
|
181
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
182
|
+
|
183
|
+
|
184
|
+
request_headers = {}
|
185
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
186
|
+
|
187
|
+
# Set Headers
|
188
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
189
|
+
request_headers['Cache-Control'] = cache_control unless cache_control.nil?
|
190
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
191
|
+
path_template = '{nextLink}'
|
192
|
+
|
193
|
+
request_url = @base_url || @client.base_url
|
194
|
+
|
195
|
+
options = {
|
196
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
197
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
198
|
+
headers: request_headers.merge(custom_headers || {}),
|
199
|
+
base_url: request_url
|
200
|
+
}
|
201
|
+
promise = @client.make_request_async(:post, path_template, options)
|
202
|
+
|
203
|
+
promise = promise.then do |result|
|
204
|
+
http_response = result.response
|
205
|
+
status_code = http_response.status
|
206
|
+
response_content = http_response.body
|
207
|
+
unless status_code == 200
|
208
|
+
error_model = JSON.load(response_content)
|
209
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
210
|
+
end
|
211
|
+
|
212
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
213
|
+
# Deserialize Response
|
214
|
+
if status_code == 200
|
215
|
+
begin
|
216
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
217
|
+
result_mapper = Azure::ResourcesManagement::Mgmt::V2018_01_01_preview::Models::EntityListResult.mapper()
|
218
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
219
|
+
rescue Exception => e
|
220
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
result
|
225
|
+
end
|
226
|
+
|
227
|
+
promise.execute
|
228
|
+
end
|
229
|
+
|
230
|
+
#
|
231
|
+
# List all entities (Management Groups, Subscriptions, etc.) for the
|
232
|
+
# authenticated user.
|
233
|
+
#
|
234
|
+
#
|
235
|
+
# @param group_name [String] A filter which allows the call to be filtered for
|
236
|
+
# a specific group.
|
237
|
+
# @param cache_control [String] Indicates that the request shouldn't utilize
|
238
|
+
# any caches.
|
239
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
240
|
+
# will be added to the HTTP request.
|
241
|
+
#
|
242
|
+
# @return [EntityListResult] which provide lazy access to pages of the
|
243
|
+
# response.
|
244
|
+
#
|
245
|
+
def list_as_lazy(group_name:nil, cache_control:'no-cache', custom_headers:nil)
|
246
|
+
response = list_async(group_name:group_name, cache_control:cache_control, custom_headers:custom_headers).value!
|
247
|
+
unless response.nil?
|
248
|
+
page = response.body
|
249
|
+
page.next_method = Proc.new do |next_page_link|
|
250
|
+
list_next_async(next_page_link, cache_control:cache_control, custom_headers:custom_headers)
|
251
|
+
end
|
252
|
+
page
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
257
|
+
end
|