# Google Cloud Notebooks V1 Client - Class VirtualMachineConfig (1.1.3)

1.1.3 (latest) 1.1.2 1.0.5 0.7.5 0.6.2 0.5.0 0.4.1 0.3.6 Reference documentation and code samples for the Google Cloud Notebooks V1 Client class VirtualMachineConfig.

The config settings for virtual machine.

Generated from protobuf message `google.cloud.notebooks.v1.VirtualMachineConfig`

## Namespace

Google \\ Cloud \\ Notebooks \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ zone` | `string` Output only. The zone where the virtual machine is located. If using regional request, the notebooks service will pick a location in the corresponding runtime region. On a get request, zone will always be present. Example: \* \* `us-central1-b` |
| `↳ machine_type` | `string` Required. The Compute Engine machine type used for runtimes. Short name is valid. Examples: \* \* `n1-standard-2` \* \* `e2-standard-8` |
| `↳ container_images` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V1.ContainerImage>` Optional. Use a list of container images to use as Kernels in the notebook instance. |
| `↳ data_disk` | `https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V1.LocalDisk` Required. Data disk option configuration settings. |
| `↳ encryption_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V1.EncryptionConfig` Optional. Encryption settings for virtual machine data disk. |
| `↳ shielded_instance_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V1.RuntimeShieldedInstanceConfig` Optional. Shielded VM Instance configuration settings. |
| `↳ accelerator_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V1.RuntimeAcceleratorConfig` Optional. The Compute Engine accelerator configuration for this runtime. |
| `↳ network` | `string` Optional. The Compute Engine network to be used for machine communications. Cannot be specified with subnetwork. If neither `network` nor `subnet` is specified, the "default" network of the project is used, if it exists. A full URL or partial URI. Examples: \* \* `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` \* \* `projects/[project_id]/global/networks/default` Runtimes are managed resources inside Google Infrastructure. Runtimes support the following network configurations: \* \* Google Managed Network (Network \& subnet are empty) \* \* Consumer Project VPC (network \& subnet are required). Requires configuring Private Service Access. \* \* Shared VPC (network \& subnet are required). Requires configuring Private Service Access. |
| `↳ subnet` | `string` Optional. The Compute Engine subnetwork to be used for machine communications. Cannot be specified with network. A full URL or partial URI are valid. Examples: \* \* `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/subnetworks/sub0` \* \* `projects/[project_id]/regions/us-east1/subnetworks/sub0` |
| `↳ internal_ip_only` | `bool` Optional. If true, runtime will only have internal IP addresses. By default, runtimes are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each vm. This `internal_ip_only` restriction can only be enabled for subnetwork enabled networks, and all dependencies must be configured to be accessible without external IP addresses. |
| `↳ tags` | `string[]` Optional. The Compute Engine tags to add to runtime (see [Tagging instances](https://cloud.google.com/compute/docs/label-or-tag-resources#tags)). |
| `↳ guest_attributes` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Output only. The Compute Engine guest attributes. (see [Project and instance guest attributes](https://cloud.google.com/compute/docs/storing-retrieving-metadata#guest_attributes)). |
| `↳ metadata` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. The Compute Engine metadata entries to add to virtual machine. (see [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. The labels to associate with this runtime. Label **keys** must contain 1 to 63 characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). Label **values** may be empty, but, if present, must contain 1 to 63 characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster. |
| `↳ nic_type` | `int` Optional. The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. |
| `↳ reserved_ip_range` | `string` Optional. Reserved IP Range name is used for VPC Peering. The subnetwork allocation will use the range *name* if it's assigned. Example: managed-notebooks-range-c PEERING_RANGE_NAME_3=managed-notebooks-range-c gcloud compute addresses create $PEERING_RANGE_NAME_3 \\ --global \\ --prefix-length=24 \\ --description="Google Cloud Managed Notebooks Range 24 c" \\ --network=$NETWORK \\ --addresses=192.168.0.0 \\ --purpose=VPC_PEERING Field value will be: `managed-notebooks-range-c` |
| `↳ boot_image` | `https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V1.VirtualMachineConfig.BootImage` Optional. Boot image metadata used for runtime upgradeability. |

### getZone

Output only. The zone where the virtual machine is located.

If using regional request, the notebooks service will pick a location
in the corresponding runtime region.
On a get request, zone will always be present. Example:

- `us-central1-b`

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

### setZone

Output only. The zone where the virtual machine is located.

If using regional request, the notebooks service will pick a location
in the corresponding runtime region.
On a get request, zone will always be present. Example:

- `us-central1-b`

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

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

### getMachineType

Required. The Compute Engine machine type used for runtimes.

Short name is valid. Examples:

- `n1-standard-2`
- `e2-standard-8`

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

### setMachineType

Required. The Compute Engine machine type used for runtimes.

Short name is valid. Examples:

- `n1-standard-2`
- `e2-standard-8`

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

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

### getContainerImages

Optional. Use a list of container images to use as Kernels in the notebook instance.

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

### setContainerImages

Optional. Use a list of container images to use as Kernels in the notebook instance.

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

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

### getDataDisk

Required. Data disk option configuration settings.

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

### hasDataDisk

### clearDataDisk

### setDataDisk

Required. Data disk option configuration settings.

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

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

### getEncryptionConfig

Optional. Encryption settings for virtual machine data disk.

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

### hasEncryptionConfig

### clearEncryptionConfig

### setEncryptionConfig

Optional. Encryption settings for virtual machine data disk.

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

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

### getShieldedInstanceConfig

Optional. Shielded VM Instance configuration settings.

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

### hasShieldedInstanceConfig

### clearShieldedInstanceConfig

### setShieldedInstanceConfig

Optional. Shielded VM Instance configuration settings.

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

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

### getAcceleratorConfig

Optional. The Compute Engine accelerator configuration for this runtime.

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

### hasAcceleratorConfig

### clearAcceleratorConfig

### setAcceleratorConfig

Optional. The Compute Engine accelerator configuration for this runtime.

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

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

### getNetwork

Optional. The Compute Engine network to be used for machine
communications. Cannot be specified with subnetwork. If neither
`network` nor `subnet` is specified, the "default" network of
the project is used, if it exists.

A full URL or partial URI. Examples:

- `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default`
- `projects/[project_id]/global/networks/default` Runtimes are managed resources inside Google Infrastructure. Runtimes support the following network configurations:
- Google Managed Network (Network \& subnet are empty)
- Consumer Project VPC (network \& subnet are required). Requires configuring Private Service Access.
- Shared VPC (network \& subnet are required). Requires configuring Private Service Access.

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

### setNetwork

Optional. The Compute Engine network to be used for machine
communications. Cannot be specified with subnetwork. If neither
`network` nor `subnet` is specified, the "default" network of
the project is used, if it exists.

A full URL or partial URI. Examples:

- `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default`
- `projects/[project_id]/global/networks/default` Runtimes are managed resources inside Google Infrastructure. Runtimes support the following network configurations:
- Google Managed Network (Network \& subnet are empty)
- Consumer Project VPC (network \& subnet are required). Requires configuring Private Service Access.
- Shared VPC (network \& subnet are required). Requires configuring Private Service Access.

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

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

### getSubnet

Optional. The Compute Engine subnetwork to be used for machine
communications. Cannot be specified with network.

A full URL or partial URI are valid. Examples:

- `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/subnetworks/sub0`
- `projects/[project_id]/regions/us-east1/subnetworks/sub0`

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

### setSubnet

Optional. The Compute Engine subnetwork to be used for machine
communications. Cannot be specified with network.

A full URL or partial URI are valid. Examples:

- `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/subnetworks/sub0`
- `projects/[project_id]/regions/us-east1/subnetworks/sub0`

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

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

### getInternalIpOnly

Optional. If true, runtime will only have internal IP
addresses. By default, runtimes are not restricted to internal IP
addresses, and will have ephemeral external IP addresses assigned to each
vm. This `internal_ip_only` restriction can only be enabled for
subnetwork enabled networks, and all dependencies must be
configured to be accessible without external IP addresses.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setInternalIpOnly

Optional. If true, runtime will only have internal IP
addresses. By default, runtimes are not restricted to internal IP
addresses, and will have ephemeral external IP addresses assigned to each
vm. This `internal_ip_only` restriction can only be enabled for
subnetwork enabled networks, and all dependencies must be
configured to be accessible without external IP addresses.

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

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

### getTags

Optional. The Compute Engine tags to add to runtime (see [Tagging
instances](https://cloud.google.com/compute/docs/label-or-tag-resources#tags)).

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

### setTags

Optional. The Compute Engine tags to add to runtime (see [Tagging
instances](https://cloud.google.com/compute/docs/label-or-tag-resources#tags)).

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

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

### getGuestAttributes

Output only. The Compute Engine guest attributes. (see
[Project and instance
guest
attributes](https://cloud.google.com/compute/docs/storing-retrieving-metadata#guest_attributes)).

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

### setGuestAttributes

Output only. The Compute Engine guest attributes. (see
[Project and instance
guest
attributes](https://cloud.google.com/compute/docs/storing-retrieving-metadata#guest_attributes)).

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

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

### getMetadata

Optional. The Compute Engine metadata entries to add to virtual machine. (see
[Project and instance
metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).

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

### setMetadata

Optional. The Compute Engine metadata entries to add to virtual machine. (see
[Project and instance
metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).

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

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

### getLabels

Optional. The labels to associate with this runtime.

Label **keys** must contain 1 to 63 characters, and must conform to
[RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
Label **values** may be empty, but, if present, must contain 1 to 63
characters, and must conform to [RFC
1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
associated with a cluster.

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

### setLabels

Optional. The labels to associate with this runtime.

Label **keys** must contain 1 to 63 characters, and must conform to
[RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
Label **values** may be empty, but, if present, must contain 1 to 63
characters, and must conform to [RFC
1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
associated with a cluster.

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

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

### getNicType

Optional. The type of vNIC to be used on this interface. This may be gVNIC or
VirtioNet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [NicType](https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V1.VirtualMachineConfig.NicType). |

### setNicType

Optional. The type of vNIC to be used on this interface. This may be gVNIC or
VirtioNet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [NicType](https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V1.VirtualMachineConfig.NicType). |

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

### getReservedIpRange

Optional. Reserved IP Range name is used for VPC Peering.

The subnetwork allocation will use the range *name* if it's assigned.
Example: managed-notebooks-range-c
PEERING_RANGE_NAME_3=managed-notebooks-range-c
gcloud compute addresses create $PEERING_RANGE_NAME_3 \\
--global \\
--prefix-length=24 \\
--description="Google Cloud Managed Notebooks Range 24 c" \\
--network=$NETWORK \\
--addresses=192.168.0.0 \\
--purpose=VPC_PEERING
Field value will be: `managed-notebooks-range-c`

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

### setReservedIpRange

Optional. Reserved IP Range name is used for VPC Peering.

The subnetwork allocation will use the range *name* if it's assigned.
Example: managed-notebooks-range-c
PEERING_RANGE_NAME_3=managed-notebooks-range-c
gcloud compute addresses create $PEERING_RANGE_NAME_3 \\
--global \\
--prefix-length=24 \\
--description="Google Cloud Managed Notebooks Range 24 c" \\
--network=$NETWORK \\
--addresses=192.168.0.0 \\
--purpose=VPC_PEERING
Field value will be: `managed-notebooks-range-c`

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

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

### getBootImage

Optional. Boot image metadata used for runtime upgradeability.

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

### hasBootImage

### clearBootImage

### setBootImage

Optional. Boot image metadata used for runtime upgradeability.

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

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