From c8597106e83451e2e66939d6c0de6d6eddafbe05 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 10 Aug 2022 09:11:10 -0600 Subject: [PATCH] Flux 0.178 (#4323) * flux 0.178 release notes * stdlib updates for flux 0.178 * add boundary package update to release notes --- content/flux/v0.x/release-notes.md | 14 ++ .../contrib/bonitoo-io/zenoss/endpoint.md | 46 ++++--- .../stdlib/contrib/bonitoo-io/zenoss/event.md | 40 +++--- .../v0.x/stdlib/date/boundaries/_index.md | 6 +- .../v0.x/stdlib/date/boundaries/friday.md | 3 +- .../v0.x/stdlib/date/boundaries/monday.md | 3 +- .../flux/v0.x/stdlib/date/boundaries/month.md | 3 +- .../v0.x/stdlib/date/boundaries/saturday.md | 3 +- .../v0.x/stdlib/date/boundaries/sunday.md | 3 +- .../v0.x/stdlib/date/boundaries/thursday.md | 3 +- .../v0.x/stdlib/date/boundaries/tuesday.md | 3 +- .../v0.x/stdlib/date/boundaries/wednesday.md | 3 +- .../flux/v0.x/stdlib/date/boundaries/week.md | 3 +- .../v0.x/stdlib/date/boundaries/yesterday.md | 3 +- .../v0.x/stdlib/experimental/date/_index.md | 36 ++++++ .../experimental/date/boundaries/_index.md | 44 +++++++ .../experimental/date/boundaries/friday.md | 74 +++++++++++ .../experimental/date/boundaries/monday.md | 76 +++++++++++ .../experimental/date/boundaries/month.md | 96 ++++++++++++++ .../experimental/date/boundaries/saturday.md | 74 +++++++++++ .../experimental/date/boundaries/sunday.md | 74 +++++++++++ .../experimental/date/boundaries/thursday.md | 74 +++++++++++ .../experimental/date/boundaries/tuesday.md | 74 +++++++++++ .../experimental/date/boundaries/wednesday.md | 57 +++++++++ .../experimental/date/boundaries/week.md | 120 ++++++++++++++++++ .../experimental/date/boundaries/yesterday.md | 73 +++++++++++ .../stdlib/experimental/http/requests/peek.md | 4 +- .../flux/v0.x/stdlib/http/requests/peek.md | 4 +- .../flux/v0.x/stdlib/pagerduty/endpoint.md | 2 +- .../flux/v0.x/stdlib/pagerduty/sendevent.md | 4 +- 30 files changed, 969 insertions(+), 53 deletions(-) create mode 100644 content/flux/v0.x/stdlib/experimental/date/_index.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/_index.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/friday.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/monday.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/month.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/saturday.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/sunday.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/thursday.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/tuesday.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/wednesday.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/week.md create mode 100644 content/flux/v0.x/stdlib/experimental/date/boundaries/yesterday.md diff --git a/content/flux/v0.x/release-notes.md b/content/flux/v0.x/release-notes.md index b07799bcf..949a957de 100644 --- a/content/flux/v0.x/release-notes.md +++ b/content/flux/v0.x/release-notes.md @@ -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 diff --git a/content/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/endpoint.md b/content/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/endpoint.md index 399d1574f..b4c6b492a 100644 --- a/content/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/endpoint.md +++ b/content/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/endpoint.md @@ -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. diff --git a/content/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/event.md b/content/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/event.md index 98004ddc6..eaffad001 100644 --- a/content/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/event.md +++ b/content/flux/v0.x/stdlib/contrib/bonitoo-io/zenoss/event.md @@ -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. diff --git a/content/flux/v0.x/stdlib/date/boundaries/_index.md b/content/flux/v0.x/stdlib/date/boundaries/_index.md index b33865cae..4fe517074 100644 --- a/content/flux/v0.x/stdlib/date/boundaries/_index.md +++ b/content/flux/v0.x/stdlib/date/boundaries/_index.md @@ -11,6 +11,7 @@ weight: 21 cascade: introduced: 0.172.0 + deprecated: 0.177.1 --- + + + + + + +## Packages + +{{< children show="sections" >}} diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/_index.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/_index.md new file mode 100644 index 000000000..60038a8fc --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/_index.md @@ -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 +--- + + + +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" >}} diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/friday.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/friday.md new file mode 100644 index 000000000..5047fe754 --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/friday.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/monday.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/monday.md new file mode 100644 index 000000000..72d341f9a --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/monday.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/month.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/month.md new file mode 100644 index 000000000..ad3b4eb82 --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/month.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/saturday.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/saturday.md new file mode 100644 index 000000000..ee608dfea --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/saturday.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/sunday.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/sunday.md new file mode 100644 index 000000000..f7481953b --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/sunday.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/thursday.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/thursday.md new file mode 100644 index 000000000..bad7af2a2 --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/thursday.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/tuesday.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/tuesday.md new file mode 100644 index 000000000..a52aa100b --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/tuesday.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/wednesday.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/wednesday.md new file mode 100644 index 000000000..c3c1602f6 --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/wednesday.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/week.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/week.md new file mode 100644 index 000000000..9ba865131 --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/week.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/date/boundaries/yesterday.md b/content/flux/v0.x/stdlib/experimental/date/boundaries/yesterday.md new file mode 100644 index 000000000..1001210e9 --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/date/boundaries/yesterday.md @@ -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 +--- + + + +`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) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/http/requests/peek.md b/content/flux/v0.x/stdlib/experimental/http/requests/peek.md index 7f388f6a2..28b88d8a9 100644 --- a/content/flux/v0.x/stdlib/experimental/http/requests/peek.md +++ b/content/flux/v0.x/stdlib/experimental/http/requests/peek.md @@ -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 %}} diff --git a/content/flux/v0.x/stdlib/http/requests/peek.md b/content/flux/v0.x/stdlib/http/requests/peek.md index 1f235d3bd..7b42e68cb 100644 --- a/content/flux/v0.x/stdlib/http/requests/peek.md +++ b/content/flux/v0.x/stdlib/http/requests/peek.md @@ -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 %}} diff --git a/content/flux/v0.x/stdlib/pagerduty/endpoint.md b/content/flux/v0.x/stdlib/pagerduty/endpoint.md index 31e94590a..b44151494 100644 --- a/content/flux/v0.x/stdlib/pagerduty/endpoint.md +++ b/content/flux/v0.x/stdlib/pagerduty/endpoint.md @@ -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 diff --git a/content/flux/v0.x/stdlib/pagerduty/sendevent.md b/content/flux/v0.x/stdlib/pagerduty/sendevent.md index b647d9ee1..6870b5df1 100644 --- a/content/flux/v0.x/stdlib/pagerduty/sendevent.md +++ b/content/flux/v0.x/stdlib/pagerduty/sendevent.md @@ -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 %}}