Compute V1 Client - Class ResourceCommitment (1.11.1)

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

Namespace

Google \ Cloud \ Compute \ V1

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, MEMORY, LOCAL_SSD, and ACCELERATOR. Check the Type enum for the list of possible values.

getAcceleratorType

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

Returns
TypeDescription
string

hasAcceleratorType

clearAcceleratorType

setAcceleratorType

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

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.

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.

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getType

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

Check the Type enum for the list of possible values.

Returns
TypeDescription
string

hasType

clearType

setType

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

Check the Type enum for the list of possible values.

Parameter
NameDescription
var string
Returns
TypeDescription
$this