influxdata / influxdata/openapi
/telegrafs POST are requestBody properties up-to-date?
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 18
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
After comparing a POST request to /telegrafs sent from the UI to the definitions in openapi
(components/schemas/TelegrafPluginRequest) there appears to be a number of differences.
The UI request body looks like this.
{
"name":"Ferret Config",
"description":"asdf",
"agent":{"collectionInterval":10000},
"orgID":"9c5955fc99a60b8f",
"plugins":
[
{
"name":"influxdb_v2",
"type":
"output",
"config":
{
"urls":
[
"https://twodotoh-dev-bonitoo-kk.remocal.influxdev.co"
],
"token":"$INFLUX_TOKEN",
"organization":"dev",
"bucket":"devbucket"
}
},
{
"name":"cpu",
"type":"input"
}
]
}
There are five top level properties name, description, agent, orgID, plugins.
The document components/schemas/TelegrafPluginRequest.yml also includes fields for metadata and config, however it makes no mention of an agent field. Also during blackbox testing, when sending a request body with a combination {name, description, orgID, config} the server returns HTTP 500.
The fields metadata and config do show up as part of the response, however the response config field seems to ignore the config field sent in the request. I see the word "legacy" in the comments of the yaml document, So, the question arises: are these schema definitions up-to-date?
# This defines the 'legacy' `TelegrafConfigDecode` type in the api.
type: object
properties:
name:
type: string
description:
type: string
plugins:
type: array
items:
type: object
properties:
type:
type: string
name:
type: string
alias:
type: string
description:
type: string
config:
type: string
metadata:
type: object
properties:
buckets:
type: array
items:
type: string
config:
type: string
orgID:
type: string
Related Issue
#610
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with components/schemas/TelegrafPluginRequest.yml and compare it with the documented POST /telegrafs request example and the observed response fields. Review related issue #610 and verify whether agent, metadata, and config match the API behavior. Done means the schema accurately describes the accepted request and returned fields, or clearly documents the legacy behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100