# Compute V1 Client - Class InstanceProperties (2.10.0)

2.10.0 (latest) 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.0.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.1 1.21.0 1.20.0 1.19.0 1.18.1 1.17.0 1.16.2 1.14.0 1.13.0 1.12.1 1.11.1 1.10.1 1.9.1 1.8.3 1.7.1 1.6.1 1.5.0 Reference documentation and code samples for the Compute V1 Client class InstanceProperties.

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

## Namespace

Google \\ Cloud \\ Compute \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ advanced_machine_features` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/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 tofalse. See theEnable IP forwarding documentation for more information. |
| `↳ confidential_instance_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/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<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AttachedDisk>` An array of disks that are associated with the instances that are created from these properties. |
| `↳ guest_accelerators` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/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|https://protobuf.dev/reference/php/api-docs/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. This field only accepts a machine type name, for example `n2-standard-4`. If you use the machine type full or partial URL, for example `projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`, the request will result in an `INTERNAL_ERROR`. |
| `↳ metadata` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/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. SeeProject 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 asminCpuPlatform: "Intel Haswell" orminCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. |
| `↳ network_interfaces` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.NetworkInterface>` An array of network access configurations for this interface. |
| `↳ network_performance_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/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` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ReservationAffinity` Specifies the reservations that instances can consume from. Note that for MachineImage, this is not supported yet. |
| `↳ resource_manager_tags` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Input only. Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys and values can be either in numeric format, such as `tagKeys/{tag_key_id}` and `tagValues/{tag_value_id}` or in namespaced format such as `{org_id|project_id}/{tag_key_short_name}` and `{tag_value_short_name}`. The field is ignored (both PUT \& PATCH) when empty. |
| `↳ resource_policies` | `string[]` Resource policies (names, not URLs) applied to instances created from these properties. Note that for MachineImage, this is not supported yet. |
| `↳ scheduling` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Scheduling` Specifies the scheduling options for the instances that are created from these properties. |
| `↳ service_accounts` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/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` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ShieldedInstanceConfig` Note that for MachineImage, this is not supported yet. |
| `↳ tags` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/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. |
| `↳ workload_identity_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.WorkloadIdentityConfig` |

### getAdvancedMachineFeatures

Controls for advanced machine-related behavior features.

Note that for MachineImage, this is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AdvancedMachineFeatures|null` |   |

### hasAdvancedMachineFeatures

### clearAdvancedMachineFeatures

### setAdvancedMachineFeatures

Controls for advanced machine-related behavior features.

Note that for MachineImage, this is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AdvancedMachineFeatures` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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 tofalse. See theEnable IP forwarding
documentation for more information.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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 tofalse. See theEnable IP forwarding
documentation for more information.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConfidentialInstanceConfig

Specifies the Confidential Instance options.

Note that for MachineImage, this is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ConfidentialInstanceConfig|null` |   |

### hasConfidentialInstanceConfig

### clearConfidentialInstanceConfig

### setConfidentialInstanceConfig

Specifies the Confidential Instance options.

Note that for MachineImage, this is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ConfidentialInstanceConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDescription

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasDescription

### clearDescription

### setDescription

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisks

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AttachedDisk>` |   |

### setDisks

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AttachedDisk>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGuestAccelerators

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AcceleratorConfig>` |   |

### setGuestAccelerators

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AcceleratorConfig>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabels

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMachineType

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

This field only accepts a machine type name, for example `n2-standard-4`.
If you use the machine type full or partial URL, for example
`projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`,
the request will result in an `INTERNAL_ERROR`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasMachineType

### clearMachineType

### setMachineType

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

This field only accepts a machine type name, for example `n2-standard-4`.
If you use the machine type full or partial URL, for example
`projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`,
the request will result in an `INTERNAL_ERROR`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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. SeeProject and
instance metadata for more information.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/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. SeeProject and
instance metadata for more information.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Metadata` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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 asminCpuPlatform: "Intel Haswell" orminCpuPlatform: "Intel Sandy Bridge". For more
information, read Specifying a
Minimum CPU Platform.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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 asminCpuPlatform: "Intel Haswell" orminCpuPlatform: "Intel Sandy Bridge". For more
information, read Specifying a
Minimum CPU Platform.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNetworkInterfaces

An array of network access configurations for this interface.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.NetworkInterface>` |   |

### setNetworkInterfaces

An array of network access configurations for this interface.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.NetworkInterface>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNetworkPerformanceConfig

Note that for MachineImage, this is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.NetworkPerformanceConfig|null` |   |

### hasNetworkPerformanceConfig

### clearNetworkPerformanceConfig

### setNetworkPerformanceConfig

Note that for MachineImage, this is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.NetworkPerformanceConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReservationAffinity

Specifies the reservations that instances can consume from.

Note that for MachineImage, this is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ReservationAffinity|null` |   |

### hasReservationAffinity

### clearReservationAffinity

### setReservationAffinity

Specifies the reservations that instances can consume from.

Note that for MachineImage, this is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ReservationAffinity` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourceManagerTags

Input only. Resource manager tags to be bound to the instance. Tag keys and values
have the same definition as resource
manager tags. Keys and values can be either in numeric format,
such as `tagKeys/{tag_key_id}` and `tagValues/{tag_value_id}` or in
namespaced format such as `{org_id|project_id}/{tag_key_short_name}` and
`{tag_value_short_name}`. The field is ignored (both PUT \&
PATCH) when empty.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setResourceManagerTags

Input only. Resource manager tags to be bound to the instance. Tag keys and values
have the same definition as resource
manager tags. Keys and values can be either in numeric format,
such as `tagKeys/{tag_key_id}` and `tagValues/{tag_value_id}` or in
namespaced format such as `{org_id|project_id}/{tag_key_short_name}` and
`{tag_value_short_name}`. The field is ignored (both PUT \&
PATCH) when empty.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourcePolicies

Resource policies (names, not URLs) applied to instances created from
these properties.

Note that for MachineImage, this is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setResourcePolicies

Resource policies (names, not URLs) applied to instances created from
these properties.

Note that for MachineImage, this is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getScheduling

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Scheduling|null` |   |

### hasScheduling

### clearScheduling

### setScheduling

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Scheduling` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ServiceAccount>` |   |

### 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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ServiceAccount>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getShieldedInstanceConfig

Note that for MachineImage, this is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ShieldedInstanceConfig|null` |   |

### hasShieldedInstanceConfig

### clearShieldedInstanceConfig

### setShieldedInstanceConfig

Note that for MachineImage, this is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ShieldedInstanceConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Tags` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getWorkloadIdentityConfig

Generated from protobuf field `optional .google.cloud.compute.v1.WorkloadIdentityConfig workload_identity_config = 338198811;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.WorkloadIdentityConfig|null` |   |

### hasWorkloadIdentityConfig

### clearWorkloadIdentityConfig

### setWorkloadIdentityConfig

Generated from protobuf field `optional .google.cloud.compute.v1.WorkloadIdentityConfig workload_identity_config = 338198811;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.WorkloadIdentityConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |