Method: regionCommitments.get

Returns the specified commitment resource. Gets a list of available commitments by making a list() request.

HTTP request

GET https://www.googleapis.com/compute/beta/projects/{project}/regions/{region}/commitments/{resourceId}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

region

string

Name of the region for this request.

resourceId

string

Name of the commitment to return.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. Committed use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts.

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "region": string,
  "selfLink": string,
  "status": enum,
  "statusMessage": string,
  "plan": enum,
  "startTimestamp": string,
  "endTimestamp": string,
  "resources": [
    {
      "type": enum,
      "amount": string,
      "acceleratorType": string
    }
  ],
  "reservations": [
    {
      "id": string,
      "creationTimestamp": string,
      "selfLink": string,
      "zone": string,
      "description": string,
      "name": string,
      "specificReservation": {
        "instanceProperties": {
          "machineType": string,
          "guestAccelerators": [
            {
              "acceleratorType": string,
              "acceleratorCount": number
            }
          ],
          "minCpuPlatform": string,
          "localSsds": [
            {
              "diskSizeGb": string,
              "interface": enum
            }
          ]
        },
        "count": string,
        "inUseCount": string
      },
      "commitment": string,
      "specificReservationRequired": boolean,
      "kind": string
    }
  ],
  "kind": string
}
Fields
id

string (fixed64 format)

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

creationTimestamp

string

[Output Only] Creation timestamp in RFC3339 text format.

name

string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

description

string

An optional description of this resource. Provide this property when you create the resource.

region

string

[Output Only] URL of the region where this commitment may be used.

status

enum

[Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.

statusMessage

string

[Output Only] An optional, human-readable explanation of the status.

plan

enum

The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).

startTimestamp

string

[Output Only] Commitment start time in RFC3339 text format.

endTimestamp

string

[Output Only] Commitment end time in RFC3339 text format.

resources[]

object

A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.

resources[].type

enum

Type of resource for which this commitment applies. Possible values are VCPU and MEMORY

resources[].amount

string (int64 format)

The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.

resources[].acceleratorType

string

Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.

reservations[]

object

globalOperations.list of reservations for this commitment.

reservations[].id

string (fixed64 format)

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

reservations[].creationTimestamp

string

[Output Only] Creation timestamp in RFC3339 text format.

reservations[].selfLink

string

[Output Only] Server-defined fully-qualified URL for this resource.

reservations[].zone

string

Zone in which the reservation resides, must be provided if reservation is created with commitment creation.

reservations[].description

string

An optional description of this resource. Provide this property when you create the resource.

reservations[].name

string

The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

reservations[].specificReservation

object

Reservation for instances with specific machine shapes.

reservations[].specificReservation.instanceProperties

object

The instance properties for this specific sku reservation.

reservations[].specificReservation.instanceProperties.machineType

string

Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.

reservations[].specificReservation.instanceProperties.guestAccelerators[]

object

Specifies accelerator type and count.

reservations[].specificReservation.instanceProperties.guestAccelerators[].acceleratorType

string

Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.

reservations[].specificReservation.instanceProperties.guestAccelerators[].acceleratorCount

number

The number of the guest accelerator cards exposed to this instance.

reservations[].specificReservation.instanceProperties.minCpuPlatform

string

Minimum cpu platform the reservation.

reservations[].specificReservation.instanceProperties.localSsds[]

object

Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.

reservations[].specificReservation.instanceProperties.localSsds[].diskSizeGb

string (int64 format)

Specifies the size of the disk in base-2 GB.

reservations[].specificReservation.instanceProperties.localSsds[].interface

enum

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.

reservations[].specificReservation.count

string (int64 format)

Specifies number of resources that are allocated.

reservations[].specificReservation.inUseCount

string (int64 format)

[OutputOnly] Indicates how many resource are in use.

reservations[].commitment

string

[OutputOnly] Full or partial url for parent commitment for reservations which are tied to a commitment.

reservations[].specificReservationRequired

boolean

Indicates whether the reservation can be consumed by VMs with "any reservation" defined. If the field is set, then only VMs that target the reservation by name using --reservation-affinity can consume this reservation.

reservations[].kind

string

[Output Only] Type of the resource. Always compute#reservations for reservations.

kind

string

[Output Only] Type of the resource. Always compute#commitment for commitments.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/compute
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

In addition to any permissions specified on the fields above, authorization requires one or more of the following Google IAM permissions:

  • compute.commitments.get

To find predefined roles that contain those permissions, see Compute Engine IAM Roles.

Was this page helpful? Let us know how we did:

Send feedback about...

Compute Engine