Compute V1 Client - Class InstanceProperties (1.5.0)

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

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

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ advanced_machine_features Google\Cloud\Compute\V1\AdvancedMachineFeatures

Controls for advanced machine-related behavior features. Note that for MachineImage, this is not supported yet.

↳ can_ip_forward bool

Enables instances created based on these properties to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information.

↳ confidential_instance_config Google\Cloud\Compute\V1\ConfidentialInstanceConfig

Specifies the Confidential Instance options. Note that for MachineImage, this is not supported yet.

↳ description string

An optional text description for the instances that are created from these properties.

↳ disks array<Google\Cloud\Compute\V1\AttachedDisk>

An array of disks that are associated with the instances that are created from these properties.

↳ guest_accelerators array<Google\Cloud\Compute\V1\AcceleratorConfig>

A list of guest accelerator cards' type and count to use for instances created from these properties.

↳ key_revocation_action_type string

KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. Check the KeyRevocationActionType enum for the list of possible values.

↳ labels array|Google\Protobuf\Internal\MapField

Labels to apply to instances that are created from these properties.

↳ machine_type string

The machine type to use for instances that are created from these properties.

↳ metadata Google\Cloud\Compute\V1\Metadata

The metadata key/value pairs to assign to instances that are created from these properties. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information.

↳ min_cpu_platform string

Minimum cpu/platform to be used by instances. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform.

↳ network_interfaces array<Google\Cloud\Compute\V1\NetworkInterface>

An array of network access configurations for this interface.

↳ network_performance_config Google\Cloud\Compute\V1\NetworkPerformanceConfig

Note that for MachineImage, this is not supported yet.

↳ private_ipv6_google_access string

The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. Note that for MachineImage, this is not supported yet. Check the PrivateIpv6GoogleAccess enum for the list of possible values.

↳ reservation_affinity Google\Cloud\Compute\V1\ReservationAffinity

Specifies the reservations that instances can consume from. Note that for MachineImage, this is not supported yet.

↳ resource_manager_tags array|Google\Protobuf\Internal\MapField

Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored (both PUT & PATCH) when empty.

↳ resource_policies array

Resource policies (names, not URLs) applied to instances created from these properties. Note that for MachineImage, this is not supported yet.

↳ scheduling Google\Cloud\Compute\V1\Scheduling

Specifies the scheduling options for the instances that are created from these properties.

↳ service_accounts array<Google\Cloud\Compute\V1\ServiceAccount>

A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from these properties. Use metadata queries to obtain the access tokens for these instances.

↳ shielded_instance_config Google\Cloud\Compute\V1\ShieldedInstanceConfig

Note that for MachineImage, this is not supported yet.

↳ tags Google\Cloud\Compute\V1\Tags

A list of tags to apply to the instances that are created from these properties. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035.

getAdvancedMachineFeatures

Controls for advanced machine-related behavior features. Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.AdvancedMachineFeatures advanced_machine_features = 409646002;

Returns
TypeDescription
Google\Cloud\Compute\V1\AdvancedMachineFeatures|null

hasAdvancedMachineFeatures

clearAdvancedMachineFeatures

setAdvancedMachineFeatures

Controls for advanced machine-related behavior features. Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.AdvancedMachineFeatures advanced_machine_features = 409646002;

Parameter
NameDescription
var Google\Cloud\Compute\V1\AdvancedMachineFeatures
Returns
TypeDescription
$this

getCanIpForward

Enables instances created based on these properties to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information.

Generated from protobuf field optional bool can_ip_forward = 467731324;

Returns
TypeDescription
bool

hasCanIpForward

clearCanIpForward

setCanIpForward

Enables instances created based on these properties to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information.

Generated from protobuf field optional bool can_ip_forward = 467731324;

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getConfidentialInstanceConfig

Specifies the Confidential Instance options. Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.ConfidentialInstanceConfig confidential_instance_config = 490637685;

Returns
TypeDescription
Google\Cloud\Compute\V1\ConfidentialInstanceConfig|null

hasConfidentialInstanceConfig

clearConfidentialInstanceConfig

setConfidentialInstanceConfig

Specifies the Confidential Instance options. Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.ConfidentialInstanceConfig confidential_instance_config = 490637685;

Parameter
NameDescription
var Google\Cloud\Compute\V1\ConfidentialInstanceConfig
Returns
TypeDescription
$this

getDescription

An optional text description for the instances that are created from these properties.

Generated from protobuf field optional string description = 422937596;

Returns
TypeDescription
string

hasDescription

clearDescription

setDescription

An optional text description for the instances that are created from these properties.

Generated from protobuf field optional string description = 422937596;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDisks

An array of disks that are associated with the instances that are created from these properties.

Generated from protobuf field repeated .google.cloud.compute.v1.AttachedDisk disks = 95594102;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setDisks

An array of disks that are associated with the instances that are created from these properties.

Generated from protobuf field repeated .google.cloud.compute.v1.AttachedDisk disks = 95594102;

Parameter
NameDescription
var array<Google\Cloud\Compute\V1\AttachedDisk>
Returns
TypeDescription
$this

getGuestAccelerators

A list of guest accelerator cards' type and count to use for instances created from these properties.

Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setGuestAccelerators

A list of guest accelerator cards' type and count to use for instances created from these properties.

Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119;

Parameter
NameDescription
var array<Google\Cloud\Compute\V1\AcceleratorConfig>
Returns
TypeDescription
$this

getKeyRevocationActionType

KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified.

Check the KeyRevocationActionType enum for the list of possible values.

Generated from protobuf field optional string key_revocation_action_type = 235941474;

Returns
TypeDescription
string

hasKeyRevocationActionType

clearKeyRevocationActionType

setKeyRevocationActionType

KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified.

Check the KeyRevocationActionType enum for the list of possible values.

Generated from protobuf field optional string key_revocation_action_type = 235941474;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getLabels

Labels to apply to instances that are created from these properties.

Generated from protobuf field map<string, string> labels = 500195327;

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setLabels

Labels to apply to instances that are created from these properties.

Generated from protobuf field map<string, string> labels = 500195327;

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getMachineType

The machine type to use for instances that are created from these properties.

Generated from protobuf field optional string machine_type = 227711026;

Returns
TypeDescription
string

hasMachineType

clearMachineType

setMachineType

The machine type to use for instances that are created from these properties.

Generated from protobuf field optional string machine_type = 227711026;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getMetadata

The metadata key/value pairs to assign to instances that are created from these properties. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information.

Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735;

Returns
TypeDescription
Google\Cloud\Compute\V1\Metadata|null

hasMetadata

clearMetadata

setMetadata

The metadata key/value pairs to assign to instances that are created from these properties. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information.

Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735;

Parameter
NameDescription
var Google\Cloud\Compute\V1\Metadata
Returns
TypeDescription
$this

getMinCpuPlatform

Minimum cpu/platform to be used by instances. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform.

Generated from protobuf field optional string min_cpu_platform = 242912759;

Returns
TypeDescription
string

hasMinCpuPlatform

clearMinCpuPlatform

setMinCpuPlatform

Minimum cpu/platform to be used by instances. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform.

Generated from protobuf field optional string min_cpu_platform = 242912759;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getNetworkInterfaces

An array of network access configurations for this interface.

Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setNetworkInterfaces

An array of network access configurations for this interface.

Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243;

Parameter
NameDescription
var array<Google\Cloud\Compute\V1\NetworkInterface>
Returns
TypeDescription
$this

getNetworkPerformanceConfig

Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.NetworkPerformanceConfig network_performance_config = 398330850;

Returns
TypeDescription
Google\Cloud\Compute\V1\NetworkPerformanceConfig|null

hasNetworkPerformanceConfig

clearNetworkPerformanceConfig

setNetworkPerformanceConfig

Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.NetworkPerformanceConfig network_performance_config = 398330850;

Parameter
NameDescription
var Google\Cloud\Compute\V1\NetworkPerformanceConfig
Returns
TypeDescription
$this

getPrivateIpv6GoogleAccess

The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. Note that for MachineImage, this is not supported yet.

Check the PrivateIpv6GoogleAccess enum for the list of possible values.

Generated from protobuf field optional string private_ipv6_google_access = 48277006;

Returns
TypeDescription
string

hasPrivateIpv6GoogleAccess

clearPrivateIpv6GoogleAccess

setPrivateIpv6GoogleAccess

The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. Note that for MachineImage, this is not supported yet.

Check the PrivateIpv6GoogleAccess enum for the list of possible values.

Generated from protobuf field optional string private_ipv6_google_access = 48277006;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getReservationAffinity

Specifies the reservations that instances can consume from. Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.ReservationAffinity reservation_affinity = 157850683;

Returns
TypeDescription
Google\Cloud\Compute\V1\ReservationAffinity|null

hasReservationAffinity

clearReservationAffinity

setReservationAffinity

Specifies the reservations that instances can consume from. Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.ReservationAffinity reservation_affinity = 157850683;

Parameter
NameDescription
var Google\Cloud\Compute\V1\ReservationAffinity
Returns
TypeDescription
$this

getResourceManagerTags

Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored (both PUT & PATCH) when empty.

Generated from protobuf field map<string, string> resource_manager_tags = 377671164;

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setResourceManagerTags

Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored (both PUT & PATCH) when empty.

Generated from protobuf field map<string, string> resource_manager_tags = 377671164;

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getResourcePolicies

Resource policies (names, not URLs) applied to instances created from these properties. Note that for MachineImage, this is not supported yet.

Generated from protobuf field repeated string resource_policies = 22220385;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setResourcePolicies

Resource policies (names, not URLs) applied to instances created from these properties. Note that for MachineImage, this is not supported yet.

Generated from protobuf field repeated string resource_policies = 22220385;

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getScheduling

Specifies the scheduling options for the instances that are created from these properties.

Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404;

Returns
TypeDescription
Google\Cloud\Compute\V1\Scheduling|null

hasScheduling

clearScheduling

setScheduling

Specifies the scheduling options for the instances that are created from these properties.

Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404;

Parameter
NameDescription
var Google\Cloud\Compute\V1\Scheduling
Returns
TypeDescription
$this

getServiceAccounts

A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from these properties. Use metadata queries to obtain the access tokens for these instances.

Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setServiceAccounts

A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from these properties. Use metadata queries to obtain the access tokens for these instances.

Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328;

Parameter
NameDescription
var array<Google\Cloud\Compute\V1\ServiceAccount>
Returns
TypeDescription
$this

getShieldedInstanceConfig

Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config = 12862901;

Returns
TypeDescription
Google\Cloud\Compute\V1\ShieldedInstanceConfig|null

hasShieldedInstanceConfig

clearShieldedInstanceConfig

setShieldedInstanceConfig

Note that for MachineImage, this is not supported yet.

Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config = 12862901;

Parameter
NameDescription
var Google\Cloud\Compute\V1\ShieldedInstanceConfig
Returns
TypeDescription
$this

getTags

A list of tags to apply to the instances that are created from these properties. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035.

Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281;

Returns
TypeDescription
Google\Cloud\Compute\V1\Tags|null

hasTags

clearTags

setTags

A list of tags to apply to the instances that are created from these properties. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035.

Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281;

Parameter
NameDescription
var Google\Cloud\Compute\V1\Tags
Returns
TypeDescription
$this