diff --git a/content/enterprise_influxdb/v1.9/flux/flux-vs-influxql.md b/content/enterprise_influxdb/v1.9/flux/flux-vs-influxql.md index eaed03f80..c7ee8915a 100644 --- a/content/enterprise_influxdb/v1.9/flux/flux-vs-influxql.md +++ b/content/enterprise_influxdb/v1.9/flux/flux-vs-influxql.md @@ -106,7 +106,7 @@ join( ### Sort by tags InfluxQL's sorting capabilities are very limited, allowing you only to control the sort order of `time` using the `ORDER BY time` clause. -Flux's [`sort()` function](/{{< latest "flux" >}}/stdlib/universer/sort) sorts records based on list of columns. +Flux's [`sort()` function](/{{< latest "flux" >}}/stdlib/universe/sort) sorts records based on list of columns. Depending on the column type, records are sorted lexicographically, numerically, or chronologically. ```js diff --git a/content/flux/v0.x/_index.md b/content/flux/v0.x/_index.md index 4c0fa123f..dfa17e51c 100644 --- a/content/flux/v0.x/_index.md +++ b/content/flux/v0.x/_index.md @@ -9,6 +9,7 @@ menu: weight: 1 aliases: - /influxdb/v2.0/reference/flux/ + - /influxdb/v2.1/reference/flux/ - /influxdb/cloud/reference/flux/ --- diff --git a/content/flux/v0.x/spec/_index.md b/content/flux/v0.x/spec/_index.md index 49b767ba6..58359f3ae 100644 --- a/content/flux/v0.x/spec/_index.md +++ b/content/flux/v0.x/spec/_index.md @@ -10,6 +10,7 @@ weight: 2 aliases: - /influxdb/v2.0/reference/flux/language/ - /influxdb/cloud/reference/flux/language/ + - /flux/v0.x/language/ flux/v0.x/tags: [flux] --- diff --git a/content/flux/v0.x/stdlib/_index.md b/content/flux/v0.x/stdlib/_index.md index 3c9d93ba0..d9e7c03e1 100644 --- a/content/flux/v0.x/stdlib/_index.md +++ b/content/flux/v0.x/stdlib/_index.md @@ -6,7 +6,11 @@ description: > aliases: - /influxdb/v2.0/reference/flux/functions/ - /influxdb/v2.0/reference/flux/stdlib/ + - /influxdb/v2.1/reference/flux/functions/ + - /influxdb/v2.1/reference/flux/stdlib/ - /influxdb/cloud/reference/flux/stdlib/ + - /influxdb/cloud/reference/flux/stdlib/ + - /flux/v0.x/functions/ flux/v0.x/tags: [flux, functions, package] menu: flux_0_x_ref: diff --git a/content/flux/v0.x/stdlib/array/_index.md b/content/flux/v0.x/stdlib/array/_index.md index 67664fe54..781b633a8 100644 --- a/content/flux/v0.x/stdlib/array/_index.md +++ b/content/flux/v0.x/stdlib/array/_index.md @@ -9,6 +9,7 @@ aliases: - /influxdb/cloud/reference/flux/stdlib/experimental/array/ - /influxdb/v2.0/reference/flux/stdlib/array/ - /influxdb/cloud/reference/flux/stdlib/array/ + - /flux/v0.x/stdlib/experimental/array/ menu: flux_0_x_ref: name: array diff --git a/content/flux/v0.x/stdlib/array/from.md b/content/flux/v0.x/stdlib/array/from.md index 78165b2bb..ad442af6c 100644 --- a/content/flux/v0.x/stdlib/array/from.md +++ b/content/flux/v0.x/stdlib/array/from.md @@ -7,6 +7,7 @@ aliases: - /influxdb/cloud/reference/flux/stdlib/array/from/ - /influxdb/v2.0/reference/flux/stdlib/experimental/array/from/ - /influxdb/cloud/reference/flux/stdlib/experimental/array/from/ + - /flux/v0.x/stdlib/experimental/array/from/ menu: flux_0_x_ref: name: array.from diff --git a/deploy/edge.js b/deploy/edge.js index bffd1175f..ce92b5f48 100644 --- a/deploy/edge.js +++ b/deploy/edge.js @@ -97,6 +97,9 @@ exports.handler = (event, context, callback) => { //////////////////////////// v2 subdomain redirect /////////////////////////// permanentRedirect(request.headers.host[0].value === 'v2.docs.influxdata.com', `https://docs.influxdata.com${request.uri}`); + ///////////////////////// Force v in version numbers ///////////////////////// + permanentRedirect(/(^\/[\w]*\/)(\d\.)/.test(request.uri), request.uri.replace(/(^\/[\w]*\/)(\d\.)/, `$1v$2`)); + ////////////////////////// Latest version redirects ////////////////////////// temporaryRedirect(/\/influxdb\/latest/.test(request.uri), request.uri.replace(/\/latest/, `/${latestVersions['influxdb']}`)); temporaryRedirect(/\/telegraf\/latest/.test(request.uri), request.uri.replace(/\/latest/, `/${latestVersions['telegraf']}`)); @@ -130,6 +133,15 @@ exports.handler = (event, context, callback) => { temporaryRedirect(/\/influxdb\/(?:v2\.[0-9]{1,2}|cloud)\/reference\/flux\/stdlib\/built-in\/transformations\/$/.test(request.uri), `/flux/${latestVersions['flux']}/function-types/`); temporaryRedirect(/\/influxdb\/(v2\.[0-9]{1,2}|cloud)\/reference\/flux\/stdlib\/built-in\/$/.test(request.uri), `/flux/${latestVersions['flux']}/stdlib/universe/`); + temporaryRedirect(/\/flux\/v0\.x\/stdlib\/built-in\/(?:inputs\/|outputs\/|misc\/|tests\/)(\w+\/$)/.test(request.uri), request.uri.replace(/\/flux\/v0\.x\/stdlib\/built-in\/(?:inputs\/|outputs\/|misc\/|tests\/)(\w+\/$)/, `/flux/${latestVersions['flux']}/stdlib/universe/$1`)); + temporaryRedirect(/\/flux\/v0\.x\/stdlib\/built-in\/(?:inputs\/|outputs\/|misc\/|tests\/)$/.test(request.uri), `/flux/${latestVersions['flux']}/function-types/`); + temporaryRedirect(/\/flux\/v0\.x\/stdlib\/built-in\/transformations\/(?:aggregates\/|selectors\/|stream-table\/|type-conversions\/)(\w+\/$)/.test(request.uri), request.uri.replace(/\/flux\/v0\.x\/stdlib\/built-in\/transformations\/(?:aggregates\/|selectors\/|stream-table\/|type-conversions\/)(\w+\/$)/, `/flux/${latestVersions['flux']}/stdlib/universe/$1`)); + temporaryRedirect(/\/flux\/v0\.x\/stdlib\/built-in\/transformations\/(?:aggregates\/|selectors\/|stream-table\/|type-conversions\/)/.test(request.uri), `/flux/${latestVersions['flux']}/function-types/`); + temporaryRedirect(/\/flux\/v0\.x\/stdlib\/built-in\/transformations\/(\w+\/$)/.test(request.uri), request.uri.replace(/\/flux\/v0\.x\/stdlib\/built-in\/transformations\/(\w+\/$)/, `/flux/${latestVersions['flux']}/stdlib/universe/$1`)); + temporaryRedirect(/\/flux\/v0\.x\/stdlib\/built-in\/transformations\/$/.test(request.uri), `/flux/${latestVersions['flux']}/function-types/`); + temporaryRedirect(/\/flux\/v0\.x\/stdlib\/built-in\/$/.test(request.uri), `/flux/${latestVersions['flux']}/stdlib/universe/`); + temporaryRedirect(/\/flux\/v0\.x\/stdlib\/universe\/(?:inputs\/|outputs\/|misc\/|tests\/|transformations\/|selectors\/|aggregates\/)$/.test(request.uri), `/flux/${latestVersions['flux']}/function-types/`); + // Redirect Flux stdlib/influxdb sections to Flux stdlib/influxdata docs temporaryRedirect(/\/influxdb\/(v2\.[0-9]{1,2}|cloud)\/reference\/flux\/stdlib\/influxdb\//.test(request.uri), request.uri.replace(/\/influxdb\/(?:v2\.[0-9]{1,2}|cloud)\/reference\/flux\/stdlib\/influxdb\//, `/flux/${latestVersions['flux']}/stdlib/influxdata/influxdb/`)); temporaryRedirect(/\/influxdb\/(v2\.[0-9]{1,2}|cloud)\/reference\/flux\/stdlib\/monitor\//.test(request.uri), request.uri.replace(/\/influxdb\/(?:v2\.[0-9]{1,2}|cloud)\/reference\/flux\/stdlib\/monitor\//, `/flux/${latestVersions['flux']}/stdlib/influxdata/influxdb/monitor/`)); @@ -157,6 +169,8 @@ exports.handler = (event, context, callback) => { // Generic Flux stdlib redirect temporaryRedirect(/\/influxdb\/(v2\.[0-9]{1,2}|cloud)\/reference\/flux\/stdlib\//.test(request.uri), request.uri.replace(/\/influxdb\/(?:v2\.[0-9]{1,2}|cloud)\/reference\/flux\/stdlib\//, `/flux/${latestVersions['flux']}/stdlib/`)); + temporaryRedirect(/\/flux\/v0\.x\/functions\//.test(request.uri), request.uri.replace(/(\/flux\/v0\.x\/)functions\/(.*)/, `$1stdlib/$2`)); + temporaryRedirect(/\/flux\/v0\.x\/stdlib\/experimental\/to\/.+/.test(request.uri), request.uri.replace(/(\/flux\/v0\.x\/stdlib\/experimental\/)to\/(.+)/, `$1$2`)); // Redirect outdated Chronograf links temporaryRedirect(/\/flux\/v[0,1]\.x\/stdlib\/built-in\/(?:inputs\/|outputs\/|misc\/|tests\/)(\w+\/$)/.test(request.uri), request.uri.replace(/\/flux\/v[0,1]\.x\/stdlib\/built-in\/(?:inputs\/|outputs\/|misc\/|tests\/)(\w+\/$)/, `/flux/${latestVersions['flux']}/stdlib/universe/$1`));