diff --git a/content/influxdb/v2.0/query-data/execute-queries.md b/content/influxdb/v2.0/query-data/execute-queries.md index 907e06b0b..1dd589553 100644 --- a/content/influxdb/v2.0/query-data/execute-queries.md +++ b/content/influxdb/v2.0/query-data/execute-queries.md @@ -81,10 +81,10 @@ Below is an example `curl` command that queries InfluxDB: {{% code-tab-content %}} ```bash curl http://localhost:8086/api/v2/query?org=my-org -XPOST -sS \ - -H 'Authorization: Token YOURAUTHTOKEN' \ - -H 'Accept: application/csv' \ - -H 'Content-type: application/vnd.flux' \ - -d 'from(bucket:"example-bucket") + --header 'Authorization: Token YOURAUTHTOKEN' \ + --header 'Accept: application/csv' \ + --header 'Content-type: application/vnd.flux' \ + --data 'from(bucket:"example-bucket") |> range(start: -12h) |> filter(fn: (r) => r._measurement == "example-measurement") |> aggregateWindow(every: 1h, fn: mean)' @@ -93,12 +93,12 @@ curl http://localhost:8086/api/v2/query?org=my-org -XPOST -sS \ {{% code-tab-content %}} ```bash -curl http://localhost:8086/api/v2/query?org=my-org -XPOST -sS \ - -H 'Authorization: Token YOURAUTHTOKEN' \ - -H 'Accept: application/csv' \ - -H 'Content-type: application/vnd.flux' \ - -H 'Accept-Encoding: gzip' \ - -d 'from(bucket:"example-bucket") +curl --request POST http://localhost:8086/api/v2/query?org=my-org \ + --header 'Authorization: Token YOURAUTHTOKEN' \ + --header 'Accept: application/csv' \ + --header 'Content-type: application/vnd.flux' \ + --header 'Accept-Encoding: gzip' \ + --data 'from(bucket:"example-bucket") |> range(start: -12h) |> filter(fn: (r) => r._measurement == "example-measurement") |> aggregateWindow(every: 1h, fn: mean)' diff --git a/content/influxdb/v2.0/query-data/flux/geo/_index.md b/content/influxdb/v2.0/query-data/flux/geo/_index.md index b35d17302..808de218a 100644 --- a/content/influxdb/v2.0/query-data/flux/geo/_index.md +++ b/content/influxdb/v2.0/query-data/flux/geo/_index.md @@ -75,7 +75,8 @@ Use `curl` and the `influx write` command to write bird migration line protocol Replace `example-bucket` with your destination bucket: ```sh -curl https://raw.githubusercontent.com/influxdata/influxdb2-sample-data/master/bird-migration-data/bird-migration.line --output ./tmp-data +curl https://raw.githubusercontent.com/influxdata/influxdb2-sample-data/master/bird-migration-data/bird-migration.line \ + --output ./tmp-data influx write -b example-bucket @./tmp-data rm -f ./tmp-data ``` diff --git a/content/influxdb/v2.0/query-data/flux/sql.md b/content/influxdb/v2.0/query-data/flux/sql.md index 90cf64aa0..aee0eb8dc 100644 --- a/content/influxdb/v2.0/query-data/flux/sql.md +++ b/content/influxdb/v2.0/query-data/flux/sql.md @@ -233,10 +233,10 @@ to store your database credentials as secrets. {{% /tabs %}} {{% tab-content %}} ```sh -curl -X PATCH http://localhost:8086/api/v2/orgs//secrets \ - -H 'Authorization: Token YOURAUTHTOKEN' \ - -H 'Content-type: application/json' \ - -d '{ +curl --request PATCH http://localhost:8086/api/v2/orgs//secrets \ + --header 'Authorization: Token YOURAUTHTOKEN' \ + --header 'Content-type: application/json' \ + --data '{ "POSTGRES_HOST": "http://example.com", "POSTGRES_USER": "example-username", "POSTGRES_PASS": "example-password" diff --git a/content/influxdb/v2.0/query-data/influxql.md b/content/influxdb/v2.0/query-data/influxql.md index f1a19e43c..2fa7cfbd7 100644 --- a/content/influxdb/v2.0/query-data/influxql.md +++ b/content/influxdb/v2.0/query-data/influxql.md @@ -36,10 +36,10 @@ Verify the buckets that you want to query are mapped to a database and retention - To find a specific bucket (`bucket_id`), database (`database`), retention policy (`retention_policy`), or mapping ID (`id`), include the parameter in your request. ```sh -curl -GET https://cloud2.influxdata.com/api/v2/dbrps \ - -H "Authorization: Token YourAuthToken" \ - -H 'Content-type: application/json' \ - -d '{ +curl --request GET https://cloud2.influxdata.com/api/v2/dbrps \ + --header "Authorization: Token YourAuthToken" \ + --header 'Content-type: application/json' \ + --data '{ "bucket_id": "12ab34cd56ef", "database": "example-db", "id": "example-mapping-id" @@ -62,10 +62,10 @@ To map an unmapped bucket to a database and retention policy, use the [`POST /db - database and retention policy to map to bucket (`database` and `retention_policy`) ```sh -curl -XPOST https://cloud2.influxdata.com/api/v2/dbrps \ - -H "Authorization: Token YourAuthToken" \ - -H 'Content-type: application/json' \ - -d '{ +curl --request POST https://cloud2.influxdata.com/api/v2/dbrps \ + --header "Authorization: Token YourAuthToken" \ + --header 'Content-type: application/json' \ + --data '{ "bucket_id": "12ab34cd56ef", "database": "example-db", "default": true @@ -95,8 +95,8 @@ To query a mapped bucket with InfluxQL, use the `/query` 1.x compatibility endpo {{% /note %}} ```sh -curl -G https://cloud2.influxdata.com/query?database=MyDB&retention_policy=MyRP \ - -H "Authorization: Token YourAuthToken" \ +curl --request GET https://cloud2.influxdata.com/query?database=MyDB&retention_policy=MyRP \ + --header "Authorization: Token YourAuthToken" \ --data-urlencode "q=SELECT used_percent FROM example-db.example-rp.example-measurement WHERE host=host1" ``` diff --git a/content/influxdb/v2.0/reference/api/_index.md b/content/influxdb/v2.0/reference/api/_index.md index 1c145587d..415bbf16f 100644 --- a/content/influxdb/v2.0/reference/api/_index.md +++ b/content/influxdb/v2.0/reference/api/_index.md @@ -17,8 +17,8 @@ Include your authentication token as an `Authorization` header in each request. ```sh curl --request POST \ - --url http://localhost:8086/api/v2/write?org=my-org&bucket=example-bucket \ - --header 'Authorization: Token YOURAUTHTOKEN' + http://localhost:8086/api/v2/write?org=my-org&bucket=example-bucket \ + --header "Authorization: Token YOURAUTHTOKEN" ``` ## View InfluxDB v2 API Documentation diff --git a/content/influxdb/v2.0/reference/api/influxdb-1x/query.md b/content/influxdb/v2.0/reference/api/influxdb-1x/query.md index c0436203f..0bcbafb1a 100644 --- a/content/influxdb/v2.0/reference/api/influxdb-1x/query.md +++ b/content/influxdb/v2.0/reference/api/influxdb-1x/query.md @@ -81,16 +81,16 @@ The following precisions are available: ##### Query using basic authentication ```sh -curl -G https://cloud2.influxdata.com/query \ - -u username:YourAuthToken \ +curl --request GET https://cloud2.influxdata.com/query \ + --user "username:YourAuthToken" \ --data-urlencode "db=mydb" \ --data-urlencode "q=SELECT used_percent FROM mem WHERE host=host1" ``` ##### Query a non-default retention policy ```sh -curl -G https://cloud2.influxdata.com/query \ - -H "Authorization: Basic username:YourAuthToken" \ +curl --request GET https://cloud2.influxdata.com/query \ + --header "Authorization: Basic username:YourAuthToken" \ --data-urlencode "db=mydb" \ --data-urlencode "rp=customrp" \ --data-urlencode "q=SELECT used_percent FROM mem WHERE host=host1" @@ -98,27 +98,27 @@ curl -G https://cloud2.influxdata.com/query \ ##### Execute multiple queries ```sh -curl -G https://cloud2.influxdata.com/query \ - -H "Authorization: Token YourAuthToken" \ +curl --request GET https://cloud2.influxdata.com/query \ + --header "Authorization: Token YourAuthToken" \ --data-urlencode "db=mydb" \ --data-urlencode "q=SELECT * FROM mem WHERE host=host1;SELECT mean(used_percent) FROM mem WHERE host=host1 GROUP BY time(10m)" ``` ##### Return query results with millisecond Unix timestamps ```sh -curl -G https://cloud2.influxdata.com/query \ - -H "Authorization: Token YourAuthToken" \ +curl --request GET https://cloud2.influxdata.com/query \ + --header "Authorization: Token YourAuthToken" \ --data-urlencode "db=mydb" \ --data-urlencode "rp=myrp" \ - --data-urlencode "q=SELECT used_percent FROM mem WHERE host=host1" + --data-urlencode "q=SELECT used_percent FROM mem WHERE host=host1" \ --data-urlencode "epoch=ms" ``` ##### Use curl to execute InfluxQL queries from a file ```sh -curl -G https://cloud2.influxdata.com/query \ - -H "Authorization: Token YourAuthToken" \ +curl --request GET https://cloud2.influxdata.com/query \ + --header "Authorization: Token YourAuthToken" \ --data-urlencode "db=mydb" \ - -F "q=@path/to/influxql.txt" - -F "async=true" + --form "q=@path/to/influxql.txt" \ + --form "async=true" ``` diff --git a/content/influxdb/v2.0/reference/api/influxdb-1x/write.md b/content/influxdb/v2.0/reference/api/influxdb-1x/write.md index 641a01ccc..130f47da0 100644 --- a/content/influxdb/v2.0/reference/api/influxdb-1x/write.md +++ b/content/influxdb/v2.0/reference/api/influxdb-1x/write.md @@ -71,22 +71,23 @@ The following precisions are available: ##### Write data using basic authentication ```sh -curl -XPOST https://cloud2.influxdata.com/write?db=mydb \ - -H "Authorization: Basic username:YourAuthToken" \ +curl --request POST https://cloud2.influxdata.com/write?db=mydb \ + --header "Authorization: Basic username:YourAuthToken" \ --data-binary "measurement,host=host1 field1=2i,field2=2.0 1577836800000000000" ``` ##### Write data to a non-default retention policy ```sh -curl -XPOST https://cloud2.influxdata.com/write?db=mydb&rp=customrp \ - -H "Authorization: Basic username:YourAuthToken" \ +curl --request POST https://cloud2.influxdata.com/write?db=mydb&rp=customrp \ + --header "Authorization: Basic" \ + --header "username:YourAuthToken" \ --data-binary "measurement,host=host1 field1=2i,field2=2.0 1577836800000000000" ``` ##### Write multiple lines of line protocol ```sh -curl -XPOST https://cloud2.influxdata.com/write?db=mydb \ - -H "Authorization: Token YourAuthToken" \ +curl --request POST https://cloud2.influxdata.com/write?db=mydb \ + --header "Authorization: Token YourAuthToken" \ --data-binary "measurement,host=host1 field1=2i,field2=2.0 1577836800000000000 measurement,host=host2 field1=14i,field2=12.7 1577836800000000000 measurement,host=host3 field1=5i,field2=6.8 1577836800000000000" @@ -94,14 +95,14 @@ measurement,host=host3 field1=5i,field2=6.8 1577836800000000000" ##### Write data with millisecond Unix timestamps ```sh -curl -XPOST https://cloud2.influxdata.com/write?db=mydb&precision=ms \ - -H "Authorization: Token YourAuthToken" \ +curl --request POST https://cloud2.influxdata.com/write?db=mydb&precision=ms \ + --header "Authorization: Token YourAuthToken" \ --data-binary "measurement,host=host1 field1=2i,field2=2.0 1577836800000" ``` ##### Use curl to write data from a file ```sh -curl -XPOST https://cloud2.influxdata.com/write?db=mydb \ - -H "Authorization: Token YourAuthToken" \ +curl --request POST https://cloud2.influxdata.com/write?db=mydb \ + --header "Authorization: Token YourAuthToken" \ --data-binary @path/to/line-protocol.txt ``` diff --git a/content/influxdb/v2.0/security/secrets/manage-secrets/add.md b/content/influxdb/v2.0/security/secrets/manage-secrets/add.md index 7a38c6707..35be48ba4 100644 --- a/content/influxdb/v2.0/security/secrets/manage-secrets/add.md +++ b/content/influxdb/v2.0/security/secrets/manage-secrets/add.md @@ -43,9 +43,9 @@ add a new secret to your organization. ```sh -curl -XPATCH http://localhost:8086/api/v2/orgs//secrets \ - -H 'Authorization: Token YOURAUTHTOKEN' \ - -H 'Content-type: application/json' \ +curl --request PATCH http://localhost:8086/api/v2/orgs//secrets \ + --header 'Authorization: Token YOURAUTHTOKEN' \ + --header 'Content-type: application/json' \ --data '{ "": "" }' diff --git a/content/influxdb/v2.0/security/secrets/manage-secrets/delete.md b/content/influxdb/v2.0/security/secrets/manage-secrets/delete.md index 31f41e3a1..de268b012 100644 --- a/content/influxdb/v2.0/security/secrets/manage-secrets/delete.md +++ b/content/influxdb/v2.0/security/secrets/manage-secrets/delete.md @@ -35,8 +35,8 @@ to delete one or more secrets. ```bash -curl -XGET http://localhost:8086/api/v2/orgs//secrets/delete \ - --H 'Authorization: Token YOURAUTHTOKEN' +curl --request GET http://localhost:8086/api/v2/orgs//secrets/delete \ + --header 'Authorization: Token YOURAUTHTOKEN' \ --data '{ "secrets": [ "" diff --git a/content/influxdb/v2.0/security/secrets/manage-secrets/update.md b/content/influxdb/v2.0/security/secrets/manage-secrets/update.md index a06ec87d8..1798ab1f1 100644 --- a/content/influxdb/v2.0/security/secrets/manage-secrets/update.md +++ b/content/influxdb/v2.0/security/secrets/manage-secrets/update.md @@ -43,9 +43,9 @@ to update a secret in your organization. ```sh -curl -XPATCH http://localhost:8086/api/v2/orgs//secrets \ - -H 'Authorization: Token YOURAUTHTOKEN' \ - -H 'Content-type: application/json' \ +curl --request PATCH http://localhost:8086/api/v2/orgs//secrets \ + --header 'Authorization: Token YOURAUTHTOKEN' \ + --header 'Content-type: application/json' \ --data '{ "": "" }' diff --git a/content/influxdb/v2.0/security/secrets/manage-secrets/view.md b/content/influxdb/v2.0/security/secrets/manage-secrets/view.md index a3565afe7..7157e9a10 100644 --- a/content/influxdb/v2.0/security/secrets/manage-secrets/view.md +++ b/content/influxdb/v2.0/security/secrets/manage-secrets/view.md @@ -29,6 +29,6 @@ to view your organization's secrets keys. ```sh -curl -XGET http://localhost:8086/api/v2/orgs//secrets \ - -H 'Authorization: Token YOURAUTHTOKEN' +curl --request GET http://localhost:8086/api/v2/orgs//secrets \ + --header 'Authorization: Token YOURAUTHTOKEN' ``` diff --git a/content/influxdb/v2.0/write-data/best-practices/optimize-writes.md b/content/influxdb/v2.0/write-data/best-practices/optimize-writes.md index 9b0c08da9..5456f2005 100644 --- a/content/influxdb/v2.0/write-data/best-practices/optimize-writes.md +++ b/content/influxdb/v2.0/write-data/best-practices/optimize-writes.md @@ -94,7 +94,7 @@ When using the InfluxDB API `/write` endpoint to write data, set the `Content-En header to `gzip` to compress the request data. ```sh -curl -XPOST "http://localhost:8086/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \ +curl --request POST "http://localhost:8086/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \ --header "Authorization: Token YOURAUTHTOKEN" \ --header "Content-Encoding: gzip" \ --data-raw "mem,host=host1 used_percent=23.43234543 1556896326" diff --git a/content/influxdb/v2.0/write-data/delete-data.md b/content/influxdb/v2.0/write-data/delete-data.md index a49b50209..4217c56d2 100644 --- a/content/influxdb/v2.0/write-data/delete-data.md +++ b/content/influxdb/v2.0/write-data/delete-data.md @@ -108,25 +108,27 @@ The `influx` CLI is installed with **InfluxDB OSS**. If you're using **InfluxDB #### Delete data in InfluxDB Cloud ```sh -curl -X POST 'https://us-west-2-1.aws.cloud2.influxdata.com/api/v2/delete?orgID=' --H 'Authorization: Token \" and _field=\"\"", -"start": "2020-08-16T08:00:00Z", -"stop": "2020-08-17T08:00:00Z" +curl --request POST \ + https://us-west-2-1.aws.cloud2.influxdata.com/api/v2/delete?orgID= \ + --header 'Authorization: Token \" and _field=\"\"", + "start": "2020-08-16T08:00:00Z", + "stop": "2020-08-17T08:00:00Z" }' ``` #### Delete data in InfluxDB OSS ```sh -curl -XPOST http://localhost:8086/api/v2/delete/?org=myOrg&bucket=myBucket \ --H 'Authorization: Token ' \ --d '{ -"start": "1970-01-01T00:00:00.00Z", -"stop": "2020-01-01T00:00:00.00Z" -}' +curl --request POST http://localhost:8086/api/v2/delete/?org=myOrg&bucket=myBucket \ + --header 'Authorization: Token ' \ + --header 'Content-Type: application/json' \ + --data '{ + "start": "1970-01-01T00:00:00.00Z", + "stop": "2020-01-01T00:00:00.00Z" + }' ``` _For more information, see the [`/delete` API documentation](/influxdb/v2.0/api/#/paths/~1delete/post)._ diff --git a/content/influxdb/v2.0/write-data/developer-tools/api.md b/content/influxdb/v2.0/write-data/developer-tools/api.md index d270c52d4..ca22c4ff6 100644 --- a/content/influxdb/v2.0/write-data/developer-tools/api.md +++ b/content/influxdb/v2.0/write-data/developer-tools/api.md @@ -36,7 +36,7 @@ Compressing write requests reduces network bandwidth, but increases server-side {{% /code-tabs %}} {{% code-tab-content %}} ```sh -curl -XPOST "http://localhost:8086/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \ +curl --request POST "http://localhost:8086/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \ --header "Authorization: Token YOURAUTHTOKEN" \ --data-raw " mem,host=host1 used_percent=23.43234543 1556896326 @@ -48,7 +48,7 @@ mem,host=host2 used_percent=27.18294630 1556896336 {{% /code-tab-content %}} {{% code-tab-content %}} ```bash -curl -XPOST "http://localhost:8086/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \ +curl --request POST "http://localhost:8086/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \ --header "Authorization: Token YOURAUTHTOKEN" \ --header "Content-Encoding: gzip" \ --data-raw "