Skip to main content

notebooks

Creates, updates, deletes, gets or lists a notebooks resource.

Overview​

Namenotebooks
TypeResource
Idovh.cloud_ai.notebooks

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstringNotebook Id
created_atstring (date-time)Notebook creation date (wire: createdAt)
specobjectNotebook spec
statusobjectNotebook Container Status
updated_atstring (date-time)Notebook last update date (wire: updatedAt)
userstringNotebook user owner

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectnotebook_id, service_nameGet notebook information
listselectservice_namelabel_selector, order, page, size, sort, status_state, updated_after, updated_before, user_name, with_sparkList notebooks
createinsertservice_name, env, region, resourcesCreate a new notebook
updateupdatenotebook_id, service_nameUpdate an existing notebook. Only labels update can be done while notebook is running.
deletedeletenotebook_id, service_nameforceDelete a notebook
commandexecservice_name, env, region, resourcesGenerate a notebook spec corresponding CLI command
datasyncexecnotebookId, service_nameStarts a manual data synchronization on an AI Solutions notebook
update_labelexecnotebookId, service_name, nameUpdate/add an AI Solutions notebook label
restartexecnotebookId, service_nameRestart an AI Solutions notebook
startexecnotebookId, service_nameStart an AI Solutions notebook
stopexecnotebookId, service_nameStop an AI Solutions notebook

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
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
notebookIdstringNotebook ID
notebook_idstringNotebook ID (wire: notebookId)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
forcebooleanForce notebook deletion by killing it if at a running state
label_selectorstringFilter on notebook label (e.g. 'notebook_name=spell_book') (wire: labelSelector)
orderstringOrder the result set
pageintegerPage of the result set
sizeintegerSize of the result set
sortstringSort the result with this field
status_statearrayFilter on status state (wire: statusState)
updated_afterstring (date-time)Filter on updatedAt property (>) (wire: updatedAfter)
updated_beforestring (date-time)Filter on updatedAt property (<) (wire: updatedBefore)
user_namestringUser that submit the job (wire: userName)
with_sparkbooleanWhether or not to include spark notebooks in search results (wire: withSpark)

SELECT examples​

Get notebook information

SELECT
id,
created_at,
spec,
status,
updated_at,
user
FROM ovh.cloud_ai.notebooks
WHERE notebook_id = '{{ notebook_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Create a new notebook

INSERT INTO ovh.cloud_ai.notebooks (
env,
env_vars,
labels,
name,
quantum_resources,
region,
resources,
ssh_public_keys,
timeout_auto_restart,
unsecure_http,
volumes,
service_name
)
SELECT
'{{ env }}' /* required */,
'{{ env_vars }}',
'{{ labels }}',
'{{ name }}',
'{{ quantum_resources }}',
'{{ region }}' /* required */,
'{{ resources }}' /* required */,
'{{ ssh_public_keys }}',
{{ timeout_auto_restart }},
{{ unsecure_http }},
'{{ volumes }}',
'{{ service_name }}'
RETURNING
id,
created_at,
spec,
status,
updated_at,
user
;

UPDATE examples​

Update an existing notebook. Only labels update can be done while notebook is running.

UPDATE ovh.cloud_ai.notebooks
SET
framework_version = '{{ framework_version }}',
labels = '{{ labels }}',
name = '{{ name }}',
quantum_resources = '{{ quantum_resources }}',
resources = '{{ resources }}',
ssh_public_keys = '{{ ssh_public_keys }}',
timeout_auto_restart = {{ timeout_auto_restart }},
unsecure_http = {{ unsecure_http }},
volumes = '{{ volumes }}'
WHERE
notebook_id = '{{ notebook_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set;

DELETE examples​

Delete a notebook

DELETE FROM ovh.cloud_ai.notebooks
WHERE notebook_id = '{{ notebook_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
AND force = '{{ force }}'
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Generate a notebook spec corresponding CLI command

EXEC ovh.cloud_ai.notebooks.command
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"env": "{{ env }}",
"envVars": "{{ envVars }}",
"labels": "{{ labels }}",
"name": "{{ name }}",
"quantumResources": "{{ quantumResources }}",
"region": "{{ region }}",
"resources": "{{ resources }}",
"sshPublicKeys": "{{ sshPublicKeys }}",
"timeoutAutoRestart": {{ timeoutAutoRestart }},
"unsecureHttp": {{ unsecureHttp }},
"volumes": "{{ volumes }}"
}'
;