From ec1b4219cb97cc61b1f85634a4b04ecd5f5800db Mon Sep 17 00:00:00 2001 From: Michael Desa Date: Thu, 6 Sep 2018 10:43:10 -0400 Subject: [PATCH 1/5] doc(http): remove ping endpoint from swagger Co-authored-by: Chris Goller Co-authored-by: Michael Desa --- http/swagger.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/http/swagger.yml b/http/swagger.yml index 4b7716ccb9..aa7d63c04c 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -133,22 +133,6 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - /ping: - servers: - - url: / - get: - tags: - - Health - summary: Report if service is running - responses: - '204': - description: Server is healthy - default: - description: Any response other than 204 is an internal server error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" /healthz: get: tags: From 23b468d9480c81efa667ec81e06f306b06bd6482 Mon Sep 17 00:00:00 2001 From: Michael Desa Date: Thu, 6 Sep 2018 12:22:03 -0400 Subject: [PATCH 2/5] doc(http): add org query param to required resource routes Co-authored-by: Chris Goller Co-authored-by: Michael Desa --- http/swagger.yml | 128 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 108 insertions(+), 20 deletions(-) diff --git a/http/swagger.yml b/http/swagger.yml index aa7d63c04c..1328aa526c 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -152,6 +152,13 @@ paths: tags: - Sources summary: Creates a Source + parameters: + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string requestBody: description: source to create required: true @@ -176,6 +183,13 @@ paths: tags: - Sources summary: Get all sources + parameters: + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string responses: '200': description: all sources @@ -301,6 +315,12 @@ paths: type: string required: true description: ID of the source + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string responses: '200': description: a source @@ -325,6 +345,13 @@ paths: tags: - Views summary: A view contains information about the visual representation of data + parameters: + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string requestBody: description: view to create required: true @@ -349,6 +376,13 @@ paths: tags: - Views summary: Get all views + parameters: + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string responses: '200': description: all views @@ -461,6 +495,13 @@ paths: tags: - Dashboards summary: Create a dashboard + parameters: + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string requestBody: description: dashboard to create required: true @@ -485,6 +526,13 @@ paths: tags: - Dashboards summary: Get all dashboards + parameters: + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string responses: '200': description: all dashboards @@ -938,6 +986,12 @@ paths: - flux summary: description of the query capabilities of the instance parameters: + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string - in: header name: Authorization description: the authorization header should be in the format of `Token ` @@ -984,30 +1038,16 @@ paths: schema: type: string - in: query - name: organization + name: org description: specifies the name of the organization executing the query. schema: type: string - - in: query - name: query - description: flux query string to execute; used if there is no POST body. - schema: - type: string requestBody: description: flux query or specification to execute content: application/json: schema: - oneOf: - - $ref: "#/components/schemas/Query" - - $ref: "#/components/schemas/QuerySpecification" - application/x-www-form-urlencoded: - schema: - type: object - properties: - query: - description: flux query string to execute - type: string + $ref: "#/components/schemas/Query" responses: '200': description: query results @@ -1073,6 +1113,13 @@ paths: tags: - Buckets summary: List all buckets + parameters: + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string responses: '200': description: a list of buckets @@ -1090,6 +1137,13 @@ paths: tags: - Buckets summary: Create a bucket + parameters: + - in: query + name: org + description: specifies the organization of the resource + required: true + schema: + type: string requestBody: description: bucket to create required: true @@ -1280,12 +1334,12 @@ paths: name: user schema: type: string - description: filter tasks to a specific user id + description: filter tasks to a specific user name - in: query - name: organization + name: org schema: type: string - description: filter tasks to a specific organization id + description: filter tasks to a specific organization name responses: '200': description: A list of tasks @@ -1310,6 +1364,12 @@ paths: tags: - Tasks summary: Create a new task + parameters: + - in: query + name: org + schema: + type: string + description: filter tasks to a specific organization name requestBody: description: task to create required: true @@ -1709,6 +1769,8 @@ components: query: description: query script to execute type: string + spec: + $ref: "#/components/schemas/QuerySpecification" type: description: type of query type: string @@ -1823,6 +1885,28 @@ components: enum: - RFC3339 - RFC3339Nano + Permission: + properties: + action: + type: string + enum: + - read + - write + - create + - delete + resource: + type: string + enum: + - user + - org + - task/:id + - bucket/:id + - dashboard/:id + - org/:id + - org/:id/task + - org/:id/bucket + - org/:id/source + - org/:id/dashboard Authorization: properties: id: @@ -1838,9 +1922,13 @@ components: token: readOnly: true type: string + permissions: + type: array + items: + $ref: "#/components/schemas/Permission" owner: $ref: "#/components/schemas/Owners" - required: [userID] + required: [owner] Authorizations: type: array items: From e2d5ac1637f3cac08bf40d1569249177226b9886 Mon Sep 17 00:00:00 2001 From: Michael Desa Date: Thu, 6 Sep 2018 12:50:17 -0400 Subject: [PATCH 3/5] doc(http): nest users under org and misc. cleanup Co-authored-by: Chris Goller Co-authored-by: Michael Desa --- http/swagger.yml | 271 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 187 insertions(+), 84 deletions(-) diff --git a/http/swagger.yml b/http/swagger.yml index 1328aa526c..627e6c3000 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -903,14 +903,14 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - /authorizations/{authId}: + /authorizations/{authID}: get: tags: - Authorizations summary: Retrieve an authorization parameters: - in: path - name: authId + name: authID schema: type: string required: true @@ -941,7 +941,7 @@ paths: $ref: "#/components/schemas/Authorization" parameters: - in: path - name: authId + name: authID schema: type: string required: true @@ -965,7 +965,7 @@ paths: summary: Delete a authorization parameters: - in: path - name: authId + name: authID schema: type: string required: true @@ -1164,14 +1164,14 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - '/buckets/{bucketId}': + '/buckets/{bucketID}': get: tags: - Buckets summary: Retrieve a bucket parameters: - in: path - name: bucketId + name: bucketID schema: type: string required: true @@ -1202,7 +1202,7 @@ paths: $ref: "#/components/schemas/Bucket" parameters: - in: path - name: bucketId + name: bucketID schema: type: string required: true @@ -1262,14 +1262,14 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - '/orgs/{orgId}': + '/orgs/{orgID}': get: tags: - Organizations summary: Retrieve an organization parameters: - in: path - name: orgId + name: orgID schema: type: string required: true @@ -1300,7 +1300,7 @@ paths: $ref: "#/components/schemas/Organization" parameters: - in: path - name: orgId + name: orgID schema: type: string required: true @@ -1318,6 +1318,92 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" + '/orgs/{orgID}/users': + get: + tags: + - Users + - Organizations + summary: List all users in an organization + parameters: + - in: path + name: orgID + schema: + type: string + required: true + description: ID of the orgnaization + responses: + '200': + description: a list of users the belong to an organization + content: + application/json: + schema: + $ref: "#/components/schemas/Users" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + tags: + - Users + - Organizations + summary: Add user to an organization + parameters: + - in: path + name: orgID + schema: + type: string + required: true + description: ID of the orgnaization + requestBody: + description: adds user to an organization + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/User" + responses: + '201': + description: added to organization created + content: + application/json: + schema: + $ref: "#/components/schemas/User" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/users/{userID}': + delete: + tags: + - Users + - Organizations + summary: removes a user from an org + parameters: + - in: path + name: userID + schema: + type: string + required: true + description: ID of user to delete + - in: path + name: orgID + schema: + type: string + required: true + description: ID of the orgnaization + responses: + '204': + description: user removed + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" /tasks: get: tags: @@ -1390,14 +1476,14 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - '/tasks/{taskId}': + '/tasks/{taskID}': get: tags: - Tasks summary: Retrieve an task parameters: - in: path - name: taskId + name: taskID schema: type: string required: true @@ -1429,7 +1515,7 @@ paths: $ref: "#/components/schemas/Task" parameters: - in: path - name: taskId + name: taskID schema: type: string required: true @@ -1454,7 +1540,7 @@ paths: description: Deletes a task and all associated records parameters: - in: path - name: taskId + name: taskID schema: type: string required: true @@ -1468,14 +1554,14 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - '/tasks/{taskId}/runs': + '/tasks/{taskID}/runs': get: tags: - Tasks summary: Retrieve list of run records for a task parameters: - in: path - name: taskId + name: taskID schema: type: string required: true @@ -1525,20 +1611,20 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - '/tasks/{taskId}/runs/{runId}': + '/tasks/{taskID}/runs/{runID}': get: tags: - Tasks summary: Retrieve a single run record for a task parameters: - in: path - name: taskId + name: taskID schema: type: string required: true description: task ID - in: path - name: runId + name: runID schema: type: string required: true @@ -1556,20 +1642,20 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - '/tasks/{taskId}/runs/{runId}/retry': + '/tasks/{taskID}/runs/{runID}/retry': post: tags: - Tasks summary: Retry a task run parameters: - in: path - name: taskId + name: taskID schema: type: string required: true description: task ID - in: path - name: runId + name: runID schema: type: string required: true @@ -1587,14 +1673,14 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - '/tasks/{taskId}/logs': + '/tasks/{taskID}/logs': get: tags: - Tasks summary: Retrieve all logs for a task parameters: - in: path - name: taskId + name: taskID schema: type: string required: true @@ -1612,20 +1698,20 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - '/tasks/{taskId}/runs/{runId}/logs': + '/tasks/{taskID}/runs/{runID}/logs': get: tags: - Tasks summary: Retrieve all logs for a run parameters: - in: path - name: taskId + name: taskID schema: type: string required: true description: ID of task to get logs for. - in: path - name: runId + name: runID schema: type: string required: true @@ -1685,14 +1771,14 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - '/users/{userId}': + '/users/{userID}': get: tags: - Users summary: Retrieve a user parameters: - in: path - name: userId + name: userID schema: type: string required: true @@ -1723,7 +1809,7 @@ paths: $ref: "#/components/schemas/User" parameters: - in: path - name: userId + name: userID schema: type: string required: true @@ -1741,6 +1827,26 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" + delete: + tags: + - Users + summary: deletes a user + parameters: + - in: path + name: userID + schema: + type: string + required: true + description: ID of user to delete + responses: + '204': + description: user deleted + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" components: schemas: QueryCapability: @@ -1761,13 +1867,13 @@ components: - influxql - spec Query: - description: query influx with specified return formatting. + description: query influx with specified return formatting. The spec and query fields are mutually exclusive. type: object required: - query properties: query: - description: query script to execute + description: query script to execute. type: string spec: $ref: "#/components/schemas/QuerySpecification" @@ -1793,58 +1899,55 @@ components: description: consists of a set of operations and a set of edges between those operations to instruct the query engine to operate. type: object properties: - spec: + operations: + type: array + items: + type: object + properties: + kind: + description: name of the operation to perform + type: string + id: + description: identifier for this operation; it must be unique per query specification; used in edges + type: string + spec: + description: set of properties that specify details of the operation. These vary by the kind of operation. + type: object + edges: + description: list of declaring a parent child id relationship between operations + type: array + items: + type: object + properties: + parent: + description: id of parent node of child within graph of opertions + type: string + child: + description: id of child node of parent within the graph of operations + type: string + resources: + description: optional set of contraints on the resources the query can consume type: object properties: - operations: - type: array - items: - type: object - properties: - kind: - description: name of the operation to perform - type: string - id: - description: identifier for this operation; it must be unique per query specification; used in edges - type: string - spec: - description: set of properties that specify details of the operation. These vary by the kind of operation. - type: object - edges: - description: list of declaring a parent child id relationship between operations - type: array - items: - type: object - properties: - parent: - description: id of parent node of child within graph of opertions - type: string - child: - description: id of child node of parent within the graph of operations - type: string - resources: - description: optional set of contraints on the resources the query can consume - type: object - properties: - priority: - description: priority of the query - oneOf: - - type: string - description: lower value will move to the front of the priority queue - pattern: '^\d+$' - - type: string - description: constants to represent the extreme high and low priorities; high is effectively 0. - enum: - - high - - low - concurrency_quota: - description: number of concurrent workers allowed to process this query; 0 indicates the planner can pick the optimal concurrency. - type: integer - default: 0 - memory_bytes_quota: - description: number of bytes of RAM this query may consume; 0 means unlimited. - type: integer - default: 0 + priority: + description: priority of the query + oneOf: + - type: string + description: lower value will move to the front of the priority queue + pattern: '^\d+$' + - type: string + description: constants to represent the extreme high and low priorities; high is effectively 0. + enum: + - high + - low + concurrency_quota: + description: number of concurrent workers allowed to process this query; 0 indicates the planner can pick the optimal concurrency. + type: integer + default: 0 + memory_bytes_quota: + description: number of bytes of RAM this query may consume; 0 means unlimited. + type: integer + default: 0 dialect: $ref: "#/components/schemas/Dialect" Dialect: @@ -1945,7 +2048,7 @@ components: retentionPeriod: type: integer format: int64 - required: [organizationId, name, retentionPeriod] + required: [organizationID, name, retentionPeriod] Buckets: type: array items: @@ -2015,7 +2118,7 @@ components: id: readOnly: true type: string - taskId: + taskID: readOnly: true type: string status: From 2c82b18800e79db76e74446958084cb3f2bfdc11 Mon Sep 17 00:00:00 2001 From: Michael Desa Date: Thu, 6 Sep 2018 16:13:13 -0400 Subject: [PATCH 4/5] doc(http): add links to resources Co-authored-by: Chris Goller Co-authored-by: Michael Desa --- http/swagger.yml | 103 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 93 insertions(+), 10 deletions(-) diff --git a/http/swagger.yml b/http/swagger.yml index 627e6c3000..fd67798387 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -133,7 +133,7 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - /healthz: + /health: get: tags: - Health @@ -141,6 +141,10 @@ paths: responses: '200': description: the instance is healthy + content: + application/json: + schema: + $ref: "#/components/schemas/Health" default: description: unexpected error content: @@ -2012,6 +2016,21 @@ components: - org/:id/dashboard Authorization: properties: + links: + type: object + readOnly: true + example: + self: "/v2/authorizations/1" + user: "/v2/users/12" + properties: + self: + readOnly: true + type: string + format: url + user: + readOnly: true + type: string + format: url id: readOnly: true type: string @@ -2033,11 +2052,37 @@ components: $ref: "#/components/schemas/Owners" required: [owner] Authorizations: - type: array - items: - $ref: "#/components/schemas/Authorization" + type: object + properties: + links: + readOnly: true + $ref: "#/components/schemas/Links" + authorizations: + type: array + items: + $ref: "#/components/schemas/Authorization" Bucket: properties: + links: + type: object + readOnly: true + example: + self: "/v2/buckets/1" + org: "/v2/orgs/2" + write: "/v2/write?org=myorg" + properties: + self: + readOnly: true + type: string + format: url + org: + readOnly: true + type: string + format: url + write: + readOnly: true + type: string + format: url id: readOnly: true type: string @@ -2045,14 +2090,35 @@ components: $ref: "#/components/schemas/Owners" name: type: string - retentionPeriod: - type: integer - format: int64 + retentionPeriods: + type: array + default: + type: expire + duration: "infinite" + items: + type: object + properties: + type: + type: string + default: expire + enum: + - expire + duration: + type: string + description: durations are an extension of the golang duration syntax + example: 1d + default: "infinite" required: [organizationID, name, retentionPeriod] Buckets: - type: array - items: - $ref: "#/components/schemas/Bucket" + type: object + properties: + links: + readOnly: true + $ref: "#/components/schemas/Links" + buckets: + type: array + items: + $ref: "#/components/schemas/Bucket" Link: type: object readOnly: true @@ -2805,7 +2871,24 @@ components: properties: self: type: string + format: url sources: type: array items: $ref: "#/components/schemas/Source" + Health: + type: object + properties: + name: + type: string + message: + type: string + checks: + type: array + items: + $ref: "#/components/schemas/Health" + status: + type: string + enum: + - unhealthy + - healthy From f437888ee24e812fb8ddaa03468e7acd1103ef91 Mon Sep 17 00:00:00 2001 From: Michael Desa Date: Thu, 6 Sep 2018 18:13:36 -0400 Subject: [PATCH 5/5] doc(http): add macro (template variable) swagger documentation Co-authored-by: Chris Goller Co-authored-by: Michael Desa --- http/swagger.yml | 448 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 401 insertions(+), 47 deletions(-) diff --git a/http/swagger.yml b/http/swagger.yml index fd67798387..7bf9d782dc 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -3,7 +3,7 @@ info: title: Influx API Service version: 0.1.0 servers: - - url: /v2 + - url: /api/v2 paths: /: get: @@ -15,6 +15,136 @@ paths: application/json: schema: $ref: "#/components/schemas/Routes" + /macros: + get: + tags: + - Macros + summary: keywords that specify how input data gets mapped to a replacement output sequence + parameters: + - in: header + name: Authorization + description: the authorization header should be in the format of `Token ` + required: true + schema: + type: string + - in: query + name: org + required: true + schema: + type: string + description: filter macros to a specific organization name + responses: + '200': + description: all macros for an organization + content: + application/json: + schema: + $ref: "#/components/schemas/Macros" + default: + description: internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + summary: keywords that specify how input data gets mapped to a replacement output sequence + tags: + - Macros + parameters: + - in: header + name: Authorization + description: the authorization header should be in the format of `Token ` + required: true + schema: + type: string + - in: query + name: org + required: true + schema: + type: string + description: filter macros to a specific organization name + responses: + '201': + description: macro created + content: + application/json: + schema: + $ref: "#/components/schemas/Macros" + default: + description: internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/macros/{macroID}': + delete: + tags: + - Macros + summary: keywords that specify how input data gets mapped to a replacement output sequence + parameters: + - in: header + name: Authorization + description: the authorization header should be in the format of `Token ` + required: true + schema: + type: string + - in: path + name: macroID + required: true + schema: + type: string + description: id of the macro + - in: query + name: org + required: true + schema: + type: string + description: filter macros to a specific organization name + responses: + '204': + description: macro deleted + default: + description: internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + summary: keywords that specify how input data gets mapped to a replacement output sequence + tags: + - Macros + parameters: + - in: header + name: Authorization + description: the authorization header should be in the format of `Token ` + required: true + schema: + type: string + - in: path + name: macroID + required: true + schema: + type: string + description: id of the macro + - in: query + name: org + required: true + schema: + type: string + description: filter macros to a specific organization name + responses: + '200': + description: macro updated + content: + application/json: + schema: + $ref: "#/components/schemas/Macros" + default: + description: internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" /write: post: tags: @@ -803,7 +933,7 @@ paths: post: description: not currently documented # TODO(desa): document ast endpoint tags: - - FluxLanguage + - Query responses: '200': description: Suggestions for next functions in call chain @@ -816,7 +946,7 @@ paths: /query/suggestions: get: tags: - - FluxLanguage + - Query responses: '200': description: Suggestions for next functions in call chain @@ -840,7 +970,7 @@ paths: description: name of branching suggestion get: tags: - - FluxLanguage + - Query responses: '200': description: Suggestions for next functions in call chain @@ -987,8 +1117,7 @@ paths: get: tags: - Query - - flux - summary: description of the query capabilities of the instance + summary: query influx with specified return formatting. The spec and query fields are mutually exclusive. parameters: - in: query name: org @@ -996,28 +1125,68 @@ paths: required: true schema: type: string + - in: query + name: query + description: query script to execute. + required: true + schema: + type: string - in: header name: Authorization description: the authorization header should be in the format of `Token ` schema: type: string responses: - '200': - description: the query capabilities of the instance - content: - application/json: - schema: - $ref: "#/components/schemas/QueryCapability" - default: - description: Any response other than 200 is an internal server error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" + '200': + description: query results + content: + text/csv: + schema: + type: string + example: > + result,table,_start,_stop,_time,region,host,_value + mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,east,A,15.43 + mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,east,B,59.25 + mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,east,C,52.62 + '400': + description: error processing query + headers: + X-Influx-Error: + description: error string describing the problem + schema: + type: string + X-Influx-Reference: + description: reference code unique to the error type + schema: + type: integer + content: + text/csv: + schema: + type: string + example: > + error,reference + Failed to parse query,897 + default: + description: internal server error + headers: + X-Influx-Error: + description: error string describing the problem + schema: + type: string + X-Influx-Reference: + description: reference code unique to the error type + schema: + type: integer + content: + text/csv: + schema: + type: string + example: > + error,reference + Failed to parse query,897 post: tags: - Query - - flux summary: query an influx parameters: - in: header @@ -1853,23 +2022,6 @@ paths: $ref: "#/components/schemas/Error" components: schemas: - QueryCapability: - description: the supported query languages and dialects - type: object - properties: - links: - type: object - allOf: - - $ref: "#/components/schemas/FluxLinks" - languages: - type: array - readOnly: true - items: - type: string - enum: - - flux - - influxql - - spec Query: description: query influx with specified return formatting. The spec and query fields are mutually exclusive. type: object @@ -2161,18 +2313,60 @@ components: example: Halt and catch fire Organization: properties: + links: + type: object + readOnly: true + example: + self: "/v2/orgs/1" + users: "/v2/orgs/1/users" + buckets: "/v2/buckets?org=myorg" + tasks: "/v2/tasks?org=myorg" + dashboards: "/v2/tasks?org=myorg" + properties: + self: + readOnly: true + type: string + format: url + users: + readOnly: true + type: string + format: url + buckets: + readOnly: true + type: string + format: url + tasks: + readOnly: true + type: string + format: url + dashboards: + readOnly: true + type: string + format: url id: readOnly: true type: string name: type: string + status: + description: if inactive the organization is inactive. + default: active + type: string + enum: + - active + - inactive owners: $ref: "#/components/schemas/Owners" required: [name] Organizations: - type: array - items: - $ref: "#/components/schemas/Organization" + type: object + properties: + links: + $ref: "#/components/schemas/Links" + orgs: + type: array + items: + $ref: "#/components/schemas/Organization" Owners: properties: users: @@ -2234,12 +2428,12 @@ components: description: A read-only description of the task. type: string status: - description: The current status of the task. When updated to 'disabled', cancels all queued jobs of this task. + description: The current status of the task. When updated to 'inactive', cancels all queued jobs of this task. + default: active type: string - enum: [ - "enabled", - "disabled" - ] + enum: + - active + - inactive owners: $ref: "#/components/schemas/Owners" flux: @@ -2265,6 +2459,13 @@ components: type: string name: type: string + status: + description: if inactive the user is inactive. + default: active + type: string + enum: + - active + - inactive required: [name] Users: type: array @@ -2285,30 +2486,87 @@ components: properties: ast: type: string + format: url self: type: string + format: url suggestions: type: string + format: url Routes: properties: + sources: + type: string + format: url + dashboards: + type: string + format: url + query: + type: string + format: url + write: + type: string + format: url + orgs: + type: string + format: url + auths: + type: string + format: url + buckets: + type: string + format: url + users: + type: string + format: url + tasks: + type: string + format: url + system: + type: object + properties: + metrics: + type: string + format: url + debug: + type: string + format: url + health: + type: string + format: url external: type: object properties: statusFeed: type: string - sources: - type: string + format: url flux: $ref: "#/components/schemas/FluxLinks" Error: properties: code: + description: code is the machine-readable error code. readOnly: true type: string + enum: + - internal error + - not found + - conflict + - invalid + - empty value message: readOnly: true + description: message is a human-readable message. type: string - required: [code, message] + op: + readOnly: true + description: op describes the logical code operation during error. Useful for debugging. + type: string + err: + readOnly: true + description: err is a stack of errors that occurred during processing of the request. Useful for debugging. + type: string + required: [code, message, op, err] LineProtocolError: properties: code: @@ -2712,10 +2970,97 @@ components: type: type: string enum: ["empty"] + ConstantMacroProperties: + properties: + type: + type: string + enum: ["constant"] + values: + type: array + items: + type: string + MapMacroProperties: + properties: + type: + type: string + enum: ["map"] + values: + type: object + QueryMacroProperties: + properties: + type: + type: string + enum: ["query"] + query: + type: string + queryType: + type: string + Macro: + type: object + properties: + links: + type: object + properties: + self: + type: string + format: url + id: + readOnly: true + type: string + name: + type: string + selected: + type: array + items: + type: string + arguments: + type: object + oneOf: + - $ref: "#/components/schemas/QueryMacroProperties" + - $ref: "#/components/schemas/ConstantMacroProperties" + - $ref: "#/components/schemas/MapMacroProperties" + Macros: + type: object + example: + macros: + - id: '1221432' + name: ":ok:" + selected: + - hello + arguments: + type: constant + values: + - howdy + - hello + - hi + - yo + - oy + - id: '1221432' + name: ":ok:" + selected: + - c + arguments: + type: map + values: + a: fdjaklfdjkldsfjlkjdsa + b: dfaksjfkljekfajekdljfas + c: fdjksajfdkfeawfeea + - id: '1221432' + name: ":ok:" + selected: + - host + arguments: + type: query + query: 'from(bucket: "foo") |> showMeasurements()' + language: flux + properties: + macros: + $ref: "#/components/schemas/Macro" View: properties: links: type: object + readOnly: true properties: self: type: string @@ -2863,6 +3208,15 @@ components: type: string fluxURL: type: string + languages: + type: array + readOnly: true + items: + type: string + enum: + - flux + - influxql + - spec Sources: type: object properties: