Google Cloud Notebooks V1 Client - Class Instance (0.4.1)

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
NameDescription
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
TypeDescription
string

setName

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getVmImage

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

Returns
TypeDescription
Google\Cloud\Notebooks\V1\VmImage|null

hasVmImage

setVmImage

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

Parameter
NameDescription
var Google\Cloud\Notebooks\V1\VmImage
Returns
TypeDescription
$this

getContainerImage

Use a container image to start the notebook instance.

Returns
TypeDescription
Google\Cloud\Notebooks\V1\ContainerImage|null

hasContainerImage

setContainerImage

Use a container image to start the notebook instance.

Parameter
NameDescription
var Google\Cloud\Notebooks\V1\ContainerImage
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getProxyUri

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

Returns
TypeDescription
string

setProxyUri

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

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string[]
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string[]
Returns
TypeDescription
$this

getMachineType

Required. The Compute Engine machine type of this instance.

Returns
TypeDescription
string

setMachineType

Required. The Compute Engine machine type of this instance.

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Cloud\Notebooks\V1\Instance\AcceleratorConfig
Returns
TypeDescription
$this

getState

Output only. The state of this instance.

Returns
TypeDescription
int

setState

Output only. The state of this instance.

Parameter
NameDescription
var int
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var bool
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getBootDiskType

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

Returns
TypeDescription
int

setBootDiskType

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

Parameter
NameDescription
var int
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var int|string
Returns
TypeDescription
$this

getDataDiskType

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

Returns
TypeDescription
int

setDataDiskType

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

Parameter
NameDescription
var int
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var int|string
Returns
TypeDescription
$this

getNoRemoveDataDisk

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

Returns
TypeDescription
bool

setNoRemoveDataDisk

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

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getDiskEncryption

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

Returns
TypeDescription
int

setDiskEncryption

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

Parameter
NameDescription
var int
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getDisks

Output only. Attached disks to notebook instance.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setDisks

Output only. Attached disks to notebook instance.

Parameter
NameDescription
var array<Google\Cloud\Notebooks\V1\Instance\Disk>
Returns
TypeDescription
$this

getShieldedInstanceConfig

Optional. Shielded VM configuration.

Images using supported Shielded VM features.

Returns
TypeDescription
Google\Cloud\Notebooks\V1\Instance\ShieldedInstanceConfig|null

hasShieldedInstanceConfig

clearShieldedInstanceConfig

setShieldedInstanceConfig

Optional. Shielded VM configuration.

Images using supported Shielded VM features.

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

getNoPublicIp

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

Returns
TypeDescription
bool

setNoPublicIp

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

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getNoProxyAccess

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

Returns
TypeDescription
bool

setNoProxyAccess

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

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getNetwork

The name of the VPC that this instance is in.

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

Returns
TypeDescription
string

setNetwork

The name of the VPC that this instance is in.

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getSubnet

The name of the subnet that this instance is in.

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

Returns
TypeDescription
string

setSubnet

The name of the subnet that this instance is in.

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getLabels

Labels to apply to this instance.

These can be later modified by the setLabels method.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setLabels

Labels to apply to this instance.

These can be later modified by the setLabels method.

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

getMetadata

Custom metadata to apply to this instance.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setMetadata

Custom metadata to apply to this instance.

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

getTags

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

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setTags

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

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getUpgradeHistory

The upgrade history of this instance.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setUpgradeHistory

The upgrade history of this instance.

Parameter
NameDescription
var array<Google\Cloud\Notebooks\V1\Instance\UpgradeHistoryEntry>
Returns
TypeDescription
$this

getNicType

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

Returns
TypeDescription
int

setNicType

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

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getReservationAffinity

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

Returns
TypeDescription
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
NameDescription
var Google\Cloud\Notebooks\V1\ReservationAffinity
Returns
TypeDescription
$this

getCreator

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

Returns
TypeDescription
string

setCreator

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getCanIpForward

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

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

Returns
TypeDescription
bool

setCanIpForward

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

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

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getCreateTime

Output only. Instance creation time.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. Instance creation time.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getUpdateTime

Output only. Instance update time.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

Output only. Instance update time.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getEnvironment

Returns
TypeDescription
string