Reference documentation and code samples for the BigQuery Reservation V1 API class Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.
Capacity commitment is a way to purchase compute capacity for BigQuery jobs
(in the form of slots) with some committed period of usage. Annual
commitments renew by default. Commitments can be removed after their
commitment end time passes.
In order to remove annual commitment, its plan needs to be changed
to monthly or flex first.
A capacity commitment resource exists as a child resource of the admin
project.
(::Google::Protobuf::Timestamp) — Output only. The end of the current commitment period. It is applicable
only for ACTIVE capacity commitments. Note after renewal,
commitment_end_time is the time the renewed commitment expires. So it would
be at a time after commitment_start_time + committed period, because we
don't change commitment_start_time ,
(::Google::Protobuf::Timestamp) — Output only. The start of the current commitment period. It is applicable
only for ACTIVE capacity commitments. Note after the commitment is renewed,
commitment_start_time won't be changed. It refers to the start time of the
original commitment.
(::Google::Rpc::Status) — Output only. For FAILED commitment plan, provides the reason of failure.
#is_flat_rate
defis_flat_rate()->::Boolean
Returns
(::Boolean) — Output only. If true, the commitment is a flat-rate commitment, otherwise,
it's an edition commitment.
#multi_region_auxiliary
defmulti_region_auxiliary()->::Boolean
Returns
(::Boolean) — Applicable only for commitments located within one of the BigQuery
multi-regions (US or EU).
If set to true, this commitment is placed in the organization's
secondary region which is designated for disaster recovery purposes.
If false, this commitment is placed in the organization's default region.
NOTE: this is a preview feature. Project must be allow-listed in order to
set this field.
#multi_region_auxiliary=
defmulti_region_auxiliary=(value)->::Boolean
Parameter
value (::Boolean) — Applicable only for commitments located within one of the BigQuery
multi-regions (US or EU).
If set to true, this commitment is placed in the organization's
secondary region which is designated for disaster recovery purposes.
If false, this commitment is placed in the organization's default region.
NOTE: this is a preview feature. Project must be allow-listed in order to
set this field.
Returns
(::Boolean) — Applicable only for commitments located within one of the BigQuery
multi-regions (US or EU).
If set to true, this commitment is placed in the organization's
secondary region which is designated for disaster recovery purposes.
If false, this commitment is placed in the organization's default region.
NOTE: this is a preview feature. Project must be allow-listed in order to
set this field.
#name
defname()->::String
Returns
(::String) — Output only. The resource name of the capacity commitment, e.g.,
projects/myproject/locations/US/capacityCommitments/123
The commitment_id must only contain lower case alphanumeric characters or
dashes. It must start with a letter and must not end
with a dash. Its maximum length is 64 characters.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# BigQuery Reservation V1 API - Class Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment (v1.6.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.6.0 (latest)](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/latest/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [1.5.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/1.5.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [1.4.1](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/1.4.1/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [1.3.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/1.3.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [1.2.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/1.2.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [1.1.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/1.1.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [1.0.1](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/1.0.1/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [0.12.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/0.12.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [0.11.2](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/0.11.2/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [0.10.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/0.10.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [0.9.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/0.9.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [0.8.1](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/0.8.1/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [0.7.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/0.7.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [0.6.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/0.6.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [0.5.0](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/0.5.0/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment)\n- [0.4.2](/ruby/docs/reference/google-cloud-bigquery-reservation-v1/0.4.2/Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment) \nReference documentation and code samples for the BigQuery Reservation V1 API class Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.\n\nCapacity commitment is a way to purchase compute capacity for BigQuery jobs\n(in the form of slots) with some committed period of usage. Annual\ncommitments renew by default. Commitments can be removed after their\ncommitment end time passes.\n\n\nIn order to remove annual commitment, its plan needs to be changed\nto monthly or flex first.\n\n\u003cbr /\u003e\n\nA capacity commitment resource exists as a child resource of the admin\nproject. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #commitment_end_time\n\n def commitment_end_time() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. The end of the current commitment period. It is applicable only for ACTIVE capacity commitments. Note after renewal, commitment_end_time is the time the renewed commitment expires. So it would be at a time after commitment_start_time + committed period, because we don't change commitment_start_time ,\n\n### #commitment_start_time\n\n def commitment_start_time() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. The start of the current commitment period. It is applicable only for ACTIVE capacity commitments. Note after the commitment is renewed, commitment_start_time won't be changed. It refers to the start time of the original commitment.\n\n### #edition\n\n def edition() -\u003e ::Google::Cloud::Bigquery::Reservation::V1::Edition\n\n**Returns**\n\n- ([::Google::Cloud::Bigquery::Reservation::V1::Edition](./Google-Cloud-Bigquery-Reservation-V1-Edition)) --- Edition of the capacity commitment.\n\n### #edition=\n\n def edition=(value) -\u003e ::Google::Cloud::Bigquery::Reservation::V1::Edition\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Bigquery::Reservation::V1::Edition](./Google-Cloud-Bigquery-Reservation-V1-Edition)) --- Edition of the capacity commitment. \n**Returns**\n\n- ([::Google::Cloud::Bigquery::Reservation::V1::Edition](./Google-Cloud-Bigquery-Reservation-V1-Edition)) --- Edition of the capacity commitment.\n\n### #failure_status\n\n def failure_status() -\u003e ::Google::Rpc::Status\n\n**Returns**\n\n- ([::Google::Rpc::Status](./Google-Rpc-Status)) --- Output only. For FAILED commitment plan, provides the reason of failure.\n\n### #is_flat_rate\n\n def is_flat_rate() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- Output only. If true, the commitment is a flat-rate commitment, otherwise, it's an edition commitment.\n\n### #multi_region_auxiliary\n\n def multi_region_auxiliary() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- Applicable only for commitments located within one of the BigQuery multi-regions (US or EU).\n\n If set to true, this commitment is placed in the organization's\n secondary region which is designated for disaster recovery purposes.\n If false, this commitment is placed in the organization's default region.\n\n NOTE: this is a preview feature. Project must be allow-listed in order to\n set this field.\n\n### #multi_region_auxiliary=\n\n def multi_region_auxiliary=(value) -\u003e ::Boolean\n\n**Parameter**\n\n- **value** (::Boolean) --- Applicable only for commitments located within one of the BigQuery multi-regions (US or EU).\n\n\n If set to true, this commitment is placed in the organization's\n secondary region which is designated for disaster recovery purposes.\n If false, this commitment is placed in the organization's default region.\n\n NOTE: this is a preview feature. Project must be allow-listed in order to\nset this field. \n**Returns**\n\n- (::Boolean) --- Applicable only for commitments located within one of the BigQuery multi-regions (US or EU).\n\n If set to true, this commitment is placed in the organization's\n secondary region which is designated for disaster recovery purposes.\n If false, this commitment is placed in the organization's default region.\n\n NOTE: this is a preview feature. Project must be allow-listed in order to\n set this field.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. The resource name of the capacity commitment, e.g., `projects/myproject/locations/US/capacityCommitments/123` The commitment_id must only contain lower case alphanumeric characters or dashes. It must start with a letter and must not end with a dash. Its maximum length is 64 characters.\n\n### #plan\n\n def plan() -\u003e ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan\n\n**Returns**\n\n- ([::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan](./Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment-CommitmentPlan)) --- Capacity commitment commitment plan.\n\n### #plan=\n\n def plan=(value) -\u003e ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan](./Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment-CommitmentPlan)) --- Capacity commitment commitment plan. \n**Returns**\n\n- ([::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan](./Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment-CommitmentPlan)) --- Capacity commitment commitment plan.\n\n### #renewal_plan\n\n def renewal_plan() -\u003e ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan\n\n**Returns**\n\n- ([::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan](./Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment-CommitmentPlan)) --- The plan this capacity commitment is converted to after commitment_end_time passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for ANNUAL and TRIAL commitments.\n\n### #renewal_plan=\n\n def renewal_plan=(value) -\u003e ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan](./Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment-CommitmentPlan)) --- The plan this capacity commitment is converted to after commitment_end_time passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for ANNUAL and TRIAL commitments. \n**Returns**\n\n- ([::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan](./Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment-CommitmentPlan)) --- The plan this capacity commitment is converted to after commitment_end_time passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for ANNUAL and TRIAL commitments.\n\n### #slot_count\n\n def slot_count() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- Number of slots in this commitment.\n\n### #slot_count=\n\n def slot_count=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- Number of slots in this commitment. \n**Returns**\n\n- (::Integer) --- Number of slots in this commitment.\n\n### #state\n\n def state() -\u003e ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::State\n\n**Returns**\n\n- ([::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::State](./Google-Cloud-Bigquery-Reservation-V1-CapacityCommitment-State)) --- Output only. State of the commitment."]]