Revert "fix: create-notebook for v2.1"

This reverts commit c4d3c64eec.
pull/3435/head^2
Jason Stirnaman 2021-11-29 09:47:18 -06:00
parent d0df9acab6
commit 5dc298db13
1 changed files with 29 additions and 46 deletions

View File

@ -11,66 +11,58 @@ menu:
---
To learn how notebooks can be useful and to see an overview of different cell types available in notebooks, see [Overview of Notebooks](/influxdb/v2.1/notebooks/overview/).
1. In the navigation menu on the left, click **Books** or **Notebooks**.
1. In the navigation menu on the left, click **Notebooks**.
{{< nav-icon "notebooks" >}}
2. In the **Notebooks** page, click one of the following options under **Create a Notebook**:
- **New Notebook**: includes a query builder cell, a validate cell, and a [visualize cell](#add-a-visualization-cell).
- **Set an Alert**: includes a [query builder cell](#add-a-data-source-cell), a validate cell, a visualize cell, and an [alert builder cell](#add-an-action-cell).
- **Schedule a Task**: includes a Flux script editor cell, a validate cell, and a [task schedule cell](#add-an-action-cell).
- **Write a Flux Script**: includes a Flux script editor cell, and a validate cell.
2. Click one of the following options under **Create a Notebook**:
- New Notebook
- Set an Alert
- Schedule a Task
- Write a Flux Script
3. Enter a name for your notebook in the **Untitled Notebook** field.
3. Do the following at the top of the page:
- Select your local time zone or UTC.
- Choose a time [range](/{{% latest "flux" %}}/stdlib/universe/range/) for your data.
4. Your notebook should have a **Data Source** cell as the first cell. The presets (listed in step 2) include either **Query Builder** or **Flux Script** as the first cell that provides data to subsequent cells.
5. To define your data source query, do one of the following:
- If your notebook uses a **Query Builder** cell, select your bucket and any additional filters for your query.
- If your notebook uses a **Flux Script** cell, enter or paste a [Flux script](/influxdb/v2.1/query-data/flux/).
6. Select and click **Preview** (or press **CTRL + Enter**) under the notebook title.
InfluxDB displays query results in **Validate the Data** and **Visualize the Result** *without writing data or running actions*.
7. (Optional) Change your visualization settings with the dropdown menu and the {{< icon "gear" >}} **Configure** button at the top of the **Visualize the Result** cell.
8. (Optional) Toggle the **Presentation** switch to display visualization cells and hide all other cells.
7. (Optional) Configure notebook actions (**Alert**, **Task**, or **Output to Bucket**).
7. (Optional) To run your notebook actions, select and click **Run** under the notebook title.
8. (Optional) Click the {{< icon "plus" >}} icon, and then add a new cell to your notebook:
- Choose a time range for your data.
4. Consider which notebook cells to add to your notebook. You need to have one input cell for other cells to run properly. The default notebook cell types included in your notebook (**Data Source**, **Visualization**, and **Action**) vary depending on the type of notebook you selected in step 2.
5. Select your bucket in your query or Flux script, and then select the filters to narrow your data.
6. Do one of the following:
- To view results in your cells (for example, to view your **Visualization** or **Action**) *without writing data*, click **Preview** (or press **CTRL + Enter**).
- To view the results of each cell and write the results to the specified output bucket, click **Run**.
7. (Optional) Change your visualization settings with the dropdown menus and gear icon at the top of the **Visualization** cell.
8. (Optional) Click the **+** icon, and then add one or more of the following cell types to your notebook:
- [Add a data source cell](#add-a-data-source-cell)
- [Add a validation cell](#add-a-validation-cell)
- [Add a visualization cell](#add-a-visualization-cell)
- [Add an action cell](#add-an-action-cell):
- [Data source](#add-a-data-source-cell): to pull information into your notebook
- [Visualization](#add-a-visualization-cell): to
- [Action](#add-an-action-cell): filter and apply changes to your data, for example, create an alert, process data with a task, or output data to a bucket
9. (Optional) [Convert a cell into raw Flux script](#view-and-edit-flux-script-in-a-cell) to view and edit the code.
### Add a data source cell
Add a data source cell to pull information into your notebook.
InfluxDB provides the following data source cells:
- **Query Builder** cell
- **Flux Script** cell
1. Select **Flux Script** or **Query Builder** as your input, and then select or enter the bucket to pull data from.
2. Select filters to narrow your data.
3. Select **Preview** (**CTRL + Enter**) or **Run** in the upper left dropdown menu.
### Add a validation cell
### Add an action cell
Add a **Validate the Data** cell to display raw query results from a data source cell.
1. Select one of the following action cell-types:
- **Alert**
- **Downsample**: Window data by time and apply an aggregate to each window to downsample data. For more information, see [Downsample data with notebooks](/influxdb/v2.1/notebooks/downsample/).
2. Select **Preview** (**CTRL + Enter**) or **Run** in the upper left dropdown menu.
{{% warn %}}
If your cell contains a custom script that uses any output function to write data to InfluxDB (for example: the `to()` function) or sends data to a third-party service, clicking Preview will write data.
{{% /warn %}}
### Add a visualization cell
Add a **Visualize the Result** cell to render query results as a [Visualization type](/influxdb/cloud/visualize-data/visualization-types/).
Select one of the following visualization cell-types:
- Table
- Graph
- Note
To modify a visualization cell, see [use a visualization cell](use-a-visualization-cell)
For detail on available visualization types and how to use them, see [Visualization types](/influxdb/cloud/visualize-data/visualization-types/).
### Use a visualization cell
#### Visualization
- To change your visualization type, select a new type from the dropdown menu at the top of the cell.
- (For histogram only) To specify values, click **Select**.
@ -80,15 +72,9 @@ For detail on available visualization types and how to use them, see [Visualizat
### Add an action cell
Add an action cell to filter and apply changes to your data, for example, create an alert, process data with a task, or output data to a bucket.
{{% warn %}}
If your cell contains a custom script that uses any output function to write data to InfluxDB (for example: the `to()` function) or sends data to a third-party service, clicking Preview will write data.
{{% /warn %}}
Select one of the following action cell-types:
- To receive a notification, select [Alert](#alert) and complete the steps below.
- To recieve a notification, select [Alert](#alert) and complete the steps below.
- To write output to a bucket, select [Output to Bucket](#output-to-bucket) and complete the steps below.
- To create a task, select [Task](#task) and complete the steps below.
@ -100,10 +86,7 @@ Select one of the following action cell-types:
- Slack and a Slack Channel
- HTTP post
- Pager Duty
4. (Optional) Personalize your message. By default, the message is
```
${strings.title(v: r._type)} for ${r._source_measurement} triggered at ${time(v: r._source_timestamp)}!
```
4. (Optional) Personalize your message. By default, the message is "${strings.title(v: r._type)} for ${r._source_measurement} triggered at ${time(v: r._source_timestamp)}!"
5. Click **Export as Task** to create your alert.
#### Output to bucket