Class: Azure::ARM::Network::ExpressRouteCircuitAuthorizations
- Inherits:
-
Object
- Object
- Azure::ARM::Network::ExpressRouteCircuitAuthorizations
- Includes:
- Models, MsRestAzure
- Defined in:
- lib/azure_mgmt_network/express_route_circuit_authorizations.rb
Overview
The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resrources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Reference to the NetworkManagementClient.
Instance Method Summary collapse
-
#begin_create_or_update(resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put Authorization operation creates/updates an authorization in thespecified ExpressRouteCircuits.
-
#begin_delete(resource_group_name, circuit_name, authorization_name, custom_headers = nil) ⇒ Concurrent::Promise
The delete authorization operation deletes the specified authorization from the specified ExpressRouteCircuit.
-
#create_or_update(resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put Authorization operation creates/updates an authorization in thespecified ExpressRouteCircuits.
-
#delete(resource_group_name, circuit_name, authorization_name, custom_headers = nil) ⇒ Concurrent::Promise
The delete authorization operation deletes the specified authorization from the specified ExpressRouteCircuit.
-
#get(resource_group_name, circuit_name, authorization_name, custom_headers = nil) ⇒ Concurrent::Promise
The GET authorization operation retrieves the specified authorization from the specified ExpressRouteCircuit.
-
#initialize(client) ⇒ ExpressRouteCircuitAuthorizations
constructor
Creates and initializes a new instance of the ExpressRouteCircuitAuthorizations class.
-
#list(resource_group_name, circuit_name, custom_headers = nil) ⇒ Concurrent::Promise
The List authorization operation retrieves all the authorizations in an ExpressRouteCircuit.
-
#list_next(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise
The List authorization operation retrieves all the authorizations in an ExpressRouteCircuit.
Constructor Details
#initialize(client) ⇒ ExpressRouteCircuitAuthorizations
Creates and initializes a new instance of the ExpressRouteCircuitAuthorizations class.
21 22 23 |
# File 'lib/azure_mgmt_network/express_route_circuit_authorizations.rb', line 21 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns reference to the NetworkManagementClient.
26 27 28 |
# File 'lib/azure_mgmt_network/express_route_circuit_authorizations.rb', line 26 def client @client end |
Instance Method Details
#begin_create_or_update(resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put Authorization operation creates/updates an authorization in thespecified ExpressRouteCircuits
Parameters supplied to the create/update ExpressRouteCircuitAuthorization operation applied to HTTP request.
response.
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/azure_mgmt_network/express_route_circuit_authorizations.rb', line 229 def begin_create_or_update(resource_group_name, circuit_name, , , custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'circuit_name is nil' if circuit_name.nil? fail ArgumentError, 'authorization_name is nil' if .nil? fail ArgumentError, 'authorization_parameters is nil' if .nil? .validate unless .nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_headers['Content-Type'] = 'application/json; charset=utf-8' unless .nil? = ExpressRouteCircuitAuthorization.serialize_object() end request_content = JSON.generate(, quirks_mode: true) path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'authorizationName' => ,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}) } request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 201 || status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = ExpressRouteCircuitAuthorization.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = ExpressRouteCircuitAuthorization.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#begin_delete(resource_group_name, circuit_name, authorization_name, custom_headers = nil) ⇒ Concurrent::Promise
The delete authorization operation deletes the specified authorization from the specified ExpressRouteCircuit.
applied to HTTP request.
response.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/azure_mgmt_network/express_route_circuit_authorizations.rb', line 67 def begin_delete(resource_group_name, circuit_name, , custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'circuit_name is nil' if circuit_name.nil? fail ArgumentError, 'authorization_name is nil' if .nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'authorizationName' => ,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 202 || status_code == 200 || status_code == 204 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result end promise.execute end |
#create_or_update(resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put Authorization operation creates/updates an authorization in thespecified ExpressRouteCircuits
Parameters supplied to the create/update ExpressRouteCircuitAuthorization operation uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. for the response.
response.
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/azure_mgmt_network/express_route_circuit_authorizations.rb', line 194 def create_or_update(resource_group_name, circuit_name, , , custom_headers = nil) # Send request promise = begin_create_or_update(resource_group_name, circuit_name, , , custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| unless parsed_response.nil? parsed_response = ExpressRouteCircuitAuthorization.deserialize_object(parsed_response) end end # Waiting for response. @client.get_put_operation_result(response, deserialize_method) end promise end |
#delete(resource_group_name, circuit_name, authorization_name, custom_headers = nil) ⇒ Concurrent::Promise
The delete authorization operation deletes the specified authorization from the specified ExpressRouteCircuit.
response.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/azure_mgmt_network/express_route_circuit_authorizations.rb', line 38 def delete(resource_group_name, circuit_name, , custom_headers = nil) # Send request promise = begin_delete(resource_group_name, circuit_name, , custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_post_or_delete_operation_result(response, deserialize_method) end promise end |
#get(resource_group_name, circuit_name, authorization_name, custom_headers = nil) ⇒ Concurrent::Promise
The GET authorization operation retrieves the specified authorization from the specified ExpressRouteCircuit.
applied to HTTP request.
response.
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/azure_mgmt_network/express_route_circuit_authorizations.rb', line 121 def get(resource_group_name, circuit_name, , custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'circuit_name is nil' if circuit_name.nil? fail ArgumentError, 'authorization_name is nil' if .nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'authorizationName' => ,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = ExpressRouteCircuitAuthorization.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list(resource_group_name, circuit_name, custom_headers = nil) ⇒ Concurrent::Promise
The List authorization operation retrieves all the authorizations in an ExpressRouteCircuit.
applied to HTTP request.
response.
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/azure_mgmt_network/express_route_circuit_authorizations.rb', line 316 def list(resource_group_name, circuit_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'circuit_name is nil' if circuit_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = AuthorizationListResult.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_next(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise
The List authorization operation retrieves all the authorizations in an ExpressRouteCircuit.
call to List operation. applied to HTTP request.
response.
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 |
# File 'lib/azure_mgmt_network/express_route_circuit_authorizations.rb', line 380 def list_next(next_page_link, custom_headers = nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}) } request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = AuthorizationListResult.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |