diff --git a/openstack_cli/src/block_storage/v3/scheduler_stat/get_pool/get.rs b/openstack_cli/src/block_storage/v3/scheduler_stat/get_pool/get.rs index e55c22694..337161422 100644 --- a/openstack_cli/src/block_storage/v3/scheduler_stat/get_pool/get.rs +++ b/openstack_cli/src/block_storage/v3/scheduler_stat/get_pool/get.rs @@ -47,7 +47,13 @@ pub struct GetPoolCommand { /// Query parameters #[derive(Args)] -struct QueryParameters {} +struct QueryParameters { + /// Indicates whether to show pool details or only pool names in the + /// response. Set to true to show pool details. Set to false to show only + /// pool names. Default is false. + #[arg(action=clap::ArgAction::Set, help_heading = "Query parameters", long)] + detail: Option, +} /// Path parameters #[derive(Args)] @@ -69,14 +75,19 @@ impl GetPoolCommand { ); op.validate_args(parsed_args)?; - let ep_builder = get::Request::builder(); + let mut ep_builder = get::Request::builder(); + + // Set query parameters + if let Some(val) = &self.query.detail { + ep_builder.detail(*val); + } let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: Vec = ep.query_async(client).await?; + op.output_list::(data)?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/openstack_sdk/src/api/block_storage/v3/scheduler_stat/get_pool/get.rs b/openstack_sdk/src/api/block_storage/v3/scheduler_stat/get_pool/get.rs index 884296a1e..bb0df5dfc 100644 --- a/openstack_sdk/src/api/block_storage/v3/scheduler_stat/get_pool/get.rs +++ b/openstack_sdk/src/api/block_storage/v3/scheduler_stat/get_pool/get.rs @@ -25,6 +25,12 @@ use crate::api::rest_endpoint_prelude::*; #[derive(Builder, Debug, Clone)] #[builder(setter(strip_option))] pub struct Request { + /// Indicates whether to show pool details or only pool names in the + /// response. Set to true to show pool details. Set to false to show only + /// pool names. Default is false. + #[builder(default)] + detail: Option, + #[builder(setter(name = "_headers"), default, private)] _headers: Option, } @@ -73,7 +79,10 @@ impl RestEndpoint for Request { } fn parameters(&self) -> QueryParams<'_> { - QueryParams::default() + let mut params = QueryParams::default(); + params.push_opt("detail", self.detail); + + params } fn service_type(&self) -> ServiceType { diff --git a/openstack_types/data/block-storage/v3.71.yaml b/openstack_types/data/block-storage/v3.71.yaml index 08a122765..d85c1ee50 100644 --- a/openstack_types/data/block-storage/v3.71.yaml +++ b/openstack_types/data/block-storage/v3.71.yaml @@ -2459,6 +2459,8 @@ paths: description: |- List all active pools in scheduler. operationId: scheduler-stats/get_pools:get + parameters: + - $ref: '#/components/parameters/detail' responses: '200': content: @@ -7712,6 +7714,14 @@ components: type: string x-openstack: resource_link: identity/v3/project.id + detail: + description: Indicates whether to show pool details or only pool names in + the response. Set to true to show pool details. Set to false to show + only pool names. Default is false. + in: query + name: detail + schema: + type: boolean extensions_project_id: description: project_id parameter for /v3/{project_id}/extensions API in: path @@ -15838,8 +15848,71 @@ components: description: Response of the :get operation type: object Scheduler_StatsGet_PoolsResponse: - description: Response of the project_id/scheduler-stats/get_pools:get - operation + properties: + pools: + description: |- + List of storage pools. + items: + properties: + capabilities: + description: |- + The capabilities for the back end. The value is + either `null` or a string value that indicates the capabilities + for each pool. For example, `total_capacity_gb` or `QoS_support`. + properties: + QoS_support: + description: |- + The quality of service (QoS) support. + type: boolean + driver_version: + description: |- + The driver version. + type: string + free_capacity_gb: + description: |- + The amount of free capacity for the back-end + volume, in GBs. A valid value is a string, such as `unknown`, or + a number (integer or floating point). + minimum: 0 + type: + - integer + - string + reserved_percentage: + description: |- + The percentage of the total capacity that is + reserved for the internal use by the back end. + type: integer + storage_protocol: + description: |- + The storage back end for the back-end volume. For + example, `iSCSI` or `FC`. + type: string + total_capacity_gb: + description: |- + The total capacity for the back-end volume, in + GBs. A valid value is a string, such as `unknown`, or a + number (integer or floating point). + minimum: 0 + type: + - integer + - string + updated: + description: |- + The date and time stamp when the extension was + last updated. + format: date-time + type: string + volume_backend_name: + description: |- + The name of the back-end volume. + type: string + type: object + name: + description: |- + The name of the backend pool. + type: string + type: object + type: array type: object SnapshotShowResponse: additionalProperties: false diff --git a/openstack_types/data/block-storage/v3.yaml b/openstack_types/data/block-storage/v3.yaml index 08a122765..d85c1ee50 100644 --- a/openstack_types/data/block-storage/v3.yaml +++ b/openstack_types/data/block-storage/v3.yaml @@ -2459,6 +2459,8 @@ paths: description: |- List all active pools in scheduler. operationId: scheduler-stats/get_pools:get + parameters: + - $ref: '#/components/parameters/detail' responses: '200': content: @@ -7712,6 +7714,14 @@ components: type: string x-openstack: resource_link: identity/v3/project.id + detail: + description: Indicates whether to show pool details or only pool names in + the response. Set to true to show pool details. Set to false to show + only pool names. Default is false. + in: query + name: detail + schema: + type: boolean extensions_project_id: description: project_id parameter for /v3/{project_id}/extensions API in: path @@ -15838,8 +15848,71 @@ components: description: Response of the :get operation type: object Scheduler_StatsGet_PoolsResponse: - description: Response of the project_id/scheduler-stats/get_pools:get - operation + properties: + pools: + description: |- + List of storage pools. + items: + properties: + capabilities: + description: |- + The capabilities for the back end. The value is + either `null` or a string value that indicates the capabilities + for each pool. For example, `total_capacity_gb` or `QoS_support`. + properties: + QoS_support: + description: |- + The quality of service (QoS) support. + type: boolean + driver_version: + description: |- + The driver version. + type: string + free_capacity_gb: + description: |- + The amount of free capacity for the back-end + volume, in GBs. A valid value is a string, such as `unknown`, or + a number (integer or floating point). + minimum: 0 + type: + - integer + - string + reserved_percentage: + description: |- + The percentage of the total capacity that is + reserved for the internal use by the back end. + type: integer + storage_protocol: + description: |- + The storage back end for the back-end volume. For + example, `iSCSI` or `FC`. + type: string + total_capacity_gb: + description: |- + The total capacity for the back-end volume, in + GBs. A valid value is a string, such as `unknown`, or a + number (integer or floating point). + minimum: 0 + type: + - integer + - string + updated: + description: |- + The date and time stamp when the extension was + last updated. + format: date-time + type: string + volume_backend_name: + description: |- + The name of the back-end volume. + type: string + type: object + name: + description: |- + The name of the backend pool. + type: string + type: object + type: array type: object SnapshotShowResponse: additionalProperties: false diff --git a/openstack_types/src/block_storage/v3/scheduler_stat/get_pool/response/get.rs b/openstack_types/src/block_storage/v3/scheduler_stat/get_pool/response/get.rs index 2f74a5b72..d3b999af7 100644 --- a/openstack_types/src/block_storage/v3/scheduler_stat/get_pool/response/get.rs +++ b/openstack_types/src/block_storage/v3/scheduler_stat/get_pool/response/get.rs @@ -17,30 +17,45 @@ //! Response type for the GET `scheduler-stats/get_pools` operation use serde::{Deserialize, Serialize}; -use serde_json::Value; -use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; -/// Response data as HashMap type -#[derive(Deserialize, Serialize)] -pub struct GetPoolResponse(BTreeMap); - -impl StructTable for GetPoolResponse { - fn instance_headers(&self, _options: &O) -> Option> { - Some(self.0.keys().map(Into::into).collect()) - } - - fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| serde_json::to_string(&v).ok())) - } +/// GetPool response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct GetPoolResponse { + /// List of storage pools. + #[structable(serialize)] + pub pools: Vec, } -impl StructTable for &GetPoolResponse { - fn instance_headers(&self, _options: &O) -> Option> { - Some(self.0.keys().map(Into::into).collect()) - } +/// The capabilities for the back end. The value is either `null` or a string +/// value that indicates the capabilities for each pool. For example, +/// `total_capacity_gb` or `QoS_support`. +/// `Capabilities` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Capabilities { + #[serde(default)] + pub driver_version: Option, + #[serde(default, deserialize_with = "crate::common::deser_num_str_opt")] + pub free_capacity_gb: Option, + #[serde(default, rename = "QoS_support")] + pub qo_s_support: Option, + #[serde(default)] + pub reserved_percentage: Option, + #[serde(default)] + pub storage_protocol: Option, + #[serde(default, deserialize_with = "crate::common::deser_num_str_opt")] + pub total_capacity_gb: Option, + #[serde(default)] + pub updated: Option, + #[serde(default)] + pub volume_backend_name: Option, +} - fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| serde_json::to_string(&v).ok())) - } +/// `Pools` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Pools { + #[serde(default)] + pub capabilities: Option, + #[serde(default)] + pub name: Option, }