Reference documentation and code samples for the Compute V1 Client class Commitment.
Represents a regional 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.
Generated from protobuf message google.cloud.compute.v1.Commitment
Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ auto_renew |
bool
Specifies whether to enable automatic renewal for the commitment. The default value is false if not specified. The field can be updated until the day of the commitment expiration at 12:00am PST. If the field is set to true, the commitment will be automatically renewed for either one or three years according to the terms of the existing commitment. |
↳ category |
string
The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. Check the Category enum for the list of possible values. |
↳ creation_timestamp |
string
[Output Only] Creation timestamp in RFC3339 text format. |
↳ description |
string
An optional description of this resource. Provide this property when you create the resource. |
↳ end_timestamp |
string
[Output Only] Commitment end time in RFC3339 text format. |
↳ id |
int|string
[Output Only] The unique identifier for the resource. This identifier is defined by the server. |
↳ kind |
string
[Output Only] Type of the resource. Always compute#commitment for commitments. |
↳ license_resource |
Google\Cloud\Compute\V1\LicenseResourceCommitment
The license specification required as part of a license commitment. |
↳ merge_source_commitments |
array
List of source commitments to be merged into a new commitment. |
↳ 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 |
↳ plan |
string
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). Check the Plan enum for the list of possible values. |
↳ region |
string
[Output Only] URL of the region where this commitment may be used. |
↳ reservations |
array<Google\Cloud\Compute\V1\Reservation>
List of reservations in this commitment. |
↳ resources |
array<Google\Cloud\Compute\V1\ResourceCommitment>
A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. |
↳ self_link |
string
[Output Only] Server-defined URL for the resource. |
↳ split_source_commitment |
string
Source commitment to be splitted into a new commitment. |
↳ start_timestamp |
string
[Output Only] Commitment start time in RFC3339 text format. |
↳ status |
string
[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. Check the Status enum for the list of possible values. |
↳ status_message |
string
[Output Only] An optional, human-readable explanation of the status. |
↳ type |
string
The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to accelerator optimized machines. Check the Type enum for the list of possible values. |
getAutoRenew
Specifies whether to enable automatic renewal for the commitment. The default value is false if not specified. The field can be updated until the day of the commitment expiration at 12:00am PST. If the field is set to true, the commitment will be automatically renewed for either one or three years according to the terms of the existing commitment.
Generated from protobuf field optional bool auto_renew = 495520765;
Returns | |
---|---|
Type | Description |
bool |
hasAutoRenew
clearAutoRenew
setAutoRenew
Specifies whether to enable automatic renewal for the commitment. The default value is false if not specified. The field can be updated until the day of the commitment expiration at 12:00am PST. If the field is set to true, the commitment will be automatically renewed for either one or three years according to the terms of the existing commitment.
Generated from protobuf field optional bool auto_renew = 495520765;
Parameter | |
---|---|
Name | Description |
var |
bool
|
Returns | |
---|---|
Type | Description |
$this |
getCategory
The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified.
Check the Category enum for the list of possible values.
Generated from protobuf field optional string category = 50511102;
Returns | |
---|---|
Type | Description |
string |
hasCategory
clearCategory
setCategory
The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified.
Check the Category enum for the list of possible values.
Generated from protobuf field optional string category = 50511102;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getCreationTimestamp
[Output Only] Creation timestamp in RFC3339 text format.
Generated from protobuf field optional string creation_timestamp = 30525366;
Returns | |
---|---|
Type | Description |
string |
hasCreationTimestamp
clearCreationTimestamp
setCreationTimestamp
[Output Only] Creation timestamp in RFC3339 text format.
Generated from protobuf field optional string creation_timestamp = 30525366;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getDescription
An optional description of this resource. Provide this property when you create the resource.
Generated from protobuf field optional string description = 422937596;
Returns | |
---|---|
Type | Description |
string |
hasDescription
clearDescription
setDescription
An optional description of this resource. Provide this property when you create the resource.
Generated from protobuf field optional string description = 422937596;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getEndTimestamp
[Output Only] Commitment end time in RFC3339 text format.
Generated from protobuf field optional string end_timestamp = 468096690;
Returns | |
---|---|
Type | Description |
string |
hasEndTimestamp
clearEndTimestamp
setEndTimestamp
[Output Only] Commitment end time in RFC3339 text format.
Generated from protobuf field optional string end_timestamp = 468096690;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getId
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
Generated from protobuf field optional uint64 id = 3355;
Returns | |
---|---|
Type | Description |
int|string |
hasId
clearId
setId
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
Generated from protobuf field optional uint64 id = 3355;
Parameter | |
---|---|
Name | Description |
var |
int|string
|
Returns | |
---|---|
Type | Description |
$this |
getKind
[Output Only] Type of the resource. Always compute#commitment for commitments.
Generated from protobuf field optional string kind = 3292052;
Returns | |
---|---|
Type | Description |
string |
hasKind
clearKind
setKind
[Output Only] Type of the resource. Always compute#commitment for commitments.
Generated from protobuf field optional string kind = 3292052;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getLicenseResource
The license specification required as part of a license commitment.
Generated from protobuf field optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
Returns | |
---|---|
Type | Description |
Google\Cloud\Compute\V1\LicenseResourceCommitment|null |
hasLicenseResource
clearLicenseResource
setLicenseResource
The license specification required as part of a license commitment.
Generated from protobuf field optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Compute\V1\LicenseResourceCommitment
|
Returns | |
---|---|
Type | Description |
$this |
getMergeSourceCommitments
List of source commitments to be merged into a new commitment.
Generated from protobuf field repeated string merge_source_commitments = 188093761;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setMergeSourceCommitments
List of source commitments to be merged into a new commitment.
Generated from protobuf field repeated string merge_source_commitments = 188093761;
Parameter | |
---|---|
Name | Description |
var |
string[]
|
Returns | |
---|---|
Type | Description |
$this |
getName
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.
Generated from protobuf field optional string name = 3373707;
Returns | |
---|---|
Type | Description |
string |
hasName
clearName
setName
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.
Generated from protobuf field optional string name = 3373707;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getPlan
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).
Check the Plan enum for the list of possible values.
Generated from protobuf field optional string plan = 3443497;
Returns | |
---|---|
Type | Description |
string |
hasPlan
clearPlan
setPlan
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).
Check the Plan enum for the list of possible values.
Generated from protobuf field optional string plan = 3443497;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getRegion
[Output Only] URL of the region where this commitment may be used.
Generated from protobuf field optional string region = 138946292;
Returns | |
---|---|
Type | Description |
string |
hasRegion
clearRegion
setRegion
[Output Only] URL of the region where this commitment may be used.
Generated from protobuf field optional string region = 138946292;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getReservations
List of reservations in this commitment.
Generated from protobuf field repeated .google.cloud.compute.v1.Reservation reservations = 399717927;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setReservations
List of reservations in this commitment.
Generated from protobuf field repeated .google.cloud.compute.v1.Reservation reservations = 399717927;
Parameter | |
---|---|
Name | Description |
var |
array<Google\Cloud\Compute\V1\Reservation>
|
Returns | |
---|---|
Type | Description |
$this |
getResources
A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
Generated from protobuf field repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setResources
A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
Generated from protobuf field repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;
Parameter | |
---|---|
Name | Description |
var |
array<Google\Cloud\Compute\V1\ResourceCommitment>
|
Returns | |
---|---|
Type | Description |
$this |
getSelfLink
[Output Only] Server-defined URL for the resource.
Generated from protobuf field optional string self_link = 456214797;
Returns | |
---|---|
Type | Description |
string |
hasSelfLink
clearSelfLink
setSelfLink
[Output Only] Server-defined URL for the resource.
Generated from protobuf field optional string self_link = 456214797;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getSplitSourceCommitment
Source commitment to be splitted into a new commitment.
Generated from protobuf field optional string split_source_commitment = 402611156;
Returns | |
---|---|
Type | Description |
string |
hasSplitSourceCommitment
clearSplitSourceCommitment
setSplitSourceCommitment
Source commitment to be splitted into a new commitment.
Generated from protobuf field optional string split_source_commitment = 402611156;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getStartTimestamp
[Output Only] Commitment start time in RFC3339 text format.
Generated from protobuf field optional string start_timestamp = 83645817;
Returns | |
---|---|
Type | Description |
string |
hasStartTimestamp
clearStartTimestamp
setStartTimestamp
[Output Only] Commitment start time in RFC3339 text format.
Generated from protobuf field optional string start_timestamp = 83645817;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getStatus
[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.
Check the Status enum for the list of possible values.
Generated from protobuf field optional string status = 181260274;
Returns | |
---|---|
Type | Description |
string |
hasStatus
clearStatus
setStatus
[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.
Check the Status enum for the list of possible values.
Generated from protobuf field optional string status = 181260274;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getStatusMessage
[Output Only] An optional, human-readable explanation of the status.
Generated from protobuf field optional string status_message = 297428154;
Returns | |
---|---|
Type | Description |
string |
hasStatusMessage
clearStatusMessage
setStatusMessage
[Output Only] An optional, human-readable explanation of the status.
Generated from protobuf field optional string status_message = 297428154;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getType
The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to accelerator optimized machines.
Check the Type enum for the list of possible values.
Generated from protobuf field optional string type = 3575610;
Returns | |
---|---|
Type | Description |
string |
hasType
clearType
setType
The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to accelerator optimized machines.
Check the Type enum for the list of possible values.
Generated from protobuf field optional string type = 3575610;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |