Compute V1 Client - Class ResourceCommitment (1.5.0)

Reference documentation and code samples for the Compute V1 Client class ResourceCommitment.

Commitment for a particular resource (a Commitment is composed of one or more of these).

Generated from protobuf message google.cloud.compute.v1.ResourceCommitment

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ accelerator_type string

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

↳ amount int|string

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.

↳ type string

Type of resource for which this commitment applies. Possible values are VCPU and MEMORY Check the Type enum for the list of possible values.

getAcceleratorType

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

Generated from protobuf field optional string accelerator_type = 138031246;

Returns
TypeDescription
string

hasAcceleratorType

clearAcceleratorType

setAcceleratorType

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

Generated from protobuf field optional string accelerator_type = 138031246;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getAmount

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.

Generated from protobuf field optional int64 amount = 196759640;

Returns
TypeDescription
int|string

hasAmount

clearAmount

setAmount

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.

Generated from protobuf field optional int64 amount = 196759640;

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getType

Type of resource for which this commitment applies. Possible values are VCPU and MEMORY Check the Type enum for the list of possible values.

Generated from protobuf field optional string type = 3575610;

Returns
TypeDescription
string

hasType

clearType

setType

Type of resource for which this commitment applies. Possible values are VCPU and MEMORY Check the Type enum for the list of possible values.

Generated from protobuf field optional string type = 3575610;

Parameter
NameDescription
var string
Returns
TypeDescription
$this