Add docs for a few functions

Signed-off-by: David Arendsen <darendsen@gamepoint.com>
This commit is contained in:
David Arendsen 2023-01-11 16:34:14 +01:00
commit 7a70c361c9
8 changed files with 227 additions and 12 deletions

View file

@ -0,0 +1,51 @@
# Flux Query Builder Docs
## Functions &raquo; addRangeInBetween()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Required</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>start</td>
<td>Yes</td>
<td>DateTime</td>
<td>Earliest time to include in results.</td>
</tr>
<tr>
<td>stop</td>
<td>Yes</td>
<td>DateTime</td>
<td>Latest time to include in results. Default is the current time.</td>
</tr>
</tbody>
</table>
### Example
```php
->addRangeInBetween(
new DateTime('2022-08-12 18:00:00'),
new DateTime('2022-08-12 20:00:00')
)
```
This will result in the following Flux function part:
```
|> range(
start: time(v: 2022-08-12T18:00:00Z),
stop: time(v: 2022-08-12T20:00:00Z)
)
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/range/)

View file

@ -0,0 +1,43 @@
# Flux Query Builder Docs
## Functions &raquo; addRangeStart()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Required</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>start</td>
<td>Yes</td>
<td>DateTime</td>
<td>Earliest time to include in results.</td>
</tr>
</tbody>
</table>
### Example
```php
->addRangeStart(
new DateTime('2022-08-12 18:00:00')
)
```
This will result in the following Flux function part:
```
|> range(
start: time(v: 2022-08-12T18:00:00Z)
)
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/range/)

49
docs/functions/from.md Normal file
View file

@ -0,0 +1,49 @@
# Flux Query Builder Docs
## Functions &raquo; from()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Required</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>settings</td>
<td>Yes</td>
<td>array</td>
<td>Settings to retrieve a data source.</td>
</tr>
</tbody>
</table>
### Example
```php
->from([
'bucket' => 'test_bucket',
'host' => 'https://us-west-2-1.aws.cloud2.influxdata.com',
'org' => 'example-org',
'token' => 'token'
])
```
This will result in the following Flux function part:
```
|> from(
bucket: "test_bucket",
host: "https://us-west-2-1.aws.cloud2.influxdata.com",
org: "example-org",
token: "token",
)
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/from/)

View file

@ -0,0 +1,39 @@
# Flux Query Builder Docs
## Functions &raquo; fromBucket()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Required</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>bucket</td>
<td>Yes</td>
<td>string</td>
<td>The bucket you want to retrieve data from.</td>
</tr>
</tbody>
</table>
### Example
```php
->fromBucket('test_bucket')
```
This will result in the following Flux function part:
```
|> from(bucket: "test_bucket")
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/from/)

View file

@ -0,0 +1,39 @@
# Flux Query Builder Docs
## Functions &raquo; fromMeasurement()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Required</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>measurement</td>
<td>Yes</td>
<td>string</td>
<td>The measurement to filter on.</td>
</tr>
</tbody>
</table>
### Example
```php
->fromMeasurement('test_measurement')
```
This will result in the following Flux function part:
```
|> filter(fn: (r) => r._measurement == "test_measurement")
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/filter/)