notebooks
Creates, updates, deletes, gets or lists a notebooks resource.
Overview​
| Name | notebooks |
| Type | Resource |
| Id | ovh.cloud_ai.notebooks |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string | Notebook Id |
created_at | string (date-time) | Notebook creation date (wire: createdAt) |
spec | object | Notebook spec |
status | object | Notebook Container Status |
updated_at | string (date-time) | Notebook last update date (wire: updatedAt) |
user | string | Notebook user owner |
AI Solutions Platform Notebook Object
| Name | Datatype | Description |
|---|---|---|
id | string | Notebook Id |
created_at | string (date-time) | Notebook creation date (wire: createdAt) |
spec | object | Notebook spec |
status | object | Notebook Container Status |
updated_at | string (date-time) | Notebook last update date (wire: updatedAt) |
user | string | Notebook user owner |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | notebook_id, service_name | Get notebook information | |
list | select | service_name | label_selector, order, page, size, sort, status_state, updated_after, updated_before, user_name, with_spark | List notebooks |
create | insert | service_name, env, region, resources | Create a new notebook | |
update | update | notebook_id, service_name | Update an existing notebook. Only labels update can be done while notebook is running. | |
delete | delete | notebook_id, service_name | force | Delete a notebook |
command | exec | service_name, env, region, resources | Generate a notebook spec corresponding CLI command | |
datasync | exec | notebookId, service_name | Starts a manual data synchronization on an AI Solutions notebook | |
update_label | exec | notebookId, service_name, name | Update/add an AI Solutions notebook label | |
restart | exec | notebookId, service_name | Restart an AI Solutions notebook | |
start | exec | notebookId, service_name | Start an AI Solutions notebook | |
stop | exec | notebookId, service_name | Stop 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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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"}}) |
notebookId | string | Notebook ID |
notebook_id | string | Notebook ID (wire: notebookId) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
force | boolean | Force notebook deletion by killing it if at a running state |
label_selector | string | Filter on notebook label (e.g. 'notebook_name=spell_book') (wire: labelSelector) |
order | string | Order the result set |
page | integer | Page of the result set |
size | integer | Size of the result set |
sort | string | Sort the result with this field |
status_state | array | Filter on status state (wire: statusState) |
updated_after | string (date-time) | Filter on updatedAt property (>) (wire: updatedAfter) |
updated_before | string (date-time) | Filter on updatedAt property (<) (wire: updatedBefore) |
user_name | string | User that submit the job (wire: userName) |
with_spark | boolean | Whether or not to include spark notebooks in search results (wire: withSpark) |
SELECT examples​
- get
- list
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
;
List notebooks
SELECT
id,
created_at,
spec,
status,
updated_at,
user
FROM ovh.cloud_ai.notebooks
WHERE service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND label_selector = '{{ label_selector }}'
AND order = '{{ order }}'
AND page = '{{ page }}'
AND size = '{{ size }}'
AND sort = '{{ sort }}'
AND status_state = '{{ status_state }}'
AND updated_after = '{{ updated_after }}'
AND updated_before = '{{ updated_before }}'
AND user_name = '{{ user_name }}'
AND with_spark = '{{ with_spark }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: notebooks
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the notebooks resource.
- name: env
description: |
Environment to deploy in this notebook
value:
editorId: "{{ editorId }}"
frameworkId: "{{ frameworkId }}"
frameworkVersion: "{{ frameworkVersion }}"
- name: env_vars
description: |
List of environment variables to be set inside the notebook
value:
- name: "{{ name }}"
value: "{{ value }}"
- name: labels
value: "{{ labels }}"
description: |
Labels are used to scope tokens, labels prefixed by 'ovh/' are owned by the platform and overridden
- name: name
value: "{{ name }}"
description: |
Notebook name
- name: quantum_resources
description: |
Quantum resources
value:
qpuFlavorId: "{{ qpuFlavorId }}"
- name: region
value: "{{ region }}"
description: |
Host region of the notebook
- name: resources
description: |
Notebook resources
value:
cpu: {{ cpu }}
ephemeralStorage: {{ ephemeralStorage }}
flavor: "{{ flavor }}"
flavorCount: {{ flavorCount }}
gpu: {{ gpu }}
gpuBrand: "{{ gpuBrand }}"
gpuMemory: {{ gpuMemory }}
gpuModel: "{{ gpuModel }}"
memory: {{ memory }}
privateNetwork: {{ privateNetwork }}
publicNetwork: {{ publicNetwork }}
- name: ssh_public_keys
value:
- "{{ ssh_public_keys }}"
description: |
SSH keys authorized to access the notebook
- name: timeout_auto_restart
value: {{ timeout_auto_restart }}
description: |
Whether notebook is set to be restarted after timeout
- name: unsecure_http
value: {{ unsecure_http }}
description: |
Whether notebook api port can be accessed without any authentication token
- name: volumes
description: |
Notebook Data linked
value:
- cache: {{ cache }}
container: "{{ container }}"
dataStore:
alias: "{{ alias }}"
archive: "{{ archive }}"
container: "{{ container }}"
internal: {{ internal }}
prefix: "{{ prefix }}"
id: "{{ id }}"
mountPath: "{{ mountPath }}"
permission: "{{ permission }}"
prefix: "{{ prefix }}"
publicGit:
url: "{{ url }}"
publicSwift:
url: "{{ url }}"
region: "{{ region }}"
standalone:
name: "{{ name }}"
targetDataStore:
alias: "{{ alias }}"
archive: "{{ archive }}"
container: "{{ container }}"
internal: {{ internal }}
prefix: "{{ prefix }}"
volumeSource:
dataStore:
alias: "{{ alias }}"
archive: "{{ archive }}"
container: "{{ container }}"
internal: {{ internal }}
prefix: "{{ prefix }}"
publicGit:
url: "{{ url }}"
publicSwift:
url: "{{ url }}"
standalone:
name: "{{ name }}"
volumeTarget:
targetDataStore:
alias: "{{ alias }}"
archive: "{{ archive }}"
container: "{{ container }}"
internal: {{ internal }}
prefix: "{{ prefix }}"
UPDATE examples​
- update
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
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.
- command
- datasync
- update_label
- restart
- start
- stop
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 }}"
}'
;
Starts a manual data synchronization on an AI Solutions notebook
EXEC ovh.cloud_ai.notebooks.datasync
@notebookId='{{ notebookId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"direction": "{{ direction }}",
"volume": "{{ volume }}"
}'
;
Update/add an AI Solutions notebook label
EXEC ovh.cloud_ai.notebooks.update_label
@notebookId='{{ notebookId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"name": "{{ name }}",
"value": "{{ value }}"
}'
;
Restart an AI Solutions notebook
EXEC ovh.cloud_ai.notebooks.restart
@notebookId='{{ notebookId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Start an AI Solutions notebook
EXEC ovh.cloud_ai.notebooks.start
@notebookId='{{ notebookId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Stop an AI Solutions notebook
EXEC ovh.cloud_ai.notebooks.stop
@notebookId='{{ notebookId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;