From cf80d437a881699bec5bfbc6254ae630a3ce7bae Mon Sep 17 00:00:00 2001 From: Felipe Monteiro Date: Tue, 30 Oct 2018 19:50:10 -0400 Subject: [PATCH] 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] https://github.com/openstack/cinder/blob/95d6d49b01cfdd18505069098e1fa9e5763a99b5/cinder/api/contrib/hosts.py#L169 Change-Id: I36486724cc30389d371ec0b18b9b7f96883d193c --- api-ref/source/v2/hosts.inc | 6 +++--- api-ref/source/v2/parameters.yaml | 18 ++++++++++++++++++ api-ref/source/v3/hosts.inc | 2 +- api-ref/source/v3/parameters.yaml | 6 ++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/api-ref/source/v2/hosts.inc b/api-ref/source/v2/hosts.inc index 665ce27504e..181505680f2 100644 --- a/api-ref/source/v2/hosts.inc +++ b/api-ref/source/v2/hosts.inc @@ -92,9 +92,9 @@ Response .. rest_parameters:: parameters.yaml - - volume_count: total_count - - total_volume_gb: totalGigabytesUsed - - total_snapshot_gb: totalSnapshotsUsed + - volume_count: total_count_str + - total_volume_gb: totalGigabytesUsedStr + - total_snapshot_gb: totalSnapshotsUsedStr - project: project_id_2 - host: host_name_1 - snapshot_count: totalSnapshotsUsed diff --git a/api-ref/source/v2/parameters.yaml b/api-ref/source/v2/parameters.yaml index 251070a36a3..6004f36d13e 100644 --- a/api-ref/source/v2/parameters.yaml +++ b/api-ref/source/v2/parameters.yaml @@ -1649,6 +1649,12 @@ total_count: in: body required: true type: integer +total_count_str: + description: | + Total number of volumes. + in: body + required: true + type: string totalBackupGigabytesUsed: description: | The total number of backups gibibytes (GiB) used. @@ -1667,12 +1673,24 @@ totalGigabytesUsed: in: body required: true type: integer +totalGigabytesUsedStr: + description: | + The total number of gibibytes (GiB) used. + in: body + required: true + type: string totalSnapshotsUsed: description: | The total number of snapshots used. in: body required: true type: integer +totalSnapshotsUsedStr: + description: | + The total number of snapshots used. + in: body + required: true + type: string totalVolumesUsed: description: | The total number of volumes used. diff --git a/api-ref/source/v3/hosts.inc b/api-ref/source/v3/hosts.inc index da5b83dc2a8..1bdddfb71f3 100644 --- a/api-ref/source/v3/hosts.inc +++ b/api-ref/source/v3/hosts.inc @@ -95,7 +95,7 @@ Response - host: host - volume_count: total_count - - total_volume_gb: totalGigabytesUsed + - total_volume_gb: totalGigabytesUsedStr - total_snapshot_gb: totalSnapGigabytesUsed - project: project_id_2 - host: host_name_1 diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index d55a10ae6db..b3043a55aee 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -2823,6 +2823,12 @@ totalGigabytesUsed: in: body required: true type: integer +totalGigabytesUsedStr: + description: | + The total number of gibibytes (GiB) used. + in: body + required: true + type: string totalSnapGigabytesUsed: description: | The total number of gibibytes (GiB) used by snapshots.