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
Instance Attribute Summary collapse
-
#global_operations ⇒ ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client
readonly
Get the associated client for long-running operations via GlobalOperations.
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, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Disable this project as a shared VPC host project.
-
#disable_xpn_resource(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Disable a service resource (also known as service project) associated with this host project.
-
#enable_xpn_host(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Enable this project as a shared VPC host project.
-
#enable_xpn_resource(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
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, operation| ... } ⇒ ::Google::Cloud::Compute::V1::Project
Returns the specified Project resource.
-
#get_xpn_host(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::Project
Gets the shared VPC host project that this project links to.
-
#get_xpn_resources(request, options = nil) {|result, operation| ... } ⇒ ::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, operation| ... } ⇒ ::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, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Moves a persistent disk from one zone to another.
-
#move_instance(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Moves an instance and its attached persistent disks from one zone to another.
-
#set_cloud_armor_tier(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets the Cloud Armor tier of the project.
-
#set_common_instance_metadata(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
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, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets the default network tier of the project.
-
#set_usage_export_bucket(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Enables the usage export feature and sets the usage export bucket where reports are stored.
-
#universe_domain ⇒ String
The effective universe domain.
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new Projects REST client object.
162 163 164 165 166 167 168 169 170 171 172 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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 162 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 # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.universe_domain = @config.universe_domain end @projects_stub = ::Google::Cloud::Compute::V1::Projects::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) end |
Instance Attribute Details
#global_operations ⇒ ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client (readonly)
Get the associated client for long-running operations via GlobalOperations.
205 206 207 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 205 def global_operations @global_operations end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the Projects Client class.
See Configuration for a description of the configuration fields.
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 107 108 109 110 111 112 113 114 115 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 63 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.set_cloud_armor_tier.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.
132 133 134 135 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 132 def configure yield @config if block_given? @config end |
#disable_xpn_host(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #disable_xpn_host(project: nil, request_id: nil) ⇒ ::Gapic::GenericLRO::Operation
Disable this project as a shared VPC host project.
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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 254 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.disable_xpn_host.timeout, metadata: , retry_policy: @config.rpcs.disable_xpn_host.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.disable_xpn_host request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#disable_xpn_resource(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #disable_xpn_resource(project: nil, projects_disable_xpn_resource_request_resource: nil, request_id: nil) ⇒ ::Gapic::GenericLRO::Operation
Disable a service resource (also known as service project) associated with this host project.
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 345 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.disable_xpn_resource.timeout, metadata: , retry_policy: @config.rpcs.disable_xpn_resource.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.disable_xpn_resource request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#enable_xpn_host(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #enable_xpn_host(project: nil, request_id: nil) ⇒ ::Gapic::GenericLRO::Operation
Enable this project as a shared VPC host project.
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 434 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.enable_xpn_host.timeout, metadata: , retry_policy: @config.rpcs.enable_xpn_host.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.enable_xpn_host request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#enable_xpn_resource(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #enable_xpn_resource(project: nil, projects_enable_xpn_resource_request_resource: nil, request_id: nil) ⇒ ::Gapic::GenericLRO::Operation
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.
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 525 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.enable_xpn_resource.timeout, metadata: , retry_policy: @config.rpcs.enable_xpn_resource.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.enable_xpn_resource request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) 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.
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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 612 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get.timeout, metadata: , retry_policy: @config.rpcs.get.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.get request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) 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.
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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 691 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_xpn_host.timeout, metadata: , retry_policy: @config.rpcs.get_xpn_host.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.get_xpn_host request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) 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.
780 781 782 783 784 785 786 787 788 789 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 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 780 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_xpn_resources.timeout, metadata: , retry_policy: @config.rpcs.get_xpn_resources.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.get_xpn_resources request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :get_xpn_resources, "resources", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) 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.
872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 872 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_xpn_hosts.timeout, metadata: , retry_policy: @config.rpcs.list_xpn_hosts.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.list_xpn_hosts request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :list_xpn_hosts, "items", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#move_disk(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #move_disk(disk_move_request_resource: nil, project: nil, request_id: nil) ⇒ ::Gapic::GenericLRO::Operation
Moves a persistent disk from one zone to another.
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 956 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.move_disk.timeout, metadata: , retry_policy: @config.rpcs.move_disk.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.move_disk request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#move_instance(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #move_instance(instance_move_request_resource: nil, project: nil, request_id: nil) ⇒ ::Gapic::GenericLRO::Operation
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. [Deprecated] This method is deprecated. See moving instance across zones instead.
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 1047 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.move_instance.timeout, metadata: , retry_policy: @config.rpcs.move_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.move_instance request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_cloud_armor_tier(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_cloud_armor_tier(project: nil, projects_set_cloud_armor_tier_request_resource: nil, request_id: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information.
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 1138 def set_cloud_armor_tier request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetCloudArmorTierProjectRequest # 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_cloud_armor_tier..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_cloud_armor_tier.timeout, metadata: , retry_policy: @config.rpcs.set_cloud_armor_tier.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.set_cloud_armor_tier request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_common_instance_metadata(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_common_instance_metadata(metadata_resource: nil, project: nil, request_id: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets metadata common to all instances within the specified project using the data included in the request.
1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 1229 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub. request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_default_network_tier(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_default_network_tier(project: nil, projects_set_default_network_tier_request_resource: nil, request_id: nil) ⇒ ::Gapic::GenericLRO::Operation
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.
1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 1320 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_default_network_tier.timeout, metadata: , retry_policy: @config.rpcs.set_default_network_tier.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.set_default_network_tier request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_usage_export_bucket(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_usage_export_bucket(project: nil, request_id: nil, usage_export_location_resource: nil) ⇒ ::Gapic::GenericLRO::Operation
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.
1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 1411 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, x-goog-user-project and x-goog-api-version headers [:"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] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_usage_export_bucket.timeout, metadata: , retry_policy: @config.rpcs.set_usage_export_bucket.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @projects_stub.set_usage_export_bucket request, do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( operation: result, client: global_operations, request_values: { "project" => request.project }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
142 143 144 |
# File 'lib/google/cloud/compute/v1/projects/rest/client.rb', line 142 def universe_domain @projects_stub.universe_domain end |