diff --git a/content/influxdb/cloud-dedicated/admin/databases/create.md b/content/influxdb/cloud-dedicated/admin/databases/create.md index 02a33ebac..3d3cc32ea 100644 --- a/content/influxdb/cloud-dedicated/admin/databases/create.md +++ b/content/influxdb/cloud-dedicated/admin/databases/create.md @@ -1,7 +1,8 @@ --- title: Create a database description: > - Use the [`influxctl database create` command](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/) or the Management HTTP API + Use the [`influxctl database create` command](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/) + or the [Management HTTP API](/influxdb/cloud-dedicated/api/management/) to create a new InfluxDB database in your InfluxDB Cloud Dedicated cluster. Provide a database name and an optional retention period. menu: @@ -9,6 +10,7 @@ menu: parent: Manage databases weight: 201 list_code_example: | + ##### CLI ```sh influxctl database create \ --retention-period 30d \ @@ -16,13 +18,57 @@ list_code_example: | --max-columns 250 \ ``` + + ##### API + ```sh + curl \ + --location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases" \ + --request POST + --header "Accept: application/json" \ + --header 'Content-Type: application/json' \ + --header "Authorization: Bearer MANAGEMENT_TOKEN" \ + --data '{ + "name": "'DATABASE_NAME'", + "maxTables": 500, + "maxColumnsPerTable": 250, + "retentionPeriod": 2592000000000, + "partitionTemplate": [ + { + "type": "tag", + "value": "TAG_KEY_1" + }, + { + "type": "tag", + "value": "TAG_KEY_2" + }, + { + "type": "bucket", + "value": { + "tagName": "TAG_KEY_3", + "numberOfBuckets": 100 + } + }, + { + "type": "bucket", + "value": { + "tagName": "TAG_KEY_4", + "numberOfBuckets": 300 + } + }, + { + "type": "time", + "value": "%Y-%m-%d" + } + ] + }' + ``` related: - /influxdb/cloud-dedicated/reference/cli/influxctl/database/create/ - /influxdb/cloud-dedicated/admin/custom-partitions/ - - /influxdb/cloud-dedicated/api/management/#operation/CreateClusterDatabase + - /influxdb/cloud-dedicated/reference/api/ --- -Use the [`influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/) +Use the [`influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/) or the [Management HTTP API](influxdb/cloud-dedicated/api/management/) to create a database in your {{< product-name omit=" Clustered" >}} cluster. {{< tabs-wrapper >}} @@ -33,13 +79,15 @@ or the [Management HTTP API](influxdb/cloud-dedicated/api/management/) to create {{% tab-content %}} +Use the [`influxctl database create` command](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/) +to create a database in your {{< product-name omit=" Clustered" >}} cluster. 1. If you haven't already, [download and install the `influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/#download-and-install-influxctl), and then [configure an `influxctl` connection profile](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles) for your cluster. 2. Run the `influxctl database create` command and provide the following: - _Optional_: Database [retention period](/influxdb/cloud-dedicated/admin/databases/#retention-periods) - Default is `0` (infinite). + Default is `infinite` (`0`). - _Optional_: Database table (measurement) limit. Default is `500`. - _Optional_: Database column limit. Default is `250`. - _Optional_: [InfluxDB tags](/influxdb/cloud-dedicated/reference/glossary/#tag) @@ -74,7 +122,7 @@ influxctl database create \ Replace the following in your command: -- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/cloud-dedicated/admin/databases/) - {{% code-placeholder-key %}}`TAG_KEY_1`, `TAG_KEY_2`, `TAG_KEY_3`, and `TAG_KEY_4`{{% /code-placeholder-key %}}: [tag]((/influxdb/cloud-dedicated/reference/glossary/#tag)) keys from your data ## Database attributes @@ -138,6 +186,7 @@ flags to define partition template parts used to generate partition keys for the For more information, see [Manage data partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/). {{% note %}} + #### Partition templates can only be applied on create You can only apply a partition template when creating a database. @@ -158,8 +207,9 @@ _This example uses [cURL](https://curl.se/) to send a Management HTTP API reques In the URL, provide the following credentials: - - `ACCOUNT_ID`: The ID of the [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that the cluster belongs to. To view account ID and cluster ID, [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json). - - `CLUSTER_ID`: The ID of the [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that you want to manage. To view account ID and cluster ID, [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json). + - `ACCOUNT_ID`: The ID of the [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that the cluster belongs to _(see how to [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_. + - `CLUSTER_ID`: The ID of the [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that you want to manage _(see how to [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_. + Provide the following request headers: @@ -193,6 +243,7 @@ The following example shows how to use the Management API to create a database w ```sh curl \ --location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases" \ + --request POST --header "Accept: application/json" \ --header 'Content-Type: application/json' \ --header "Authorization: Bearer MANAGEMENT_TOKEN" \ @@ -236,10 +287,10 @@ curl \ Replace the following in your request: -- {{% code-placeholder-key %}}`ACCOUNT_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} account to create the database for -- {{% code-placeholder-key %}}`CLUSTER_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} cluster to create the database for +- {{% code-placeholder-key %}}`ACCOUNT_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) to create the database for +- {{% code-placeholder-key %}}`CLUSTER_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) to create the database for - {{% code-placeholder-key %}}`MANAGEMENT TOKEN`{{% /code-placeholder-key %}}: a [management token](/influxdb/cloud-dedicated/admin/tokens/management/) for your {{% product-name %}} cluster -- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/cloud-dedicated/admin/databases/) - {{% code-placeholder-key %}}`TAG_KEY_1`, `TAG_KEY_2`, `TAG_KEY_3`, and `TAG_KEY_4`{{% /code-placeholder-key %}}: [tag]((/influxdb/cloud-dedicated/reference/glossary/#tag)) keys from your data ## Database attributes @@ -280,6 +331,7 @@ Use the [`partitionTemplate`](/influxdb/cloud-dedicated/api/management/#operatio For more information, see [Manage data partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/). {{% note %}} + #### Partition templates can only be applied on create You can only apply a partition template when creating a database. diff --git a/content/influxdb/cloud-dedicated/admin/databases/delete.md b/content/influxdb/cloud-dedicated/admin/databases/delete.md index 952494c17..beb3d8c68 100644 --- a/content/influxdb/cloud-dedicated/admin/databases/delete.md +++ b/content/influxdb/cloud-dedicated/admin/databases/delete.md @@ -2,6 +2,7 @@ title: Delete a database description: > Use the [`influxctl database delete` command](/influxdb/cloud-dedicated/reference/cli/influxctl/database/delete/) + or the [Management HTTP API](/influxdb/cloud-dedicated/api/management/) to delete a database from your InfluxDB Cloud Dedicated cluster. Provide the name of the database you want to delete. menu: @@ -9,30 +10,29 @@ menu: parent: Manage databases weight: 203 list_code_example: | + ##### CLI ```sh influxctl database delete ``` + + ##### API + ```sh + curl \ + --location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases/DATABASE_NAME" \ + --request DELETE \ + --header "Accept: application/json" \ + --header "Authorization: Bearer MANAGEMENT_TOKEN" + ``` related: - /influxdb/cloud-dedicated/reference/cli/influxctl/database/delete/ + - /influxdb/cloud-dedicated/reference/api/ --- -Use the [`influxctl database delete` command](/influxdb/cloud-dedicated/reference/cli/influxctl/database/delete/) -to delete a database from your InfluxDB Cloud Dedicated cluster. - -1. If you haven't already, [download and install the `influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/#download-and-install-influxctl). -2. Run the `influxctl database delete` command and provide the following: - - - Name of the database to delete - -3. Confirm that you want to delete the database. - -{{% code-placeholders "DATABASE_NAME" %}} -```sh -influxctl database delete DATABASE_NAME -``` -{{% /code-placeholders %}} +Use the [`influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/) +or the [Management HTTP API](/influxdb/cloud-dedicated/api/management/) to create a database in your {{< product-name omit=" Clustered" >}} cluster. {{% warn %}} + #### Deleting a database cannot be undone Once a database is deleted, data stored in that database cannot be recovered. @@ -40,4 +40,78 @@ Once a database is deleted, data stored in that database cannot be recovered. #### Cannot reuse database names After a database is deleted, you cannot reuse the same name for a new database. -{{% /warn %}} \ No newline at end of file +{{% /warn %}} + +{{< tabs-wrapper >}} +{{% tabs %}} +[influxctl](#) +[Management API](#) +{{% /tabs %}} +{{% tab-content %}} + + + +1. If you haven't already, [download and install the `influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/#download-and-install-influxctl), and then [configure an `influxctl` connection profile](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles) for your cluster. + +2. Run the `influxctl database delete` command and provide the following: + + - Name of the database to delete + +3. Confirm that you want to delete the database. + +{{% code-placeholders "DATABASE_NAME" %}} + +```sh +influxctl database delete DATABASE_NAME +``` + +{{% /code-placeholders %}} + + +{{% /tab-content %}} +{{% tab-content %}} + + +_This example uses [cURL](https://curl.se/) to send a Management HTTP API request, but you can use any HTTP client._ + +1. If you haven't already, follow the instructions to [install cURL](https://everything.curl.dev/install/index.html) for your system. +2. In your terminal, use cURL to send a request to the following {{% product-name %}} console endpoint: + + {{% api-endpoint endpoint="https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases/DATABASE_NAME" method="delete" api-ref="/influxdb/cloud-dedicated/api/management/#operation/DeleteClusterDatabase" %}} + + In the URL, provide the following: + + - `ACCOUNT_ID`: The ID of the [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that the cluster belongs to _(see how to [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_. + - `CLUSTER_ID`: The ID of the [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that you want to manage _(see how to [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_. + - `DATABASE_NAME`: The name of the [database](/influxdb/cloud-dedicated/admin/databases/) that you want to delete _(see how to [list databases](/influxdb/cloud-dedicated/admin/databases/list/))_. + + Provide the following request headers: + + - `Accept: application/json` to ensure the response body is JSON content + - `Authorization: Bearer` and a [Management API token](/influxdb/cloud-dedicated/admin/tokens/management/) for your cluster _(see how to [create a management token](/influxdb/cloud-dedicated/admin/tokens/management/) for Management API requests)_. + + Specify the `DELETE` request method. + +The following example shows how to use the Management API to delete a database: + +{{% code-placeholders "DATABASE_NAME|ACCOUNT_ID|CLUSTER_ID|MANAGEMENT_TOKEN" %}} + +```sh +curl \ + --location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases/DATABASE_NAME" \ + --request DELETE \ + --header "Accept: application/json" \ + --header "Authorization: Bearer MANAGEMENT_TOKEN" +``` + +{{% /code-placeholders %}} + +Replace the following in your request: + +- {{% code-placeholder-key %}}`ACCOUNT_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) to create the database for +- {{% code-placeholder-key %}}`CLUSTER_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) to create the database for +- {{% code-placeholder-key %}}`MANAGEMENT TOKEN`{{% /code-placeholder-key %}}: a [management token](/influxdb/cloud-dedicated/admin/tokens/management/) for your {{% product-name %}} cluster +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/cloud-dedicated/admin/databases/) + +{{% /tab-content %}} +{{< /tabs-wrapper >}} diff --git a/content/influxdb/cloud-dedicated/admin/databases/list.md b/content/influxdb/cloud-dedicated/admin/databases/list.md index 7ad72b906..92b53950f 100644 --- a/content/influxdb/cloud-dedicated/admin/databases/list.md +++ b/content/influxdb/cloud-dedicated/admin/databases/list.md @@ -8,11 +8,21 @@ menu: parent: Manage databases weight: 202 list_code_example: | + ##### CLI ```sh influxctl database list ``` + + ##### API + ```sh + curl \ + --location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases" \ + --header "Accept: application/json" \ + --header "Authorization: Bearer MANAGEMENT_TOKEN" + ``` related: - /influxdb/cloud-dedicated/reference/cli/influxctl/database/list/ + - /influxdb/cloud-dedicated/reference/api/ --- Use the [`influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/) @@ -33,7 +43,7 @@ to list databases in your InfluxDB Cloud Dedicated cluster. 1. If you haven't already, [download and install the `influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/#download-and-install-influxctl), and then [configure an `influxctl` connection profile](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles) for your cluster. 2. Run the `influxctl database list` command and provide the following: - - _Optional_: [Output format](#output-formats) + - _Optional_: [Output format](#output-format) ```sh influxctl database list --format table @@ -48,17 +58,15 @@ _This example uses [cURL](https://curl.se/) to send a Management HTTP API reques 1. If you haven't already, follow the instructions to [install cURL](https://everything.curl.dev/install/index.html) for your system. 2. In your terminal, use cURL to send a request to the following {{% product-name %}} console endpoint: - {{% api-endpoint endpoint="https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases" method="get" api-ref="/influxdb/cloud-dedicated/api/management/#operation/CreateClusterDatabase" %}} + {{% api-endpoint endpoint="https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases" method="get" api-ref="/influxdb/cloud-dedicated/api/management/#operation/GetClusterDatabases" %}} In the URL, provide the following credentials: - - - `ACCOUNT_ID`: The ID of the [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that the cluster belongs to. To view account ID and cluster ID, [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json). - - `CLUSTER_ID`: The ID of the [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that you want to manage. To view account ID and cluster ID, [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json). + - `ACCOUNT_ID`: The ID of the [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that the cluster belongs to _(see how to [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_. + - `CLUSTER_ID`: The ID of the [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that you want to manage _(see how to [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_. Provide the following request headers: - `Accept: application/json` to ensure the response body is JSON content - - `Content-Type: application/json` to indicate the request body is JSON content - `Authorization: Bearer` and a [Management API token](/influxdb/cloud-dedicated/admin/tokens/management/) for your cluster _(see how to [create a management token](/influxdb/cloud-dedicated/admin/tokens/management/) for Management API requests)_. The following example shows how to use the Management API to list databases in a cluster: @@ -76,8 +84,8 @@ curl \ Replace the following in your request: -- {{% code-placeholder-key %}}`ACCOUNT_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} account to create the database for -- {{% code-placeholder-key %}}`CLUSTER_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} cluster to create the database for +- {{% code-placeholder-key %}}`ACCOUNT_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) to create the database for +- {{% code-placeholder-key %}}`CLUSTER_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) to create the database for - {{% code-placeholder-key %}}`MANAGEMENT TOKEN`{{% /code-placeholder-key %}}: a [management token](/influxdb/cloud-dedicated/admin/tokens/management/) for your {{% product-name %}} cluster {{% /tab-content %}} diff --git a/content/influxdb/cloud-dedicated/admin/databases/update.md b/content/influxdb/cloud-dedicated/admin/databases/update.md index 4b771d896..2f9b3881c 100644 --- a/content/influxdb/cloud-dedicated/admin/databases/update.md +++ b/content/influxdb/cloud-dedicated/admin/databases/update.md @@ -2,22 +2,53 @@ title: Update a database description: > Use the [`influxctl database update` command](/influxdb/cloud-dedicated/reference/cli/influxctl/database/update/) - to update a database in your InfluxDB Cloud Dedicated cluster. + or the [Management HTTP API](/influxdb/cloud-dedicated/api/management/) + to update attributes for a database in your InfluxDB Cloud Dedicated cluster. + Provide the database name and the attributes to update. menu: influxdb_cloud_dedicated: parent: Manage databases weight: 201 list_code_example: | + ##### CLI ```sh - influxctl database update DATABASE_NAME \ + influxctl database update \ --retention-period 30d \ --max-tables 500 \ --max-columns 250 + + ``` + + ##### API + ```sh + curl \ + --location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases/DATABASE_NAME" \ + --request PATCH \ + --header "Accept: application/json" \ + --header 'Content-Type: application/json' \ + --header "Authorization: Bearer MANAGEMENT_TOKEN" \ + --data '{ + "maxTables": 500, + "maxColumnsPerTable": 250, + "retentionPeriod": 2592000000000000 + }' ``` related: - /influxdb/cloud-dedicated/reference/cli/influxctl/database/update/ + - /influxdb/cloud-dedicated/reference/api/ --- +Use the [`influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/) +or the [Management HTTP API](/influxdb/cloud-dedicated/api/management/) to update attributes such as retention period, column limits, and table limits for a database in your {{< product-name omit=" Clustered" >}} cluster. + +{{< tabs-wrapper >}} +{{% tabs %}} +[influxctl](#) +[Management API](#) +{{% /tabs %}} +{{% tab-content %}} + + Use the [`influxctl database update` command](/influxdb/cloud-dedicated/reference/cli/influxctl/database/update/) to update a database in your {{< product-name omit=" Clustered" >}} cluster. @@ -26,45 +57,47 @@ to update a database in your {{< product-name omit=" Clustered" >}} cluster. - Database name - _Optional_: Database [retention period](/influxdb/cloud-dedicated/admin/databases/#retention-periods) - _(default is infinite)_ - - _Optional_: Database table (measurement) limit _(default is 500)_ - - _Optional_: Database column limit _(default is 250)_ + Default is `infinite` (`0`). + - _Optional_: Database table (measurement) limit. Default is `500`. + - _Optional_: Database column limit. Default is `250`. {{% code-placeholders "DATABASE_NAME|30d|500|200" %}} + ```sh influxctl database update DATABASE_NAME \ --retention-period 30d \ --max-tables 500 \ --max-columns 250 ``` + {{% /code-placeholders %}} -{{% warn %}} -#### Database names can't be updated +Replace the following in your command: -The `influxctl database update` command uses the database name to identify which -database to apply updates to. The database name itself can't be updated. -{{% /warn %}} +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/cloud-dedicated/admin/databases/) -- [Retention period syntax](#retention-period-syntax) +## Database attributes + +- [Retention period syntax](#retention-period-syntax-influxctl-cli) - [Database naming restrictions](#database-naming-restrictions) - [InfluxQL DBRP naming convention](#influxql-dbrp-naming-convention) - [Table and column limits](#table-and-column-limits) -## Retention period syntax +### Retention period syntax (influxctl CLI) -Use the `--retention-period` flag to define a specific +Use the `--retention-period` flag to define the [retention period](/influxdb/cloud-dedicated/admin/databases/#retention-periods) for the database. The retention period value is a time duration value made up of a numeric value -plus a duration unit. For example, `30d` means 30 days. -A zero duration retention period is infinite and data will not expire. +plus a duration unit. +For example, `30d` means 30 days. +A zero duration (`0d`) retention period is infinite and data won't expire. The retention period value cannot be negative or contain whitespace. {{< flex >}} -{{% flex-content %}} +{{% flex-content "half" %}} -##### Valid durations units include +#### Valid durations units include - **m**: minute - **h**: hour @@ -74,9 +107,9 @@ The retention period value cannot be negative or contain whitespace. - **y**: year {{% /flex-content %}} -{{% flex-content %}} +{{% flex-content "half" %}} -##### Example retention period values +#### Example retention period values - `0d`: infinite/none - `3d`: 3 days @@ -89,7 +122,105 @@ The retention period value cannot be negative or contain whitespace. {{% /flex-content %}} {{< /flex >}} -## Database naming restrictions + +{{% /tab-content %}} +{{% tab-content %}} + + +1. In your terminal, use cURL to send a request to the following {{% product-name %}} console endpoint: + + {{% api-endpoint endpoint="https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases" method="post" api-ref="/influxdb/cloud-dedicated/api/management/#operation/CreateClusterDatabase" %}} + + In the URL, provide the following credentials: + + - `ACCOUNT_ID`: The ID of the [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that the cluster belongs to _(see how to [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_. + - `CLUSTER_ID`: The ID of the [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that you want to manage _(see how to [list cluster details](/influxdb/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_. + - `DATABASE_NAME`: The name of the [database](/influxdb/cloud-dedicated/admin/databases/) that you want to delete _(see how to [list databases](/influxdb/cloud-dedicated/admin/databases/list/))_. + + Provide the following request headers: + + - `Accept: application/json` to ensure the response body is JSON content + - `Content-Type: application/json` to indicate the request body is JSON content + - `Authorization: Bearer` and a [Management API token](/influxdb/cloud-dedicated/admin/tokens/management/) for your cluster _(see how to [create a management token](/influxdb/cloud-dedicated/admin/tokens/management/) for Management API requests)_. + + In the request body, provide the parameters to update: + + - _Optional:_ Database [retention period](/influxdb/cloud-dedicated/admin/databases/#retention-periods) in nanoseconds. + Default is `0` (infinite). + - _Optional_: Database table (measurement) limit. Default is `500`. + - _Optional_: Database column limit. Default is `250`. + + Specify the `PATCH` request method. + +The following example shows how to use the Management API to update a database: + +{{% code-placeholders "DATABASE_NAME|2592000000000000|500|250|ACCOUNT_ID|CLUSTER_ID|MANAGEMENT_TOKEN" %}} + + ```sh + curl \ + --location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases/DATABASE_NAME" \ + --request PATCH \ + --header "Accept: application/json" \ + --header 'Content-Type: application/json' \ + --header "Authorization: Bearer MANAGEMENT_TOKEN" \ + --data '{ + "maxTables": 500, + "maxColumnsPerTable": 250, + "retentionPeriod": 2592000000000000 + }' + ``` + +{{% /code-placeholders %}} + +Replace the following in your request: + +- {{% code-placeholder-key %}}`ACCOUNT_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} [account](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) to create the database for +- {{% code-placeholder-key %}}`CLUSTER_ID`{{% /code-placeholder-key %}}: the ID of the {{% product-name %}} [cluster](/influxdb/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) to create the database for +- {{% code-placeholder-key %}}`MANAGEMENT TOKEN`{{% /code-placeholder-key %}}: a [management token](/influxdb/cloud-dedicated/admin/tokens/management/) for your {{% product-name %}} cluster +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/cloud-dedicated/admin/databases/) + +## Database attributes + +- [Retention period syntax](#retention-period-syntax-management-api) +- [Database naming restrictions](#database-naming-restrictions) +- [InfluxQL DBRP naming convention](#influxql-dbrp-naming-convention) +- [Table and column limits](#table-and-column-limits) + +### Retention period syntax (Management API) + +Use the `retentionPeriod` property to specify the +[retention period](/influxdb/cloud-dedicated/admin/databases/#retention-periods) +for the database. +The retention period value is an integer (``) that represents the number of nanoseconds. +For example, `2592000000000` means 30 days. +A zero (`0`) retention period is infinite and data won't expire. +The retention period value cannot be negative or contain whitespace. + +#### Example retention period values + +- `0`: infinite/none +- `259200000000000`: 3 days +- `2592000000000000`: 30 days +- `31536000000000000`: 1 standard year (365 days) + + +{{% /tab-content %}} +{{< /tabs-wrapper >}} + +{{% warn %}} + +#### Database names can't be updated + +The `influxctl database update` command uses the database name to identify which +database to apply updates to. The database name itself can't be updated. + +#### Partition templates can't be updated + +You can only apply a partition template when creating a database. +There is no way to update a partition template on an existing database. +{{% /warn %}} + +### Database naming restrictions Database names must adhere to the following naming restrictions: @@ -99,7 +230,7 @@ Database names must adhere to the following naming restrictions: - Should not start with an underscore (`_`). - Maximum length of 64 characters. -## InfluxQL DBRP naming convention +### InfluxQL DBRP naming convention In InfluxDB 1.x, data is stored in [databases](/influxdb/v1/concepts/glossary/#database) and [retention policies](/influxdb/v1/concepts/glossary/#retention-policy-rp). @@ -116,7 +247,7 @@ naming convention to automatically map v1 DBRP combinations to a database: database_name/retention_policy_name ``` -##### Database naming examples +#### Database naming examples | v1 Database name | v1 Retention Policy name | New database name | | :--------------- | :----------------------- | :------------------------ | @@ -124,12 +255,17 @@ database_name/retention_policy_name | telegraf | autogen | telegraf/autogen | | webmetrics | 1w-downsampled | webmetrics/1w-downsampled | -## Table and column limits +### Table and column limits In {{< product-name >}}, table (measurement) and column limits can be -configured using the `--max-tables` and `--max-columns` flags. +configured using the following options: -### Table limit +| Description | Default | influxctl CLI flag | Management API property | +| :---------------------------- | :------ | :-------------- | :------------------- | +| [Table limit](#table-limit) | 500 | `--max-tables` | `maxTables` | +| [Column limit](#column-limit) | 250 | `--max-columns` | `maxColumnsPerTable` | + +#### Table limit **Default maximum number of tables**: 500 @@ -172,7 +308,7 @@ operating cost of your cluster. {{% /expand %}} {{< /expand-wrapper >}} -### Column limit +#### Column limit **Default maximum number of columns**: 250 diff --git a/content/influxdb/cloud-dedicated/guides/api-compatibility/v2/_index.md b/content/influxdb/cloud-dedicated/guides/api-compatibility/v2/_index.md index 123a0302b..35c2863e7 100644 --- a/content/influxdb/cloud-dedicated/guides/api-compatibility/v2/_index.md +++ b/content/influxdb/cloud-dedicated/guides/api-compatibility/v2/_index.md @@ -95,7 +95,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_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/cloud-dedicated/admin/databases/) - {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/#database-tokens) with sufficient permissions to the specified database diff --git a/content/influxdb/cloud-dedicated/query-data/troubleshoot-and-optimize/analyze-query-plan.md b/content/influxdb/cloud-dedicated/query-data/troubleshoot-and-optimize/analyze-query-plan.md index 587155789..915b95683 100644 --- a/content/influxdb/cloud-dedicated/query-data/troubleshoot-and-optimize/analyze-query-plan.md +++ b/content/influxdb/cloud-dedicated/query-data/troubleshoot-and-optimize/analyze-query-plan.md @@ -91,7 +91,7 @@ assert 'logical_plan' in df.plan_type.values, "Expect logical_plan" Replace the following: -- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/cloud-dedicated/admin/databases/) - {{% code-placeholder-key %}}`TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/#database-tokens) with sufficient permissions to the specified database diff --git a/content/influxdb/cloud-dedicated/query-data/troubleshoot-and-optimize/trace.md b/content/influxdb/cloud-dedicated/query-data/troubleshoot-and-optimize/trace.md index 62ab37af6..99a64a264 100644 --- a/content/influxdb/cloud-dedicated/query-data/troubleshoot-and-optimize/trace.md +++ b/content/influxdb/cloud-dedicated/query-data/troubleshoot-and-optimize/trace.md @@ -230,7 +230,7 @@ use_middleware_trace_header() Replace the following: -- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/cloud-dedicated/admin/databases/) - {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/cloud-dedicated/admin/tokens/#database-tokens) with sufficient permissions to the specified database diff --git a/content/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/get.md b/content/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/get.md index 1fd3fd5eb..63a3b6746 100644 --- a/content/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/get.md +++ b/content/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/get.md @@ -29,7 +29,7 @@ influxctl cluster get | Argument | Description | | :------------- | :----------------------- | -| **CLUSTER_ID** | ID of the cluster to get | +| **CLUSTER_ID** | ID of the [cluster](/influxdb/cloud-dedicated/reference/glossary/#cluster) to get | ## Flags diff --git a/content/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/update.md b/content/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/update.md index 46070130c..32c72648a 100644 --- a/content/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/update.md +++ b/content/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/update.md @@ -21,7 +21,7 @@ influxctl cluster update [flags] | Argument | Description | | :------------- | :----------------------- | -| **CLUSTER_ID** | ID of the cluster to get | +| **CLUSTER_ID** | ID of the [cluster](/influxdb/cloud-dedicated/reference/glossary/#cluster) to get | ## Flags diff --git a/content/influxdb/cloud-serverless/guides/api-compatibility/v1/_index.md b/content/influxdb/cloud-serverless/guides/api-compatibility/v1/_index.md index 14a2edad3..105ed587b 100644 --- a/content/influxdb/cloud-serverless/guides/api-compatibility/v1/_index.md +++ b/content/influxdb/cloud-serverless/guides/api-compatibility/v1/_index.md @@ -105,7 +105,7 @@ curl "https://{{< influxdb/host >}}/query" \ Replace the following: -- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} bucket +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [bucket](/influxdb/cloud-serverless/admin/buckets/) - {{% code-placeholder-key %}}`RETENTION_POLICY`{{% /code-placeholder-key %}}: your {{% product-name %}} retention policy - {{% code-placeholder-key %}}`API_TOKEN`{{% /code-placeholder-key %}}: a [token](/influxdb/cloud-serverless/admin/tokens/) with sufficient permissions to the mapped bucket diff --git a/content/influxdb/cloud-serverless/query-data/troubleshoot-and-optimize/analyze-query-plan.md b/content/influxdb/cloud-serverless/query-data/troubleshoot-and-optimize/analyze-query-plan.md index b1d733281..b89c301dd 100644 --- a/content/influxdb/cloud-serverless/query-data/troubleshoot-and-optimize/analyze-query-plan.md +++ b/content/influxdb/cloud-serverless/query-data/troubleshoot-and-optimize/analyze-query-plan.md @@ -89,7 +89,7 @@ assert 'logical_plan' in df.plan_type.values, "Expect logical_plan" Replace the following: -- {{% code-placeholder-key %}}`BUCKET_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} bucket +- {{% code-placeholder-key %}}`BUCKET_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [bucket](/influxdb/cloud-serverless/admin/buckets/) - {{% code-placeholder-key %}}`TOKEN`{{% /code-placeholder-key %}}: a [token](/influxdb/cloud-serverless/admin/tokens/) with sufficient permissions to the specified bucket {{% /expand %}} diff --git a/content/influxdb/clustered/guides/api-compatibility/v1/_index.md b/content/influxdb/clustered/guides/api-compatibility/v1/_index.md index 7b5398a96..23330633b 100644 --- a/content/influxdb/clustered/guides/api-compatibility/v1/_index.md +++ b/content/influxdb/clustered/guides/api-compatibility/v1/_index.md @@ -112,7 +112,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_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/clustered/admin/databases/) - {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/#database-tokens) with sufficient permissions to the specified database #### Query string authentication @@ -142,7 +142,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_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/clustered/admin/databases/) - {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/#database-tokens) with sufficient permissions to the specified database ### Authenticate with a token scheme @@ -195,7 +195,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_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/clustered/admin/databases/) - {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/#database-tokens) with sufficient permissions to the specified database ## Responses @@ -320,7 +320,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_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/clustered/admin/databases/) - {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/#database-tokens) with sufficient permissions to the specified database ##### Other Telegraf configuration options @@ -355,7 +355,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_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/clustered/admin/databases/) - {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/#database-tokens) with sufficient permissions to the specified database ##### v1 CLI (not supported) @@ -425,7 +425,7 @@ client = InfluxDBClient( Replace the following: -- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/clustered/admin/databases/) - {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/#database-tokens) with sufficient permissions to the specified database ## Query data diff --git a/content/influxdb/clustered/guides/api-compatibility/v2/_index.md b/content/influxdb/clustered/guides/api-compatibility/v2/_index.md index bc8b7dede..ef9be6b18 100644 --- a/content/influxdb/clustered/guides/api-compatibility/v2/_index.md +++ b/content/influxdb/clustered/guides/api-compatibility/v2/_index.md @@ -97,7 +97,7 @@ curl --request post "https://{{< influxdb/host >}}/api/v2/write?bucket=DATABASE_ Replace the following: -- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/clustered/admin/databases/) - {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/#database-tokens) with sufficient permissions to the specified database ## Responses diff --git a/content/influxdb/clustered/query-data/troubleshoot-and-optimize/analyze-query-plan.md b/content/influxdb/clustered/query-data/troubleshoot-and-optimize/analyze-query-plan.md index 31739769c..898b01496 100644 --- a/content/influxdb/clustered/query-data/troubleshoot-and-optimize/analyze-query-plan.md +++ b/content/influxdb/clustered/query-data/troubleshoot-and-optimize/analyze-query-plan.md @@ -91,7 +91,7 @@ assert 'logical_plan' in df.plan_type.values, "Expect logical_plan" Replace the following: -- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} database +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb/clustered/admin/databases/) - {{% code-placeholder-key %}}`TOKEN`{{% /code-placeholder-key %}}: a [database token](/influxdb/clustered/admin/tokens/#database-tokens) with sufficient permissions to the specified database