New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] REST API documentation #1117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I've added a few comments.
docs/conf.py
Outdated
|
||
from docutils.parsers.rst import directives | ||
from sphinx.directives.code import CodeBlock | ||
directives.register_directive('code', CodeBlock) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this required for the ``` blocks in the openapi.yaml file?
If yes, is it possible to change the syntax highlighting language? Some code blocks look weird, for example https://demozxc.readthedocs.io/en/latest/api/#operation/get/series/instances (605
is colored differently than the rest of the ID).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I forgot to remove these lines. These were just to check something.
Yes, I have changed the syntax highlighting language to bash
docs/specs/openapi.yaml
Outdated
tags: | ||
- OPEN METRICS | ||
summary: Fetches current values and metadata | ||
description: " `Get metrics` fetches current values and metadata for all metrics, or only metrics\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you format this block with description: |
and normal line breaks (like in the other API methods)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
docs/specs/openapi.yaml
Outdated
|
||
components: | ||
schemas: | ||
response1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give them names? For example "seriesIds"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
docs/specs/openapi.yaml
Outdated
- ddff1bfe286a3b18cebcbadc1678a68a964fbe9d | ||
- 605fc77742cd0317597291329561ac4e50c0dd12 | ||
|
||
response2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be seriesValues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
docs/specs/openapi.yaml
Outdated
platform: dev | ||
userid: 1000 | ||
|
||
response4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
labelNames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
docs/specs/openapi.yaml
Outdated
- series: 605fc77742cd0317597291329561ac4e50c0dd12 | ||
name: disk.dev.read_bytes | ||
|
||
response7: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metricNames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
This PR contains the REST API documentation alongwith the basic setup and some necessary changes in UAG and PG books.