Google Cloud Notebooks V1 Client - Class Instance (0.7.5)

Reference documentation and code samples for the Google Cloud Notebooks V1 Client class Instance.

The definition of a notebook instance.

Generated from protobuf message google.cloud.notebooks.v1.Instance

Namespace

Google \ Cloud \ Notebooks \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

Output only. The name of this notebook instance. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

↳ vm_image Google\Cloud\Notebooks\V1\VmImage

Use a Compute Engine VM image to start the notebook instance.

↳ container_image Google\Cloud\Notebooks\V1\ContainerImage

Use a container image to start the notebook instance.

↳ post_startup_script string

Path to a Bash script that automatically runs after a notebook instance fully boots up. The path must be a URL or Cloud Storage path (gs://path-to-file/file-name).

↳ proxy_uri string

Output only. The proxy endpoint that is used to access the Jupyter notebook.

↳ instance_owners array

Input only. The owner of this instance after creation. Format: alias@example.com Currently supports one owner only. If not specified, all of the service account users of your VM instance's service account can use the instance.

↳ service_account string

The service account on this instance, giving access to other Google Cloud services. You can use any service account within the same project, but you must have the service account user permission to use the instance. If not specified, the Compute Engine default service account is used.

↳ service_account_scopes array

Optional. The URIs of service account scopes to be included in Compute Engine instances. If not specified, the following scopes are defined: - https://www.googleapis.com/auth/cloud-platform - https://www.googleapis.com/auth/userinfo.email If not using default scopes, you need at least: https://www.googleapis.com/auth/compute

↳ machine_type string

Required. The Compute Engine machine type of this instance.

↳ accelerator_config Google\Cloud\Notebooks\V1\Instance\AcceleratorConfig

The hardware accelerator used on this instance. If you use accelerators, make sure that your configuration has enough vCPUs and memory to support the machine_type you have selected.

↳ state int

Output only. The state of this instance.

↳ install_gpu_driver bool

Whether the end user authorizes Google Cloud to install GPU driver on this instance. If this field is empty or set to false, the GPU driver won't be installed. Only applicable to instances with GPUs.

↳ custom_gpu_driver_path string

Specify a custom Cloud Storage path where the GPU driver is stored. If not specified, we'll automatically choose from official GPU drivers.

↳ boot_disk_type int

Input only. The type of the boot disk attached to this instance, defaults to standard persistent disk (PD_STANDARD).

↳ boot_disk_size_gb int|string

Input only. The size of the boot disk in GB attached to this instance, up to a maximum of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not specified, this defaults to 100.

↳ data_disk_type int

Input only. The type of the data disk attached to this instance, defaults to standard persistent disk (PD_STANDARD).

↳ data_disk_size_gb int|string

Input only. The size of the data disk in GB attached to this instance, up to a maximum of 64000 GB (64 TB). You can choose the size of the data disk based on how big your notebooks and data are. If not specified, this defaults to 100.

↳ no_remove_data_disk bool

Input only. If true, the data disk will not be auto deleted when deleting the instance.

↳ disk_encryption int

Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.

↳ kms_key string

Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption is CMEK. Format: projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id} Learn more about using your own encryption keys.

↳ disks array<Google\Cloud\Notebooks\V1\Instance\Disk>

Output only. Attached disks to notebook instance.

↳ shielded_instance_config Google\Cloud\Notebooks\V1\Instance\ShieldedInstanceConfig

Optional. Shielded VM configuration. Images using supported Shielded VM features.

↳ no_public_ip bool

If true, no public IP will be assigned to this instance.

↳ no_proxy_access bool

If true, the notebook instance will not register with the proxy.

↳ network string

The name of the VPC that this instance is in. Format: projects/{project_id}/global/networks/{network_id}

↳ subnet string

The name of the subnet that this instance is in. Format: projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}

↳ labels array|Google\Protobuf\Internal\MapField

Labels to apply to this instance. These can be later modified by the setLabels method.

↳ metadata array|Google\Protobuf\Internal\MapField

Custom metadata to apply to this instance.

↳ tags array

Optional. The Compute Engine tags to add to runtime (see Tagging instances).

↳ upgrade_history array<Google\Cloud\Notebooks\V1\Instance\UpgradeHistoryEntry>

The upgrade history of this instance.

↳ nic_type int

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

↳ reservation_affinity Google\Cloud\Notebooks\V1\ReservationAffinity

Optional. The optional reservation affinity. Setting this field will apply the specified Zonal Compute Reservation to this notebook instance.

↳ creator string

Output only. Email address of entity that sent original CreateInstance request.

↳ can_ip_forward bool

Optional. Flag to enable ip forwarding or not, default false/off. https://cloud.google.com/vpc/docs/using-routes#canipforward

↳ create_time Google\Protobuf\Timestamp

Output only. Instance creation time.

↳ update_time Google\Protobuf\Timestamp

Output only. Instance update time.

getName

Output only. The name of this notebook instance. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

Returns
Type Description
string

setName

Output only. The name of this notebook instance. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

Parameter
Name Description
var string
Returns
Type Description
$this

getVmImage

Use a Compute Engine VM image to start the notebook instance.

Returns
Type Description
Google\Cloud\Notebooks\V1\VmImage|null

hasVmImage

setVmImage

Use a Compute Engine VM image to start the notebook instance.

Parameter
Name Description
var Google\Cloud\Notebooks\V1\VmImage
Returns
Type Description
$this

getContainerImage

Use a container image to start the notebook instance.

Returns
Type Description
Google\Cloud\Notebooks\V1\ContainerImage|null

hasContainerImage

setContainerImage

Use a container image to start the notebook instance.

Parameter
Name Description
var Google\Cloud\Notebooks\V1\ContainerImage
Returns
Type Description
$this

getPostStartupScript

Path to a Bash script that automatically runs after a notebook instance fully boots up. The path must be a URL or Cloud Storage path (gs://path-to-file/file-name).

Returns
Type Description
string

setPostStartupScript

Path to a Bash script that automatically runs after a notebook instance fully boots up. The path must be a URL or Cloud Storage path (gs://path-to-file/file-name).

Parameter
Name Description
var string
Returns
Type Description
$this

getProxyUri

Output only. The proxy endpoint that is used to access the Jupyter notebook.

Returns
Type Description
string

setProxyUri

Output only. The proxy endpoint that is used to access the Jupyter notebook.

Parameter
Name Description
var string
Returns
Type Description
$this

getInstanceOwners

Input only. The owner of this instance after creation. Format: alias@example.com Currently supports one owner only. If not specified, all of the service account users of your VM instance's service account can use the instance.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setInstanceOwners

Input only. The owner of this instance after creation. Format: alias@example.com Currently supports one owner only. If not specified, all of the service account users of your VM instance's service account can use the instance.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getServiceAccount

The service account on this instance, giving access to other Google Cloud services.

You can use any service account within the same project, but you must have the service account user permission to use the instance. If not specified, the Compute Engine default service account is used.

Returns
Type Description
string

setServiceAccount

The service account on this instance, giving access to other Google Cloud services.

You can use any service account within the same project, but you must have the service account user permission to use the instance. If not specified, the Compute Engine default service account is used.

Parameter
Name Description
var string
Returns
Type Description
$this

getServiceAccountScopes

Optional. The URIs of service account scopes to be included in Compute Engine instances.

If not specified, the following scopes are defined:

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setServiceAccountScopes

Optional. The URIs of service account scopes to be included in Compute Engine instances.

If not specified, the following scopes are defined:

Parameter
Name Description
var string[]
Returns
Type Description
$this

getMachineType

Required. The Compute Engine machine type of this instance.

Returns
Type Description
string

setMachineType

Required. The Compute Engine machine type of this instance.

Parameter
Name Description
var string
Returns
Type Description
$this

getAcceleratorConfig

The hardware accelerator used on this instance. If you use accelerators, make sure that your configuration has enough vCPUs and memory to support the machine_type you have selected.

Returns
Type Description
Google\Cloud\Notebooks\V1\Instance\AcceleratorConfig|null

hasAcceleratorConfig

clearAcceleratorConfig

setAcceleratorConfig

The hardware accelerator used on this instance. If you use accelerators, make sure that your configuration has enough vCPUs and memory to support the machine_type you have selected.

Parameter
Name Description
var Google\Cloud\Notebooks\V1\Instance\AcceleratorConfig
Returns
Type Description
$this

getState

Output only. The state of this instance.

Returns
Type Description
int

setState

Output only. The state of this instance.

Parameter
Name Description
var int
Returns
Type Description
$this

getInstallGpuDriver

Whether the end user authorizes Google Cloud to install GPU driver on this instance.

If this field is empty or set to false, the GPU driver won't be installed. Only applicable to instances with GPUs.

Returns
Type Description
bool

setInstallGpuDriver

Whether the end user authorizes Google Cloud to install GPU driver on this instance.

If this field is empty or set to false, the GPU driver won't be installed. Only applicable to instances with GPUs.

Parameter
Name Description
var bool
Returns
Type Description
$this

getCustomGpuDriverPath

Specify a custom Cloud Storage path where the GPU driver is stored.

If not specified, we'll automatically choose from official GPU drivers.

Returns
Type Description
string

setCustomGpuDriverPath

Specify a custom Cloud Storage path where the GPU driver is stored.

If not specified, we'll automatically choose from official GPU drivers.

Parameter
Name Description
var string
Returns
Type Description
$this

getBootDiskType

Input only. The type of the boot disk attached to this instance, defaults to standard persistent disk (PD_STANDARD).

Returns
Type Description
int

setBootDiskType

Input only. The type of the boot disk attached to this instance, defaults to standard persistent disk (PD_STANDARD).

Parameter
Name Description
var int
Returns
Type Description
$this

getBootDiskSizeGb

Input only. The size of the boot disk in GB attached to this instance, up to a maximum of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not specified, this defaults to 100.

Returns
Type Description
int|string

setBootDiskSizeGb

Input only. The size of the boot disk in GB attached to this instance, up to a maximum of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not specified, this defaults to 100.

Parameter
Name Description
var int|string
Returns
Type Description
$this

getDataDiskType

Input only. The type of the data disk attached to this instance, defaults to standard persistent disk (PD_STANDARD).

Returns
Type Description
int

setDataDiskType

Input only. The type of the data disk attached to this instance, defaults to standard persistent disk (PD_STANDARD).

Parameter
Name Description
var int
Returns
Type Description
$this

getDataDiskSizeGb

Input only. The size of the data disk in GB attached to this instance, up to a maximum of 64000 GB (64 TB). You can choose the size of the data disk based on how big your notebooks and data are. If not specified, this defaults to 100.

Returns
Type Description
int|string

setDataDiskSizeGb

Input only. The size of the data disk in GB attached to this instance, up to a maximum of 64000 GB (64 TB). You can choose the size of the data disk based on how big your notebooks and data are. If not specified, this defaults to 100.

Parameter
Name Description
var int|string
Returns
Type Description
$this

getNoRemoveDataDisk

Input only. If true, the data disk will not be auto deleted when deleting the instance.

Returns
Type Description
bool

setNoRemoveDataDisk

Input only. If true, the data disk will not be auto deleted when deleting the instance.

Parameter
Name Description
var bool
Returns
Type Description
$this

getDiskEncryption

Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.

Returns
Type Description
int

setDiskEncryption

Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.

Parameter
Name Description
var int
Returns
Type Description
$this

getKmsKey

Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption is CMEK.

Format: projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id} Learn more about using your own encryption keys.

Returns
Type Description
string

setKmsKey

Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption is CMEK.

Format: projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id} Learn more about using your own encryption keys.

Parameter
Name Description
var string
Returns
Type Description
$this

getDisks

Output only. Attached disks to notebook instance.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setDisks

Output only. Attached disks to notebook instance.

Parameter
Name Description
var array<Google\Cloud\Notebooks\V1\Instance\Disk>
Returns
Type Description
$this

getShieldedInstanceConfig

Optional. Shielded VM configuration.

Images using supported Shielded VM features.

Returns
Type Description
Google\Cloud\Notebooks\V1\Instance\ShieldedInstanceConfig|null

hasShieldedInstanceConfig

clearShieldedInstanceConfig

setShieldedInstanceConfig

Optional. Shielded VM configuration.

Images using supported Shielded VM features.

Parameter
Name Description
var Google\Cloud\Notebooks\V1\Instance\ShieldedInstanceConfig
Returns
Type Description
$this

getNoPublicIp

If true, no public IP will be assigned to this instance.

Returns
Type Description
bool

setNoPublicIp

If true, no public IP will be assigned to this instance.

Parameter
Name Description
var bool
Returns
Type Description
$this

getNoProxyAccess

If true, the notebook instance will not register with the proxy.

Returns
Type Description
bool

setNoProxyAccess

If true, the notebook instance will not register with the proxy.

Parameter
Name Description
var bool
Returns
Type Description
$this

getNetwork

The name of the VPC that this instance is in.

Format: projects/{project_id}/global/networks/{network_id}

Returns
Type Description
string

setNetwork

The name of the VPC that this instance is in.

Format: projects/{project_id}/global/networks/{network_id}

Parameter
Name Description
var string
Returns
Type Description
$this

getSubnet

The name of the subnet that this instance is in.

Format: projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}

Returns
Type Description
string

setSubnet

The name of the subnet that this instance is in.

Format: projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}

Parameter
Name Description
var string
Returns
Type Description
$this

getLabels

Labels to apply to this instance.

These can be later modified by the setLabels method.

Returns
Type Description
Google\Protobuf\Internal\MapField

setLabels

Labels to apply to this instance.

These can be later modified by the setLabels method.

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this

getMetadata

Custom metadata to apply to this instance.

Returns
Type Description
Google\Protobuf\Internal\MapField

setMetadata

Custom metadata to apply to this instance.

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this

getTags

Optional. The Compute Engine tags to add to runtime (see Tagging instances).

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setTags

Optional. The Compute Engine tags to add to runtime (see Tagging instances).

Parameter
Name Description
var string[]
Returns
Type Description
$this

getUpgradeHistory

The upgrade history of this instance.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setUpgradeHistory

The upgrade history of this instance.

Parameter
Name Description
var array<Google\Cloud\Notebooks\V1\Instance\UpgradeHistoryEntry>
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

setNicType

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

Parameter
Name Description
var int
Returns
Type Description
$this

getReservationAffinity

Optional. The optional reservation affinity. Setting this field will apply the specified Zonal Compute Reservation to this notebook instance.

Returns
Type Description
Google\Cloud\Notebooks\V1\ReservationAffinity|null

hasReservationAffinity

clearReservationAffinity

setReservationAffinity

Optional. The optional reservation affinity. Setting this field will apply the specified Zonal Compute Reservation to this notebook instance.

Parameter
Name Description
var Google\Cloud\Notebooks\V1\ReservationAffinity
Returns
Type Description
$this

getCreator

Output only. Email address of entity that sent original CreateInstance request.

Returns
Type Description
string

setCreator

Output only. Email address of entity that sent original CreateInstance request.

Parameter
Name Description
var string
Returns
Type Description
$this

getCanIpForward

Optional. Flag to enable ip forwarding or not, default false/off.

https://cloud.google.com/vpc/docs/using-routes#canipforward

Returns
Type Description
bool

setCanIpForward

Optional. Flag to enable ip forwarding or not, default false/off.

https://cloud.google.com/vpc/docs/using-routes#canipforward

Parameter
Name Description
var bool
Returns
Type Description
$this

getCreateTime

Output only. Instance creation time.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. Instance creation time.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getUpdateTime

Output only. Instance update time.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

Output only. Instance update time.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getEnvironment

Returns
Type Description
string