azure_mgmt_policy 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy.rb +34 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_assignment.rb +94 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_assignment_list_result.rb +94 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_definition.rb +98 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_definition_list_result.rb +94 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_type.rb +17 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/module_definition.rb +9 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb +1318 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_client.rb +133 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_definitions.rb +492 -0
- data/lib/2015-10-01-preview/generated/azure_mgmt_policy/version.rb +8 -0
- data/lib/2016-04-01/generated/azure_mgmt_policy.rb +34 -0
- data/lib/2016-04-01/generated/azure_mgmt_policy/models/policy_assignment.rb +94 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/models/policy_assignment_list_result.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_policy/models/policy_definition.rb +98 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/models/policy_definition_list_result.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/models/policy_type.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_policy/module_definition.rb +9 -0
- data/lib/2016-04-01/generated/azure_mgmt_policy/policy_assignments.rb +1318 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/policy_client.rb +7 -7
- data/lib/2016-04-01/generated/azure_mgmt_policy/policy_definitions.rb +492 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/version.rb +2 -2
- data/lib/2016-12-01/generated/azure_mgmt_policy.rb +35 -0
- data/lib/2016-12-01/generated/azure_mgmt_policy/models/policy_assignment.rb +116 -0
- data/lib/2016-12-01/generated/azure_mgmt_policy/models/policy_assignment_list_result.rb +94 -0
- data/lib/{generated → 2016-12-01/generated}/azure_mgmt_policy/models/policy_definition.rb +1 -1
- data/lib/2016-12-01/generated/azure_mgmt_policy/models/policy_definition_list_result.rb +94 -0
- data/lib/{generated → 2016-12-01/generated}/azure_mgmt_policy/models/policy_mode.rb +1 -1
- data/lib/2016-12-01/generated/azure_mgmt_policy/models/policy_type.rb +17 -0
- data/lib/2016-12-01/generated/azure_mgmt_policy/module_definition.rb +9 -0
- data/lib/2016-12-01/generated/azure_mgmt_policy/policy_assignments.rb +1318 -0
- data/lib/2016-12-01/generated/azure_mgmt_policy/policy_client.rb +133 -0
- data/lib/{generated → 2016-12-01/generated}/azure_mgmt_policy/policy_definitions.rb +34 -34
- data/lib/{generated/azure_mgmt_policy/module_definition.rb → 2016-12-01/generated/azure_mgmt_policy/version.rb} +3 -3
- data/lib/2017-06-01-preview/generated/azure_mgmt_policy.rb +37 -0
- data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/error_response.rb +1 -1
- data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_assignment.rb +1 -1
- data/lib/2017-06-01-preview/generated/azure_mgmt_policy/models/policy_assignment_list_result.rb +94 -0
- data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_definition_reference.rb +1 -1
- data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_set_definition.rb +1 -1
- data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_set_definition_list_result.rb +1 -1
- data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_sku.rb +1 -1
- data/lib/2017-06-01-preview/generated/azure_mgmt_policy/models/policy_type.rb +17 -0
- data/lib/2017-06-01-preview/generated/azure_mgmt_policy/module_definition.rb +9 -0
- data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/policy_assignments.rb +33 -33
- data/lib/2017-06-01-preview/generated/azure_mgmt_policy/policy_client.rb +133 -0
- data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/policy_set_definitions.rb +36 -36
- data/lib/2017-06-01-preview/generated/azure_mgmt_policy/version.rb +8 -0
- data/lib/azure_mgmt_policy.rb +6 -1
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/common/configurable.rb +73 -0
- data/lib/profiles/common/default.rb +68 -0
- data/lib/profiles/latest/modules/policy_profile_module.rb +95 -0
- data/lib/profiles/latest/policy_latest_profile_client.rb +33 -0
- data/lib/profiles/latest/policy_module_definition.rb +9 -0
- data/lib/profiles/v2017_03_09/modules/policy_profile_module.rb +64 -0
- data/lib/profiles/v2017_03_09/policy_module_definition.rb +9 -0
- data/lib/profiles/v2017_03_09/policy_v2017_03_09_profile_client.rb +33 -0
- data/lib/version.rb +7 -0
- metadata +60 -20
- data/lib/generated/azure_mgmt_policy.rb +0 -41
@@ -0,0 +1,133 @@
|
|
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::Policy::Mgmt::V2016_12_01
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class PolicyClient < 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 [String] The ID of the target subscription.
|
21
|
+
attr_accessor :subscription_id
|
22
|
+
|
23
|
+
# @return [String] The API version to use for the operation.
|
24
|
+
attr_reader :api_version
|
25
|
+
|
26
|
+
# @return [String] Gets or sets the preferred language for the response.
|
27
|
+
attr_accessor :accept_language
|
28
|
+
|
29
|
+
# @return [Integer] Gets or sets the retry timeout in seconds for Long
|
30
|
+
# Running Operations. Default value is 30.
|
31
|
+
attr_accessor :long_running_operation_retry_timeout
|
32
|
+
|
33
|
+
# @return [Boolean] When set to true a unique x-ms-client-request-id value
|
34
|
+
# is generated and included in each request. Default is true.
|
35
|
+
attr_accessor :generate_client_request_id
|
36
|
+
|
37
|
+
# @return [PolicyDefinitions] policy_definitions
|
38
|
+
attr_reader :policy_definitions
|
39
|
+
|
40
|
+
# @return [PolicyAssignments] policy_assignments
|
41
|
+
attr_reader :policy_assignments
|
42
|
+
|
43
|
+
#
|
44
|
+
# Creates initializes a new instance of the PolicyClient class.
|
45
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
46
|
+
# @param base_url [String] the base URI of the service.
|
47
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
48
|
+
#
|
49
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
50
|
+
super(credentials, options)
|
51
|
+
@base_url = base_url || 'https://management.azure.com'
|
52
|
+
|
53
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
54
|
+
@credentials = credentials
|
55
|
+
|
56
|
+
@policy_definitions = PolicyDefinitions.new(self)
|
57
|
+
@policy_assignments = PolicyAssignments.new(self)
|
58
|
+
@api_version = '2016-12-01'
|
59
|
+
@accept_language = 'en-US'
|
60
|
+
@long_running_operation_retry_timeout = 30
|
61
|
+
@generate_client_request_id = true
|
62
|
+
add_telemetry
|
63
|
+
end
|
64
|
+
|
65
|
+
#
|
66
|
+
# Makes a request and returns the body of the response.
|
67
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
68
|
+
# @param path [String] the path, relative to {base_url}.
|
69
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
70
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
71
|
+
# Example:
|
72
|
+
#
|
73
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
74
|
+
# path = "/path"
|
75
|
+
# options = {
|
76
|
+
# body: request_content,
|
77
|
+
# query_params: {'api-version' => '2016-02-01'}
|
78
|
+
# }
|
79
|
+
# result = @client.make_request(:put, path, options)
|
80
|
+
#
|
81
|
+
def make_request(method, path, options = {})
|
82
|
+
result = make_request_with_http_info(method, path, options)
|
83
|
+
result.body unless result.nil?
|
84
|
+
end
|
85
|
+
|
86
|
+
#
|
87
|
+
# Makes a request and returns the operation response.
|
88
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
89
|
+
# @param path [String] the path, relative to {base_url}.
|
90
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
91
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
92
|
+
#
|
93
|
+
def make_request_with_http_info(method, path, options = {})
|
94
|
+
result = make_request_async(method, path, options).value!
|
95
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
96
|
+
result
|
97
|
+
end
|
98
|
+
|
99
|
+
#
|
100
|
+
# Makes a request asynchronously.
|
101
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
102
|
+
# @param path [String] the path, relative to {base_url}.
|
103
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
104
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
105
|
+
#
|
106
|
+
def make_request_async(method, path, options = {})
|
107
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
108
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
109
|
+
|
110
|
+
request_url = options[:base_url] || @base_url
|
111
|
+
|
112
|
+
request_headers = @request_headers
|
113
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
114
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
115
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
116
|
+
|
117
|
+
super(request_url, method, path, options)
|
118
|
+
end
|
119
|
+
|
120
|
+
|
121
|
+
private
|
122
|
+
#
|
123
|
+
# Adds telemetry information.
|
124
|
+
#
|
125
|
+
def add_telemetry
|
126
|
+
sdk_information = 'azure_mgmt_policy'
|
127
|
+
if defined? Azure::Policy::Mgmt::V2016_12_01::VERSION
|
128
|
+
sdk_information = "#{sdk_information}/#{Azure::Policy::Mgmt::V2016_12_01::VERSION}"
|
129
|
+
end
|
130
|
+
add_user_agent_information(sdk_information)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
@@ -3,7 +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::
|
6
|
+
module Azure::Policy::Mgmt::V2016_12_01
|
7
7
|
#
|
8
8
|
# To manage and control access to your resources, you can define customized
|
9
9
|
# policies and assign them at a scope.
|
@@ -67,7 +67,7 @@ module Azure::ARM::Policy
|
|
67
67
|
def create_or_update_async(policy_definition_name, parameters, custom_headers = nil)
|
68
68
|
fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
|
69
69
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
70
|
-
api_version
|
70
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
71
71
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
72
72
|
|
73
73
|
|
@@ -80,7 +80,7 @@ module Azure::ARM::Policy
|
|
80
80
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
81
81
|
|
82
82
|
# Serialize Request
|
83
|
-
request_mapper = Azure::
|
83
|
+
request_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinition.mapper()
|
84
84
|
request_content = @client.serialize(request_mapper, parameters)
|
85
85
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
86
86
|
|
@@ -91,7 +91,7 @@ module Azure::ARM::Policy
|
|
91
91
|
options = {
|
92
92
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
93
93
|
path_params: {'policyDefinitionName' => policy_definition_name,'subscriptionId' => @client.subscription_id},
|
94
|
-
query_params: {'api-version' => api_version},
|
94
|
+
query_params: {'api-version' => @client.api_version},
|
95
95
|
body: request_content,
|
96
96
|
headers: request_headers.merge(custom_headers || {}),
|
97
97
|
base_url: request_url
|
@@ -112,7 +112,7 @@ module Azure::ARM::Policy
|
|
112
112
|
if status_code == 201
|
113
113
|
begin
|
114
114
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
115
|
-
result_mapper = Azure::
|
115
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinition.mapper()
|
116
116
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
117
117
|
rescue Exception => e
|
118
118
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -165,7 +165,7 @@ module Azure::ARM::Policy
|
|
165
165
|
#
|
166
166
|
def delete_async(policy_definition_name, custom_headers = nil)
|
167
167
|
fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
|
168
|
-
api_version
|
168
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
169
169
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
170
170
|
|
171
171
|
|
@@ -181,7 +181,7 @@ module Azure::ARM::Policy
|
|
181
181
|
options = {
|
182
182
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
183
183
|
path_params: {'policyDefinitionName' => policy_definition_name,'subscriptionId' => @client.subscription_id},
|
184
|
-
query_params: {'api-version' => api_version},
|
184
|
+
query_params: {'api-version' => @client.api_version},
|
185
185
|
headers: request_headers.merge(custom_headers || {}),
|
186
186
|
base_url: request_url
|
187
187
|
}
|
@@ -245,7 +245,7 @@ module Azure::ARM::Policy
|
|
245
245
|
#
|
246
246
|
def get_async(policy_definition_name, custom_headers = nil)
|
247
247
|
fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
|
248
|
-
api_version
|
248
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
249
249
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
250
250
|
|
251
251
|
|
@@ -261,7 +261,7 @@ module Azure::ARM::Policy
|
|
261
261
|
options = {
|
262
262
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
263
263
|
path_params: {'policyDefinitionName' => policy_definition_name,'subscriptionId' => @client.subscription_id},
|
264
|
-
query_params: {'api-version' => api_version},
|
264
|
+
query_params: {'api-version' => @client.api_version},
|
265
265
|
headers: request_headers.merge(custom_headers || {}),
|
266
266
|
base_url: request_url
|
267
267
|
}
|
@@ -281,7 +281,7 @@ module Azure::ARM::Policy
|
|
281
281
|
if status_code == 200
|
282
282
|
begin
|
283
283
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
284
|
-
result_mapper = Azure::
|
284
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinition.mapper()
|
285
285
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
286
286
|
rescue Exception => e
|
287
287
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -335,7 +335,7 @@ module Azure::ARM::Policy
|
|
335
335
|
#
|
336
336
|
def get_built_in_async(policy_definition_name, custom_headers = nil)
|
337
337
|
fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
|
338
|
-
api_version
|
338
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
339
339
|
|
340
340
|
|
341
341
|
request_headers = {}
|
@@ -350,7 +350,7 @@ module Azure::ARM::Policy
|
|
350
350
|
options = {
|
351
351
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
352
352
|
path_params: {'policyDefinitionName' => policy_definition_name},
|
353
|
-
query_params: {'api-version' => api_version},
|
353
|
+
query_params: {'api-version' => @client.api_version},
|
354
354
|
headers: request_headers.merge(custom_headers || {}),
|
355
355
|
base_url: request_url
|
356
356
|
}
|
@@ -370,7 +370,7 @@ module Azure::ARM::Policy
|
|
370
370
|
if status_code == 200
|
371
371
|
begin
|
372
372
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
373
|
-
result_mapper = Azure::
|
373
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinition.mapper()
|
374
374
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
375
375
|
rescue Exception => e
|
376
376
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -431,7 +431,7 @@ module Azure::ARM::Policy
|
|
431
431
|
def create_or_update_at_management_group_async(policy_definition_name, parameters, management_group_id, custom_headers = nil)
|
432
432
|
fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
|
433
433
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
434
|
-
api_version
|
434
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
435
435
|
fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
|
436
436
|
|
437
437
|
|
@@ -444,7 +444,7 @@ module Azure::ARM::Policy
|
|
444
444
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
445
445
|
|
446
446
|
# Serialize Request
|
447
|
-
request_mapper = Azure::
|
447
|
+
request_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinition.mapper()
|
448
448
|
request_content = @client.serialize(request_mapper, parameters)
|
449
449
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
450
450
|
|
@@ -455,7 +455,7 @@ module Azure::ARM::Policy
|
|
455
455
|
options = {
|
456
456
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
457
457
|
path_params: {'policyDefinitionName' => policy_definition_name,'managementGroupId' => management_group_id},
|
458
|
-
query_params: {'api-version' => api_version},
|
458
|
+
query_params: {'api-version' => @client.api_version},
|
459
459
|
body: request_content,
|
460
460
|
headers: request_headers.merge(custom_headers || {}),
|
461
461
|
base_url: request_url
|
@@ -476,7 +476,7 @@ module Azure::ARM::Policy
|
|
476
476
|
if status_code == 201
|
477
477
|
begin
|
478
478
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
479
|
-
result_mapper = Azure::
|
479
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinition.mapper()
|
480
480
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
481
481
|
rescue Exception => e
|
482
482
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -532,7 +532,7 @@ module Azure::ARM::Policy
|
|
532
532
|
#
|
533
533
|
def delete_at_management_group_async(policy_definition_name, management_group_id, custom_headers = nil)
|
534
534
|
fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
|
535
|
-
api_version
|
535
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
536
536
|
fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
|
537
537
|
|
538
538
|
|
@@ -548,7 +548,7 @@ module Azure::ARM::Policy
|
|
548
548
|
options = {
|
549
549
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
550
550
|
path_params: {'policyDefinitionName' => policy_definition_name,'managementGroupId' => management_group_id},
|
551
|
-
query_params: {'api-version' => api_version},
|
551
|
+
query_params: {'api-version' => @client.api_version},
|
552
552
|
headers: request_headers.merge(custom_headers || {}),
|
553
553
|
base_url: request_url
|
554
554
|
}
|
@@ -615,7 +615,7 @@ module Azure::ARM::Policy
|
|
615
615
|
#
|
616
616
|
def get_at_management_group_async(policy_definition_name, management_group_id, custom_headers = nil)
|
617
617
|
fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
|
618
|
-
api_version
|
618
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
619
619
|
fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
|
620
620
|
|
621
621
|
|
@@ -631,7 +631,7 @@ module Azure::ARM::Policy
|
|
631
631
|
options = {
|
632
632
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
633
633
|
path_params: {'policyDefinitionName' => policy_definition_name,'managementGroupId' => management_group_id},
|
634
|
-
query_params: {'api-version' => api_version},
|
634
|
+
query_params: {'api-version' => @client.api_version},
|
635
635
|
headers: request_headers.merge(custom_headers || {}),
|
636
636
|
base_url: request_url
|
637
637
|
}
|
@@ -651,7 +651,7 @@ module Azure::ARM::Policy
|
|
651
651
|
if status_code == 200
|
652
652
|
begin
|
653
653
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
654
|
-
result_mapper = Azure::
|
654
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinition.mapper()
|
655
655
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
656
656
|
rescue Exception => e
|
657
657
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -698,7 +698,7 @@ module Azure::ARM::Policy
|
|
698
698
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
699
699
|
#
|
700
700
|
def list_async(custom_headers = nil)
|
701
|
-
api_version
|
701
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
702
702
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
703
703
|
|
704
704
|
|
@@ -714,7 +714,7 @@ module Azure::ARM::Policy
|
|
714
714
|
options = {
|
715
715
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
716
716
|
path_params: {'subscriptionId' => @client.subscription_id},
|
717
|
-
query_params: {'api-version' => api_version},
|
717
|
+
query_params: {'api-version' => @client.api_version},
|
718
718
|
headers: request_headers.merge(custom_headers || {}),
|
719
719
|
base_url: request_url
|
720
720
|
}
|
@@ -734,7 +734,7 @@ module Azure::ARM::Policy
|
|
734
734
|
if status_code == 200
|
735
735
|
begin
|
736
736
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
737
|
-
result_mapper = Azure::
|
737
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinitionListResult.mapper()
|
738
738
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
739
739
|
rescue Exception => e
|
740
740
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -781,7 +781,7 @@ module Azure::ARM::Policy
|
|
781
781
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
782
782
|
#
|
783
783
|
def list_built_in_async(custom_headers = nil)
|
784
|
-
api_version
|
784
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
785
785
|
|
786
786
|
|
787
787
|
request_headers = {}
|
@@ -795,7 +795,7 @@ module Azure::ARM::Policy
|
|
795
795
|
|
796
796
|
options = {
|
797
797
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
798
|
-
query_params: {'api-version' => api_version},
|
798
|
+
query_params: {'api-version' => @client.api_version},
|
799
799
|
headers: request_headers.merge(custom_headers || {}),
|
800
800
|
base_url: request_url
|
801
801
|
}
|
@@ -815,7 +815,7 @@ module Azure::ARM::Policy
|
|
815
815
|
if status_code == 200
|
816
816
|
begin
|
817
817
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
818
|
-
result_mapper = Azure::
|
818
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinitionListResult.mapper()
|
819
819
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
820
820
|
rescue Exception => e
|
821
821
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -865,7 +865,7 @@ module Azure::ARM::Policy
|
|
865
865
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
866
866
|
#
|
867
867
|
def list_by_management_group_async(management_group_id, custom_headers = nil)
|
868
|
-
api_version
|
868
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
869
869
|
fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
|
870
870
|
|
871
871
|
|
@@ -881,7 +881,7 @@ module Azure::ARM::Policy
|
|
881
881
|
options = {
|
882
882
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
883
883
|
path_params: {'managementGroupId' => management_group_id},
|
884
|
-
query_params: {'api-version' => api_version},
|
884
|
+
query_params: {'api-version' => @client.api_version},
|
885
885
|
headers: request_headers.merge(custom_headers || {}),
|
886
886
|
base_url: request_url
|
887
887
|
}
|
@@ -901,7 +901,7 @@ module Azure::ARM::Policy
|
|
901
901
|
if status_code == 200
|
902
902
|
begin
|
903
903
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
904
|
-
result_mapper = Azure::
|
904
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinitionListResult.mapper()
|
905
905
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
906
906
|
rescue Exception => e
|
907
907
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -988,7 +988,7 @@ module Azure::ARM::Policy
|
|
988
988
|
if status_code == 200
|
989
989
|
begin
|
990
990
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
991
|
-
result_mapper = Azure::
|
991
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinitionListResult.mapper()
|
992
992
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
993
993
|
rescue Exception => e
|
994
994
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -1075,7 +1075,7 @@ module Azure::ARM::Policy
|
|
1075
1075
|
if status_code == 200
|
1076
1076
|
begin
|
1077
1077
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1078
|
-
result_mapper = Azure::
|
1078
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinitionListResult.mapper()
|
1079
1079
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
1080
1080
|
rescue Exception => e
|
1081
1081
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -1162,7 +1162,7 @@ module Azure::ARM::Policy
|
|
1162
1162
|
if status_code == 200
|
1163
1163
|
begin
|
1164
1164
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1165
|
-
result_mapper = Azure::
|
1165
|
+
result_mapper = Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinitionListResult.mapper()
|
1166
1166
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
1167
1167
|
rescue Exception => e
|
1168
1168
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -0,0 +1,37 @@
|
|
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 '2017-06-01-preview/generated/azure_mgmt_policy/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::Policy::Mgmt::V2017_06_01_preview
|
23
|
+
autoload :PolicyAssignments, '2017-06-01-preview/generated/azure_mgmt_policy/policy_assignments.rb'
|
24
|
+
autoload :PolicySetDefinitions, '2017-06-01-preview/generated/azure_mgmt_policy/policy_set_definitions.rb'
|
25
|
+
autoload :PolicyClient, '2017-06-01-preview/generated/azure_mgmt_policy/policy_client.rb'
|
26
|
+
|
27
|
+
module Models
|
28
|
+
autoload :ErrorResponse, '2017-06-01-preview/generated/azure_mgmt_policy/models/error_response.rb'
|
29
|
+
autoload :PolicyDefinitionReference, '2017-06-01-preview/generated/azure_mgmt_policy/models/policy_definition_reference.rb'
|
30
|
+
autoload :PolicyAssignment, '2017-06-01-preview/generated/azure_mgmt_policy/models/policy_assignment.rb'
|
31
|
+
autoload :PolicySetDefinition, '2017-06-01-preview/generated/azure_mgmt_policy/models/policy_set_definition.rb'
|
32
|
+
autoload :PolicySku, '2017-06-01-preview/generated/azure_mgmt_policy/models/policy_sku.rb'
|
33
|
+
autoload :PolicySetDefinitionListResult, '2017-06-01-preview/generated/azure_mgmt_policy/models/policy_set_definition_list_result.rb'
|
34
|
+
autoload :PolicyAssignmentListResult, '2017-06-01-preview/generated/azure_mgmt_policy/models/policy_assignment_list_result.rb'
|
35
|
+
autoload :PolicyType, '2017-06-01-preview/generated/azure_mgmt_policy/models/policy_type.rb'
|
36
|
+
end
|
37
|
+
end
|