Fix: Placeholder cleanup (#5164)

* chore(ci): Update vocab.

* chore(test): Set language-specific replacements for code sample tests

This is a bit of kludge to allow for language-specific replacement patterns
while keeping the code samples valid when a user replaces placeholder strings with their own and copies the sample.
This is necessary for executing (not for validating syntax) of the code samples.

- Workaround for identifying language-specific replacements for pytest-codeblocks test runs.
- Uses Python f-strings to identify Python-specific placeholders.
- To import os for your code sample and hide it from users, wrap it in a comment and use the `pytest-codeblocks:cont` comment tag. See d0ca7e22b8/README.md?plain=1#L117

* fix(v3): Cleanup: fix link and grammar
pull/5168/head
Jason Stirnaman 2023-10-04 09:36:20 -05:00 committed by GitHub
parent 9696bf15fe
commit de4fe4c0ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 31 additions and 29 deletions

View File

@ -18,12 +18,14 @@ Data Explorer
dashboarding
datasource
dateTime
deserialize
[Dd]ownsampl.*\b
dotenv
enum
Flight
FlightQuery
Grafana
groupId
gzip(ped)?
homogenous
hostname

View File

@ -305,7 +305,7 @@ home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the specified database
<!------------------------------ END v1 API CONTENT ------------------------------>
{{% /tab-content %}}
{{% tab-content %}}
@ -1006,7 +1006,7 @@ _The tutorial assumes using Maven version 3.9 and Java version >= 15._
...
</dependencies>
```
5. To check your `pom.xml` for errors, run Maven's `validate` command--for example, enter the following in your terminal:
5. To validate your `pom.xml`, run Maven's `validate` command--for example, enter the following in your terminal:
```sh
mvn validate
@ -1115,7 +1115,7 @@ _The tutorial assumes using Maven version 3.9 and Java version >= 15._
- **`host`**: your {{% product-name omit=" Clustered" %}} cluster URL
- **`database`**: the name of the {{% product-name %}} database to write to
- **`token`**: a [database token]/influxdb/cloud-dedicated/admin/tokens/) with _write_ access to the specified database.
- **`token`**: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with _write_ access to the specified database.
_Store this in a secret store or environment variable to avoid exposing the raw token string._
2. Defines a list of line protocol strings where each string represents a data record.

View File

@ -111,7 +111,7 @@ The following example shows how to use cURL with the `Basic` authentication sche
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the specified database
#### Query string authentication
@ -138,7 +138,7 @@ The following example shows how to use cURL with query string authentication and
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the specified database
### Authenticate with a token scheme
@ -181,7 +181,7 @@ Use `Token` to authenticate a write request:
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the specified database
## Responses
@ -306,7 +306,7 @@ To configure the v1.x output plugin for writing to {{% product-name %}}, add the
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the specified database
##### Other Telegraf configuration options
@ -341,7 +341,7 @@ curl -i 'https://{{< influxdb/host >}}/write?db=DATABASE_NAME&precision=s' \
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the specified database
##### v1 CLI (not supported)
@ -411,7 +411,7 @@ client = InfluxDBClient(
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the specified database
## Query data

View File

@ -93,7 +93,7 @@ Use `Token` to authenticate a write request:
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the specified database
## Responses
@ -136,7 +136,7 @@ Response body messages may differ across {{% product-name %}} v1 API, v2 API, In
## Write data
We recommend using the InfluxDB v2 API `/api/v2/write` endpoint for new write workloads and existing v2 workloads.
Use the InfluxDB v2 API `/api/v2/write` endpoint for new write workloads and existing v2 workloads.
{{% api-endpoint endpoint="https://{{< influxdb/host >}}/api/v2/write" method="post"%}}

View File

@ -151,6 +151,6 @@ print(data_frame.to_markdown())
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/) with sufficient permissions to the specified database
{{% /code-tabs-wrapper %}}

View File

@ -343,7 +343,7 @@ Replace the following in the sample script:
your InfluxDB Cloud Dedicated database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}:
a [database token](/influxdb/cloud-dedicated/admin/tokens/)
with sufficient permissions to the database
with sufficient permissions to the specified database
{{% /expand %}}
{{< /expand-wrapper >}}
@ -426,7 +426,7 @@ Replace the following in the sample script:
your InfluxDB Cloud Dedicated database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}:
a [database token](/influxdb/cloud-dedicated/admin/tokens/)
with sufficient permissions to the database
with sufficient permissions to the specified database
{{% /expand %}}
{{< /expand-wrapper >}}
@ -497,7 +497,7 @@ Replace the following in the sample script:
your InfluxDB Cloud Dedicated database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}:
a [database token](/influxdb/cloud-dedicated/admin/tokens/)
with sufficient permissions to the database
with sufficient permissions to the specified database
{{% /expand %}}
{{< /expand-wrapper >}}

View File

@ -81,7 +81,7 @@ curl --post "https://{{< influxdb/host >}}/api/v2/write?bucket=BUCKET_NAME&preci
Replace the following:
- {{% code-placeholder-key %}}`BUCKET_NAME`{{% /code-placeholder-key %}}: your InfluxDB Cloud Serverless [bucket](/influxdb/cloud-serverless/admin/buckets/)
- {{% code-placeholder-key %}}`API_TOKEN`{{% /code-placeholder-key %}}: an [API token](/influxdb/cloud-serverless/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`API_TOKEN`{{% /code-placeholder-key %}}: an [API token](/influxdb/cloud-serverless/admin/tokens/) with sufficient permissions to the specified bucket
## Responses
@ -124,7 +124,7 @@ Response body messages may differ across {{% product-name %}} v1 API, v2 API, In
## Write data
We recommend using the InfluxDB v2 API `/api/v2/write` endpoint for new write workloads and existing v2 workloads.
Use the InfluxDB v2 API `/api/v2/write` endpoint for new write workloads and existing v2 workloads.
{{% api-endpoint endpoint="https://{{< influxdb/host >}}/api/v2/write" method="post"%}}

View File

@ -305,7 +305,7 @@ home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the specified database
<!------------------------------ END v1 API CONTENT ------------------------------>
{{% /tab-content %}}
{{% tab-content %}}

View File

@ -113,7 +113,7 @@ curl --get "https://{{< influxdb/host >}}/query" \
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the specified database
#### Query string authentication
@ -143,7 +143,7 @@ curl --get "https://{{< influxdb/host >}}/query" \
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the specified database
### Authenticate with a token scheme
@ -196,7 +196,7 @@ curl -i "https://{{< influxdb/host >}}/write?db=DATABASE_NAME&precision=s" \
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the specified database
## Responses
@ -321,7 +321,7 @@ To configure the v1.x output plugin for writing to {{% product-name %}}, add the
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the specified database
##### Other Telegraf configuration options
@ -356,7 +356,7 @@ curl -i 'https://{{< influxdb/host >}}/write?db=DATABASE_NAME&precision=s' \
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the specified database
##### v1 CLI (not supported)
@ -426,7 +426,7 @@ client = InfluxDBClient(
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the specified database
## Query data

View File

@ -98,7 +98,7 @@ curl --post "https://{{< influxdb/host >}}/api/v2/write?bucket=DATABASE_NAME&pre
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the specified database
## Responses

View File

@ -151,6 +151,6 @@ print(data_frame.to_markdown())
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/) with sufficient permissions to the specified database
{{% /code-tabs-wrapper %}}

View File

@ -343,7 +343,7 @@ Replace the following in the sample script:
your InfluxDB Clustered database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}:
a [database token](/influxdb/clustered/admin/tokens/)
with sufficient permissions to the database
with sufficient permissions to the specified database
{{% /expand %}}
{{< /expand-wrapper >}}
@ -426,7 +426,7 @@ Replace the following in the sample script:
your InfluxDB Clustered database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}:
a [database token](/influxdb/clustered/admin/tokens/)
with sufficient permissions to the database
with sufficient permissions to the specified database
{{% /expand %}}
{{< /expand-wrapper >}}
@ -497,7 +497,7 @@ Replace the following in the sample script:
your InfluxDB Clustered database
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}:
a [database token](/influxdb/clustered/admin/tokens/)
with sufficient permissions to the database
with sufficient permissions to the specified database
{{% /expand %}}
{{< /expand-wrapper >}}