All URIs are relative to https://api.datadoghq.com
Method | HTTP request | Description |
---|---|---|
createNotebook | POST /api/v1/notebooks | Create a notebook |
deleteNotebook | DELETE /api/v1/notebooks/{notebook_id} | Delete a notebook |
getNotebook | GET /api/v1/notebooks/{notebook_id} | Get a notebook |
listNotebooks | GET /api/v1/notebooks | Get all notebooks |
updateNotebook | PUT /api/v1/notebooks/{notebook_id} | Update a notebook |
NotebookResponse createNotebook(body)
Create a notebook using the specified options.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.NotebooksApi(configuration);
let params: v1.NotebooksApiCreateNotebookRequest = {
// NotebookCreateRequest | The JSON description of the notebook you want to create.
body: {
data: {
attributes: {
cells: [
{
attributes: {
definition: {
text: `# Example Header
example content`,
type: "markdown",
},
},
type: "notebook_cells",
},
{
attributes: {
definition: {
text: `# Example Header
example content`,
type: "markdown",
},
},
type: "notebook_cells",
},
],
metadata: {
isTemplate: false,
takeSnapshots: false,
type: "investigation",
},
name: "Example Notebook",
status: "published",
time: {
liveSpan: "5m",
},
},
type: "notebooks",
},
},
};
apiInstance
.createNotebook(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
body | NotebookCreateRequest | The JSON description of the notebook you want to create. |
NotebookResponse
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request | - |
403 | Authentication Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void deleteNotebook()
Delete a notebook using the specified ID.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.NotebooksApi(configuration);
let params: v1.NotebooksApiDeleteNotebookRequest = {
// number | Unique ID, assigned when you create the notebook.
notebookId: 1,
};
apiInstance
.deleteNotebook(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
notebookId | [number] | Unique ID, assigned when you create the notebook. | defaults to undefined |
void
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | OK | - |
400 | Bad Request | - |
403 | Authentication Error | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NotebookResponse getNotebook()
Get a notebook using the specified notebook ID.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.NotebooksApi(configuration);
let params: v1.NotebooksApiGetNotebookRequest = {
// number | Unique ID, assigned when you create the notebook.
notebookId: 1,
};
apiInstance
.getNotebook(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
notebookId | [number] | Unique ID, assigned when you create the notebook. | defaults to undefined |
NotebookResponse
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request | - |
403 | Authentication Error | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NotebooksResponse listNotebooks()
Get all notebooks. This can also be used to search for notebooks with a particular query
in the notebook
name
or author handle
.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.NotebooksApi(configuration);
let params: v1.NotebooksApiListNotebooksRequest = {
// string | Return notebooks created by the given `author_handle`. (optional)
authorHandle: "[email protected]",
// string | Return notebooks not created by the given `author_handle`. (optional)
excludeAuthorHandle: "[email protected]",
// number | The index of the first notebook you want returned. (optional)
start: 0,
// number | The number of notebooks to be returned. (optional)
count: 5,
// string | Sort by field `modified`, `name`, or `created`. (optional)
sortField: "modified",
// string | Sort by direction `asc` or `desc`. (optional)
sortDir: "desc",
// string | Return only notebooks with `query` string in notebook name or author handle. (optional)
query: "postmortem",
// boolean | Value of `false` excludes the `cells` and global `time` for each notebook. (optional)
includeCells: false,
// boolean | True value returns only template notebooks. Default is false (returns only non-template notebooks). (optional)
isTemplate: false,
// string | If type is provided, returns only notebooks with that metadata type. Default does not have type filtering. (optional)
type: "investigation",
};
apiInstance
.listNotebooks(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
authorHandle | [string] | Return notebooks created by the given `author_handle`. | (optional) defaults to undefined |
excludeAuthorHandle | [string] | Return notebooks not created by the given `author_handle`. | (optional) defaults to undefined |
start | [number] | The index of the first notebook you want returned. | (optional) defaults to undefined |
count | [number] | The number of notebooks to be returned. | (optional) defaults to undefined |
sortField | [string] | Sort by field `modified`, `name`, or `created`. | (optional) defaults to 'modified' |
sortDir | [string] | Sort by direction `asc` or `desc`. | (optional) defaults to 'desc' |
query | [string] | Return only notebooks with `query` string in notebook name or author handle. | (optional) defaults to undefined |
includeCells | [boolean] | Value of `false` excludes the `cells` and global `time` for each notebook. | (optional) defaults to undefined |
isTemplate | [boolean] | True value returns only template notebooks. Default is false (returns only non-template notebooks). | (optional) defaults to undefined |
type | [string] | If type is provided, returns only notebooks with that metadata type. Default does not have type filtering. | (optional) defaults to undefined |
NotebooksResponse
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request | - |
403 | Authentication Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NotebookResponse updateNotebook(body)
Update a notebook using the specified ID.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.NotebooksApi(configuration);
let params: v1.NotebooksApiUpdateNotebookRequest = {
// number | Unique ID, assigned when you create the notebook.
notebookId: 1,
// NotebookUpdateRequest | Update notebook request body.
body: {
data: {
attributes: {
cells: [
{
attributes: {
definition: {
text: `# Example Header
example content`,
type: "markdown",
},
},
type: "notebook_cells",
},
{
attributes: {
definition: {
text: `# Example Header
example content`,
type: "markdown",
},
},
type: "notebook_cells",
},
],
metadata: {
isTemplate: false,
takeSnapshots: false,
type: "investigation",
},
name: "Example Notebook",
status: "published",
time: {
liveSpan: "5m",
},
},
type: "notebooks",
},
},
};
apiInstance
.updateNotebook(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
body | NotebookUpdateRequest | Update notebook request body. | |
notebookId | [number] | Unique ID, assigned when you create the notebook. | defaults to undefined |
NotebookResponse
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request | - |
403 | Authentication Error | - |
404 | Not Found | - |
409 | Conflict | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]