Merge pull request #171 from influxdata/api-docs

API documentation
pull/178/head
Scott Anderson 2019-04-18 12:19:16 -06:00 committed by GitHub
commit 33bdbf6de1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 6 deletions

View File

@ -8,7 +8,8 @@ menu:
name: Get started with InfluxDB Cloud
---
{{< cloud-name >}} is a fully managed and hosted version of the InfluxDB 2.x API. To get started, complete the tasks below.
{{< cloud-name >}} is a fully managed and hosted version of the [InfluxDB v2 API](/v2.0/reference/api/).
To get started, complete the tasks below.
{{% cloud-msg %}}
The InfluxDB v2.0 alpha documentation linked to in this article also applies to {{< cloud-name "short" >}} unless otherwise specified.

View File

@ -55,7 +55,7 @@ for using Telegraf with InfluxDB v2.0._
## Start Telegraf
### Configure your API token as an environment variable
Requests to the InfluxDB v2.0 API must include an authentication token.
Requests to the [InfluxDB v2 API](/v2.0/reference/api/) must include an authentication token.
A token identifies specific permissions to the InfluxDB instance.
Define the `INFLUX_TOKEN` environment variable using your token.

View File

@ -50,7 +50,8 @@ If you rename the binaries, all references to `influx` and `influxd` in this doc
{{% /note %}}
### Networking ports
By default, InfluxDB uses TCP port `9999` for client-server communication over InfluxDBs HTTP API.
By default, InfluxDB uses TCP port `9999` for client-server communication over
the [InfluxDB HTTP API](/v2.0/reference/api/).
## Start InfluxDB
Start InfluxDB by running the `influxd` daemon:
@ -108,7 +109,8 @@ If you rename the binaries, all references to `influx` and `influxd` in this doc
{{% /note %}}
### Networking ports
By default, InfluxDB uses TCP port `9999` for client-server communication over InfluxDBs HTTP API.
By default, InfluxDB uses TCP port `9999` for client-server communication over
the [InfluxDB HTTP API](/v2.0/reference/api/).
## Start InfluxDB
Start InfluxDB by running the `influxd` daemon:
@ -141,7 +143,8 @@ influxd --reporting-disabled
{{% tab-content %}}
### Download and run InfluxDB v2.0 alpha
Use `docker run` to download and run the InfluxDB v2.0 alpha Docker image.
Expose port `9999`, which InfluxDB uses for client-server communication over its HTTP API.
Expose port `9999`, which InfluxDB uses for client-server communication over
the [InfluxDB HTTP API](/v2.0/reference/api/).
```sh
docker run --name influxdb -p 9999:9999 quay.io/influxdb/influxdb:2.0.0-alpha

View File

@ -51,6 +51,8 @@ data = from(bucket: "example-bucket") |> range(start: -10m) # ...
```
## InfluxDB API
The [InfluxDB v2 API](/v2.0/reference/api) provides a programmatic
interface for all interactions with InfluxDB.
Query InfluxDB through the `/api/v2/query` endpoint.
Queried data is returned in annotated CSV format.
@ -61,7 +63,7 @@ In your request, set the following:
- `accept` header to `application/csv`.
- `content-type` header to `application/vnd.flux`.
This allows you to POST the Flux query in plain text and receive the annotated CSV response.
This lets you POST the Flux query in plain text and receive the annotated CSV response.
Below is an example `curl` command that queries InfluxDB:

View File

@ -0,0 +1,29 @@
---
title: InfluxDB v2 API
description: >
The InfluxDB v2 API provides a programmatic interface for interactions with InfluxDB.
Access the InfluxDB API using the `/api/v2/` endpoint.
menu: v2_0_ref
weight: 2
v2.0/tags: [api]
---
The InfluxDB v2 API provides a programmatic interface for interactions with InfluxDB.
Access the InfluxDB API using the `/api/v2/` endpoint.
## Authentication
InfluxDB uses [authentication tokens](/v2.0/security/tokens/) to authorize API requests.
Include your authentication token as an `Authorization` header in each request.
```sh
curl --request GET \
--url http://localhost:9999/api/v2/ \
--header 'Authorization: Token YOURAUTHTOKEN'
```
## View Influx v2 API Documentation
Full InfluxDB v2 API documentation is built into the `influxd` service.
To view the API documentation, [start InfluxDB](/v2.0/get-started/#start-influxdb)
and visit the `/docs` endpoint in a browser.
<a class="btn" href="http://localhost:9999/docs" target="\_blank">localhost:9999/docs</a>