added cloud-only url replacement
parent
59c810712e
commit
ed272f713b
|
@ -625,6 +625,19 @@ http://localhost:9999
|
|||
```
|
||||
~~~
|
||||
|
||||
### Code examples only supported in InfluxDB Cloud
|
||||
Some functionality is only supported in InfluxDB Cloud and code examples should
|
||||
only use InfluxDB Cloud URLs. In these cases, use `https://cloud2.influxdata.com`
|
||||
as the placeholder in the code block. It will get updated on page load and when
|
||||
users select a Cloud region in the URL select modal.
|
||||
|
||||
~~~
|
||||
```sh
|
||||
# This URL will get updated
|
||||
https://cloud2.influxdata.com
|
||||
```
|
||||
~~~
|
||||
|
||||
## New Versions of InfluxDB
|
||||
Version bumps occur regularly in the documentation.
|
||||
Each minor version has its own directory with unique content.
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
var defaultUrl = "http://localhost:9999"
|
||||
var placeholderCloudUrl = "https://cloud2.influxdata.com"
|
||||
var defaultCloudUrl = "https://us-west-2-1.aws.cloud2.influxdata.com"
|
||||
var elementSelector = ".article--content pre:not(.preserve)"
|
||||
|
||||
// Retrieve the selected URL from the influxdb_url session cookie
|
||||
|
@ -99,6 +101,16 @@ updateUrls(defaultUrl, getUrl())
|
|||
// Append URL selector buttons to code blocks
|
||||
appendUrlSelector(getUrl())
|
||||
|
||||
// Append URL selector buttons to cloud-only code blocks
|
||||
appendUrlSelector(placeholderCloudUrl)
|
||||
|
||||
// Update cloud-only URLs on load
|
||||
if (cloudUrls.includes(getUrl())) {
|
||||
updateUrls(placeholderCloudUrl, getUrl())
|
||||
} else {
|
||||
updateUrls(placeholderCloudUrl, defaultCloudUrl)
|
||||
}
|
||||
|
||||
// Update URLs whenever you focus on the browser tab
|
||||
$(window).focus(function() {
|
||||
updateUrls(getPrevUrl(), getUrl())
|
||||
|
|
|
@ -34,7 +34,7 @@ Provide the following:
|
|||
{{% /note %}}
|
||||
|
||||
```sh
|
||||
curl -G http://localhost:9999/query?db=db&rp=rp \
|
||||
curl -G https://cloud2.influxdata.com/query?db=db&rp=rp \
|
||||
-H "Authorization: Token YourAuthToken" \
|
||||
--data-urlencode "q=SELECT used_percent FROM mem WHERE host=host1"
|
||||
```
|
||||
|
|
|
@ -84,7 +84,7 @@ manually create and manage DBRP mappings.
|
|||
|
||||
<!-- -->
|
||||
```sh
|
||||
curl -XPOST http://localhost:9999/api/v2/dbrps \
|
||||
curl -XPOST https://cloud2.influxdata.com/api/v2/dbrps \
|
||||
-H "Authorization: Token YourAuthToken" \
|
||||
-H 'Content-type: application/json' \
|
||||
-d '{
|
||||
|
|
|
@ -12,7 +12,7 @@ v2.0/tags: [influxql, query]
|
|||
products: [cloud]
|
||||
list_code_example: |
|
||||
<pre>
|
||||
<span class="api get">GET</span> http://localhost:9999/query
|
||||
<span class="api get">GET</span> https://cloud2.influxdata.com/query
|
||||
</pre>
|
||||
related:
|
||||
- /v2.0/query-data/influxql
|
||||
|
@ -22,7 +22,7 @@ The `/query` 1.x compatibility endpoint queries InfluxDB 2.0 using **InfluxQL**.
|
|||
Use the `GET` request method to query data from the `/query` endpoint.
|
||||
|
||||
<pre>
|
||||
<span class="api get">GET</span> `http://localhost:9999/query`
|
||||
<span class="api get">GET</span> https://cloud2.influxdata.com/query
|
||||
</pre>
|
||||
|
||||
The `/query` compatibility endpoint use the **database** and **retention policy**
|
||||
|
@ -82,7 +82,7 @@ The following precisions are available:
|
|||
|
||||
##### Query using basic authentication
|
||||
```sh
|
||||
curl -G http://localhost:9999/query \
|
||||
curl -G https://cloud2.influxdata.com/query \
|
||||
-u username:YourAuthToken \
|
||||
--data-urlencode "db=mydb" \
|
||||
--data-urlencode "q=SELECT used_percent FROM mem WHERE host=host1"
|
||||
|
@ -90,7 +90,7 @@ curl -G http://localhost:9999/query \
|
|||
|
||||
##### Query a non-default retention policy
|
||||
```sh
|
||||
curl -G http://localhost:9999/query \
|
||||
curl -G https://cloud2.influxdata.com/query \
|
||||
-H "Authorization: Basic username:YourAuthToken" \
|
||||
--data-urlencode "db=mydb" \
|
||||
--data-urlencode "rp=customrp" \
|
||||
|
@ -99,7 +99,7 @@ curl -G http://localhost:9999/query \
|
|||
|
||||
##### Execute multiple queries
|
||||
```sh
|
||||
curl -G http://localhost:9999/query \
|
||||
curl -G https://cloud2.influxdata.com/query \
|
||||
-H "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)"
|
||||
|
@ -107,7 +107,7 @@ curl -G http://localhost:9999/query \
|
|||
|
||||
##### Return query results with millisecond Unix timestamps
|
||||
```sh
|
||||
curl -G http://localhost:9999/query \
|
||||
curl -G https://cloud2.influxdata.com/query \
|
||||
-H "Authorization: Token YourAuthToken" \
|
||||
--data-urlencode "db=mydb" \
|
||||
--data-urlencode "rp=myrp" \
|
||||
|
@ -117,7 +117,7 @@ curl -G http://localhost:9999/query \
|
|||
|
||||
##### Use curl to execute InfluxQL queries from a file
|
||||
```sh
|
||||
curl -G http://localhost:9999/query \
|
||||
curl -G https://cloud2.influxdata.com/query \
|
||||
-H "Authorization: Token YourAuthToken" \
|
||||
--data-urlencode "db=mydb" \
|
||||
-F "q=@path/to/influxql.txt"
|
||||
|
|
|
@ -13,7 +13,7 @@ v2.0/tags: [write]
|
|||
products: [cloud]
|
||||
list_code_example: |
|
||||
<pre>
|
||||
<span class="api post">POST</span> http://localhost:9999/write
|
||||
<span class="api post">POST</span> https://cloud2.influxdata.com/write
|
||||
</pre>
|
||||
related:
|
||||
- /v2.0/reference/syntax/line-protocol
|
||||
|
@ -25,7 +25,7 @@ Use the `POST` request method to write [line protocol](/v2.0/reference/syntax/li
|
|||
to the `/write` endpoint.
|
||||
|
||||
<pre>
|
||||
<span class="api post">POST</span> http://localhost:9999/write
|
||||
<span class="api post">POST</span> https://cloud2.influxdata.com/write
|
||||
</pre>
|
||||
|
||||
## Authentication
|
||||
|
@ -72,21 +72,21 @@ The following precisions are available:
|
|||
|
||||
##### Write data using basic authentication
|
||||
```sh
|
||||
curl -XPOST http://localhost:9999/write?db=mydb \
|
||||
curl -XPOST https://cloud2.influxdata.com/write?db=mydb \
|
||||
-H "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 http://localhost:9999/write?db=mydb&rp=customrp \
|
||||
curl -XPOST https://cloud2.influxdata.com/write?db=mydb&rp=customrp \
|
||||
-H "Authorization: Basic username:YourAuthToken" \
|
||||
--data-binary "measurement,host=host1 field1=2i,field2=2.0 1577836800000000000"
|
||||
```
|
||||
|
||||
##### Write multiple lines of line protocol
|
||||
```sh
|
||||
curl -XPOST http://localhost:9999/write?db=mydb \
|
||||
curl -XPOST https://cloud2.influxdata.com/write?db=mydb \
|
||||
-H "Authorization: Token YourAuthToken" \
|
||||
--data-binary "measurement,host=host1 field1=2i,field2=2.0 1577836800000000000
|
||||
measurement,host=host2 field1=14i,field2=12.7 1577836800000000000
|
||||
|
@ -95,14 +95,14 @@ measurement,host=host3 field1=5i,field2=6.8 1577836800000000000"
|
|||
|
||||
##### Write data with millisecond Unix timestamps
|
||||
```sh
|
||||
curl -XPOST http://localhost:9999/write?db=mydb&precision=ms \
|
||||
curl -XPOST https://cloud2.influxdata.com/write?db=mydb&precision=ms \
|
||||
-H "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 http://localhost:9999/write?db=mydb \
|
||||
curl -XPOST https://cloud2.influxdata.com/write?db=mydb \
|
||||
-H "Authorization: Token YourAuthToken" \
|
||||
--data-binary @path/to/line-protocol.txt
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue