Class: Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb
Overview
REST client for the ReservationService service.
This API allows users to manage their BigQuery reservations.
A reservation provides computational resource guarantees, in the form of
slots, to users. A slot is a
unit of computational power in BigQuery, and serves as the basic unit of
parallelism. In a scan of a multi-partitioned table, a single slot operates
on a single partition of the table. A reservation resource exists as a child
resource of the admin project and location, e.g.:
projects/myproject/locations/US/reservations/reservationName.
A capacity commitment is a way to purchase compute capacity for BigQuery jobs
(in the form of slots) with some committed period of usage. A capacity
commitment resource exists as a child resource of the admin project and
location, e.g.:
projects/myproject/locations/US/capacityCommitments/id.
Defined Under Namespace
Classes: Configuration
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the ReservationService Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the ReservationService Client instance.
-
#create_assignment(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation.
-
#create_capacity_commitment(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Creates a new capacity commitment resource.
-
#create_reservation(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Creates a new reservation resource.
-
#create_reservation_group(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup
Creates a new reservation group.
-
#delete_assignment(request, options = nil) {|result, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a assignment.
-
#delete_capacity_commitment(request, options = nil) {|result, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a capacity commitment.
-
#delete_reservation(request, options = nil) {|result, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a reservation.
-
#delete_reservation_group(request, options = nil) {|result, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a reservation.
-
#failover_reservation(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Fail over a reservation to the secondary location.
-
#get_bi_reservation(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
Retrieves a BI reservation.
-
#get_capacity_commitment(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Returns information about the capacity commitment.
-
#get_iam_policy(request, options = nil) {|result, operation| ... } ⇒ ::Google::Iam::V1::Policy
Gets the access control policy for a resource.
-
#get_reservation(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Returns information about the reservation.
-
#get_reservation_group(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup
Returns information about the reservation group.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new ReservationService REST client object.
-
#list_assignments(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Lists assignments.
-
#list_capacity_commitments(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>
Lists all the capacity commitments for the admin project.
-
#list_reservation_groups(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>
Lists all the reservation groups for the project in the specified location.
-
#list_reservations(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>
Lists all the reservations for the project in the specified location.
-
#logger ⇒ Logger
The logger used for request/response debug logging.
-
#merge_capacity_commitments(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Merges capacity commitments of the same plan into a single commitment.
-
#move_assignment(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Moves an assignment under a new reservation.
-
#search_all_assignments(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Looks up assignments for a specified resource for a particular region.
-
#search_assignments(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Deprecated: Looks up assignments for a specified resource for a particular region.
-
#set_iam_policy(request, options = nil) {|result, operation| ... } ⇒ ::Google::Iam::V1::Policy
Sets an access control policy for a resource.
-
#split_capacity_commitment(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse
Splits capacity commitment to two commitments of the same plan and
commitment_end_time. -
#test_iam_permissions(request, options = nil) {|result, operation| ... } ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Gets your permissions on a resource.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_assignment(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Updates an existing assignment.
-
#update_bi_reservation(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
Updates a BI reservation.
-
#update_capacity_commitment(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Updates an existing capacity commitment.
-
#update_reservation(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Updates an existing reservation resource.
Methods included from Paths
#assignment_path, #bi_reservation_path, #capacity_commitment_path, #location_path, #reservation_group_path, #reservation_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new ReservationService REST client object.
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 211 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 @reservation_service_stub = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials, logger: @config.logger ) @reservation_service_stub.logger(stub: true)&.info do |entry| entry.set_system_name entry.set_service entry. = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the ReservationService Client class.
See Configuration for a description of the configuration fields.
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 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 158 159 160 161 162 163 164 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 79 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Bigquery", "Reservation", "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.create_reservation.timeout = 300.0 default_config.rpcs.list_reservations.timeout = 300.0 default_config.rpcs.list_reservations.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_reservation.timeout = 300.0 default_config.rpcs.get_reservation.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.delete_reservation.timeout = 300.0 default_config.rpcs.delete_reservation.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.update_reservation.timeout = 300.0 default_config.rpcs.failover_reservation.timeout = 300.0 default_config.rpcs.create_capacity_commitment.timeout = 300.0 default_config.rpcs.list_capacity_commitments.timeout = 300.0 default_config.rpcs.list_capacity_commitments.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_capacity_commitment.timeout = 300.0 default_config.rpcs.get_capacity_commitment.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.delete_capacity_commitment.timeout = 300.0 default_config.rpcs.delete_capacity_commitment.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.update_capacity_commitment.timeout = 300.0 default_config.rpcs.split_capacity_commitment.timeout = 300.0 default_config.rpcs.merge_capacity_commitments.timeout = 300.0 default_config.rpcs.create_assignment.timeout = 300.0 default_config.rpcs.list_assignments.timeout = 300.0 default_config.rpcs.list_assignments.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.delete_assignment.timeout = 300.0 default_config.rpcs.delete_assignment.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.search_assignments.timeout = 300.0 default_config.rpcs.search_assignments.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.move_assignment.timeout = 300.0 default_config.rpcs.get_bi_reservation.timeout = 300.0 default_config.rpcs.get_bi_reservation.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.update_bi_reservation.timeout = 300.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#configure {|config| ... } ⇒ Client::Configuration
Configure the ReservationService 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.
181 182 183 184 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 181 def configure yield @config if block_given? @config end |
#create_assignment(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Assignment #create_assignment(parent: nil, assignment: nil, assignment_id: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation.
Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type.
Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query.
When creating assignments, it does not matter if other assignments exist at higher levels.
Example:
- The organization
organizationAcontains two projects,project1andproject2. - Assignments for all three entities (
organizationA,project1, andproject2) could all be created and mapped to the same or different reservations.
"None" assignments represent an absence of the assignment. Projects
assigned to None use on-demand pricing. To create a "None" assignment, use
"none" as a reservation_id in the parent. Example parent:
projects/myproject/locations/US/reservations/none.
Returns google.rpc.Code.PERMISSION_DENIED if user does not have
'bigquery.admin' permissions on the project using the reservation
and the project that owns this reservation.
Returns google.rpc.Code.INVALID_ARGUMENT when location of the assignment
does not match location of the reservation.
1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 1463 def create_assignment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest # 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.create_assignment..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::Bigquery::Reservation::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.create_assignment.timeout, metadata: , retry_policy: @config.rpcs.create_assignment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.create_assignment request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#create_capacity_commitment(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment #create_capacity_commitment(parent: nil, capacity_commitment: nil, enforce_single_admin_project_per_org: nil, capacity_commitment_id: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Creates a new capacity commitment resource.
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 820 def create_capacity_commitment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest # 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.create_capacity_commitment..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::Bigquery::Reservation::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.create_capacity_commitment.timeout, metadata: , retry_policy: @config.rpcs.create_capacity_commitment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.create_capacity_commitment request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#create_reservation(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation #create_reservation(parent: nil, reservation_id: nil, reservation: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Creates a new reservation resource.
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 314 def create_reservation request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest # 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.create_reservation..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::Bigquery::Reservation::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.create_reservation.timeout, metadata: , retry_policy: @config.rpcs.create_reservation.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.create_reservation request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#create_reservation_group(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup #create_reservation_group(parent: nil, reservation_group_id: nil, reservation_group: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup
Creates a new reservation group.
2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2618 def create_reservation_group request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest # 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.create_reservation_group..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::Bigquery::Reservation::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.create_reservation_group.timeout, metadata: , retry_policy: @config.rpcs.create_reservation_group.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.create_reservation_group request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_assignment(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_assignment(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a assignment. No expansion will happen.
Example:
- Organization
organizationAcontains two projects,project1andproject2. - Reservation
res1exists and was created previously. - CreateAssignment was used previously to define the following
associations between entities and reservations:
<organizationA, res1>and<project1, res1>
In this example, deletion of the <organizationA, res1> assignment won't
affect the other assignment <project1, res1>. After said deletion,
queries from project1 will still use res1 while queries from
project2 will switch to use on-demand mode.
1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 1670 def delete_assignment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest # 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.delete_assignment..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::Bigquery::Reservation::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.delete_assignment.timeout, metadata: , retry_policy: @config.rpcs.delete_assignment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.delete_assignment request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_capacity_commitment(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_capacity_commitment(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty
Deletes a capacity commitment. Attempting to delete capacity commitment
before its commitment_end_time will fail with the error code
google.rpc.Code.FAILED_PRECONDITION.
1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 1073 def delete_capacity_commitment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest # 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.delete_capacity_commitment..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::Bigquery::Reservation::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.delete_capacity_commitment.timeout, metadata: , retry_policy: @config.rpcs.delete_capacity_commitment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.delete_capacity_commitment request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_reservation(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_reservation(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a reservation.
Returns google.rpc.Code.FAILED_PRECONDITION when reservation has
assignments.
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 563 def delete_reservation request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest # 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.delete_reservation..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::Bigquery::Reservation::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.delete_reservation.timeout, metadata: , retry_policy: @config.rpcs.delete_reservation.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.delete_reservation request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_reservation_group(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_reservation_group(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a reservation.
Returns google.rpc.Code.FAILED_PRECONDITION when reservation has
assignments.
2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2778 def delete_reservation_group request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest # 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.delete_reservation_group..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::Bigquery::Reservation::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.delete_reservation_group.timeout, metadata: , retry_policy: @config.rpcs.delete_reservation_group.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.delete_reservation_group request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#failover_reservation(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation #failover_reservation(name: nil, failover_mode: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Fail over a reservation to the secondary location. The operation should be
done in the current secondary location, which will be promoted to the
new primary location for the reservation.
Attempting to failover a reservation in the current primary location will
fail with the error code google.rpc.Code.FAILED_PRECONDITION.
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 756 757 758 759 760 761 762 763 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 730 def failover_reservation request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest # 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.failover_reservation..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::Bigquery::Reservation::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.failover_reservation.timeout, metadata: , retry_policy: @config.rpcs.failover_reservation.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.failover_reservation request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_bi_reservation(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::BiReservation #get_bi_reservation(name: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
Retrieves a BI reservation.
2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2161 def get_bi_reservation request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest # 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_bi_reservation..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::Bigquery::Reservation::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_bi_reservation.timeout, metadata: , retry_policy: @config.rpcs.get_bi_reservation.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.get_bi_reservation request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_capacity_commitment(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment #get_capacity_commitment(name: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Returns information about the capacity commitment.
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 1020 1021 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 988 def get_capacity_commitment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest # 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_capacity_commitment..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::Bigquery::Reservation::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_capacity_commitment.timeout, metadata: , retry_policy: @config.rpcs.get_capacity_commitment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.get_capacity_commitment request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy
Gets the access control policy for a resource. May return:
- A
NOT_FOUNDerror if the resource doesn't exist or you don't have the permission to view it. - An empty policy if the resource exists but doesn't have a set policy.
Supported resources are:
- Reservations
- ReservationAssignments
To call this method, you must have the following Google IAM permissions:
bigqueryreservation.reservations.getIamPolicyto get policies on reservations.
2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2344 def get_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest # 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_iam_policy..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::Bigquery::Reservation::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_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.get_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.get_iam_policy request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_reservation(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation #get_reservation(name: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Returns information about the reservation.
482 483 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 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 482 def get_reservation request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest # 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_reservation..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::Bigquery::Reservation::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_reservation.timeout, metadata: , retry_policy: @config.rpcs.get_reservation.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.get_reservation request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_reservation_group(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup #get_reservation_group(name: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup
Returns information about the reservation group.
2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2697 def get_reservation_group request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest # 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_reservation_group..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::Bigquery::Reservation::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_reservation_group.timeout, metadata: , retry_policy: @config.rpcs.get_reservation_group.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.get_reservation_group request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_assignments(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment> #list_assignments(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Lists assignments.
Only explicitly created assignments will be returned.
Example:
- Organization
organizationAcontains two projects,project1andproject2. - Reservation
res1exists and was created previously. - CreateAssignment was used previously to define the following
associations between entities and reservations:
<organizationA, res1>and<project1, res1>
In this example, ListAssignments will just return the above two assignments
for reservation res1, and no expansion/merge will happen.
The wildcard "-" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed.
Note "-" cannot be used for projects nor locations.
1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 1575 def list_assignments request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest # 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_assignments..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::Bigquery::Reservation::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_assignments.timeout, metadata: , retry_policy: @config.rpcs.list_assignments.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.list_assignments request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_assignments, "assignments", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_capacity_commitments(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment> #list_capacity_commitments(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>
Lists all the capacity commitments for the admin project.
907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 907 def list_capacity_commitments request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest # 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_capacity_commitments..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::Bigquery::Reservation::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_capacity_commitments.timeout, metadata: , retry_policy: @config.rpcs.list_capacity_commitments.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.list_capacity_commitments request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_capacity_commitments, "capacity_commitments", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_reservation_groups(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup> #list_reservation_groups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>
Lists all the reservation groups for the project in the specified location.
2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2865 def list_reservation_groups request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest # 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_reservation_groups..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::Bigquery::Reservation::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_reservation_groups.timeout, metadata: , retry_policy: @config.rpcs.list_reservation_groups.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.list_reservation_groups request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_reservation_groups, "reservation_groups", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_reservations(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation> #list_reservations(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>
Lists all the reservations for the project in the specified location.
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 431 432 433 434 435 436 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 401 def list_reservations request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest # 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_reservations..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::Bigquery::Reservation::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_reservations.timeout, metadata: , retry_policy: @config.rpcs.list_reservations.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.list_reservations request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_reservations, "reservations", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
258 259 260 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 258 def logger @reservation_service_stub.logger end |
#merge_capacity_commitments(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment #merge_capacity_commitments(parent: nil, capacity_commitment_ids: nil, capacity_commitment_id: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Merges capacity commitments of the same plan into a single commitment.
The resulting capacity commitment has the greater commitment_end_time out of the to-be-merged capacity commitments.
Attempting to merge capacity commitments of different plan will fail
with the error code google.rpc.Code.FAILED_PRECONDITION.
1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 1343 def merge_capacity_commitments request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest # 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.merge_capacity_commitments..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::Bigquery::Reservation::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.merge_capacity_commitments.timeout, metadata: , retry_policy: @config.rpcs.merge_capacity_commitments.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.merge_capacity_commitments request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#move_assignment(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Assignment #move_assignment(name: nil, destination_id: nil, assignment_id: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Moves an assignment under a new reservation.
This differs from removing an existing assignment and recreating a new one by providing a transactional change that ensures an assignee always has an associated reservation.
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2000 def move_assignment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest # 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_assignment..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::Bigquery::Reservation::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_assignment.timeout, metadata: , retry_policy: @config.rpcs.move_assignment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.move_assignment request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#search_all_assignments(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment> #search_all_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Looks up assignments for a specified resource for a particular region. If the request is about a project:
- Assignments created on the project will be returned if they exist.
- Otherwise assignments created on the closest ancestor will be returned.
- Assignments for different JobTypes will all be returned.
The same logic applies if the request is about a folder.
If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors).
Comparing to ListAssignments, there are some behavior differences:
- permission on the assignee will be verified in this API.
- Hierarchy lookup (project->folder->organization) happens in this API.
- Parent here is
projects/*/locations/*, instead ofprojects/*/locations/*reservations/*.
1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 1905 def search_all_assignments request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest # 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.search_all_assignments..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::Bigquery::Reservation::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.search_all_assignments.timeout, metadata: , retry_policy: @config.rpcs.search_all_assignments.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.search_all_assignments request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :search_all_assignments, "assignments", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#search_assignments(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment> #search_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project:
- Assignments created on the project will be returned if they exist.
- Otherwise assignments created on the closest ancestor will be returned.
- Assignments for different JobTypes will all be returned.
The same logic applies if the request is about a folder.
If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors).
Comparing to ListAssignments, there are some behavior differences:
- permission on the assignee will be verified in this API.
- Hierarchy lookup (project->folder->organization) happens in this API.
- Parent here is
projects/*/locations/*, instead ofprojects/*/locations/*reservations/*.
Note "-" cannot be used for projects nor locations.
1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 1788 def search_assignments request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest # 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.search_assignments..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::Bigquery::Reservation::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.search_assignments.timeout, metadata: , retry_policy: @config.rpcs.search_assignments.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.search_assignments request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :search_assignments, "assignments", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy
Sets an access control policy for a resource. Replaces any existing policy.
Supported resources are:
- Reservations
To call this method, you must have the following Google IAM permissions:
bigqueryreservation.reservations.setIamPolicyto set policies on reservations.
2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2443 def set_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest # 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_iam_policy..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::Bigquery::Reservation::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_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.set_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.set_iam_policy request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#split_capacity_commitment(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse #split_capacity_commitment(name: nil, slot_count: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse
Splits capacity commitment to two commitments of the same plan and
commitment_end_time.
A common use case is to enable downgrading commitments.
For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the commitment end time passes.
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 1272 1273 1274 1275 1276 1277 1278 1279 1280 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 1247 def split_capacity_commitment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest # 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.split_capacity_commitment..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::Bigquery::Reservation::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.split_capacity_commitment.timeout, metadata: , retry_policy: @config.rpcs.split_capacity_commitment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.split_capacity_commitment request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Gets your permissions on a resource. Returns an empty set of permissions if the resource doesn't exist.
Supported resources are:
- Reservations
No Google IAM permissions are required to call this method.
2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2533 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest # 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::Bigquery::Reservation::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 @reservation_service_stub. request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
191 192 193 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 191 def universe_domain @reservation_service_stub.universe_domain end |
#update_assignment(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Assignment #update_assignment(assignment: nil, update_mask: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Updates an existing assignment.
Only the priority field can be updated.
2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2082 def update_assignment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest # 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.update_assignment..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::Bigquery::Reservation::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.update_assignment.timeout, metadata: , retry_policy: @config.rpcs.update_assignment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.update_assignment request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_bi_reservation(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::BiReservation #update_bi_reservation(bi_reservation: nil, update_mask: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
Updates a BI reservation.
Only fields specified in the field_mask are updated.
A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.
2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 2248 def update_bi_reservation request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest # 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.update_bi_reservation..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::Bigquery::Reservation::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.update_bi_reservation.timeout, metadata: , retry_policy: @config.rpcs.update_bi_reservation.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.update_bi_reservation request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_capacity_commitment(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment #update_capacity_commitment(capacity_commitment: nil, update_mask: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Updates an existing capacity commitment.
Only plan and renewal_plan fields can be updated.
Plan can only be changed to a plan of a longer commitment period.
Attempting to change to a plan with shorter commitment period will fail
with the error code google.rpc.Code.FAILED_PRECONDITION.
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 1159 def update_capacity_commitment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest # 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.update_capacity_commitment..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::Bigquery::Reservation::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.update_capacity_commitment.timeout, metadata: , retry_policy: @config.rpcs.update_capacity_commitment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.update_capacity_commitment request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_reservation(request, options = nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation #update_reservation(reservation: nil, update_mask: nil) ⇒ ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Updates an existing reservation resource.
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 |
# File 'lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb', line 643 def update_reservation request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest # 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.update_reservation..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::Bigquery::Reservation::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.update_reservation.timeout, metadata: , retry_policy: @config.rpcs.update_reservation.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @reservation_service_stub.update_reservation request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |