notebooks
Creates, updates, deletes, gets or lists a notebooks resource.
Overview
| Name | notebooks |
| Type | Resource |
| Id | datadog.dashboards.notebooks |
Fields
The following fields are returned by SELECT queries:
- get_notebook
- list_notebooks
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | Unique notebook ID, assigned when you create the notebook. |
attributes | object | The attributes of a notebook. |
type | string | Type of the Notebook resource. (notebooks) (default: notebooks, example: notebooks) |
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | Unique notebook ID, assigned when you create the notebook. |
attributes | object | The attributes of a notebook in get all response. |
type | string | Type of the Notebook resource. (notebooks) (default: notebooks, example: notebooks) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_notebook | select | notebook_id | Get a notebook using the specified notebook ID. | |
list_notebooks | select | author_handle, exclude_author_handle, start, count, sort_field, sort_dir, query, include_cells, is_template, type | Get all notebooks. This can also be used to search for notebooks with a particular query in the notebook<br />name or author handle. | |
create_notebook | insert | data | Create a notebook using the specified options. | |
update_notebook | replace | notebook_id, data | Update a notebook using the specified ID. | |
delete_notebook | delete | notebook_id | Delete a notebook using the specified ID. |
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 |
|---|---|---|
notebook_id | integer (int64) | Unique ID, assigned when you create the notebook. |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
author_handle | string | Return notebooks created by the given author_handle. |
count | integer (int64) | The number of notebooks to be returned. |
exclude_author_handle | string | Return notebooks not created by the given author_handle. |
include_cells | boolean | Value of false excludes the cells and global time for each notebook. |
is_template | boolean | True value returns only template notebooks. Default is false (returns only non-template notebooks). |
query | string | Return only notebooks with query string in notebook name or author handle. |
sort_dir | string | Sort by direction asc or desc. |
sort_field | string | Sort by field modified, name, or created. |
start | integer (int64) | The index of the first notebook you want returned. |
type | string | If type is provided, returns only notebooks with that metadata type. Default does not have type filtering. |
SELECT examples
- get_notebook
- list_notebooks
Get a notebook using the specified notebook ID.
SELECT
id,
attributes,
type
FROM datadog.dashboards.notebooks
WHERE notebook_id = '{{ notebook_id }}' -- required
;
Get all notebooks. This can also be used to search for notebooks with a particular query in the notebook<br />name or author handle.
SELECT
id,
attributes,
type
FROM datadog.dashboards.notebooks
WHERE author_handle = '{{ author_handle }}'
AND exclude_author_handle = '{{ exclude_author_handle }}'
AND start = '{{ start }}'
AND count = '{{ count }}'
AND sort_field = '{{ sort_field }}'
AND sort_dir = '{{ sort_dir }}'
AND query = '{{ query }}'
AND include_cells = '{{ include_cells }}'
AND is_template = '{{ is_template }}'
AND type = '{{ type }}'
;
INSERT examples
- create_notebook
- Manifest
Create a notebook using the specified options.
INSERT INTO datadog.dashboards.notebooks (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: notebooks
props:
- name: data
description: |
The data for a notebook create request.
value:
attributes:
cells:
- attributes:
definition:
text: "{{ text }}"
type: "{{ type }}"
graph_size: "{{ graph_size }}"
split_by:
keys: "{{ keys }}"
tags: "{{ tags }}"
time:
live_span: "{{ live_span }}"
end: "{{ end }}"
live: {{ live }}
start: "{{ start }}"
type: "{{ type }}"
metadata:
is_template: {{ is_template }}
take_snapshots: {{ take_snapshots }}
type: "{{ type }}"
name: "{{ name }}"
status: "{{ status }}"
template_variables:
- available_values: "{{ available_values }}"
available_values_query:
data_source: "{{ data_source }}"
group_by:
- facet: "{{ facet }}"
search:
query: "{{ query }}"
query: "{{ query }}"
data_source_mappings: "{{ data_source_mappings }}"
default: "{{ default }}"
defaults: "{{ defaults }}"
name: "{{ name }}"
placement: "{{ placement }}"
prefix: "{{ prefix }}"
type: "{{ type }}"
time:
live_span: "{{ live_span }}"
end: "{{ end }}"
live: {{ live }}
start: "{{ start }}"
type: "{{ type }}"
REPLACE examples
- update_notebook
Update a notebook using the specified ID.
REPLACE datadog.dashboards.notebooks
SET
data = '{{ data }}'
WHERE
notebook_id = '{{ notebook_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;
DELETE examples
- delete_notebook
Delete a notebook using the specified ID.
DELETE FROM datadog.dashboards.notebooks
WHERE notebook_id = '{{ notebook_id }}' --required
;