Flux 0.178 (#4323)

* flux 0.178 release notes

* stdlib updates for flux 0.178

* add boundary package update to release notes
pull/4236/head^2
Scott Anderson 2022-08-10 09:11:10 -06:00 committed by GitHub
parent c5d197cd75
commit c8597106e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 969 additions and 53 deletions

View File

@ -10,6 +10,20 @@ aliases:
- /influxdb/cloud/reference/release-notes/flux/
---
## v0.178.0 [2022-08-09]
### Features
- Support `apiKey` parameter in [`zenoss.event()`](/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/event/)
and [`zenoss.endpoint()`](/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/endpoint/).
- Remove `vectorizedConst` feature flag.
### Bug fixes
- Deprecate `date/boundaries` package in favor of [`experimental/date/boundaries`](/flux/v0.x/stdlib/experimental/date/boundaries/).
- Update pattern matching to specify successor counts.
- Restore integer return value for [`pagerduty.sendEvent()`](/flux/v0.x/stdlib/pagerduty/sendevent/).
---
## v0.177.1 [2022-08-08]
### Bug fixes

View File

@ -20,7 +20,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/contrib/bonitoo-io/zenoss/zenoss.flux#L204-L243
https://github.com/influxdata/flux/blob/master/stdlib/contrib/bonitoo-io/zenoss/zenoss.flux#L217-L258
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
@ -53,28 +53,29 @@ For more information, see `zenoss.event()` parameters.
```js
(
password: string,
url: string,
username: string,
?action: A,
?method: B,
?tid: C,
?type: D,
?apiKey: B,
?method: C,
?password: string,
?tid: D,
?type: E,
?username: string,
) => (
mapFn: (
r: E,
r: F,
) => {
F with
summary: N,
severity: M,
message: L,
eventClassKey: K,
eventClass: J,
device: I,
component: H,
collector: G,
G with
summary: O,
severity: N,
message: M,
eventClassKey: L,
eventClass: K,
device: J,
component: I,
collector: H,
},
) => (<-tables: stream[E]) => stream[{E with _sent: string}]
) => (<-tables: stream[F]) => stream[{F with _sent: string}] where B: Equatable
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
@ -88,19 +89,26 @@ Zenoss [router endpoint URL](https://help.zenoss.com/zsd/RM/configuring-resource
### username
({{< req >}})
Zenoss username to use for HTTP BASIC authentication.
Default is `""` (no authentication).
### password
({{< req >}})
Zenoss password to use for HTTP BASIC authentication.
Default is `""` (no authentication).
### apiKey
Zenoss cloud API key.
Default is `""` (no API key).
### action
Zenoss router name.

View File

@ -20,7 +20,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/contrib/bonitoo-io/zenoss/zenoss.flux#L88-L127
https://github.com/influxdata/flux/blob/master/stdlib/contrib/bonitoo-io/zenoss/zenoss.flux#L90-L138
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
@ -35,22 +35,23 @@ Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
```js
(
password: string,
severity: A,
url: string,
username: string,
?action: B,
?collector: C,
?component: D,
?device: E,
?eventClass: F,
?eventClassKey: G,
?message: H,
?method: I,
?summary: J,
?tid: K,
?type: L,
) => int
?apiKey: C,
?collector: D,
?component: E,
?device: F,
?eventClass: G,
?eventClassKey: H,
?message: I,
?method: J,
?password: string,
?summary: K,
?tid: L,
?type: M,
?username: string,
) => int where C: Equatable
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
@ -64,19 +65,26 @@ Zenoss [router endpoint URL](https://help.zenoss.com/zsd/RM/configuring-resource
### username
({{< req >}})
Zenoss username to use for HTTP BASIC authentication.
Default is `""` (no authentication).
### password
({{< req >}})
Zenoss password to use for HTTP BASIC authentication.
Default is `""` (no authentication).
### apiKey
Zenoss cloud API key.
Default is `""` (no API key).
### action
Zenoss router name.

View File

@ -11,6 +11,7 @@ weight: 21
cascade:
introduced: 0.172.0
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -36,7 +37,10 @@ Import the `date/boundaries` package:
import "date/boundaries"
```
{{% warn %}}
#### Deprecated
The `boundaries` package is deprecated in favor of [`experimental/date/boundaries`](/flux/v0.x/stdlib/experimental/date/boundaries/).
{{% /warn %}}
## Functions

View File

@ -9,6 +9,7 @@ menu:
identifier: date/boundaries/friday
weight: 201
flux/v0.x/tags: [date/time]
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -20,7 +21,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L254-L256
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L273-L277
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -10,6 +10,7 @@ menu:
identifier: date/boundaries/monday
weight: 201
flux/v0.x/tags: [date/time]
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -21,7 +22,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L111-L113
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L118-L122
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -9,6 +9,7 @@ menu:
identifier: date/boundaries/month
weight: 201
flux/v0.x/tags: [date/time]
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -20,7 +21,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L378-L384
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L406-L414
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -9,6 +9,7 @@ menu:
identifier: date/boundaries/saturday
weight: 201
flux/v0.x/tags: [date/time]
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -20,7 +21,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L290-L292
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L312-L316
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -9,6 +9,7 @@ menu:
identifier: date/boundaries/sunday
weight: 201
flux/v0.x/tags: [date/time]
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -20,7 +21,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L326-L328
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L351-L355
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -9,6 +9,7 @@ menu:
identifier: date/boundaries/thursday
weight: 201
flux/v0.x/tags: [date/time]
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -20,7 +21,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L218-L220
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L234-L238
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -9,6 +9,7 @@ menu:
identifier: date/boundaries/tuesday
weight: 201
flux/v0.x/tags: [date/time]
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -20,7 +21,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L147-L149
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L157-L161
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -9,6 +9,7 @@ menu:
identifier: date/boundaries/wednesday
weight: 201
flux/v0.x/tags: [date/time]
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -20,7 +21,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L183-L185
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L196-L200
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -10,6 +10,7 @@ menu:
identifier: date/boundaries/week
weight: 201
flux/v0.x/tags: [date/time]
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -21,7 +22,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L448-L454
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L479-L487
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -10,6 +10,7 @@ menu:
weight: 201
flux/v0.x/tags: [date/time]
introduced: 0.172.0
deprecated: 0.177.1
---
<!------------------------------------------------------------------------------
@ -21,7 +22,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L44-L46
https://github.com/influxdata/flux/blob/master/stdlib/date/boundaries/boundaries.flux#L48-L52
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -0,0 +1,36 @@
---
title: date package
description: >
menu:
flux_0_x_ref:
name: date
parent: experimental
identifier: experimental/date
weight: 21
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the comments above the package
declaration in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/date.flux
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
## Packages
{{< children show="sections" >}}

View File

@ -0,0 +1,44 @@
---
title: boundaries package
description: >
The `boundaries` package provides operators for finding the boundaries around certain days, months, and weeks.
menu:
flux_0_x_ref:
name: boundaries
parent: experimental/date
identifier: experimental/date/boundaries
weight: 31
cascade:
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the comments above the package
declaration in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
The `boundaries` package provides operators for finding the boundaries around certain days, months, and weeks.
Import the `experimental/date/boundaries` package:
```js
import "experimental/date/boundaries"
```
## Functions
{{< children type="functions" show="pages" >}}

View File

@ -0,0 +1,74 @@
---
title: boundaries.friday() function
description: >
`boundaries.friday()` returns a record with `start` and `stop` boundary timestamps for last Friday.
menu:
flux_0_x_ref:
name: boundaries.friday
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/friday
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L259-L261
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.friday()` returns a record with `start` and `stop` boundary timestamps for last Friday.
Last Friday is relative to `now()`. If today is Friday, the function returns boundaries for the previous Friday.
##### Function type signature
```js
() => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Examples
- [Return start and stop timestamps of last Friday](#return-start-and-stop-timestamps-of-last-friday)
- [Query data collected last Friday](#query-data-collected-last-friday)
### Return start and stop timestamps of last Friday
```js
import "experimental/date/boundaries"
option location = timezone.fixed(offset: -8h)
option now = () => 2021-12-30T00:40:44Z
boundaries.friday()// Returns {start: 2021-12-24T08:00:00Z, stop:2022-12-25T08:00:00Z }
```
### Query data collected last Friday
```js
import "experimental/date/boundaries"
day = boundaries.friday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
```

View File

@ -0,0 +1,76 @@
---
title: boundaries.monday() function
description: >
`boundaries.monday()` returns a record with `start` and `stop` boundary timestamps of last Monday.
Last Monday is relative to `now()`. If today is Monday, the function returns boundaries for the previous Monday.
menu:
flux_0_x_ref:
name: boundaries.monday
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/monday
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L112-L114
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.monday()` returns a record with `start` and `stop` boundary timestamps of last Monday.
Last Monday is relative to `now()`. If today is Monday, the function returns boundaries for the previous Monday.
##### Function type signature
```js
() => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Examples
- [Return start and stop timestamps of last Monday](#return-start-and-stop-timestamps-of-last-monday)
- [Query data collected last Monday](#query-data-collected-last-monday)
### Return start and stop timestamps of last Monday
```js
import "experimental/date/boundaries"
option location = timezone.fixed(offset: -8h)
option now = () => 2021-12-30T00:40:44Z
boundaries.monday()// Returns {start: 2021-12-27T08:00:00Z, stop:2021-12-28T08:00:00Z }
```
### Query data collected last Monday
```js
import "experimental/date/boundaries"
day = boundaries.monday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
```

View File

@ -0,0 +1,96 @@
---
title: boundaries.month() function
description: >
`boundaries.month()` returns a record with `start` and `stop` boundary timestamps for the current month.
menu:
flux_0_x_ref:
name: boundaries.month
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/month
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L386-L392
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.month()` returns a record with `start` and `stop` boundary timestamps for the current month.
`now()` determines the current month.
##### Function type signature
```js
(?month_offset: int) => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Parameters
### month_offset
Number of months to offset from the current month. Default is `0`.
Use a negative offset to return boundaries from previous months.
Use a positive offset to return boundaries for future months.
## Examples
- [Return start and stop timestamps for the current month](#return-start-and-stop-timestamps-for-the-current-month)
- [Query data from this month](#query-data-from-this-month)
- [Query data from last month](#query-data-from-last-month)
### Return start and stop timestamps for the current month
```js
import "experimental/date/boundaries"
option now = () => 2022-05-10T10:10:00Z
boundaries.month()// Returns {start:2022-05-01T00:00:00.000000000Z, stop:2022-06-01T00:00:00.000000000Z}
```
### Query data from this month
```js
import "experimental/date/boundaries"
thisMonth = boundaries.month()
from(bucket: "example-bucket")
|> range(start: thisMonth.start, stop: thisMonth.stop)
```
### Query data from last month
```js
import "experimental/date/boundaries"
lastMonth = boundaries.month(month_offset: -1)
from(bucket: "example-bucket")
|> range(start: lastMonth.start, stop: lastMonth.stop)
```

View File

@ -0,0 +1,74 @@
---
title: boundaries.saturday() function
description: >
`boundaries.saturday()` returns a record with `start` and `stop` boundary timestamps for last Saturday.
menu:
flux_0_x_ref:
name: boundaries.saturday
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/saturday
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L296-L298
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.saturday()` returns a record with `start` and `stop` boundary timestamps for last Saturday.
Last Saturday is relative to `now()`. If today is Saturday, the function returns boundaries for the previous Saturday.
##### Function type signature
```js
() => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Examples
- [Return start and stop timestamps of last Saturday](#return-start-and-stop-timestamps-of-last-saturday)
- [Query data collected last Saturday](#query-data-collected-last-saturday)
### Return start and stop timestamps of last Saturday
```js
import "experimental/date/boundaries"
option location = timezone.fixed(offset: -8h)
option now = () => 2021-12-30T00:40:44Z
boundaries.saturday()// Returns {start: 2022-12-25T08:00:00Z, stop:2022-12-26T08:00:00Z }
```
### Query data collected last Saturday
```js
import "experimental/date/boundaries"
day = boundaries.saturday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
```

View File

@ -0,0 +1,74 @@
---
title: boundaries.sunday() function
description: >
`boundaries.sunday()` returns a record with `start` and `stop` boundary timestamps for last Sunday.
menu:
flux_0_x_ref:
name: boundaries.sunday
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/sunday
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L333-L335
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.sunday()` returns a record with `start` and `stop` boundary timestamps for last Sunday.
Last Sunday is relative to `now()`. If today is Sunday, the function returns boundaries for the previous Sunday.
##### Function type signature
```js
() => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Examples
- [Return start and stop timestamps of last Sunday](#return-start-and-stop-timestamps-of-last-sunday)
- [Query data collected last Sunday](#query-data-collected-last-sunday)
### Return start and stop timestamps of last Sunday
```js
import "experimental/date/boundaries"
option location = timezone.fixed(offset: -8h)
option now = () => 2021-12-30T00:40:44Z
boundaries.sunday()// Returns {start: 2021-12-26T08:00:00Z, stop:2021-12-27T08:00:00Z }
```
### Query data collected last Sunday
```js
import "experimental/date/boundaries"
day = boundaries.sunday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
```

View File

@ -0,0 +1,74 @@
---
title: boundaries.thursday() function
description: >
`boundaries.thursday()` returns a record with `start` and `stop` boundary timestamps for last Thursday.
menu:
flux_0_x_ref:
name: boundaries.thursday
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/thursday
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L222-L224
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.thursday()` returns a record with `start` and `stop` boundary timestamps for last Thursday.
Last Thursday is relative to `now()`. If today is Thursday, the function returns boundaries for the previous Thursday.
##### Function type signature
```js
() => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Examples
- [Return start and stop timestamps of last Thursday](#return-start-and-stop-timestamps-of-last-thursday)
- [Query data collected last Thursday](#query-data-collected-last-thursday)
### Return start and stop timestamps of last Thursday
```js
import "experimental/date/boundaries"
option location = timezone.fixed(offset: -8h)
option now = () => 2021-12-30T00:40:44Z
boundaries.thursday()// Returns {start: 2021-12-23T08:00:00Z, stop:2021-12-24T08:00:00Z }
```
### Query data collected last Thursday
```js
import "experimental/date/boundaries"
day = boundaries.thursday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
```

View File

@ -0,0 +1,74 @@
---
title: boundaries.tuesday() function
description: >
`boundaries.tuesday()` returns a record with `start` and `stop` boundary timestamps of last Tuesday.
menu:
flux_0_x_ref:
name: boundaries.tuesday
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/tuesday
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L149-L151
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.tuesday()` returns a record with `start` and `stop` boundary timestamps of last Tuesday.
Last Tuesday is relative to `now()`. If today is Tuesday, the function returns boundaries for the previous Tuesday.
##### Function type signature
```js
() => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Examples
- [Return start and stop timestamps of last Tuesday](#return-start-and-stop-timestamps-of-last-tuesday)
- [Query data collected last Tuesday](#query-data-collected-last-tuesday)
### Return start and stop timestamps of last Tuesday
```js
import "experimental/date/boundaries"
option location = timezone.fixed(offset: -8h)
option now = () => 2021-12-30T00:40:44Z
boundaries.tuesday()// Returns {start: 2021-12-28T08:00:00Z, stop:2021-12-29T08:00:00Z }
```
### Query data collected last Tuesday
```js
import "experimental/date/boundaries"
day = boundaries.tuesday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
```

View File

@ -0,0 +1,57 @@
---
title: boundaries.wednesday() function
description: >
`boundaries.wednesday()` returns a record with `start` and `stop` boundary timestamps for last Wednesday.
menu:
flux_0_x_ref:
name: boundaries.wednesday
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/wednesday
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L186-L188
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.wednesday()` returns a record with `start` and `stop` boundary timestamps for last Wednesday.
Last Wednesday is relative to `now()`. If today is Wednesday, the function returns boundaries for the previous Wednesday.
##### Function type signature
```js
() => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Examples
### Query data collected last Wednesday
```js
import "experimental/date/boundaries"
day = boundaries.wednesday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
```

View File

@ -0,0 +1,120 @@
---
title: boundaries.week() function
description: >
`boundaries.week()` returns a record with `start` and `stop` boundary timestamps of the current week.
By default, weeks start on Monday.
menu:
flux_0_x_ref:
name: boundaries.week
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/week
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L457-L471
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.week()` returns a record with `start` and `stop` boundary timestamps of the current week.
By default, weeks start on Monday.
##### Function type signature
```js
(?start_sunday: bool, ?week_offset: int) => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Parameters
### start_sunday
Indicate if the week starts on Sunday. Default is `false`.
When set to `false`, the week starts on Monday.
### week_offset
Number of weeks to offset from the current week. Default is `0`.
Use a negative offset to return boundaries from previous weeks.
Use a positive offset to return boundaries for future weeks.
## Examples
- [Return start and stop timestamps of the current week starting on Monday](#return-start-and-stop-timestamps-of-the-current-week-starting-on-monday)
- [Return start and stop timestamps of the current week starting on Sunday](#return-start-and-stop-timestamps-of-the-current-week-starting-on-sunday)
- [Query data from the current week](#query-data-from-the-current-week)
- [Query data from last week](#query-data-from-last-week)
### Return start and stop timestamps of the current week starting on Monday
```js
import "experimental/date/boundaries"
option now = () => 2022-05-10T00:00:00.00001Z
boundaries.week()// Returns {start: 2022-05-09T00:00:00.000000000Z, stop: 2022-05-16T00:00:00.000000000Z}
```
### Return start and stop timestamps of the current week starting on Sunday
```js
import "experimental/date/boundaries"
option now = () => 2022-05-10T10:10:00Z
boundaries.week(
start_sunday: true,
)// Returns {start: 2022-05-08T00:00:00.000000000Z, stop: 2022-05-14T00:00:00.000000000Z}
```
### Query data from the current week
```js
import "experimental/date/boundaries"
thisWeek = boundaries.week()
from(bucket: "example-bucket")
|> range(start: thisWeek.start, stop: thisWeek.stop)
```
### Query data from last week
```js
import "experimental/date/boundaries"
lastWeek = boundaries.week(week_offset: -1)
from(bucket: "example-bucket")
|> range(start: lastWeek.start, stop: lastWeek.stop)
```

View File

@ -0,0 +1,73 @@
---
title: boundaries.yesterday() function
description: >
`boundaries.yesterday()` returns a record with `start` and `stop` boundary timestamps for yesterday.
menu:
flux_0_x_ref:
name: boundaries.yesterday
parent: experimental/date/boundaries
identifier: experimental/date/boundaries/yesterday
weight: 301
flux/v0.x/tags: [date/time]
introduced: 0.177.1
---
<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/experimental/date/boundaries/boundaries.flux#L44-L46
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->
`boundaries.yesterday()` returns a record with `start` and `stop` boundary timestamps for yesterday.
Yesterday is relative to `now()`.
##### Function type signature
```js
() => {stop: time, start: time}
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}
## Examples
- [Return start and stop timestamps of yesterday](#return-start-and-stop-timestamps-of-yesterday)
- [Query data from yesterday](#query-data-from-yesterday)
### Return start and stop timestamps of yesterday
```js
import "experimental/date/boundaries"
option now = () => 2022-01-02T13:45:28Z
boundaries.yesterday()// Returns {start: 2022-01-01T00:00:00.000000000Z, stop: 2022-01-02T00:00:00.000000000Z}
```
### Query data from yesterday
```js
import "experimental/date/boundaries"
day = boundaries.yesterday()
from(bucket: "example-bucket")
|> range(start: day.start, stop: day.stop)
```

View File

@ -87,12 +87,12 @@ requests.peek(response: requests.get(url: "https://api.agify.io", params: ["name
Connection: keep-alive,
Content-Length: 41,
Content-Type: application/json; charset=utf-8,
Date: Mon, 01 Aug 2022 17:34:48 GMT,
Date: Tue, 09 Aug 2022 20:20:45 GMT,
Etag: W/"29-klDahUESBLxHyQ7NiaetCn2CvCI",
Server: nginx/1.16.1,
X-Rate-Limit-Limit: 1000,
X-Rate-Limit-Remaining: 998,
X-Rate-Reset: 23111
X-Rate-Reset: 13154
] | 200 |
{{% /expand %}}

View File

@ -82,12 +82,12 @@ requests.peek(response: requests.get(url: "https://api.agify.io", params: ["name
Connection: keep-alive,
Content-Length: 41,
Content-Type: application/json; charset=utf-8,
Date: Mon, 01 Aug 2022 17:34:50 GMT,
Date: Tue, 09 Aug 2022 20:20:47 GMT,
Etag: W/"29-klDahUESBLxHyQ7NiaetCn2CvCI",
Server: nginx/1.16.1,
X-Rate-Limit-Limit: 1000,
X-Rate-Limit-Remaining: 996,
X-Rate-Reset: 23110
X-Rate-Reset: 13153
] | 200 |
{{% /expand %}}

View File

@ -20,7 +20,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/pagerduty/pagerduty.flux#L306-L338
https://github.com/influxdata/flux/blob/master/stdlib/pagerduty/pagerduty.flux#L341-L373
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md

View File

@ -20,7 +20,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/pagerduty/pagerduty.flux#L195-L237
https://github.com/influxdata/flux/blob/master/stdlib/pagerduty/pagerduty.flux#L241-L272
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
@ -49,7 +49,7 @@ Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
?component: K,
?customDetails: L,
?pagerdutyURL: string,
) => {statusCode: int, headers: [string:string], duration: duration, body: bytes} where L: Equatable
) => int where L: Equatable
```
{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}