azure_mgmt_authorization 0.18.1 → 0.18.2
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 +4 -4
- data/lib/2015-06-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +1 -1
- data/lib/2015-07-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +1 -1
- data/lib/2015-07-01/generated/azure_mgmt_authorization/authorization_management_client.rb +1 -1
- data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +1 -1
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization.rb +9 -9
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +5 -5
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/permissions.rb +1 -5
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/provider_operations_metadata_operations.rb +1 -5
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/role_assignments.rb +1 -5
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/role_definitions.rb +1 -5
- data/lib/2018-07-01-preview/generated/azure_mgmt_authorization.rb +33 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +131 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_authorization/deny_assignments.rb +1226 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_authorization/models/deny_assignment.rb +191 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_authorization/models/deny_assignment_filter.rb +71 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_authorization/models/deny_assignment_list_result.rb +98 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_authorization/models/deny_assignment_permission.rb +115 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_authorization/models/principal.rb +65 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_authorization/module_definition.rb +9 -0
- data/lib/2018-09-01-preview/generated/azure_mgmt_authorization.rb +33 -0
- data/lib/2018-09-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +131 -0
- data/lib/2018-09-01-preview/generated/azure_mgmt_authorization/models/principal_type.rb +24 -0
- data/lib/2018-09-01-preview/generated/azure_mgmt_authorization/models/role_assignment.rb +115 -0
- data/lib/2018-09-01-preview/generated/azure_mgmt_authorization/models/role_assignment_create_parameters.rb +85 -0
- data/lib/2018-09-01-preview/generated/azure_mgmt_authorization/models/role_assignment_filter.rb +57 -0
- data/lib/2018-09-01-preview/generated/azure_mgmt_authorization/models/role_assignment_list_result.rb +98 -0
- data/lib/2018-09-01-preview/generated/azure_mgmt_authorization/module_definition.rb +9 -0
- data/lib/2018-09-01-preview/generated/azure_mgmt_authorization/role_assignments.rb +1492 -0
- data/lib/azure_mgmt_authorization.rb +2 -0
- data/lib/profiles/latest/modules/authorization_profile_module.rb +72 -30
- data/lib/version.rb +1 -1
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce83090cfbc46b2748c6cb20cb058e0cb60bb4d4
|
4
|
+
data.tar.gz: 8a993c010a52f9e45060c8cf5cfbf3ddb582c436
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01e24754891f6ec86ca2e06e6ad9245a55a02d77422b98ab83a47f51130f4d7e86503d5c028e4b37033bff652015b1f985896843d6a95f0487b24e64402061fb
|
7
|
+
data.tar.gz: 2124e1a97eefa53b35ad597dd40cd422ea0c842e8bb9197adadf4b85e56b1f9017d1ee69ca7612a8e133fbccb5d526a4ac1b268fea214388ae93dd013d51cf26
|
data/lib/2015-06-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb
CHANGED
@@ -124,7 +124,7 @@ module Azure::Authorization::Mgmt::V2015_06_01_preview
|
|
124
124
|
#
|
125
125
|
def add_telemetry
|
126
126
|
sdk_information = 'azure_mgmt_authorization'
|
127
|
-
sdk_information = "#{sdk_information}/0.18.
|
127
|
+
sdk_information = "#{sdk_information}/0.18.2"
|
128
128
|
add_user_agent_information(sdk_information)
|
129
129
|
end
|
130
130
|
end
|
data/lib/2015-07-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb
CHANGED
@@ -133,7 +133,7 @@ module Azure::Authorization::Mgmt::V2015_07_01_preview
|
|
133
133
|
#
|
134
134
|
def add_telemetry
|
135
135
|
sdk_information = 'azure_mgmt_authorization'
|
136
|
-
sdk_information = "#{sdk_information}/0.18.
|
136
|
+
sdk_information = "#{sdk_information}/0.18.2"
|
137
137
|
add_user_agent_information(sdk_information)
|
138
138
|
end
|
139
139
|
end
|
@@ -141,7 +141,7 @@ module Azure::Authorization::Mgmt::V2015_07_01
|
|
141
141
|
#
|
142
142
|
def add_telemetry
|
143
143
|
sdk_information = 'azure_mgmt_authorization'
|
144
|
-
sdk_information = "#{sdk_information}/0.18.
|
144
|
+
sdk_information = "#{sdk_information}/0.18.2"
|
145
145
|
add_user_agent_information(sdk_information)
|
146
146
|
end
|
147
147
|
end
|
data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb
CHANGED
@@ -124,7 +124,7 @@ module Azure::Authorization::Mgmt::V2017_10_01_preview
|
|
124
124
|
#
|
125
125
|
def add_telemetry
|
126
126
|
sdk_information = 'azure_mgmt_authorization'
|
127
|
-
sdk_information = "#{sdk_information}/0.18.
|
127
|
+
sdk_information = "#{sdk_information}/0.18.2"
|
128
128
|
add_user_agent_information(sdk_information)
|
129
129
|
end
|
130
130
|
end
|
@@ -21,24 +21,24 @@ require 'ms_rest_azure'
|
|
21
21
|
|
22
22
|
module Azure::Authorization::Mgmt::V2018_01_01_preview
|
23
23
|
autoload :ProviderOperationsMetadataOperations, '2018-01-01-preview/generated/azure_mgmt_authorization/provider_operations_metadata_operations.rb'
|
24
|
-
autoload :Permissions, '2018-01-01-preview/generated/azure_mgmt_authorization/permissions.rb'
|
25
24
|
autoload :RoleAssignments, '2018-01-01-preview/generated/azure_mgmt_authorization/role_assignments.rb'
|
25
|
+
autoload :Permissions, '2018-01-01-preview/generated/azure_mgmt_authorization/permissions.rb'
|
26
26
|
autoload :RoleDefinitions, '2018-01-01-preview/generated/azure_mgmt_authorization/role_definitions.rb'
|
27
27
|
autoload :AuthorizationManagementClient, '2018-01-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb'
|
28
28
|
|
29
29
|
module Models
|
30
|
-
autoload :
|
31
|
-
autoload :
|
30
|
+
autoload :RoleAssignmentListResult, '2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment_list_result.rb'
|
31
|
+
autoload :RoleAssignmentCreateParameters, '2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment_create_parameters.rb'
|
32
32
|
autoload :ResourceType, '2018-01-01-preview/generated/azure_mgmt_authorization/models/resource_type.rb'
|
33
|
-
autoload :
|
33
|
+
autoload :RoleDefinitionFilter, '2018-01-01-preview/generated/azure_mgmt_authorization/models/role_definition_filter.rb'
|
34
34
|
autoload :ProviderOperationsMetadataListResult, '2018-01-01-preview/generated/azure_mgmt_authorization/models/provider_operations_metadata_list_result.rb'
|
35
|
-
autoload :
|
36
|
-
autoload :PermissionGetResult, '2018-01-01-preview/generated/azure_mgmt_authorization/models/permission_get_result.rb'
|
35
|
+
autoload :Permission, '2018-01-01-preview/generated/azure_mgmt_authorization/models/permission.rb'
|
37
36
|
autoload :RoleAssignment, '2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment.rb'
|
37
|
+
autoload :RoleDefinition, '2018-01-01-preview/generated/azure_mgmt_authorization/models/role_definition.rb'
|
38
38
|
autoload :ProviderOperationsMetadata, '2018-01-01-preview/generated/azure_mgmt_authorization/models/provider_operations_metadata.rb'
|
39
|
-
autoload :
|
39
|
+
autoload :RoleDefinitionListResult, '2018-01-01-preview/generated/azure_mgmt_authorization/models/role_definition_list_result.rb'
|
40
40
|
autoload :ProviderOperation, '2018-01-01-preview/generated/azure_mgmt_authorization/models/provider_operation.rb'
|
41
|
-
autoload :
|
42
|
-
autoload :
|
41
|
+
autoload :PermissionGetResult, '2018-01-01-preview/generated/azure_mgmt_authorization/models/permission_get_result.rb'
|
42
|
+
autoload :RoleAssignmentFilter, '2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment_filter.rb'
|
43
43
|
end
|
44
44
|
end
|
data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb
CHANGED
@@ -39,12 +39,12 @@ module Azure::Authorization::Mgmt::V2018_01_01_preview
|
|
39
39
|
# provider_operations_metadata_operations
|
40
40
|
attr_reader :provider_operations_metadata_operations
|
41
41
|
|
42
|
-
# @return [Permissions] permissions
|
43
|
-
attr_reader :permissions
|
44
|
-
|
45
42
|
# @return [RoleAssignments] role_assignments
|
46
43
|
attr_reader :role_assignments
|
47
44
|
|
45
|
+
# @return [Permissions] permissions
|
46
|
+
attr_reader :permissions
|
47
|
+
|
48
48
|
# @return [RoleDefinitions] role_definitions
|
49
49
|
attr_reader :role_definitions
|
50
50
|
|
@@ -62,8 +62,8 @@ module Azure::Authorization::Mgmt::V2018_01_01_preview
|
|
62
62
|
@credentials = credentials
|
63
63
|
|
64
64
|
@provider_operations_metadata_operations = ProviderOperationsMetadataOperations.new(self)
|
65
|
-
@permissions = Permissions.new(self)
|
66
65
|
@role_assignments = RoleAssignments.new(self)
|
66
|
+
@permissions = Permissions.new(self)
|
67
67
|
@role_definitions = RoleDefinitions.new(self)
|
68
68
|
@api_version = '2018-01-01-preview'
|
69
69
|
@accept_language = 'en-US'
|
@@ -137,7 +137,7 @@ module Azure::Authorization::Mgmt::V2018_01_01_preview
|
|
137
137
|
#
|
138
138
|
def add_telemetry
|
139
139
|
sdk_information = 'azure_mgmt_authorization'
|
140
|
-
sdk_information = "#{sdk_information}/0.18.
|
140
|
+
sdk_information = "#{sdk_information}/0.18.2"
|
141
141
|
add_user_agent_information(sdk_information)
|
142
142
|
end
|
143
143
|
end
|
@@ -5,11 +5,7 @@
|
|
5
5
|
|
6
6
|
module Azure::Authorization::Mgmt::V2018_01_01_preview
|
7
7
|
#
|
8
|
-
#
|
9
|
-
# administration down to individual resources or resource groups. These
|
10
|
-
# operations enable you to manage role definitions and role assignments. A
|
11
|
-
# role definition describes the set of actions that can be performed on
|
12
|
-
# resources. A role assignment grants access to Azure Active Directory users.
|
8
|
+
# Permissions
|
13
9
|
#
|
14
10
|
class Permissions
|
15
11
|
include MsRestAzure
|
@@ -5,11 +5,7 @@
|
|
5
5
|
|
6
6
|
module Azure::Authorization::Mgmt::V2018_01_01_preview
|
7
7
|
#
|
8
|
-
#
|
9
|
-
# administration down to individual resources or resource groups. These
|
10
|
-
# operations enable you to manage role definitions and role assignments. A
|
11
|
-
# role definition describes the set of actions that can be performed on
|
12
|
-
# resources. A role assignment grants access to Azure Active Directory users.
|
8
|
+
# ProviderOperationsMetadataOperations
|
13
9
|
#
|
14
10
|
class ProviderOperationsMetadataOperations
|
15
11
|
include MsRestAzure
|
@@ -5,11 +5,7 @@
|
|
5
5
|
|
6
6
|
module Azure::Authorization::Mgmt::V2018_01_01_preview
|
7
7
|
#
|
8
|
-
#
|
9
|
-
# administration down to individual resources or resource groups. These
|
10
|
-
# operations enable you to manage role definitions and role assignments. A
|
11
|
-
# role definition describes the set of actions that can be performed on
|
12
|
-
# resources. A role assignment grants access to Azure Active Directory users.
|
8
|
+
# RoleAssignments
|
13
9
|
#
|
14
10
|
class RoleAssignments
|
15
11
|
include MsRestAzure
|
@@ -5,11 +5,7 @@
|
|
5
5
|
|
6
6
|
module Azure::Authorization::Mgmt::V2018_01_01_preview
|
7
7
|
#
|
8
|
-
#
|
9
|
-
# administration down to individual resources or resource groups. These
|
10
|
-
# operations enable you to manage role definitions and role assignments. A
|
11
|
-
# role definition describes the set of actions that can be performed on
|
12
|
-
# resources. A role assignment grants access to Azure Active Directory users.
|
8
|
+
# RoleDefinitions
|
13
9
|
#
|
14
10
|
class RoleDefinitions
|
15
11
|
include MsRestAzure
|
@@ -0,0 +1,33 @@
|
|
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-07-01-preview/generated/azure_mgmt_authorization/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::Authorization::Mgmt::V2018_07_01_preview
|
23
|
+
autoload :DenyAssignments, '2018-07-01-preview/generated/azure_mgmt_authorization/deny_assignments.rb'
|
24
|
+
autoload :AuthorizationManagementClient, '2018-07-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb'
|
25
|
+
|
26
|
+
module Models
|
27
|
+
autoload :Principal, '2018-07-01-preview/generated/azure_mgmt_authorization/models/principal.rb'
|
28
|
+
autoload :DenyAssignment, '2018-07-01-preview/generated/azure_mgmt_authorization/models/deny_assignment.rb'
|
29
|
+
autoload :DenyAssignmentPermission, '2018-07-01-preview/generated/azure_mgmt_authorization/models/deny_assignment_permission.rb'
|
30
|
+
autoload :DenyAssignmentListResult, '2018-07-01-preview/generated/azure_mgmt_authorization/models/deny_assignment_list_result.rb'
|
31
|
+
autoload :DenyAssignmentFilter, '2018-07-01-preview/generated/azure_mgmt_authorization/models/deny_assignment_filter.rb'
|
32
|
+
end
|
33
|
+
end
|
data/lib/2018-07-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb
ADDED
@@ -0,0 +1,131 @@
|
|
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::Authorization::Mgmt::V2018_07_01_preview
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class AuthorizationManagementClient < 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 this operation.
|
24
|
+
attr_reader :api_version
|
25
|
+
|
26
|
+
# @return [String] The preferred language for the response.
|
27
|
+
attr_accessor :accept_language
|
28
|
+
|
29
|
+
# @return [Integer] The retry timeout in seconds for Long Running
|
30
|
+
# Operations. Default value is 30.
|
31
|
+
attr_accessor :long_running_operation_retry_timeout
|
32
|
+
|
33
|
+
# @return [Boolean] Whether a unique x-ms-client-request-id should be
|
34
|
+
# generated. When set to true a unique x-ms-client-request-id value is
|
35
|
+
# generated and included in each request. Default is true.
|
36
|
+
attr_accessor :generate_client_request_id
|
37
|
+
|
38
|
+
# @return [DenyAssignments] deny_assignments
|
39
|
+
attr_reader :deny_assignments
|
40
|
+
|
41
|
+
#
|
42
|
+
# Creates initializes a new instance of the AuthorizationManagementClient class.
|
43
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
44
|
+
# @param base_url [String] the base URI of the service.
|
45
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
46
|
+
#
|
47
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
48
|
+
super(credentials, options)
|
49
|
+
@base_url = base_url || 'https://management.azure.com'
|
50
|
+
|
51
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
52
|
+
@credentials = credentials
|
53
|
+
|
54
|
+
@deny_assignments = DenyAssignments.new(self)
|
55
|
+
@api_version = '2018-07-01-preview'
|
56
|
+
@accept_language = 'en-US'
|
57
|
+
@long_running_operation_retry_timeout = 30
|
58
|
+
@generate_client_request_id = true
|
59
|
+
add_telemetry
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# Makes a request and returns the body of the response.
|
64
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
65
|
+
# @param path [String] the path, relative to {base_url}.
|
66
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
67
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
68
|
+
# Example:
|
69
|
+
#
|
70
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
71
|
+
# path = "/path"
|
72
|
+
# options = {
|
73
|
+
# body: request_content,
|
74
|
+
# query_params: {'api-version' => '2016-02-01'}
|
75
|
+
# }
|
76
|
+
# result = @client.make_request(:put, path, options)
|
77
|
+
#
|
78
|
+
def make_request(method, path, options = {})
|
79
|
+
result = make_request_with_http_info(method, path, options)
|
80
|
+
result.body unless result.nil?
|
81
|
+
end
|
82
|
+
|
83
|
+
#
|
84
|
+
# Makes a request and returns the operation response.
|
85
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
86
|
+
# @param path [String] the path, relative to {base_url}.
|
87
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
88
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
89
|
+
#
|
90
|
+
def make_request_with_http_info(method, path, options = {})
|
91
|
+
result = make_request_async(method, path, options).value!
|
92
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
93
|
+
result
|
94
|
+
end
|
95
|
+
|
96
|
+
#
|
97
|
+
# Makes a request asynchronously.
|
98
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
99
|
+
# @param path [String] the path, relative to {base_url}.
|
100
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
101
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
102
|
+
#
|
103
|
+
def make_request_async(method, path, options = {})
|
104
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
105
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
106
|
+
|
107
|
+
request_url = options[:base_url] || @base_url
|
108
|
+
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
|
109
|
+
@request_headers['Content-Type'] = options[:headers]['Content-Type']
|
110
|
+
end
|
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_authorization'
|
127
|
+
sdk_information = "#{sdk_information}/0.18.2"
|
128
|
+
add_user_agent_information(sdk_information)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
@@ -0,0 +1,1226 @@
|
|
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::Authorization::Mgmt::V2018_07_01_preview
|
7
|
+
#
|
8
|
+
# Role based access control provides you a way to apply granular level policy
|
9
|
+
# administration down to individual resources or resource groups. These
|
10
|
+
# operations enable you to get deny assignments. A deny assignment describes
|
11
|
+
# the set of actions on resources that are denied for Azure Active Directory
|
12
|
+
# users.
|
13
|
+
#
|
14
|
+
class DenyAssignments
|
15
|
+
include MsRestAzure
|
16
|
+
|
17
|
+
#
|
18
|
+
# Creates and initializes a new instance of the DenyAssignments class.
|
19
|
+
# @param client service class for accessing basic functionality.
|
20
|
+
#
|
21
|
+
def initialize(client)
|
22
|
+
@client = client
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [AuthorizationManagementClient] reference to the AuthorizationManagementClient
|
26
|
+
attr_reader :client
|
27
|
+
|
28
|
+
#
|
29
|
+
# Gets deny assignments for a resource.
|
30
|
+
#
|
31
|
+
# @param resource_group_name [String] The name of the resource group.
|
32
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
33
|
+
# provider.
|
34
|
+
# @param parent_resource_path [String] The parent resource identity.
|
35
|
+
# @param resource_type [String] The resource type of the resource.
|
36
|
+
# @param resource_name [String] The name of the resource to get deny
|
37
|
+
# assignments for.
|
38
|
+
# @param filter [String] The filter to apply on the operation. Use
|
39
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
40
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
41
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
42
|
+
# assignments at, above and below the scope for the specified principal. Use
|
43
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
44
|
+
# above and below the scope for the specified principal. This filter is
|
45
|
+
# different from the principalId filter as it returns not only those deny
|
46
|
+
# assignments that contain the specified principal is the Principals list but
|
47
|
+
# also those deny assignments that contain the specified principal is the
|
48
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
49
|
+
# used, only the deny assignment name and description properties are returned.
|
50
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
51
|
+
# will be added to the HTTP request.
|
52
|
+
#
|
53
|
+
# @return [Array<DenyAssignment>] operation results.
|
54
|
+
#
|
55
|
+
def list_for_resource(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter:nil, custom_headers:nil)
|
56
|
+
first_page = list_for_resource_as_lazy(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter:filter, custom_headers:custom_headers)
|
57
|
+
first_page.get_all_items
|
58
|
+
end
|
59
|
+
|
60
|
+
#
|
61
|
+
# Gets deny assignments for a resource.
|
62
|
+
#
|
63
|
+
# @param resource_group_name [String] The name of the resource group.
|
64
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
65
|
+
# provider.
|
66
|
+
# @param parent_resource_path [String] The parent resource identity.
|
67
|
+
# @param resource_type [String] The resource type of the resource.
|
68
|
+
# @param resource_name [String] The name of the resource to get deny
|
69
|
+
# assignments for.
|
70
|
+
# @param filter [String] The filter to apply on the operation. Use
|
71
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
72
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
73
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
74
|
+
# assignments at, above and below the scope for the specified principal. Use
|
75
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
76
|
+
# above and below the scope for the specified principal. This filter is
|
77
|
+
# different from the principalId filter as it returns not only those deny
|
78
|
+
# assignments that contain the specified principal is the Principals list but
|
79
|
+
# also those deny assignments that contain the specified principal is the
|
80
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
81
|
+
# used, only the deny assignment name and description properties are returned.
|
82
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
83
|
+
# will be added to the HTTP request.
|
84
|
+
#
|
85
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
86
|
+
#
|
87
|
+
def list_for_resource_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter:nil, custom_headers:nil)
|
88
|
+
list_for_resource_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter:filter, custom_headers:custom_headers).value!
|
89
|
+
end
|
90
|
+
|
91
|
+
#
|
92
|
+
# Gets deny assignments for a resource.
|
93
|
+
#
|
94
|
+
# @param resource_group_name [String] The name of the resource group.
|
95
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
96
|
+
# provider.
|
97
|
+
# @param parent_resource_path [String] The parent resource identity.
|
98
|
+
# @param resource_type [String] The resource type of the resource.
|
99
|
+
# @param resource_name [String] The name of the resource to get deny
|
100
|
+
# assignments for.
|
101
|
+
# @param filter [String] The filter to apply on the operation. Use
|
102
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
103
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
104
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
105
|
+
# assignments at, above and below the scope for the specified principal. Use
|
106
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
107
|
+
# above and below the scope for the specified principal. This filter is
|
108
|
+
# different from the principalId filter as it returns not only those deny
|
109
|
+
# assignments that contain the specified principal is the Principals list but
|
110
|
+
# also those deny assignments that contain the specified principal is the
|
111
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
112
|
+
# used, only the deny assignment name and description properties are returned.
|
113
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
114
|
+
# to the HTTP request.
|
115
|
+
#
|
116
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
117
|
+
#
|
118
|
+
def list_for_resource_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter:nil, custom_headers:nil)
|
119
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
120
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
121
|
+
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
|
122
|
+
fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
|
123
|
+
fail ArgumentError, 'resource_type is nil' if resource_type.nil?
|
124
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
125
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
126
|
+
|
127
|
+
|
128
|
+
request_headers = {}
|
129
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
130
|
+
|
131
|
+
# Set Headers
|
132
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
133
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
134
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/denyAssignments'
|
135
|
+
|
136
|
+
request_url = @base_url || @client.base_url
|
137
|
+
|
138
|
+
options = {
|
139
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
140
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name},
|
141
|
+
skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
|
142
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter},
|
143
|
+
headers: request_headers.merge(custom_headers || {}),
|
144
|
+
base_url: request_url
|
145
|
+
}
|
146
|
+
promise = @client.make_request_async(:get, path_template, options)
|
147
|
+
|
148
|
+
promise = promise.then do |result|
|
149
|
+
http_response = result.response
|
150
|
+
status_code = http_response.status
|
151
|
+
response_content = http_response.body
|
152
|
+
unless status_code == 200
|
153
|
+
error_model = JSON.load(response_content)
|
154
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
155
|
+
end
|
156
|
+
|
157
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
158
|
+
# Deserialize Response
|
159
|
+
if status_code == 200
|
160
|
+
begin
|
161
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
162
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignmentListResult.mapper()
|
163
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
164
|
+
rescue Exception => e
|
165
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
result
|
170
|
+
end
|
171
|
+
|
172
|
+
promise.execute
|
173
|
+
end
|
174
|
+
|
175
|
+
#
|
176
|
+
# Gets deny assignments for a resource group.
|
177
|
+
#
|
178
|
+
# @param resource_group_name [String] The name of the resource group.
|
179
|
+
# @param filter [String] The filter to apply on the operation. Use
|
180
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
181
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
182
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
183
|
+
# assignments at, above and below the scope for the specified principal. Use
|
184
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
185
|
+
# above and below the scope for the specified principal. This filter is
|
186
|
+
# different from the principalId filter as it returns not only those deny
|
187
|
+
# assignments that contain the specified principal is the Principals list but
|
188
|
+
# also those deny assignments that contain the specified principal is the
|
189
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
190
|
+
# used, only the deny assignment name and description properties are returned.
|
191
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
192
|
+
# will be added to the HTTP request.
|
193
|
+
#
|
194
|
+
# @return [Array<DenyAssignment>] operation results.
|
195
|
+
#
|
196
|
+
def list_for_resource_group(resource_group_name, filter:nil, custom_headers:nil)
|
197
|
+
first_page = list_for_resource_group_as_lazy(resource_group_name, filter:filter, custom_headers:custom_headers)
|
198
|
+
first_page.get_all_items
|
199
|
+
end
|
200
|
+
|
201
|
+
#
|
202
|
+
# Gets deny assignments for a resource group.
|
203
|
+
#
|
204
|
+
# @param resource_group_name [String] The name of the resource group.
|
205
|
+
# @param filter [String] The filter to apply on the operation. Use
|
206
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
207
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
208
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
209
|
+
# assignments at, above and below the scope for the specified principal. Use
|
210
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
211
|
+
# above and below the scope for the specified principal. This filter is
|
212
|
+
# different from the principalId filter as it returns not only those deny
|
213
|
+
# assignments that contain the specified principal is the Principals list but
|
214
|
+
# also those deny assignments that contain the specified principal is the
|
215
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
216
|
+
# used, only the deny assignment name and description properties are returned.
|
217
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
218
|
+
# will be added to the HTTP request.
|
219
|
+
#
|
220
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
221
|
+
#
|
222
|
+
def list_for_resource_group_with_http_info(resource_group_name, filter:nil, custom_headers:nil)
|
223
|
+
list_for_resource_group_async(resource_group_name, filter:filter, custom_headers:custom_headers).value!
|
224
|
+
end
|
225
|
+
|
226
|
+
#
|
227
|
+
# Gets deny assignments for a resource group.
|
228
|
+
#
|
229
|
+
# @param resource_group_name [String] The name of the resource group.
|
230
|
+
# @param filter [String] The filter to apply on the operation. Use
|
231
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
232
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
233
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
234
|
+
# assignments at, above and below the scope for the specified principal. Use
|
235
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
236
|
+
# above and below the scope for the specified principal. This filter is
|
237
|
+
# different from the principalId filter as it returns not only those deny
|
238
|
+
# assignments that contain the specified principal is the Principals list but
|
239
|
+
# also those deny assignments that contain the specified principal is the
|
240
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
241
|
+
# used, only the deny assignment name and description properties are returned.
|
242
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
243
|
+
# to the HTTP request.
|
244
|
+
#
|
245
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
246
|
+
#
|
247
|
+
def list_for_resource_group_async(resource_group_name, filter:nil, custom_headers:nil)
|
248
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
249
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
250
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
251
|
+
|
252
|
+
|
253
|
+
request_headers = {}
|
254
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
255
|
+
|
256
|
+
# Set Headers
|
257
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
258
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
259
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/denyAssignments'
|
260
|
+
|
261
|
+
request_url = @base_url || @client.base_url
|
262
|
+
|
263
|
+
options = {
|
264
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
265
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
|
266
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter},
|
267
|
+
headers: request_headers.merge(custom_headers || {}),
|
268
|
+
base_url: request_url
|
269
|
+
}
|
270
|
+
promise = @client.make_request_async(:get, path_template, options)
|
271
|
+
|
272
|
+
promise = promise.then do |result|
|
273
|
+
http_response = result.response
|
274
|
+
status_code = http_response.status
|
275
|
+
response_content = http_response.body
|
276
|
+
unless status_code == 200
|
277
|
+
error_model = JSON.load(response_content)
|
278
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
279
|
+
end
|
280
|
+
|
281
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
282
|
+
# Deserialize Response
|
283
|
+
if status_code == 200
|
284
|
+
begin
|
285
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
286
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignmentListResult.mapper()
|
287
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
288
|
+
rescue Exception => e
|
289
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
result
|
294
|
+
end
|
295
|
+
|
296
|
+
promise.execute
|
297
|
+
end
|
298
|
+
|
299
|
+
#
|
300
|
+
# Gets all deny assignments for the subscription.
|
301
|
+
#
|
302
|
+
# @param filter [String] The filter to apply on the operation. Use
|
303
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
304
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
305
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
306
|
+
# assignments at, above and below the scope for the specified principal. Use
|
307
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
308
|
+
# above and below the scope for the specified principal. This filter is
|
309
|
+
# different from the principalId filter as it returns not only those deny
|
310
|
+
# assignments that contain the specified principal is the Principals list but
|
311
|
+
# also those deny assignments that contain the specified principal is the
|
312
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
313
|
+
# used, only the deny assignment name and description properties are returned.
|
314
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
315
|
+
# will be added to the HTTP request.
|
316
|
+
#
|
317
|
+
# @return [Array<DenyAssignment>] operation results.
|
318
|
+
#
|
319
|
+
def list(filter:nil, custom_headers:nil)
|
320
|
+
first_page = list_as_lazy(filter:filter, custom_headers:custom_headers)
|
321
|
+
first_page.get_all_items
|
322
|
+
end
|
323
|
+
|
324
|
+
#
|
325
|
+
# Gets all deny assignments for the subscription.
|
326
|
+
#
|
327
|
+
# @param filter [String] The filter to apply on the operation. Use
|
328
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
329
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
330
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
331
|
+
# assignments at, above and below the scope for the specified principal. Use
|
332
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
333
|
+
# above and below the scope for the specified principal. This filter is
|
334
|
+
# different from the principalId filter as it returns not only those deny
|
335
|
+
# assignments that contain the specified principal is the Principals list but
|
336
|
+
# also those deny assignments that contain the specified principal is the
|
337
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
338
|
+
# used, only the deny assignment name and description properties are returned.
|
339
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
340
|
+
# will be added to the HTTP request.
|
341
|
+
#
|
342
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
343
|
+
#
|
344
|
+
def list_with_http_info(filter:nil, custom_headers:nil)
|
345
|
+
list_async(filter:filter, custom_headers:custom_headers).value!
|
346
|
+
end
|
347
|
+
|
348
|
+
#
|
349
|
+
# Gets all deny assignments for the subscription.
|
350
|
+
#
|
351
|
+
# @param filter [String] The filter to apply on the operation. Use
|
352
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
353
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
354
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
355
|
+
# assignments at, above and below the scope for the specified principal. Use
|
356
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
357
|
+
# above and below the scope for the specified principal. This filter is
|
358
|
+
# different from the principalId filter as it returns not only those deny
|
359
|
+
# assignments that contain the specified principal is the Principals list but
|
360
|
+
# also those deny assignments that contain the specified principal is the
|
361
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
362
|
+
# used, only the deny assignment name and description properties are returned.
|
363
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
364
|
+
# to the HTTP request.
|
365
|
+
#
|
366
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
367
|
+
#
|
368
|
+
def list_async(filter:nil, custom_headers:nil)
|
369
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
370
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
371
|
+
|
372
|
+
|
373
|
+
request_headers = {}
|
374
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
375
|
+
|
376
|
+
# Set Headers
|
377
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
378
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
379
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Authorization/denyAssignments'
|
380
|
+
|
381
|
+
request_url = @base_url || @client.base_url
|
382
|
+
|
383
|
+
options = {
|
384
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
385
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
386
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter},
|
387
|
+
headers: request_headers.merge(custom_headers || {}),
|
388
|
+
base_url: request_url
|
389
|
+
}
|
390
|
+
promise = @client.make_request_async(:get, path_template, options)
|
391
|
+
|
392
|
+
promise = promise.then do |result|
|
393
|
+
http_response = result.response
|
394
|
+
status_code = http_response.status
|
395
|
+
response_content = http_response.body
|
396
|
+
unless status_code == 200
|
397
|
+
error_model = JSON.load(response_content)
|
398
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
399
|
+
end
|
400
|
+
|
401
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
402
|
+
# Deserialize Response
|
403
|
+
if status_code == 200
|
404
|
+
begin
|
405
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
406
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignmentListResult.mapper()
|
407
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
408
|
+
rescue Exception => e
|
409
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
result
|
414
|
+
end
|
415
|
+
|
416
|
+
promise.execute
|
417
|
+
end
|
418
|
+
|
419
|
+
#
|
420
|
+
# Get the specified deny assignment.
|
421
|
+
#
|
422
|
+
# @param scope [String] The scope of the deny assignment.
|
423
|
+
# @param deny_assignment_id [String] The ID of the deny assignment to get.
|
424
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
425
|
+
# will be added to the HTTP request.
|
426
|
+
#
|
427
|
+
# @return [DenyAssignment] operation results.
|
428
|
+
#
|
429
|
+
def get(scope, deny_assignment_id, custom_headers:nil)
|
430
|
+
response = get_async(scope, deny_assignment_id, custom_headers:custom_headers).value!
|
431
|
+
response.body unless response.nil?
|
432
|
+
end
|
433
|
+
|
434
|
+
#
|
435
|
+
# Get the specified deny assignment.
|
436
|
+
#
|
437
|
+
# @param scope [String] The scope of the deny assignment.
|
438
|
+
# @param deny_assignment_id [String] The ID of the deny assignment to get.
|
439
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
440
|
+
# will be added to the HTTP request.
|
441
|
+
#
|
442
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
443
|
+
#
|
444
|
+
def get_with_http_info(scope, deny_assignment_id, custom_headers:nil)
|
445
|
+
get_async(scope, deny_assignment_id, custom_headers:custom_headers).value!
|
446
|
+
end
|
447
|
+
|
448
|
+
#
|
449
|
+
# Get the specified deny assignment.
|
450
|
+
#
|
451
|
+
# @param scope [String] The scope of the deny assignment.
|
452
|
+
# @param deny_assignment_id [String] The ID of the deny assignment to get.
|
453
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
454
|
+
# to the HTTP request.
|
455
|
+
#
|
456
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
457
|
+
#
|
458
|
+
def get_async(scope, deny_assignment_id, custom_headers:nil)
|
459
|
+
fail ArgumentError, 'scope is nil' if scope.nil?
|
460
|
+
fail ArgumentError, 'deny_assignment_id is nil' if deny_assignment_id.nil?
|
461
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
462
|
+
|
463
|
+
|
464
|
+
request_headers = {}
|
465
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
466
|
+
|
467
|
+
# Set Headers
|
468
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
469
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
470
|
+
path_template = '{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}'
|
471
|
+
|
472
|
+
request_url = @base_url || @client.base_url
|
473
|
+
|
474
|
+
options = {
|
475
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
476
|
+
path_params: {'denyAssignmentId' => deny_assignment_id},
|
477
|
+
skip_encoding_path_params: {'scope' => scope},
|
478
|
+
query_params: {'api-version' => @client.api_version},
|
479
|
+
headers: request_headers.merge(custom_headers || {}),
|
480
|
+
base_url: request_url
|
481
|
+
}
|
482
|
+
promise = @client.make_request_async(:get, path_template, options)
|
483
|
+
|
484
|
+
promise = promise.then do |result|
|
485
|
+
http_response = result.response
|
486
|
+
status_code = http_response.status
|
487
|
+
response_content = http_response.body
|
488
|
+
unless status_code == 200
|
489
|
+
error_model = JSON.load(response_content)
|
490
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
491
|
+
end
|
492
|
+
|
493
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
494
|
+
# Deserialize Response
|
495
|
+
if status_code == 200
|
496
|
+
begin
|
497
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
498
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignment.mapper()
|
499
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
500
|
+
rescue Exception => e
|
501
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
502
|
+
end
|
503
|
+
end
|
504
|
+
|
505
|
+
result
|
506
|
+
end
|
507
|
+
|
508
|
+
promise.execute
|
509
|
+
end
|
510
|
+
|
511
|
+
#
|
512
|
+
# Gets a deny assignment by ID.
|
513
|
+
#
|
514
|
+
# @param deny_assignment_id [String] The fully qualified deny assignment ID.
|
515
|
+
# For example, use the format,
|
516
|
+
# /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}
|
517
|
+
# for subscription level deny assignments, or
|
518
|
+
# /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for
|
519
|
+
# tenant level deny assignments.
|
520
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
521
|
+
# will be added to the HTTP request.
|
522
|
+
#
|
523
|
+
# @return [DenyAssignment] operation results.
|
524
|
+
#
|
525
|
+
def get_by_id(deny_assignment_id, custom_headers:nil)
|
526
|
+
response = get_by_id_async(deny_assignment_id, custom_headers:custom_headers).value!
|
527
|
+
response.body unless response.nil?
|
528
|
+
end
|
529
|
+
|
530
|
+
#
|
531
|
+
# Gets a deny assignment by ID.
|
532
|
+
#
|
533
|
+
# @param deny_assignment_id [String] The fully qualified deny assignment ID.
|
534
|
+
# For example, use the format,
|
535
|
+
# /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}
|
536
|
+
# for subscription level deny assignments, or
|
537
|
+
# /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for
|
538
|
+
# tenant level deny assignments.
|
539
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
540
|
+
# will be added to the HTTP request.
|
541
|
+
#
|
542
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
543
|
+
#
|
544
|
+
def get_by_id_with_http_info(deny_assignment_id, custom_headers:nil)
|
545
|
+
get_by_id_async(deny_assignment_id, custom_headers:custom_headers).value!
|
546
|
+
end
|
547
|
+
|
548
|
+
#
|
549
|
+
# Gets a deny assignment by ID.
|
550
|
+
#
|
551
|
+
# @param deny_assignment_id [String] The fully qualified deny assignment ID.
|
552
|
+
# For example, use the format,
|
553
|
+
# /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}
|
554
|
+
# for subscription level deny assignments, or
|
555
|
+
# /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for
|
556
|
+
# tenant level deny assignments.
|
557
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
558
|
+
# to the HTTP request.
|
559
|
+
#
|
560
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
561
|
+
#
|
562
|
+
def get_by_id_async(deny_assignment_id, custom_headers:nil)
|
563
|
+
fail ArgumentError, 'deny_assignment_id is nil' if deny_assignment_id.nil?
|
564
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
565
|
+
|
566
|
+
|
567
|
+
request_headers = {}
|
568
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
569
|
+
|
570
|
+
# Set Headers
|
571
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
572
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
573
|
+
path_template = '{denyAssignmentId}'
|
574
|
+
|
575
|
+
request_url = @base_url || @client.base_url
|
576
|
+
|
577
|
+
options = {
|
578
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
579
|
+
skip_encoding_path_params: {'denyAssignmentId' => deny_assignment_id},
|
580
|
+
query_params: {'api-version' => @client.api_version},
|
581
|
+
headers: request_headers.merge(custom_headers || {}),
|
582
|
+
base_url: request_url
|
583
|
+
}
|
584
|
+
promise = @client.make_request_async(:get, path_template, options)
|
585
|
+
|
586
|
+
promise = promise.then do |result|
|
587
|
+
http_response = result.response
|
588
|
+
status_code = http_response.status
|
589
|
+
response_content = http_response.body
|
590
|
+
unless status_code == 200
|
591
|
+
error_model = JSON.load(response_content)
|
592
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
593
|
+
end
|
594
|
+
|
595
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
596
|
+
# Deserialize Response
|
597
|
+
if status_code == 200
|
598
|
+
begin
|
599
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
600
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignment.mapper()
|
601
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
602
|
+
rescue Exception => e
|
603
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
604
|
+
end
|
605
|
+
end
|
606
|
+
|
607
|
+
result
|
608
|
+
end
|
609
|
+
|
610
|
+
promise.execute
|
611
|
+
end
|
612
|
+
|
613
|
+
#
|
614
|
+
# Gets deny assignments for a scope.
|
615
|
+
#
|
616
|
+
# @param scope [String] The scope of the deny assignments.
|
617
|
+
# @param filter [String] The filter to apply on the operation. Use
|
618
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
619
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
620
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
621
|
+
# assignments at, above and below the scope for the specified principal. Use
|
622
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
623
|
+
# above and below the scope for the specified principal. This filter is
|
624
|
+
# different from the principalId filter as it returns not only those deny
|
625
|
+
# assignments that contain the specified principal is the Principals list but
|
626
|
+
# also those deny assignments that contain the specified principal is the
|
627
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
628
|
+
# used, only the deny assignment name and description properties are returned.
|
629
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
630
|
+
# will be added to the HTTP request.
|
631
|
+
#
|
632
|
+
# @return [Array<DenyAssignment>] operation results.
|
633
|
+
#
|
634
|
+
def list_for_scope(scope, filter:nil, custom_headers:nil)
|
635
|
+
first_page = list_for_scope_as_lazy(scope, filter:filter, custom_headers:custom_headers)
|
636
|
+
first_page.get_all_items
|
637
|
+
end
|
638
|
+
|
639
|
+
#
|
640
|
+
# Gets deny assignments for a scope.
|
641
|
+
#
|
642
|
+
# @param scope [String] The scope of the deny assignments.
|
643
|
+
# @param filter [String] The filter to apply on the operation. Use
|
644
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
645
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
646
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
647
|
+
# assignments at, above and below the scope for the specified principal. Use
|
648
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
649
|
+
# above and below the scope for the specified principal. This filter is
|
650
|
+
# different from the principalId filter as it returns not only those deny
|
651
|
+
# assignments that contain the specified principal is the Principals list but
|
652
|
+
# also those deny assignments that contain the specified principal is the
|
653
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
654
|
+
# used, only the deny assignment name and description properties are returned.
|
655
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
656
|
+
# will be added to the HTTP request.
|
657
|
+
#
|
658
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
659
|
+
#
|
660
|
+
def list_for_scope_with_http_info(scope, filter:nil, custom_headers:nil)
|
661
|
+
list_for_scope_async(scope, filter:filter, custom_headers:custom_headers).value!
|
662
|
+
end
|
663
|
+
|
664
|
+
#
|
665
|
+
# Gets deny assignments for a scope.
|
666
|
+
#
|
667
|
+
# @param scope [String] The scope of the deny assignments.
|
668
|
+
# @param filter [String] The filter to apply on the operation. Use
|
669
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
670
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
671
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
672
|
+
# assignments at, above and below the scope for the specified principal. Use
|
673
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
674
|
+
# above and below the scope for the specified principal. This filter is
|
675
|
+
# different from the principalId filter as it returns not only those deny
|
676
|
+
# assignments that contain the specified principal is the Principals list but
|
677
|
+
# also those deny assignments that contain the specified principal is the
|
678
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
679
|
+
# used, only the deny assignment name and description properties are returned.
|
680
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
681
|
+
# to the HTTP request.
|
682
|
+
#
|
683
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
684
|
+
#
|
685
|
+
def list_for_scope_async(scope, filter:nil, custom_headers:nil)
|
686
|
+
fail ArgumentError, 'scope is nil' if scope.nil?
|
687
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
688
|
+
|
689
|
+
|
690
|
+
request_headers = {}
|
691
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
692
|
+
|
693
|
+
# Set Headers
|
694
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
695
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
696
|
+
path_template = '{scope}/providers/Microsoft.Authorization/denyAssignments'
|
697
|
+
|
698
|
+
request_url = @base_url || @client.base_url
|
699
|
+
|
700
|
+
options = {
|
701
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
702
|
+
skip_encoding_path_params: {'scope' => scope},
|
703
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter},
|
704
|
+
headers: request_headers.merge(custom_headers || {}),
|
705
|
+
base_url: request_url
|
706
|
+
}
|
707
|
+
promise = @client.make_request_async(:get, path_template, options)
|
708
|
+
|
709
|
+
promise = promise.then do |result|
|
710
|
+
http_response = result.response
|
711
|
+
status_code = http_response.status
|
712
|
+
response_content = http_response.body
|
713
|
+
unless status_code == 200
|
714
|
+
error_model = JSON.load(response_content)
|
715
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
716
|
+
end
|
717
|
+
|
718
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
719
|
+
# Deserialize Response
|
720
|
+
if status_code == 200
|
721
|
+
begin
|
722
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
723
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignmentListResult.mapper()
|
724
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
725
|
+
rescue Exception => e
|
726
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
727
|
+
end
|
728
|
+
end
|
729
|
+
|
730
|
+
result
|
731
|
+
end
|
732
|
+
|
733
|
+
promise.execute
|
734
|
+
end
|
735
|
+
|
736
|
+
#
|
737
|
+
# Gets deny assignments for a resource.
|
738
|
+
#
|
739
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
740
|
+
# to List operation.
|
741
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
742
|
+
# will be added to the HTTP request.
|
743
|
+
#
|
744
|
+
# @return [DenyAssignmentListResult] operation results.
|
745
|
+
#
|
746
|
+
def list_for_resource_next(next_page_link, custom_headers:nil)
|
747
|
+
response = list_for_resource_next_async(next_page_link, custom_headers:custom_headers).value!
|
748
|
+
response.body unless response.nil?
|
749
|
+
end
|
750
|
+
|
751
|
+
#
|
752
|
+
# Gets deny assignments for a resource.
|
753
|
+
#
|
754
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
755
|
+
# to List operation.
|
756
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
757
|
+
# will be added to the HTTP request.
|
758
|
+
#
|
759
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
760
|
+
#
|
761
|
+
def list_for_resource_next_with_http_info(next_page_link, custom_headers:nil)
|
762
|
+
list_for_resource_next_async(next_page_link, custom_headers:custom_headers).value!
|
763
|
+
end
|
764
|
+
|
765
|
+
#
|
766
|
+
# Gets deny assignments for a resource.
|
767
|
+
#
|
768
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
769
|
+
# to List operation.
|
770
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
771
|
+
# to the HTTP request.
|
772
|
+
#
|
773
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
774
|
+
#
|
775
|
+
def list_for_resource_next_async(next_page_link, custom_headers:nil)
|
776
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
777
|
+
|
778
|
+
|
779
|
+
request_headers = {}
|
780
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
781
|
+
|
782
|
+
# Set Headers
|
783
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
784
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
785
|
+
path_template = '{nextLink}'
|
786
|
+
|
787
|
+
request_url = @base_url || @client.base_url
|
788
|
+
|
789
|
+
options = {
|
790
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
791
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
792
|
+
headers: request_headers.merge(custom_headers || {}),
|
793
|
+
base_url: request_url
|
794
|
+
}
|
795
|
+
promise = @client.make_request_async(:get, path_template, options)
|
796
|
+
|
797
|
+
promise = promise.then do |result|
|
798
|
+
http_response = result.response
|
799
|
+
status_code = http_response.status
|
800
|
+
response_content = http_response.body
|
801
|
+
unless status_code == 200
|
802
|
+
error_model = JSON.load(response_content)
|
803
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
804
|
+
end
|
805
|
+
|
806
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
807
|
+
# Deserialize Response
|
808
|
+
if status_code == 200
|
809
|
+
begin
|
810
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
811
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignmentListResult.mapper()
|
812
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
813
|
+
rescue Exception => e
|
814
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
815
|
+
end
|
816
|
+
end
|
817
|
+
|
818
|
+
result
|
819
|
+
end
|
820
|
+
|
821
|
+
promise.execute
|
822
|
+
end
|
823
|
+
|
824
|
+
#
|
825
|
+
# Gets deny assignments for a resource group.
|
826
|
+
#
|
827
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
828
|
+
# to List operation.
|
829
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
830
|
+
# will be added to the HTTP request.
|
831
|
+
#
|
832
|
+
# @return [DenyAssignmentListResult] operation results.
|
833
|
+
#
|
834
|
+
def list_for_resource_group_next(next_page_link, custom_headers:nil)
|
835
|
+
response = list_for_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
|
836
|
+
response.body unless response.nil?
|
837
|
+
end
|
838
|
+
|
839
|
+
#
|
840
|
+
# Gets deny assignments for a resource group.
|
841
|
+
#
|
842
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
843
|
+
# to List operation.
|
844
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
845
|
+
# will be added to the HTTP request.
|
846
|
+
#
|
847
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
848
|
+
#
|
849
|
+
def list_for_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
|
850
|
+
list_for_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
|
851
|
+
end
|
852
|
+
|
853
|
+
#
|
854
|
+
# Gets deny assignments for a resource group.
|
855
|
+
#
|
856
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
857
|
+
# to List operation.
|
858
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
859
|
+
# to the HTTP request.
|
860
|
+
#
|
861
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
862
|
+
#
|
863
|
+
def list_for_resource_group_next_async(next_page_link, custom_headers:nil)
|
864
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
865
|
+
|
866
|
+
|
867
|
+
request_headers = {}
|
868
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
869
|
+
|
870
|
+
# Set Headers
|
871
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
872
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
873
|
+
path_template = '{nextLink}'
|
874
|
+
|
875
|
+
request_url = @base_url || @client.base_url
|
876
|
+
|
877
|
+
options = {
|
878
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
879
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
880
|
+
headers: request_headers.merge(custom_headers || {}),
|
881
|
+
base_url: request_url
|
882
|
+
}
|
883
|
+
promise = @client.make_request_async(:get, path_template, options)
|
884
|
+
|
885
|
+
promise = promise.then do |result|
|
886
|
+
http_response = result.response
|
887
|
+
status_code = http_response.status
|
888
|
+
response_content = http_response.body
|
889
|
+
unless status_code == 200
|
890
|
+
error_model = JSON.load(response_content)
|
891
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
892
|
+
end
|
893
|
+
|
894
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
895
|
+
# Deserialize Response
|
896
|
+
if status_code == 200
|
897
|
+
begin
|
898
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
899
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignmentListResult.mapper()
|
900
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
901
|
+
rescue Exception => e
|
902
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
903
|
+
end
|
904
|
+
end
|
905
|
+
|
906
|
+
result
|
907
|
+
end
|
908
|
+
|
909
|
+
promise.execute
|
910
|
+
end
|
911
|
+
|
912
|
+
#
|
913
|
+
# Gets all deny assignments for the subscription.
|
914
|
+
#
|
915
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
916
|
+
# to List operation.
|
917
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
918
|
+
# will be added to the HTTP request.
|
919
|
+
#
|
920
|
+
# @return [DenyAssignmentListResult] operation results.
|
921
|
+
#
|
922
|
+
def list_next(next_page_link, custom_headers:nil)
|
923
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
924
|
+
response.body unless response.nil?
|
925
|
+
end
|
926
|
+
|
927
|
+
#
|
928
|
+
# Gets all deny assignments for the subscription.
|
929
|
+
#
|
930
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
931
|
+
# to List operation.
|
932
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
933
|
+
# will be added to the HTTP request.
|
934
|
+
#
|
935
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
936
|
+
#
|
937
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
938
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
939
|
+
end
|
940
|
+
|
941
|
+
#
|
942
|
+
# Gets all deny assignments for the subscription.
|
943
|
+
#
|
944
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
945
|
+
# to List operation.
|
946
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
947
|
+
# to the HTTP request.
|
948
|
+
#
|
949
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
950
|
+
#
|
951
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
952
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
953
|
+
|
954
|
+
|
955
|
+
request_headers = {}
|
956
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
957
|
+
|
958
|
+
# Set Headers
|
959
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
960
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
961
|
+
path_template = '{nextLink}'
|
962
|
+
|
963
|
+
request_url = @base_url || @client.base_url
|
964
|
+
|
965
|
+
options = {
|
966
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
967
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
968
|
+
headers: request_headers.merge(custom_headers || {}),
|
969
|
+
base_url: request_url
|
970
|
+
}
|
971
|
+
promise = @client.make_request_async(:get, path_template, options)
|
972
|
+
|
973
|
+
promise = promise.then do |result|
|
974
|
+
http_response = result.response
|
975
|
+
status_code = http_response.status
|
976
|
+
response_content = http_response.body
|
977
|
+
unless status_code == 200
|
978
|
+
error_model = JSON.load(response_content)
|
979
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
980
|
+
end
|
981
|
+
|
982
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
983
|
+
# Deserialize Response
|
984
|
+
if status_code == 200
|
985
|
+
begin
|
986
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
987
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignmentListResult.mapper()
|
988
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
989
|
+
rescue Exception => e
|
990
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
991
|
+
end
|
992
|
+
end
|
993
|
+
|
994
|
+
result
|
995
|
+
end
|
996
|
+
|
997
|
+
promise.execute
|
998
|
+
end
|
999
|
+
|
1000
|
+
#
|
1001
|
+
# Gets deny assignments for a scope.
|
1002
|
+
#
|
1003
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1004
|
+
# to List operation.
|
1005
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1006
|
+
# will be added to the HTTP request.
|
1007
|
+
#
|
1008
|
+
# @return [DenyAssignmentListResult] operation results.
|
1009
|
+
#
|
1010
|
+
def list_for_scope_next(next_page_link, custom_headers:nil)
|
1011
|
+
response = list_for_scope_next_async(next_page_link, custom_headers:custom_headers).value!
|
1012
|
+
response.body unless response.nil?
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
#
|
1016
|
+
# Gets deny assignments for a scope.
|
1017
|
+
#
|
1018
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1019
|
+
# to List operation.
|
1020
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1021
|
+
# will be added to the HTTP request.
|
1022
|
+
#
|
1023
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1024
|
+
#
|
1025
|
+
def list_for_scope_next_with_http_info(next_page_link, custom_headers:nil)
|
1026
|
+
list_for_scope_next_async(next_page_link, custom_headers:custom_headers).value!
|
1027
|
+
end
|
1028
|
+
|
1029
|
+
#
|
1030
|
+
# Gets deny assignments for a scope.
|
1031
|
+
#
|
1032
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1033
|
+
# to List operation.
|
1034
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1035
|
+
# to the HTTP request.
|
1036
|
+
#
|
1037
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1038
|
+
#
|
1039
|
+
def list_for_scope_next_async(next_page_link, custom_headers:nil)
|
1040
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1041
|
+
|
1042
|
+
|
1043
|
+
request_headers = {}
|
1044
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1045
|
+
|
1046
|
+
# Set Headers
|
1047
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1048
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1049
|
+
path_template = '{nextLink}'
|
1050
|
+
|
1051
|
+
request_url = @base_url || @client.base_url
|
1052
|
+
|
1053
|
+
options = {
|
1054
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1055
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
1056
|
+
headers: request_headers.merge(custom_headers || {}),
|
1057
|
+
base_url: request_url
|
1058
|
+
}
|
1059
|
+
promise = @client.make_request_async(:get, path_template, options)
|
1060
|
+
|
1061
|
+
promise = promise.then do |result|
|
1062
|
+
http_response = result.response
|
1063
|
+
status_code = http_response.status
|
1064
|
+
response_content = http_response.body
|
1065
|
+
unless status_code == 200
|
1066
|
+
error_model = JSON.load(response_content)
|
1067
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1068
|
+
end
|
1069
|
+
|
1070
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1071
|
+
# Deserialize Response
|
1072
|
+
if status_code == 200
|
1073
|
+
begin
|
1074
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1075
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_07_01_preview::Models::DenyAssignmentListResult.mapper()
|
1076
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1077
|
+
rescue Exception => e
|
1078
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1079
|
+
end
|
1080
|
+
end
|
1081
|
+
|
1082
|
+
result
|
1083
|
+
end
|
1084
|
+
|
1085
|
+
promise.execute
|
1086
|
+
end
|
1087
|
+
|
1088
|
+
#
|
1089
|
+
# Gets deny assignments for a resource.
|
1090
|
+
#
|
1091
|
+
# @param resource_group_name [String] The name of the resource group.
|
1092
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
1093
|
+
# provider.
|
1094
|
+
# @param parent_resource_path [String] The parent resource identity.
|
1095
|
+
# @param resource_type [String] The resource type of the resource.
|
1096
|
+
# @param resource_name [String] The name of the resource to get deny
|
1097
|
+
# assignments for.
|
1098
|
+
# @param filter [String] The filter to apply on the operation. Use
|
1099
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
1100
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
1101
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
1102
|
+
# assignments at, above and below the scope for the specified principal. Use
|
1103
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
1104
|
+
# above and below the scope for the specified principal. This filter is
|
1105
|
+
# different from the principalId filter as it returns not only those deny
|
1106
|
+
# assignments that contain the specified principal is the Principals list but
|
1107
|
+
# also those deny assignments that contain the specified principal is the
|
1108
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
1109
|
+
# used, only the deny assignment name and description properties are returned.
|
1110
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1111
|
+
# will be added to the HTTP request.
|
1112
|
+
#
|
1113
|
+
# @return [DenyAssignmentListResult] which provide lazy access to pages of the
|
1114
|
+
# response.
|
1115
|
+
#
|
1116
|
+
def list_for_resource_as_lazy(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter:nil, custom_headers:nil)
|
1117
|
+
response = list_for_resource_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter:filter, custom_headers:custom_headers).value!
|
1118
|
+
unless response.nil?
|
1119
|
+
page = response.body
|
1120
|
+
page.next_method = Proc.new do |next_page_link|
|
1121
|
+
list_for_resource_next_async(next_page_link, custom_headers:custom_headers)
|
1122
|
+
end
|
1123
|
+
page
|
1124
|
+
end
|
1125
|
+
end
|
1126
|
+
|
1127
|
+
#
|
1128
|
+
# Gets deny assignments for a resource group.
|
1129
|
+
#
|
1130
|
+
# @param resource_group_name [String] The name of the resource group.
|
1131
|
+
# @param filter [String] The filter to apply on the operation. Use
|
1132
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
1133
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
1134
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
1135
|
+
# assignments at, above and below the scope for the specified principal. Use
|
1136
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
1137
|
+
# above and below the scope for the specified principal. This filter is
|
1138
|
+
# different from the principalId filter as it returns not only those deny
|
1139
|
+
# assignments that contain the specified principal is the Principals list but
|
1140
|
+
# also those deny assignments that contain the specified principal is the
|
1141
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
1142
|
+
# used, only the deny assignment name and description properties are returned.
|
1143
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1144
|
+
# will be added to the HTTP request.
|
1145
|
+
#
|
1146
|
+
# @return [DenyAssignmentListResult] which provide lazy access to pages of the
|
1147
|
+
# response.
|
1148
|
+
#
|
1149
|
+
def list_for_resource_group_as_lazy(resource_group_name, filter:nil, custom_headers:nil)
|
1150
|
+
response = list_for_resource_group_async(resource_group_name, filter:filter, custom_headers:custom_headers).value!
|
1151
|
+
unless response.nil?
|
1152
|
+
page = response.body
|
1153
|
+
page.next_method = Proc.new do |next_page_link|
|
1154
|
+
list_for_resource_group_next_async(next_page_link, custom_headers:custom_headers)
|
1155
|
+
end
|
1156
|
+
page
|
1157
|
+
end
|
1158
|
+
end
|
1159
|
+
|
1160
|
+
#
|
1161
|
+
# Gets all deny assignments for the subscription.
|
1162
|
+
#
|
1163
|
+
# @param filter [String] The filter to apply on the operation. Use
|
1164
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
1165
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
1166
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
1167
|
+
# assignments at, above and below the scope for the specified principal. Use
|
1168
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
1169
|
+
# above and below the scope for the specified principal. This filter is
|
1170
|
+
# different from the principalId filter as it returns not only those deny
|
1171
|
+
# assignments that contain the specified principal is the Principals list but
|
1172
|
+
# also those deny assignments that contain the specified principal is the
|
1173
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
1174
|
+
# used, only the deny assignment name and description properties are returned.
|
1175
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1176
|
+
# will be added to the HTTP request.
|
1177
|
+
#
|
1178
|
+
# @return [DenyAssignmentListResult] which provide lazy access to pages of the
|
1179
|
+
# response.
|
1180
|
+
#
|
1181
|
+
def list_as_lazy(filter:nil, custom_headers:nil)
|
1182
|
+
response = list_async(filter:filter, custom_headers:custom_headers).value!
|
1183
|
+
unless response.nil?
|
1184
|
+
page = response.body
|
1185
|
+
page.next_method = Proc.new do |next_page_link|
|
1186
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
1187
|
+
end
|
1188
|
+
page
|
1189
|
+
end
|
1190
|
+
end
|
1191
|
+
|
1192
|
+
#
|
1193
|
+
# Gets deny assignments for a scope.
|
1194
|
+
#
|
1195
|
+
# @param scope [String] The scope of the deny assignments.
|
1196
|
+
# @param filter [String] The filter to apply on the operation. Use
|
1197
|
+
# $filter=atScope() to return all deny assignments at or above the scope. Use
|
1198
|
+
# $filter=denyAssignmentName eq '{name}' to search deny assignments by name at
|
1199
|
+
# specified scope. Use $filter=principalId eq '{id}' to return all deny
|
1200
|
+
# assignments at, above and below the scope for the specified principal. Use
|
1201
|
+
# $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at,
|
1202
|
+
# above and below the scope for the specified principal. This filter is
|
1203
|
+
# different from the principalId filter as it returns not only those deny
|
1204
|
+
# assignments that contain the specified principal is the Principals list but
|
1205
|
+
# also those deny assignments that contain the specified principal is the
|
1206
|
+
# ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is
|
1207
|
+
# used, only the deny assignment name and description properties are returned.
|
1208
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1209
|
+
# will be added to the HTTP request.
|
1210
|
+
#
|
1211
|
+
# @return [DenyAssignmentListResult] which provide lazy access to pages of the
|
1212
|
+
# response.
|
1213
|
+
#
|
1214
|
+
def list_for_scope_as_lazy(scope, filter:nil, custom_headers:nil)
|
1215
|
+
response = list_for_scope_async(scope, filter:filter, custom_headers:custom_headers).value!
|
1216
|
+
unless response.nil?
|
1217
|
+
page = response.body
|
1218
|
+
page.next_method = Proc.new do |next_page_link|
|
1219
|
+
list_for_scope_next_async(next_page_link, custom_headers:custom_headers)
|
1220
|
+
end
|
1221
|
+
page
|
1222
|
+
end
|
1223
|
+
end
|
1224
|
+
|
1225
|
+
end
|
1226
|
+
end
|