diff --git a/api-docs/v2.0/swagger.yml b/api-docs/v2.0/swagger.yml index f644f5fb5..f135e364d 100644 --- a/api-docs/v2.0/swagger.yml +++ b/api-docs/v2.0/swagger.yml @@ -339,6 +339,29 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" + /telegraf/plugins: + get: + operationId: GetTelegrafPlugins + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: type + description: The type of plugin desired. + schema: + type: string + responses: + '200': + description: A list of Telegraf plugins. + content: + application/json: + schema: + $ref: "#/components/schemas/TelegrafPlugins" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" /telegrafs: get: operationId: GetTelegrafs @@ -2145,7 +2168,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Dashboard" + oneOf: + - $ref: "#/components/schemas/Dashboard" + - $ref: "#/components/schemas/DashboardWithViewProperties" default: description: Unexpected error content: @@ -2217,13 +2242,23 @@ paths: type: string required: true description: The ID of the dashboard to update. + - in: query + name: include + required: false + schema: + type: string + enum: + - properties + description: Includes the cell view properties in the response if set to `properties` responses: '200': description: Get a single dashboard content: application/json: schema: - $ref: "#/components/schemas/Dashboard" + oneOf: + - $ref: "#/components/schemas/Dashboard" + - $ref: "#/components/schemas/DashboardWithViewProperties" '404': description: Dashboard not found content: @@ -3196,6 +3231,11 @@ paths: enum: - gzip - identity + Trace-Id: + description: The Trace-Id header reports the request's trace ID, if one was generated. + schema: + type: string + description: Specifies the request's trace ID. content: text/csv: schema: @@ -4341,6 +4381,14 @@ paths: schema: type: string description: Filter tasks to a specific organization ID. + - in: query + name: status + schema: + type: string + enum: + - active + - inactive + description: Filter tasks by a status--"inactive" or "active". - in: query name: limit schema: @@ -4757,7 +4805,7 @@ paths: schema: $ref: "#/components/schemas/LabelMapping" responses: - '200': + '201': description: A list of all labels for a task content: application/json: @@ -5532,7 +5580,7 @@ paths: type: string - in: query name: tag - description: Only show notification rules that match a tag pair. Uses `AND` to specify multiple tags. + description: Only return notification rules that "would match" statuses which contain the tag key value pairs provided. schema: type: string pattern: ^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+$ @@ -6309,9 +6357,11 @@ components: start: description: RFC3339Nano type: string + format: date-time stop: description: RFC3339Nano type: string + format: date-time predicate: description: InfluxQL-like delete statement example: tag1="value1" and (tag2="value2" and tag3!="value3") @@ -6849,22 +6899,7 @@ components: rp: type: string retentionRules: - type: array - description: Rules to expire or retain data. No rules means data never expires. - items: - type: object - properties: - type: - type: string - default: expire - enum: - - expire - everySeconds: - type: integer - description: Duration in seconds for how long data will be kept in the database. - example: 86400 - minimum: 1 - required: [type, everySeconds] + $ref: "#/components/schemas/RetentionRules" required: [name, retentionRules] Bucket: properties: @@ -6928,22 +6963,7 @@ components: format: date-time readOnly: true retentionRules: - type: array - description: Rules to expire or retain data. No rules means data never expires. - items: - type: object - properties: - type: - type: string - default: expire - enum: - - expire - everySeconds: - type: integer - description: Duration in seconds for how long data will be kept in the database. - example: 86400 - minimum: 1 - required: [type, everySeconds] + $ref: "#/components/schemas/RetentionRules" labels: $ref: "#/components/schemas/Labels" required: [name, retentionRules] @@ -6957,6 +6977,25 @@ components: type: array items: $ref: "#/components/schemas/Bucket" + RetentionRules: + type: array + description: Rules to expire or retain data. No rules means data never expires. + items: + $ref: "#/components/schemas/RetentionRule" + RetentionRule: + type: object + properties: + type: + type: string + default: expire + enum: + - expire + everySeconds: + type: integer + description: Duration in seconds for how long data will be kept in the database. + example: 86400 + minimum: 1 + required: [type, everySeconds] Link: type: string format: uri @@ -7091,10 +7130,16 @@ components: PkgApply: type: object properties: - apply: + dryRun: type: boolean + orgID: + type: string package: $ref: "#/components/schemas/Pkg" + secrets: + type: object + additionalProperties: + type: string PkgCreate: type: object properties: @@ -7113,8 +7158,13 @@ components: type: string enum: - bucket + - check - dashboard - label + - notification_endpoint + - notification_rule + - task + - telegraf - variable name: type: string @@ -7151,20 +7201,39 @@ components: type: object properties: buckets: + type: array + items: + type: object + properties: + id: + type: string + orgID: + type: string + name: + type: string + description: + type: string + retentionPeriod: + type: integer + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + checks: type: array items: allOf: - - $ref: "#/components/schemas/Bucket" + - $ref: "#/components/schemas/CheckDiscriminator" - type: object properties: labelAssociations: type: array items: - $ref: "#/components/schemas/Label" + $ref: "#/components/schemas/PkgSummaryLabel" labels: type: array items: - $ref: "#/components/schemas/Label" + $ref: "#/components/schemas/PkgSummaryLabel" dashboards: type: array items: @@ -7181,7 +7250,7 @@ components: labelAssociations: type: array items: - $ref: "#/components/schemas/Label" + $ref: "#/components/schemas/PkgSummaryLabel" charts: type: array items: @@ -7201,17 +7270,119 @@ components: type: string labelID: type: string - variables: + missingSecrets: + type: array + items: + type: string + notificationEndpoints: type: array items: allOf: - - $ref: "#/components/schemas/Variable" + - $ref: "#/components/schemas/NotificationEndpointDiscrimator" - type: object properties: labelAssociations: type: array items: - $ref: "#/components/schemas/Label" + $ref: "#/components/schemas/PkgSummaryLabel" + notificationRules: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + endpointName: + type: string + endpointID: + type: string + endpointType: + type: string + every: + type: string + offset: + type: string + messageTemplate: + type: string + status: + type: string + statusRules: + type: array + items: + type: object + properties: + currentLevel: + type: string + previousLevel: + type: string + tagRules: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + operator: + type: string + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + tasks: + type: array + items: + type: object + properties: + id: + type: string + name: + type: string + cron: + type: string + description: + type: string + every: + type: string + offset: + type: string + query: + type: string + status: + type: string + telegrafConfigs: + type: array + items: + allOf: + - $ref: "#/components/schemas/TelegrafRequest" + - type: object + properties: + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + variables: + type: array + items: + type: object + properties: + id: + type: string + orgID: + type: string + name: + type: string + description: + type: string + arguments: + $ref: "#/components/schemas/VariableProperties" + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" diff: type: object properties: @@ -7224,14 +7395,33 @@ components: type: string name: type: string - oldDescription: + new: + type: object + properties: + description: + type: string + retentionRules: + $ref: "#/components/schemas/RetentionRules" + old: + type: object + properties: + description: + type: string + retentionRules: + $ref: "#/components/schemas/RetentionRules" + checks: + type: array + items: + type: object + properties: + id: type: string - newDescription: - type: string - oldRP: - type: string - newRP: + name: type: string + new: + $ref: "#/components/schemas/CheckDiscriminator" + old: + $ref: "#/components/schemas/CheckDiscriminator" dashboards: type: array items: @@ -7254,14 +7444,20 @@ components: type: string name: type: string - oldDescription: - type: string - newDescription: - type: string - oldColor: - type: string - newColor: - type: string + new: + type: object + properties: + color: + type: string + description: + type: string + old: + type: object + properties: + color: + type: string + description: + type: string labelMappings: type: array items: @@ -7279,6 +7475,85 @@ components: type: string labelName: type: string + notificationEndpoints: + type: array + items: + type: object + properties: + id: + type: string + name: + type: string + new: + $ref: "#/components/schemas/NotificationEndpointDiscrimator" + old: + $ref: "#/components/schemas/NotificationEndpointDiscrimator" + notificationRules: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + endpointName: + type: string + endpointID: + type: string + endpointType: + type: string + every: + type: string + offset: + type: string + messageTemplate: + type: string + status: + type: string + statusRules: + type: array + items: + type: object + properties: + currentLevel: + type: string + previousLevel: + type: string + tagRules: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + operator: + type: string + tasks: + type: array + items: + type: object + properties: + name: + type: string + cron: + type: string + description: + type: string + every: + type: string + offset: + type: string + query: + type: string + status: + type: string + telegrafConfigs: + type: array + items: + $ref: "#/components/schemas/TelegrafRequest" variables: type: array items: @@ -7288,14 +7563,20 @@ components: type: string name: type: string - oldDescription: - type: string - newDescription: - type: string - oldArgs: - $ref: "#/components/schemas/VariableProperties" - newArgs: - $ref: "#/components/schemas/VariableProperties" + new: + type: object + properties: + description: + type: string + args: + $ref: "#/components/schemas/VariableProperties" + old: + type: object + properties: + description: + type: string + args: + $ref: "#/components/schemas/VariableProperties" errors: type: array items: @@ -7313,6 +7594,19 @@ components: type: array items: type: integer + PkgSummaryLabel: + type: object + properties: + id: + type: string + orgID: + type: string + name: + type: string + description: + type: string + retentionPeriod: + type: string PkgChart: type: object properties: @@ -7325,12 +7619,11 @@ components: width: type: integer properties: # field name is properties - ref: "#/components/schemas/ViewProperties" + $ref: "#/components/schemas/ViewProperties" Runs: type: object properties: links: - readOnly: true $ref: "#/components/schemas/Links" runs: type: array @@ -7826,6 +8119,11 @@ components: type: array items: type: string + aggregateFunctionType: + $ref: '#/components/schemas/BuilderAggregateFunctionType' + BuilderAggregateFunctionType: + type: string + enum: ['filter', 'group'] BuilderFunctionsType: type: object properties: @@ -7934,7 +8232,10 @@ components: - legend - note - showNoteWhenEmpty + - position properties: + timeFormat: + type: string type: type: string enum: [xy] @@ -7965,6 +8266,9 @@ components: type: string shadeBelow: type: boolean + position: + type: string + enum: [overlaid, stacked] geom: $ref: '#/components/schemas/XYGeom' XYGeom: @@ -7984,6 +8288,7 @@ components: - prefix - suffix - decimalPlaces + - position properties: type: type: string @@ -8015,6 +8320,9 @@ components: type: string shadeBelow: type: boolean + position: + type: string + enum: [overlaid, stacked] prefix: type: string suffix: @@ -8043,6 +8351,8 @@ components: - xSuffix - ySuffix properties: + timeFormat: + type: string type: type: string enum: [scatter] @@ -8118,6 +8428,8 @@ components: - ySuffix - binSize properties: + timeFormat: + type: string type: type: string enum: [heatmap] @@ -8666,6 +8978,16 @@ components: type: integer message: type: string + CellWithViewProperties: + type: object + allOf: + - $ref: "#/components/schemas/Cell" + - type: object + properties: + name: + type: string + properties: + $ref: "#/components/schemas/ViewProperties" Cell: type: object properties: @@ -8693,6 +9015,10 @@ components: viewID: type: string description: The reference to a view from the views API. + CellsWithViewProperties: + type: array + items: + $ref: "#/components/schemas/CellWithViewProperties" Cells: type: array items: @@ -8736,6 +9062,53 @@ components: required: - orgID - name + DashboardWithViewProperties: + type: object + allOf: + - $ref: "#/components/schemas/CreateDashboardRequest" + - type: object + properties: + links: + type: object + example: + self: "/api/v2/dashboards/1" + cells: "/api/v2/dashboards/1/cells" + owners: "/api/v2/dashboards/1/owners" + members: "/api/v2/dashboards/1/members" + logs: "/api/v2/dashboards/1/logs" + labels: "/api/v2/dashboards/1/labels" + org: "/api/v2/labels/1" + properties: + self: + $ref: "#/components/schemas/Link" + cells: + $ref: "#/components/schemas/Link" + members: + $ref: "#/components/schemas/Link" + owners: + $ref: "#/components/schemas/Link" + logs: + $ref: "#/components/schemas/Link" + labels: + $ref: "#/components/schemas/Link" + org: + $ref: "#/components/schemas/Link" + id: + readOnly: true + type: string + meta: + type: object + properties: + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + cells: + $ref: "#/components/schemas/CellsWithViewProperties" + labels: + $ref: "#/components/schemas/Labels" Dashboard: type: object allOf: @@ -9033,15 +9406,15 @@ components: type: string description: type: string - agent: + metadata: type: object properties: - collectionInterval: - type: integer - plugins: - type: array - items: - $ref: "#/components/schemas/TelegrafRequestPlugin" + buckets: + type: array + items: + type: string + config: + type: string orgID: type: string TelegrafRequestPlugin: @@ -9453,6 +9826,28 @@ components: type: array items: $ref: "#/components/schemas/Telegraf" + TelegrafPlugin: + type: object + properties: + type: + type: string + name: + type: string + description: + type: string + config: + type: string + TelegrafPlugins: + type: object + properties: + version: + type: string + os: + type: string + plugins: + type: array + items: + $ref: "#/components/schemas/TelegrafPlugin" TelegrafPluginInputDockerConfig: type: object required: @@ -9762,33 +10157,19 @@ components: oneOf: - $ref: "#/components/schemas/DeadmanCheck" - $ref: "#/components/schemas/ThresholdCheck" + - $ref: "#/components/schemas/CustomCheck" discriminator: propertyName: type mapping: deadman: "#/components/schemas/DeadmanCheck" threshold: "#/components/schemas/ThresholdCheck" + custom: "#/components/schemas/CustomCheck" Check: allOf: - $ref: "#/components/schemas/CheckDiscriminator" - - type: object - properties: - labels: - $ref: "#/components/schemas/Labels" PostCheck: allOf: - $ref: "#/components/schemas/CheckDiscriminator" - - type: object - properties: - status: - type: string - enum: - - active - - inactive - labels: - type: array - description: List of label ids to associate with check - items: - type: string Checks: properties: checks: @@ -9823,28 +10204,26 @@ components: $ref: "#/components/schemas/DashboardQuery" status: $ref: "#/components/schemas/TaskStatusType" - every: - description: Check repetition interval. - type: string - offset: - description: Duration to delay after the schedule, before executing check. - type: string - tags: - description: List of tags to write to each status. - type: array - items: - type: object - properties: - key: - type: string - value: - type: string description: description: An optional description of the check. type: string - statusMessageTemplate: - description: The template used to generate and write a status message. + latestCompleted: + description: Timestamp of latest scheduled, completed run, RFC3339. type: string + format: date-time + readOnly: true + lastRunStatus: + readOnly: true + type: string + enum: + - failed + - success + - canceled + lastRunError: + readOnly: true + type: string + labels: + $ref: "#/components/schemas/Labels" links: type: object readOnly: true @@ -9867,11 +10246,15 @@ components: owners: description: URL to retrieve owners for this check $ref: "#/components/schemas/Link" - required: [name, type, orgID, query] + query: + description: URL to retrieve Flux script for this check + $ref: "#/components/schemas/Link" + required: [name, orgID, query] ThresholdCheck: allOf: - $ref: "#/components/schemas/CheckBase" - type: object + required: [type] properties: type: type: string @@ -9880,6 +10263,25 @@ components: type: array items: $ref: "#/components/schemas/Threshold" + every: + description: Check repetition interval. + type: string + offset: + description: Duration to delay after the schedule, before executing check. + type: string + tags: + description: List of tags to write to each status. + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + statusMessageTemplate: + description: The template used to generate and write a status message. + type: string Threshold: oneOf: - $ref: "#/components/schemas/GreaterThreshold" @@ -9895,6 +10297,7 @@ components: allOf: - $ref: "#/components/schemas/CheckBase" - type: object + required: [type] properties: type: type: string @@ -9910,6 +10313,34 @@ components: type: boolean level: $ref: "#/components/schemas/CheckStatusLevel" + every: + description: Check repetition interval. + type: string + offset: + description: Duration to delay after the schedule, before executing check. + type: string + tags: + description: List of tags to write to each status. + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + statusMessageTemplate: + description: The template used to generate and write a status message. + type: string + CustomCheck: + allOf: + - $ref: "#/components/schemas/CheckBase" + - type: object + properties: + type: + type: string + enum: [custom] + required: [type] ThresholdBase: properties: level: @@ -9994,25 +10425,9 @@ components: NotificationRule: allOf: - $ref: "#/components/schemas/NotificationRuleDiscriminator" - - type: object - properties: - labels: - $ref: "#/components/schemas/Labels" PostNotificationRule: allOf: - $ref: "#/components/schemas/NotificationRuleDiscriminator" - - type: object - properties: - status: - type: string - enum: - - active - - inactive - labels: - type: array - description: List of label IDs to associate with notification rule. - items: - type: string NotificationRules: properties: notificationRules: @@ -10032,6 +10447,21 @@ components: - statusRules - endpointID properties: + latestCompleted: + description: Timestamp of latest scheduled, completed run, RFC3339. + type: string + format: date-time + readOnly: true + lastRunStatus: + readOnly: true + type: string + enum: + - failed + - success + - canceled + lastRunError: + readOnly: true + type: string id: readOnly: true type: string @@ -10087,6 +10517,8 @@ components: minItems: 1 items: $ref: "#/components/schemas/StatusRule" + labels: + $ref: "#/components/schemas/Labels" links: type: object readOnly: true @@ -10109,6 +10541,9 @@ components: owners: description: URL to retrieve owners for this notification rule. $ref: "#/components/schemas/Link" + query: + description: URL to retrieve Flux script for this notification rule. + $ref: "#/components/schemas/Link" TagRule: type: object properties: @@ -10132,7 +10567,7 @@ components: type: string HTTPNotificationRuleBase: type: object - required: [type, url] + required: [type] properties: type: type: string @@ -10190,6 +10625,7 @@ components: type: string NotificationEndpointUpdate: type: object + properties: name: type: string @@ -10214,25 +10650,9 @@ components: NotificationEndpoint: allOf: - $ref: "#/components/schemas/NotificationEndpointDiscrimator" - - type: object - properties: - labels: - $ref: "#/components/schemas/Labels" PostNotificationEndpoint: allOf: - $ref: "#/components/schemas/NotificationEndpointDiscrimator" - - type: object - properties: - status: - type: string - enum: - - active - - inactive - labels: - type: array - description: List of label IDs to associate with check. - items: - type: string NotificationEndpoints: properties: notificationEndpoints: @@ -10269,6 +10689,8 @@ components: default: active type: string enum: ["active", "inactive"] + labels: + $ref: "#/components/schemas/Labels" links: type: object readOnly: true