Class: Azure::ARM::Network::VirtualNetworkGatewayConnections
- Inherits:
-
Object
- Object
- Azure::ARM::Network::VirtualNetworkGatewayConnections
- Includes:
- Models, MsRestAzure
- Defined in:
- lib/azure_mgmt_network/virtual_network_gateway_connections.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, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put VirtualNetworkGatewayConnection operation creates/updates a virtual network gateway connection in the specified resource group through Network resource provider.
-
#begin_delete(resource_group_name, virtual_network_gateway_connection_name, custom_headers = nil) ⇒ Concurrent::Promise
The Delete VirtualNetworkGatewayConnection operation deletes the specifed virtual network Gateway connection through Network resource provider.
-
#begin_reset_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
-
#begin_set_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
-
#create_or_update(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put VirtualNetworkGatewayConnection operation creates/updates a virtual network gateway connection in the specified resource group through Network resource provider.
-
#delete(resource_group_name, virtual_network_gateway_connection_name, custom_headers = nil) ⇒ Concurrent::Promise
The Delete VirtualNetworkGatewayConnection operation deletes the specifed virtual network Gateway connection through Network resource provider.
-
#get(resource_group_name, virtual_network_gateway_connection_name, custom_headers = nil) ⇒ Concurrent::Promise
The Get VirtualNetworkGatewayConnection operation retrieves information about the specified virtual network gateway connection through Network resource provider.
-
#get_shared_key(resource_group_name, connection_shared_key_name, custom_headers = nil) ⇒ Concurrent::Promise
The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider.
-
#initialize(client) ⇒ VirtualNetworkGatewayConnections
constructor
Creates and initializes a new instance of the VirtualNetworkGatewayConnections class.
-
#list(resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise
The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created.
-
#list_next(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise
The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created.
-
#reset_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
-
#set_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
Constructor Details
#initialize(client) ⇒ VirtualNetworkGatewayConnections
Creates and initializes a new instance of the VirtualNetworkGatewayConnections class.
21 22 23 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.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/virtual_network_gateway_connections.rb', line 26 def client @client end |
Instance Method Details
#begin_create_or_update(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put VirtualNetworkGatewayConnection operation creates/updates a virtual network gateway connection in the specified resource group through Network resource provider.
virtual network gateway conenction. the Begin Create or update Virtual Network Gateway connection operation through Network resource provider. applied to HTTP request.
response.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 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 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 85 def begin_create_or_update(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'virtual_network_gateway_connection_name is nil' if virtual_network_gateway_connection_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? parameters.validate unless parameters.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 parameters.nil? parameters = VirtualNetworkGatewayConnection.serialize_object(parameters) end request_content = JSON.generate(parameters, quirks_mode: true) path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayConnectionName' => virtual_network_gateway_connection_name,'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 == 200 || status_code == 201 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 = VirtualNetworkGatewayConnection.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 == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = VirtualNetworkGatewayConnection.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, virtual_network_gateway_connection_name, custom_headers = nil) ⇒ Concurrent::Promise
The Delete VirtualNetworkGatewayConnection operation deletes the specifed virtual network Gateway connection through Network resource provider.
virtual network gateway connection. applied to HTTP request.
response.
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/virtual_network_gateway_connections.rb', line 264 def begin_delete(resource_group_name, virtual_network_gateway_connection_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'virtual_network_gateway_connection_name is nil' if virtual_network_gateway_connection_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/connections/{virtualNetworkGatewayConnectionName}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayConnectionName' => virtual_network_gateway_connection_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, :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 == 200 || status_code == 202 || 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 |
#begin_reset_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
gateway connection reset shared key Name. Begin Reset Virtual Network Gateway connection shared key operation through Network resource provider. applied to HTTP request.
response.
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 484 def begin_reset_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'virtual_network_gateway_connection_name is nil' if virtual_network_gateway_connection_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? parameters.validate unless parameters.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 parameters.nil? parameters = ConnectionResetSharedKey.serialize_object(parameters) end request_content = JSON.generate(parameters, quirks_mode: true) path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayConnectionName' => virtual_network_gateway_connection_name,'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, :post, ) 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 || status_code == 202 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 = ConnectionResetSharedKey.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_set_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
gateway connection name. Virtual Network Gateway conection Shared key operation throughNetwork resource provider. applied to HTTP request.
response.
605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 605 def begin_set_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'virtual_network_gateway_connection_name is nil' if virtual_network_gateway_connection_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? parameters.validate unless parameters.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 parameters.nil? parameters = ConnectionSharedKey.serialize_object(parameters) end request_content = JSON.generate(parameters, quirks_mode: true) path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayConnectionName' => virtual_network_gateway_connection_name,'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 = ConnectionSharedKey.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 = ConnectionSharedKey.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 |
#create_or_update(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put VirtualNetworkGatewayConnection operation creates/updates a virtual network gateway connection in the specified resource group through Network resource provider.
virtual network gateway conenction. the Begin Create or update Virtual Network Gateway connection operation through Network resource provider. uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. for the response.
response.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 49 def create_or_update(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) # Send request promise = begin_create_or_update(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| unless parsed_response.nil? parsed_response = VirtualNetworkGatewayConnection.deserialize_object(parsed_response) end end # Waiting for response. @client.get_put_operation_result(response, deserialize_method) end promise end |
#delete(resource_group_name, virtual_network_gateway_connection_name, custom_headers = nil) ⇒ Concurrent::Promise
The Delete VirtualNetworkGatewayConnection operation deletes the specifed virtual network Gateway connection through Network resource provider.
virtual network gateway connection. response.
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 235 def delete(resource_group_name, virtual_network_gateway_connection_name, custom_headers = nil) # Send request promise = begin_delete(resource_group_name, virtual_network_gateway_connection_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, virtual_network_gateway_connection_name, custom_headers = nil) ⇒ Concurrent::Promise
The Get VirtualNetworkGatewayConnection operation retrieves information about the specified virtual network gateway connection through Network resource provider.
virtual network gateway connection. applied to HTTP request.
response.
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 173 def get(resource_group_name, virtual_network_gateway_connection_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'virtual_network_gateway_connection_name is nil' if virtual_network_gateway_connection_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/connections/{virtualNetworkGatewayConnectionName}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayConnectionName' => virtual_network_gateway_connection_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 = VirtualNetworkGatewayConnection.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 |
#get_shared_key(resource_group_name, connection_shared_key_name, custom_headers = nil) ⇒ Concurrent::Promise
The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider.
connection shared key name. applied to HTTP request.
response.
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 367 368 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 318 def get_shared_key(resource_group_name, connection_shared_key_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'connection_shared_key_name is nil' if connection_shared_key_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/connections/{connectionSharedKeyName}/sharedkey' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'connectionSharedKeyName' => connection_shared_key_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 = ConnectionSharedKeyResult.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, custom_headers = nil) ⇒ Concurrent::Promise
The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created.
applied to HTTP request.
response.
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 427 428 429 430 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 381 def list(resource_group_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_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/connections' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_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 = VirtualNetworkGatewayConnectionListResult.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 VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created.
call to List operation. applied to HTTP request.
response.
691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 691 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 = VirtualNetworkGatewayConnectionListResult.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 |
#reset_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
gateway connection reset shared key Name. Begin Reset Virtual Network Gateway connection shared key operation through Network resource provider. response.
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 447 def reset_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) # Send request promise = begin_reset_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| unless parsed_response.nil? parsed_response = ConnectionResetSharedKey.deserialize_object(parsed_response) end end # Waiting for response. @client.get_post_or_delete_operation_result(response, deserialize_method) end promise end |
#set_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
gateway connection name. Virtual Network Gateway conection Shared key operation throughNetwork resource provider. uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. for the response.
response.
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 |
# File 'lib/azure_mgmt_network/virtual_network_gateway_connections.rb', line 568 def set_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) # Send request promise = begin_set_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| unless parsed_response.nil? parsed_response = ConnectionSharedKey.deserialize_object(parsed_response) end end # Waiting for response. @client.get_put_operation_result(response, deserialize_method) end promise end |