Class: Google::Cloud::Compute::V1::Projects::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Compute::V1::Projects::Rest::Client
- Defined in:
- lib/google/cloud/compute/v1/projects/rest/client.rb
Overview
REST client for the Projects service.
The Projects API.
Defined Under Namespace
Classes: Configuration
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the Projects Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the Projects Client instance.
-
#disable_xpn_host(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::BaseOperation
Disable this project as a shared VPC host project.
-
#disable_xpn_resource(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::BaseOperation
Disable a service resource (also known as service project) associated with this host project.
-
#enable_xpn_host(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::BaseOperation
Enable this project as a shared VPC host project.
-
#enable_xpn_resource(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::BaseOperation
Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.
-
#get(request, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Project
Returns the specified Project resource.
-
#get_xpn_host(request, options = nil) {|result, response| ... } ⇒ ::Google::Cloud::Compute::V1::Project
Gets the shared VPC host project that this project links to.
-
#get_xpn_resources(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::XpnResourceId>
Gets service resources (a.k.a service project) associated with this host project.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new Projects REST client object.
-
#list_xpn_hosts(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Project>
Lists all shared VPC host projects visible to the user in an organization.
-
#move_disk(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::BaseOperation
Moves a persistent disk from one zone to another.
-
#move_instance(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::BaseOperation
Moves an instance and its attached persistent disks from one zone to another.
-
#set_common_instance_metadata(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::BaseOperation
Sets metadata common to all instances within the specified project using the data included in the request.
-
#set_default_network_tier(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::BaseOperation
Sets the default network tier of the project.
-
#set_usage_export_bucket(request, options = nil) {|result, response| ... } ⇒ ::Gapic::Rest::BaseOperation
Enables the usage export feature and sets the usage export bucket where reports are stored.
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new Projects REST client object.
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 144 def initialize # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials credentials ||= Credentials.default scope: @config.scope if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @projects_stub = ::Google::Cloud::Compute::V1::Projects::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the Projects Client class.
See Configuration for a description of the configuration fields.
56 57 58 59 60 61 62 63 64 65 66 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/google/cloud/compute/v1/projects/rest/client.rb', line 56 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Compute", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.disable_xpn_host.timeout = 600.0 default_config.rpcs.disable_xpn_resource.timeout = 600.0 default_config.rpcs.enable_xpn_host.timeout = 600.0 default_config.rpcs.enable_xpn_resource.timeout = 600.0 default_config.rpcs.get.timeout = 600.0 default_config.rpcs.get.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_xpn_host.timeout = 600.0 default_config.rpcs.get_xpn_host.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_xpn_resources.timeout = 600.0 default_config.rpcs.get_xpn_resources.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.list_xpn_hosts.timeout = 600.0 default_config.rpcs.move_disk.timeout = 600.0 default_config.rpcs.move_instance.timeout = 600.0 default_config.rpcs..timeout = 600.0 default_config.rpcs.set_default_network_tier.timeout = 600.0 default_config.rpcs.set_usage_export_bucket.timeout = 600.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#configure {|config| ... } ⇒ Client::Configuration
Configure the Projects Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
123 124 125 126 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 123 def configure yield @config if block_given? @config end |
#disable_xpn_host(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #disable_xpn_host(project: nil, request_id: nil) ⇒ ::Gapic::Rest::BaseOperation
Disable this project as a shared VPC host project.
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 224 225 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 194 def disable_xpn_host request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DisableXpnHostProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.disable_xpn_host..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.disable_xpn_host.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.disable_xpn_host request, do |result, response| result = ::Gapic::Rest::BaseOperation.new result yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#disable_xpn_resource(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #disable_xpn_resource(project: nil, projects_disable_xpn_resource_request_resource: nil, request_id: nil) ⇒ ::Gapic::Rest::BaseOperation
Disable a service resource (also known as service project) associated with this host project.
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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 260 def disable_xpn_resource request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DisableXpnResourceProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.disable_xpn_resource..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.disable_xpn_resource.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.disable_xpn_resource request, do |result, response| result = ::Gapic::Rest::BaseOperation.new result yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#enable_xpn_host(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #enable_xpn_host(project: nil, request_id: nil) ⇒ ::Gapic::Rest::BaseOperation
Enable this project as a shared VPC host project.
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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 324 def enable_xpn_host request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::EnableXpnHostProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.enable_xpn_host..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.enable_xpn_host.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.enable_xpn_host request, do |result, response| result = ::Gapic::Rest::BaseOperation.new result yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#enable_xpn_resource(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #enable_xpn_resource(project: nil, projects_enable_xpn_resource_request_resource: nil, request_id: nil) ⇒ ::Gapic::Rest::BaseOperation
Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.
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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 390 def enable_xpn_resource request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::EnableXpnResourceProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.enable_xpn_resource..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.enable_xpn_resource.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.enable_xpn_resource request, do |result, response| result = ::Gapic::Rest::BaseOperation.new result yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#get(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::Project #get(project: nil) ⇒ ::Google::Cloud::Compute::V1::Project
Returns the specified Project resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the quotas
field). To exclude one or more fields, set your request's fields
query parameter to only include the fields you need. For example, to only include the id
and selfLink
fields, add the query parameter ?fields=id,selfLink
to your request.
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 452 def get request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.get.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.get request, do |result, response| yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#get_xpn_host(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::Project #get_xpn_host(project: nil) ⇒ ::Google::Cloud::Compute::V1::Project
Gets the shared VPC host project that this project links to. May be empty if no link exists.
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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 513 def get_xpn_host request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetXpnHostProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_xpn_host..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.get_xpn_host.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.get_xpn_host request, do |result, response| yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#get_xpn_resources(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::XpnResourceId> #get_xpn_resources(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::XpnResourceId>
Gets service resources (a.k.a service project) associated with this host project.
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 584 def get_xpn_resources request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetXpnResourcesProjectsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_xpn_resources..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.get_xpn_resources.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.get_xpn_resources request, do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :get_xpn_resources, "resources", request, result, yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#list_xpn_hosts(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Project> #list_xpn_hosts(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, projects_list_xpn_hosts_request_resource: nil, return_partial_success: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Project>
Lists all shared VPC host projects visible to the user in an organization.
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 658 def list_xpn_hosts request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListXpnHostsProjectsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_xpn_hosts..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.list_xpn_hosts.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.list_xpn_hosts request, do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :list_xpn_hosts, "items", request, result, yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#move_disk(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #move_disk(disk_move_request_resource: nil, project: nil, request_id: nil) ⇒ ::Gapic::Rest::BaseOperation
Moves a persistent disk from one zone to another.
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 724 def move_disk request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::MoveDiskProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.move_disk..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.move_disk.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.move_disk request, do |result, response| result = ::Gapic::Rest::BaseOperation.new result yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#move_instance(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #move_instance(instance_move_request_resource: nil, project: nil, request_id: nil) ⇒ ::Gapic::Rest::BaseOperation
Moves an instance and its attached persistent disks from one zone to another. Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue.
790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 790 def move_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::MoveInstanceProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.move_instance..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.move_instance.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.move_instance request, do |result, response| result = ::Gapic::Rest::BaseOperation.new result yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#set_common_instance_metadata(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #set_common_instance_metadata(metadata_resource: nil, project: nil, request_id: nil) ⇒ ::Gapic::Rest::BaseOperation
Sets metadata common to all instances within the specified project using the data included in the request.
856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 856 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetCommonInstanceMetadataProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs..timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub. request, do |result, response| result = ::Gapic::Rest::BaseOperation.new result yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#set_default_network_tier(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #set_default_network_tier(project: nil, projects_set_default_network_tier_request_resource: nil, request_id: nil) ⇒ ::Gapic::Rest::BaseOperation
Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field.
922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 922 def set_default_network_tier request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetDefaultNetworkTierProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_default_network_tier..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.set_default_network_tier.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.set_default_network_tier request, do |result, response| result = ::Gapic::Rest::BaseOperation.new result yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |
#set_usage_export_bucket(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #set_usage_export_bucket(project: nil, request_id: nil, usage_export_location_resource: nil) ⇒ ::Gapic::Rest::BaseOperation
Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.
988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 988 def set_usage_export_bucket request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetUsageExportBucketProjectRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_usage_export_bucket..to_h # Set x-goog-api-client header [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Compute::V1::VERSION, transports_version_send: [:rest] .apply_defaults timeout: @config.rpcs.set_usage_export_bucket.timeout, metadata: .apply_defaults timeout: @config.timeout, metadata: @config. @projects_stub.set_usage_export_bucket request, do |result, response| result = ::Gapic::Rest::BaseOperation.new result yield result, response if block_given? return result end rescue ::Faraday::Error => e gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e raise ::Google::Cloud::Error.from_error(gapic_error) end |