Skip to main content

instances

Creates, updates, deletes, gets or lists an instances resource.

Overview

Nameinstances
TypeResource
Idgoogle.notebooks.instances

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstringOutput only. Unique ID of the resource.
namestringOutput only. The name of this notebook instance. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
createTimestring (google-datetime)Output only. Instance creation time.
creatorstringOutput only. Email address of entity that sent original CreateInstance request.
disableProxyAccessbooleanOptional. If true, the notebook instance will not register with the proxy.
enableDeletionProtectionbooleanOptional. If true, deletion protection will be enabled for this Workbench Instance. If false, deletion protection will be disabled for this Workbench Instance.
enableManagedEucbooleanOptional. Flag to enable managed end user credentials for the instance.
enableThirdPartyIdentitybooleanOptional. Flag that specifies that a notebook can be accessed with third party identity provider.
gceSetupobjectOptional. Compute Engine setup for the notebook. Uses notebook-defined fields. (id: GceSetup)
healthInfoobjectOutput only. Additional information about instance health. Example: healthInfo": { "docker_proxy_agent_status": "1", "docker_status": "1", "jupyterlab_api_status": "-1", "jupyterlab_status": "-1", "updated": "2020-10-18 09:40:03.573409" }
healthStatestringOutput only. Instance health_state.
instanceOwnersarrayOptional. 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.
labelsobjectOptional. Labels to apply to this instance. These can be later modified by the UpdateInstance method.
proxyUristringOutput only. The proxy endpoint that is used to access the Jupyter notebook.
satisfiesPzibooleanOutput only. Reserved for future use for Zone Isolation.
satisfiesPzsbooleanOutput only. Reserved for future use for Zone Separation.
statestringOutput only. The state of this instance.
thirdPartyProxyUrlstringOutput only. The workforce pools proxy endpoint that is used to access the Jupyter notebook.
updateTimestring (google-datetime)Output only. Instance update time.
upgradeHistoryarrayOutput only. The upgrade history of this instance.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, instancesIdGets details of a single Instance.
listselectprojectsId, locationsIdpageSize, pageToken, orderBy, filterLists instances in a given project and location.
createinsertprojectsId, locationsIdinstanceId, requestIdCreates a new Instance in a given project and location.
patchupdateprojectsId, locationsId, instancesIdupdateMask, requestIdUpdateInstance updates an Instance.
deletedeleteprojectsId, locationsId, instancesIdrequestIdDeletes a single Instance.
startexecprojectsId, locationsId, instancesIdStarts a notebook instance.
stopexecprojectsId, locationsId, instancesIdStops a notebook instance.
resetexecprojectsId, locationsId, instancesIdResets a notebook instance.
check_upgradabilityexecprojectsId, locationsId, instancesIdChecks whether a notebook instance is upgradable.
upgradeexecprojectsId, locationsId, instancesIdUpgrades a notebook instance to the latest version.
resize_diskexecprojectsId, locationsId, instancesIdResize a notebook instance disk to a higher capacity.
rollbackexecprojectsId, locationsId, instancesIdRollbacks a notebook instance to the previous version.
diagnoseexecprojectsId, locationsId, instancesIdCreates a Diagnostic File and runs Diagnostic Tool given an Instance.
restoreexecprojectsId, locationsId, instancesIdRestoreInstance restores an Instance from a BackupSource.
report_info_systemexecprojectsId, locationsId, instancesIdAllows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly.
upgrade_systemexecprojectsId, locationsId, instancesIdAllows notebook instances to upgrade themselves. Do not use this method directly.
check_authorizationexecprojectsId, locationsId, instancesIdInitiated by Cloud Console for Oauth consent flow for Workbench Instances. Do not use this method directly. Design doc: go/wbi-euc:auth-dd
generate_access_tokenexecprojectsId, locationsId, instancesIdCalled by VM to return an EUC for the instance owner. Do not use this method directly. Design doc: go/wbi-euc:dd

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
instancesIdstring
locationsIdstring
projectsIdstring
filterstring
instanceIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single Instance.

SELECT
id,
name,
createTime,
creator,
disableProxyAccess,
enableDeletionProtection,
enableManagedEuc,
enableThirdPartyIdentity,
gceSetup,
healthInfo,
healthState,
instanceOwners,
labels,
proxyUri,
satisfiesPzi,
satisfiesPzs,
state,
thirdPartyProxyUrl,
updateTime,
upgradeHistory
FROM google.notebooks.instances
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND instancesId = '{{ instancesId }}' -- required;

INSERT examples

Creates a new Instance in a given project and location.

INSERT INTO google.notebooks.instances (
data__gceSetup,
data__instanceOwners,
data__disableProxyAccess,
data__labels,
data__enableThirdPartyIdentity,
data__enableManagedEuc,
data__enableDeletionProtection,
projectsId,
locationsId,
instanceId,
requestId
)
SELECT
'{{ gceSetup }}',
'{{ instanceOwners }}',
{{ disableProxyAccess }},
'{{ labels }}',
{{ enableThirdPartyIdentity }},
{{ enableManagedEuc }},
{{ enableDeletionProtection }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ instanceId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

UpdateInstance updates an Instance.

UPDATE google.notebooks.instances
SET
data__gceSetup = '{{ gceSetup }}',
data__instanceOwners = '{{ instanceOwners }}',
data__disableProxyAccess = {{ disableProxyAccess }},
data__labels = '{{ labels }}',
data__enableThirdPartyIdentity = {{ enableThirdPartyIdentity }},
data__enableManagedEuc = {{ enableManagedEuc }},
data__enableDeletionProtection = {{ enableDeletionProtection }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single Instance.

DELETE FROM google.notebooks.instances
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND requestId = '{{ requestId }}';

Lifecycle Methods

Starts a notebook instance.

EXEC google.notebooks.instances.start 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@instancesId='{{ instancesId }}' --required;