-
Notifications
You must be signed in to change notification settings - Fork 57
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: finish pebble http api specs #544
Conversation
Thank you for preparing all of this! I've finished my review and have added comments on specific parts. Some other comments:
|
I fixed most comments above. There was a human error (the example indentation), and other style improvement suggestions were all adopted. There is one thing I did not change, which is the example for notices, it doesn't have For the three points above:
I think if we can split the API into two, following RestAPI design, it might be better, like If we are not changing the URL, potentially, we could unify the response format. Even though the data returned is different, we can encapsulate it within JSON for both actions, for example: examples:
list:
value:
{
"type": "sync",
"status-code": 200,
"status": "OK",
"result": {
"action": "list",
"files": [
{ "path": "/file1.txt", ... }
]
}
}
read:
value:
{
"type": "sync",
"status-code": 200,
"status": "OK",
"result": {
"action": "read",
"files": [
{ "path": "/file1.txt", "content": "File content here", ... }
]
}
} But this is also not backward compatible. Given the current situation, I will have to leave it as it is. |
In this PR:
Refactor
/v1/health
endpoint according to David's suggestion, because otherwise, people would think it's 200 even if healthy is false.VerbResource[Description]Response
, for example,GetPlanResponse
,GetHealthOKResponse
.Newly added specs
/v1/plan
, code./v1/layers
, code./v1/logs
, code./v1/signals
, code./v1/files
, code: GET, POST./v1/tasks/{task-id}/websocket/{websocket-id}
, code./v1/exec
, code./v1/notices
, code: GET, POST./v1/notices/{id}
, code./v1/identities
, code: GET, POST.Preview: https://canonical-pebble--544.com.readthedocs.build/en/544/reference/api/.