12 Commits

Author SHA1 Message Date
zhufl
d4f1e57257 [api-ref]Fix values of service-status in list-hosts
In "List all hosts for a project", service-status should take
the values of ['available', 'unavailable'], (service-state takes
the value of ['enabled', 'disabled']), and because os-services API
uses service_status which requires returning `enabled` and `disabled`,
we need add a new parameter host_service_status for os-hosts API.

https://docs.openstack.org/api-ref/block-storage/v3/index.html#list-all-hosts-for-a-project
partially-implements: blueprint volume-response-schema-validation

Change-Id: Idde4a63f00862599a13bcfcdadc1d4459f27d3a4
2019-08-23 09:41:37 +08:00
Zuul
3902a2bf28 Merge "api-ref: Correct response body type for show host details" 2019-02-06 23:25:01 +00:00
whoami-rajat
609412fcd2 Improve/Clean api-ref parameters
The parameters with name like example_1, example_2 ... etc. cause
confusion while updating the api-ref docs like the examples below:

https://review.openstack.org/#/c/609639/
https://review.openstack.org/#/c/609611/

This patch does the following changes :
1) Replace numbering in the parameter with relevant names
2) Clean up unused parameters

Change-Id: I35b343bf068281d729576e5ecc209bda60c28680
2018-11-05 10:47:14 +05:30
Felipe Monteiro
cf80d437a8 api-ref: Correct response body type for show host details
Currently [0] claims that "total_volume_gb" in the response body
is of type int -- but it is actually a string, going off the example
response body as well as the API code, which clearly casts the
value to a str() [1].

[0] https://developer.openstack.org/api-ref/block-storage/v3/index.html?expanded=show-host-details-for-a-project-detail#show-host-details-for-a-project
[1] 95d6d49b01/cinder/api/contrib/hosts.py (L169)

Change-Id: I36486724cc30389d371ec0b18b9b7f96883d193c
2018-11-02 09:53:21 -04:00
whoami-rajat
e0baecf01f Adding variable for total gigabytes used by snapshot param
Refering to the host details API doc
https://developer.openstack.org/api-ref/block-storage/v3/index.html#show-host-details-for-a-project
snapshot_count and total_snapshot_gb are two different values,
but have been assigned the same variable as can be seen here,
https://github.com/openstack/cinder/blob/master/api-ref/source/v3/hosts.inc
This patch adds a new variable for total_snapshot_gb param.

Change-Id: I5727df835456bfa0ca63e253ddc700182b7cd85c
2018-09-19 19:07:48 +05:30
Sean McGinnis
a96fad9f3b Fix api-ref response code title levels
Using the wrong character resulted in the wrong title level
being used for the response codes, which in turn caused the
"detail" show/hide toggle to not be able to hide all of the
per-endpoint details. This corrects these to be at the correct
level.

Also ran into issues after changing them where sphinx was not
happy with the random title levels. This appears to be due to
the order processed and whether not earlier included files had
all subsequent levels. Adding an additional title in our first
included file resolved that problem.

Change-Id: I19405778980310f2d6d06eb7b23102f74a3d6e03
Closes-bug: #1755566
2018-03-13 15:57:54 -05:00
Sean McGinnis
2e5a91da72 Use rest_status_code for api-ref response codes
Rather than our freeform way of listing response codes in our
api-ref, we should be using the os-api-ref extension option to
get nicely formatted response code listings.

https://docs.openstack.org/os-api-ref/latest/usage.html#rest-status-code

Change-Id: Iee21f54fe7cf0ea28258966e2d0f8fa2849c83f2
2018-03-08 21:59:37 -06:00
lihaijing
baf811f20d Api-ref: fix v2/v3 hosts extension api doc
Supplement error response codes and fix parameters problem.

Change-Id: Ia24c6980f437ab6838d64c345bc9c10a100762e1
Closes-Bug: #1715286
2017-09-26 10:33:07 +08:00
Jenkins
f32483c6e4 Merge "api-ref: Clarify os-host GET behavior" 2017-09-19 08:16:55 +00:00
Sean McGinnis
fffdac20c2 api-ref: Make v3 enclosing objects consistent
Some request details provided information about the other
JSON value while others didn't. To make things consistent
and to make sure API consumers understand how the requests
need to be structured, this adds missing instances. It also
reorders some parameter lists to be a little more logical,
so even though we can't show the nested nature of some of
these, it at least doesn't show inner values before outer
ones.

This also corrects many errors seen while going through
the API ref. This is by no means exhaustive, and is already
somewhat out of the scope for this patch, so it is expected
that there are some (many) cases that are not addressed by
this patch. Those will be fixed with ongoing effort in
future patches.

Partial-bug: #1713517
Change-Id: I30964ba8d829778fd01174d639d44ba07e4b77a6
2017-09-01 09:54:34 -05:00
Sean McGinnis
86a96625d7 api-ref: Clarify os-host GET behavior
Getting all hosts returns every Cinder service host, regardless
of which service is running on the host. But getting a specific
host will fail if you try it for a host not running cinder-volume.

This looks to be the behavior from the beginning, but there was
nothing denoting this, causing errors and confusion for code that
thought it could get a host from the list, then get detailed info
about that host. The details return volume and snapshot counts,
so it really only makes sense for cinder-volume, so the code ends
up returning a 404 for anything else.

This API design seems a little disjointed, but since this is how
it appears to have always been, just make sure the api docs have
the right details for potential API consumers to know what to
expect.

Change-Id: If53279cfcbbde1297bb2e55e17d17b473e7d0d6e
Closes-bug: #1691144
2017-08-31 20:56:46 -05:00
luqitao
7a3d344717 Adds API documentation for list and show hosts.
Adds v2 and v3 API documentation for list all hosts and show host details.

Change-Id: I43791fded823cd931c2d77a11fa502b2cb5f0105
Closes-Bug: #1558257
2017-03-14 05:36:24 -04:00