From 221014848cfb039d94aad38dd213386a42e328bd Mon Sep 17 00:00:00 2001 From: OpenStack codegenerator <16461884+gtema@users.noreply.github.com> Date: Mon, 11 May 2026 07:55:19 +0000 Subject: [PATCH] feat: BS.host.show is a "list" operation Showing details of a single BS host is a list operation returning list of host resources. Change-Id: Id6a1e20690d5766d7ccf69bdda7233589a7c1aae Signed-off-by: Artem Goncharov Changes are triggered by https://review.opendev.org/c/openstack/codegenerator/+/987405 --- .../src/v3/group_type/group_spec/list.rs | 4 +- cli-cmd/block-storage/src/v3/host/show.rs | 5 +- .../src/v3/snapshot/metadata/list.rs | 4 +- .../src/v3/type/encryption/list.rs | 4 +- .../src/v3/type/extra_spec/list.rs | 4 +- .../src/v3/volume/metadata/list.rs | 4 +- .../compute/src/v2/flavor/extra_spec/list.rs | 4 +- .../compute/src/v2/hypervisor/server/get.rs | 5 +- .../src/v2/instance_usage_audit_log/list.rs | 4 +- cli-cmd/compute/src/v2/server/ip/list.rs | 4 +- .../compute/src/v2/server/metadata/list.rs | 4 +- .../src/v1/version/get.rs | 5 +- cli-cmd/dns/src/v2/zone/share/list.rs | 6 +- cli-cmd/identity/src/v3/domain/config/list.rs | 4 +- .../os_federation/identity_provider/show.rs | 5 +- cli-cmd/identity/src/v3/role/imply/list.rs | 4 +- .../v1/resource_provider/aggregate/list.rs | 5 +- .../v1/resource_provider/inventory/list.rs | 4 +- .../src/v1/resource_provider/trait/list.rs | 5 +- cli-cmd/placement/src/v1/usage/list.rs | 4 +- openstack_types/data/block-storage/v3.71.yaml | 88 ++++++++++------- openstack_types/data/block-storage/v3.yaml | 88 ++++++++++------- openstack_types/data/compute/v2.103.yaml | 5 +- openstack_types/data/compute/v2.yaml | 5 +- .../data/identity/keystone_rust.yaml | 34 ++++--- openstack_types/data/network/v2.28.yaml | 5 + openstack_types/data/network/v2.yaml | 5 + .../tests/mocked/block_storage/v3/host/mod.rs | 15 +++ .../block_storage/v3/host/response/list.rs | 30 ++++++ .../block_storage/v3/host/response/mod.rs | 16 ++++ .../block_storage/v3/host/response/show.rs | 32 +++++++ sdk/block-storage/src/v3/host/get.rs | 4 + .../src/v2/flavor_profile/list.rs | 11 ++- .../src/v2/router/add_router_interface.rs | 5 + .../block-storage/src/v3/host/response/get.rs | 26 +++-- .../src/v3/host/response/list.rs | 95 ++++++++++++++++--- .../compute/src/v2/server/response/list_21.rs | 1 - .../v2/server/response/list_detailed_29.rs | 2 + .../src/v2/flavor_profile/response/list.rs | 30 ++---- 39 files changed, 410 insertions(+), 175 deletions(-) create mode 100644 openstack_types/tests/mocked/block_storage/v3/host/mod.rs create mode 100644 openstack_types/tests/mocked/block_storage/v3/host/response/list.rs create mode 100644 openstack_types/tests/mocked/block_storage/v3/host/response/mod.rs create mode 100644 openstack_types/tests/mocked/block_storage/v3/host/response/show.rs diff --git a/cli-cmd/block-storage/src/v3/group_type/group_spec/list.rs b/cli-cmd/block-storage/src/v3/group_type/group_spec/list.rs index ff3f3e98b..1d2aad6d5 100644 --- a/cli-cmd/block-storage/src/v3/group_type/group_spec/list.rs +++ b/cli-cmd/block-storage/src/v3/group_type/group_spec/list.rs @@ -84,9 +84,9 @@ impl GroupSpecsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/host/show.rs b/cli-cmd/block-storage/src/v3/host/show.rs index d7d2597a9..8995464da 100644 --- a/cli-cmd/block-storage/src/v3/host/show.rs +++ b/cli-cmd/block-storage/src/v3/host/show.rs @@ -80,9 +80,8 @@ impl HostCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; - - op.output_single::(data.clone())?; + let data: Vec = ep.query_async(client).await?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/snapshot/metadata/list.rs b/cli-cmd/block-storage/src/v3/snapshot/metadata/list.rs index f686c3699..ca6531e4c 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/metadata/list.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/metadata/list.rs @@ -84,9 +84,9 @@ impl MetadatasCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/type/encryption/list.rs b/cli-cmd/block-storage/src/v3/type/encryption/list.rs index 8f74121e9..b48a47384 100644 --- a/cli-cmd/block-storage/src/v3/type/encryption/list.rs +++ b/cli-cmd/block-storage/src/v3/type/encryption/list.rs @@ -83,9 +83,9 @@ impl EncryptionsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/type/extra_spec/list.rs b/cli-cmd/block-storage/src/v3/type/extra_spec/list.rs index 3460bbc20..f4702d735 100644 --- a/cli-cmd/block-storage/src/v3/type/extra_spec/list.rs +++ b/cli-cmd/block-storage/src/v3/type/extra_spec/list.rs @@ -83,9 +83,9 @@ impl ExtraSpecsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/volume/metadata/list.rs b/cli-cmd/block-storage/src/v3/volume/metadata/list.rs index 1b22abd94..b2f552f57 100644 --- a/cli-cmd/block-storage/src/v3/volume/metadata/list.rs +++ b/cli-cmd/block-storage/src/v3/volume/metadata/list.rs @@ -83,9 +83,9 @@ impl MetadatasCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/flavor/extra_spec/list.rs b/cli-cmd/compute/src/v2/flavor/extra_spec/list.rs index 1f0c9627f..8ed48fafb 100644 --- a/cli-cmd/compute/src/v2/flavor/extra_spec/list.rs +++ b/cli-cmd/compute/src/v2/flavor/extra_spec/list.rs @@ -89,9 +89,9 @@ impl ExtraSpecsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/hypervisor/server/get.rs b/cli-cmd/compute/src/v2/hypervisor/server/get.rs index 407874fb0..071f6ce84 100644 --- a/cli-cmd/compute/src/v2/hypervisor/server/get.rs +++ b/cli-cmd/compute/src/v2/hypervisor/server/get.rs @@ -91,8 +91,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: Vec = ep.query_async(client).await?; - op.output_list::(data.clone())?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/instance_usage_audit_log/list.rs b/cli-cmd/compute/src/v2/instance_usage_audit_log/list.rs index bedcd680f..3f101f7b6 100644 --- a/cli-cmd/compute/src/v2/instance_usage_audit_log/list.rs +++ b/cli-cmd/compute/src/v2/instance_usage_audit_log/list.rs @@ -79,9 +79,9 @@ impl InstanceUsageAuditLogsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/ip/list.rs b/cli-cmd/compute/src/v2/server/ip/list.rs index 62686428d..4e6555e6d 100644 --- a/cli-cmd/compute/src/v2/server/ip/list.rs +++ b/cli-cmd/compute/src/v2/server/ip/list.rs @@ -88,9 +88,9 @@ impl IpsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/metadata/list.rs b/cli-cmd/compute/src/v2/server/metadata/list.rs index aacce8563..580a1d1b4 100644 --- a/cli-cmd/compute/src/v2/server/metadata/list.rs +++ b/cli-cmd/compute/src/v2/server/metadata/list.rs @@ -89,9 +89,9 @@ impl MetadatasCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/version/get.rs b/cli-cmd/container-infrastructure-management/src/v1/version/get.rs index 4d82babf2..99292cc3b 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/version/get.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/version/get.rs @@ -73,8 +73,9 @@ impl VersionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: Vec = ep.query_async(client).await?; - op.output_list::(data.clone())?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/share/list.rs b/cli-cmd/dns/src/v2/zone/share/list.rs index 428563528..d01b39b14 100644 --- a/cli-cmd/dns/src/v2/zone/share/list.rs +++ b/cli-cmd/dns/src/v2/zone/share/list.rs @@ -196,9 +196,11 @@ impl SharesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = paged(ep, Pagination::Limit(self.max_items)) + .query_async(client) + .await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/domain/config/list.rs b/cli-cmd/identity/src/v3/domain/config/list.rs index 1e332b0ed..65d9730d1 100644 --- a/cli-cmd/identity/src/v3/domain/config/list.rs +++ b/cli-cmd/identity/src/v3/domain/config/list.rs @@ -152,9 +152,9 @@ impl ConfigsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_federation/identity_provider/show.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/show.rs index cb787b7fa..5e85f5686 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/show.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/show.rs @@ -85,9 +85,8 @@ impl IdentityProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; - - op.output_single::(data.clone())?; + let data: Vec = ep.query_async(client).await?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/role/imply/list.rs b/cli-cmd/identity/src/v3/role/imply/list.rs index ccafc5c88..3d6992d84 100644 --- a/cli-cmd/identity/src/v3/role/imply/list.rs +++ b/cli-cmd/identity/src/v3/role/imply/list.rs @@ -84,9 +84,9 @@ impl ImpliesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/aggregate/list.rs b/cli-cmd/placement/src/v1/resource_provider/aggregate/list.rs index 9f72f91e0..a551a5fd3 100644 --- a/cli-cmd/placement/src/v1/resource_provider/aggregate/list.rs +++ b/cli-cmd/placement/src/v1/resource_provider/aggregate/list.rs @@ -91,9 +91,8 @@ impl AggregateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; - - op.output_single::(data.clone())?; + let data: Vec = ep.query_async(client).await?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/inventory/list.rs b/cli-cmd/placement/src/v1/resource_provider/inventory/list.rs index 160f02ef5..bb2c42a20 100644 --- a/cli-cmd/placement/src/v1/resource_provider/inventory/list.rs +++ b/cli-cmd/placement/src/v1/resource_provider/inventory/list.rs @@ -87,9 +87,9 @@ impl InventoriesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/trait/list.rs b/cli-cmd/placement/src/v1/resource_provider/trait/list.rs index 00029780d..e0ae18d2d 100644 --- a/cli-cmd/placement/src/v1/resource_provider/trait/list.rs +++ b/cli-cmd/placement/src/v1/resource_provider/trait/list.rs @@ -88,9 +88,8 @@ impl TraitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; - - op.output_single::(data.clone())?; + let data: Vec = ep.query_async(client).await?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/usage/list.rs b/cli-cmd/placement/src/v1/usage/list.rs index c2c5f3b03..2ccb4649e 100644 --- a/cli-cmd/placement/src/v1/usage/list.rs +++ b/cli-cmd/placement/src/v1/usage/list.rs @@ -220,9 +220,9 @@ impl UsagesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data: serde_json::Value = ep.query_async(client).await?; + let data: Vec = ep.query_async(client).await?; - op.output_single::(data.clone())?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/openstack_types/data/block-storage/v3.71.yaml b/openstack_types/data/block-storage/v3.71.yaml index a0001ae60..74ba97ddb 100644 --- a/openstack_types/data/block-storage/v3.71.yaml +++ b/openstack_types/data/block-storage/v3.71.yaml @@ -14649,42 +14649,62 @@ components: A OpenStack Block Storage host. items: additionalProperties: false - description: A host object. properties: - resource: - additionalProperties: false - properties: - host: - description: The name of the host that hosts the storage - backend, may take the format of host@backend. - type: string - project: - description: The Project ID which the host resource belongs - to. In the summary resource, the value is (total). - type: string - snapshot_count: - description: The total number of snapshots used. - type: string - total_snapshot_gb: - description: The total number of gibibytes (GiB) used by - snapshots. - type: string - total_volume_gb: - description: The total number of gibibytes (GiB) used. - type: string - volume_count: - description: Total number of volumes. - type: string - required: - - host - - project - - snapshot_count - - total_snapshot_gb - - total_volume_gb - - volume_count - type: object + host_name: + description: |- + The name of the host that hosts the storage backend, + may take the format of `host@backend`. + type: string + last-update: + description: |- + The date and time when the resource was updated. + + The date and time stamp format is [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601): + + ``` + CCYY-MM-DDThh:mm:ss±hh:mm + ``` + + For example, `2015-08-27T09:49:58-05:00`. + + The `±hh:mm` value, if included, is the time zone as an offset + from UTC. In the previous example, the offset value is `-05:00`. + + If the `updated_at` date and time stamp is not set, its value is + `null`. + format: date-time + type: + - 'null' + - string + service: + description: |- + The name of the service which is running on the host. + type: string + service-state: + description: |- + The state of the service. One of `enabled` or `disabled`. + enum: + - disabled + - enabled + type: string + service-status: + description: |- + The status of the service. One of `available` or `unavailable`. + enum: + - available + - unavailable + type: string + zone: + description: |- + The availability zone name. + type: string required: - - resource + - host_name + - last-update + - service + - service-state + - service-status + - zone type: object type: array type: object diff --git a/openstack_types/data/block-storage/v3.yaml b/openstack_types/data/block-storage/v3.yaml index a0001ae60..74ba97ddb 100644 --- a/openstack_types/data/block-storage/v3.yaml +++ b/openstack_types/data/block-storage/v3.yaml @@ -14649,42 +14649,62 @@ components: A OpenStack Block Storage host. items: additionalProperties: false - description: A host object. properties: - resource: - additionalProperties: false - properties: - host: - description: The name of the host that hosts the storage - backend, may take the format of host@backend. - type: string - project: - description: The Project ID which the host resource belongs - to. In the summary resource, the value is (total). - type: string - snapshot_count: - description: The total number of snapshots used. - type: string - total_snapshot_gb: - description: The total number of gibibytes (GiB) used by - snapshots. - type: string - total_volume_gb: - description: The total number of gibibytes (GiB) used. - type: string - volume_count: - description: Total number of volumes. - type: string - required: - - host - - project - - snapshot_count - - total_snapshot_gb - - total_volume_gb - - volume_count - type: object + host_name: + description: |- + The name of the host that hosts the storage backend, + may take the format of `host@backend`. + type: string + last-update: + description: |- + The date and time when the resource was updated. + + The date and time stamp format is [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601): + + ``` + CCYY-MM-DDThh:mm:ss±hh:mm + ``` + + For example, `2015-08-27T09:49:58-05:00`. + + The `±hh:mm` value, if included, is the time zone as an offset + from UTC. In the previous example, the offset value is `-05:00`. + + If the `updated_at` date and time stamp is not set, its value is + `null`. + format: date-time + type: + - 'null' + - string + service: + description: |- + The name of the service which is running on the host. + type: string + service-state: + description: |- + The state of the service. One of `enabled` or `disabled`. + enum: + - disabled + - enabled + type: string + service-status: + description: |- + The status of the service. One of `available` or `unavailable`. + enum: + - available + - unavailable + type: string + zone: + description: |- + The availability zone name. + type: string required: - - resource + - host_name + - last-update + - service + - service-state + - service-status + - zone type: object type: array type: object diff --git a/openstack_types/data/compute/v2.103.yaml b/openstack_types/data/compute/v2.103.yaml index d00a14489..aefa18042 100644 --- a/openstack_types/data/compute/v2.103.yaml +++ b/openstack_types/data/compute/v2.103.yaml @@ -91827,6 +91827,9 @@ components: - 'null' - string accessIPv4: + description: |- + IPv4 address that should be used to access this server. May be + automatically set by the provider. oneOf: - const: '' - format: ipv4 @@ -93731,8 +93734,6 @@ components: additionalProperties: false properties: id: - description: |- - The UUID of the server. format: uuid type: string links: diff --git a/openstack_types/data/compute/v2.yaml b/openstack_types/data/compute/v2.yaml index d00a14489..aefa18042 100644 --- a/openstack_types/data/compute/v2.yaml +++ b/openstack_types/data/compute/v2.yaml @@ -91827,6 +91827,9 @@ components: - 'null' - string accessIPv4: + description: |- + IPv4 address that should be used to access this server. May be + automatically set by the provider. oneOf: - const: '' - format: ipv4 @@ -93731,8 +93734,6 @@ components: additionalProperties: false properties: id: - description: |- - The UUID of the server. format: uuid type: string links: diff --git a/openstack_types/data/identity/keystone_rust.yaml b/openstack_types/data/identity/keystone_rust.yaml index 16d3ae657..b4a4484c6 100644 --- a/openstack_types/data/identity/keystone_rust.yaml +++ b/openstack_types/data/identity/keystone_rust.yaml @@ -27,10 +27,10 @@ paths: - health summary: Health check endpoint. description: |- - Perform diverse checks to identify the overall status of the system. It can be `OK`, - `SERVICE_UNAVAILABLE`. In difference to the `/ready` check this does not return - `SERVICE_UNAVAILABLE` when components are in the degraded state to prevent from the restart. It - is similar to the `/live` check. + Perform diverse checks to identify the overall status of the system. It can + be `OK`, `SERVICE_UNAVAILABLE`. In difference to the `/ready` check this + does not return `SERVICE_UNAVAILABLE` when components are in the degraded + state to prevent from the restart. It is similar to the `/live` check. operationId: health responses: '200': @@ -51,8 +51,9 @@ paths: - health summary: Readiness health check endpoint. description: |- - Perform relevant checks only returning `OK` when all of them are ok. Any check in the - degraded/warn state would result in `SERVICE_UNAVAILABLE` response. + Perform relevant checks only returning `OK` when all of them are ok. Any + check in the degraded/warn state would result in `SERVICE_UNAVAILABLE` + response. operationId: ready responses: '200': @@ -526,14 +527,13 @@ paths: post: tags: - roles - summary: Create Role - description: Create a new role + summary: Create a new Role. operationId: create requestBody: content: application/json: schema: - $ref: '#/components/schemas/RoleCreate' + $ref: '#/components/schemas/RoleCreateRequest' required: true responses: '201': @@ -654,7 +654,7 @@ paths: - users summary: Delete user description: Delete user by ID - operationId: remove + operationId: delete parameters: - name: user_id in: path @@ -2019,14 +2019,13 @@ paths: post: tags: - roles - summary: Create Role - description: Create a new role + summary: Create a new Role. operationId: create requestBody: content: application/json: schema: - $ref: '#/components/schemas/RoleCreate' + $ref: '#/components/schemas/RoleCreateRequest' required: true responses: '201': @@ -4494,6 +4493,15 @@ components: description: The role name. additionalProperties: description: Extra attributes for the role. + RoleCreateRequest: + type: object + description: New role creation request. + required: + - role + properties: + role: + $ref: '#/components/schemas/RoleCreate' + description: Role object. RoleList: type: object description: Roles. diff --git a/openstack_types/data/network/v2.28.yaml b/openstack_types/data/network/v2.28.yaml index 4c79866e3..57c3b38af 100644 --- a/openstack_types/data/network/v2.28.yaml +++ b/openstack_types/data/network/v2.28.yaml @@ -5264,6 +5264,11 @@ paths: Specify the ID of a subnet or port in the request body: + If the `evpn` extension is enabled and the router has a VNI assigned + (`evpn_vni` is not null), the `advertise_host` parameter + can be set to `true` to instruct the EVPN plugin to advertise connected + routes from this subnet as host routes via EVPN Type-5. + When you specify an IPv6 subnet, this operation adds the subnet to an existing internal port with same network ID, on the router. If a port with the same network ID does not exist, this operation diff --git a/openstack_types/data/network/v2.yaml b/openstack_types/data/network/v2.yaml index 4c79866e3..57c3b38af 100644 --- a/openstack_types/data/network/v2.yaml +++ b/openstack_types/data/network/v2.yaml @@ -5264,6 +5264,11 @@ paths: Specify the ID of a subnet or port in the request body: + If the `evpn` extension is enabled and the router has a VNI assigned + (`evpn_vni` is not null), the `advertise_host` parameter + can be set to `true` to instruct the EVPN plugin to advertise connected + routes from this subnet as host routes via EVPN Type-5. + When you specify an IPv6 subnet, this operation adds the subnet to an existing internal port with same network ID, on the router. If a port with the same network ID does not exist, this operation diff --git a/openstack_types/tests/mocked/block_storage/v3/host/mod.rs b/openstack_types/tests/mocked/block_storage/v3/host/mod.rs new file mode 100644 index 000000000..7026a7a38 --- /dev/null +++ b/openstack_types/tests/mocked/block_storage/v3/host/mod.rs @@ -0,0 +1,15 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + +mod response; diff --git a/openstack_types/tests/mocked/block_storage/v3/host/response/list.rs b/openstack_types/tests/mocked/block_storage/v3/host/response/list.rs new file mode 100644 index 000000000..abb0cbaa5 --- /dev/null +++ b/openstack_types/tests/mocked/block_storage/v3/host/response/list.rs @@ -0,0 +1,30 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + +use openstack_sdk::api::block_storage::v3::volume::list::Request; +use openstack_sdk::api::{Pagination, QueryAsync, paged}; +use openstack_types::block_storage::v3::host::response::list::HostResponse; + +use crate::get_client; + +#[tokio::test] +async fn deserialize() -> Result<(), Box> { + let client = get_client("block-storage"); + + let _res: Vec = paged(Request::builder().build()?, Pagination::Limit(10)) + .query_async(&client) + .await?; + + Ok(()) +} diff --git a/openstack_types/tests/mocked/block_storage/v3/host/response/mod.rs b/openstack_types/tests/mocked/block_storage/v3/host/response/mod.rs new file mode 100644 index 000000000..d17ed5195 --- /dev/null +++ b/openstack_types/tests/mocked/block_storage/v3/host/response/mod.rs @@ -0,0 +1,16 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + +mod list; +mod show; diff --git a/openstack_types/tests/mocked/block_storage/v3/host/response/show.rs b/openstack_types/tests/mocked/block_storage/v3/host/response/show.rs new file mode 100644 index 000000000..bb2dde8b5 --- /dev/null +++ b/openstack_types/tests/mocked/block_storage/v3/host/response/show.rs @@ -0,0 +1,32 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + +use openstack_sdk::api::QueryAsync; +use openstack_sdk::api::block_storage::v3::host::get::Request; +use openstack_types::block_storage::v3::host::response::get::Resource; + +use crate::get_client; + +#[tokio::test] +async fn deserialize() -> Result<(), Box> { + let client = get_client("block-storage"); + + let _res: Vec = Request::builder() + .host_name("foo") + .build()? + .query_async(&client) + .await?; + + Ok(()) +} diff --git a/sdk/block-storage/src/v3/host/get.rs b/sdk/block-storage/src/v3/host/get.rs index e9f0fe8be..286a1a361 100644 --- a/sdk/block-storage/src/v3/host/get.rs +++ b/sdk/block-storage/src/v3/host/get.rs @@ -90,6 +90,10 @@ impl RestEndpoint for Request<'_> { Some("host".into()) } + fn response_list_item_key(&self) -> Option> { + Some("resource".into()) + } + /// Returns headers to be set into the request fn request_headers(&self) -> Option<&HeaderMap> { self._headers.as_ref() diff --git a/sdk/load-balancer/src/v2/flavor_profile/list.rs b/sdk/load-balancer/src/v2/flavor_profile/list.rs index 2ea677bcb..ff39058ff 100644 --- a/sdk/load-balancer/src/v2/flavor_profile/list.rs +++ b/sdk/load-balancer/src/v2/flavor_profile/list.rs @@ -117,7 +117,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("flavorprofiles".into()) } /// Returns headers to be set into the request @@ -153,7 +153,10 @@ mod tests { #[test] fn test_response_key() { - assert!(Request::builder().build().unwrap().response_key().is_none()) + assert_eq!( + Request::builder().build().unwrap().response_key().unwrap(), + "flavorprofiles" + ); } #[cfg(feature = "sync")] @@ -167,7 +170,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "flavorprofiles": {} })); }); let endpoint = Request::builder().build().unwrap(); @@ -187,7 +190,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "flavorprofiles": {} })); }); let endpoint = Request::builder() diff --git a/sdk/network/src/v2/router/add_router_interface.rs b/sdk/network/src/v2/router/add_router_interface.rs index 3c1ab667c..a8acf5468 100644 --- a/sdk/network/src/v2/router/add_router_interface.rs +++ b/sdk/network/src/v2/router/add_router_interface.rs @@ -20,6 +20,11 @@ //! //! Specify the ID of a subnet or port in the request body: //! +//! If the `evpn` extension is enabled and the router has a VNI assigned +//! (`evpn_vni` is not null), the `advertise_host` parameter can be set to +//! `true` to instruct the EVPN plugin to advertise connected routes from this +//! subnet as host routes via EVPN Type-5. +//! //! When you specify an IPv6 subnet, this operation adds the subnet to an //! existing internal port with same network ID, on the router. If a port with //! the same network ID does not exist, this operation creates a port on the diff --git a/types/block-storage/src/v3/host/response/get.rs b/types/block-storage/src/v3/host/response/get.rs index 60d67b9ca..152dc51c6 100644 --- a/types/block-storage/src/v3/host/response/get.rs +++ b/types/block-storage/src/v3/host/response/get.rs @@ -22,17 +22,29 @@ use structable::{StructTable, StructTableOptions}; /// Host response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct HostResponse { - #[structable(serialize)] - pub resource: Resource, -} - -/// `Resource` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Resource { + /// The name of the host that hosts the storage backend, may take the + /// format of host@backend. + #[structable()] pub host: String, + + /// The Project ID which the host resource belongs to. In the summary + /// resource, the value is `(total)`. + #[structable()] pub project: String, + + /// The total number of snapshots used. + #[structable()] pub snapshot_count: String, + + /// The total number of gibibytes (GiB) used by snapshots. + #[structable()] pub total_snapshot_gb: String, + + /// The total number of gibibytes (GiB) used. + #[structable()] pub total_volume_gb: String, + + /// Total number of volumes. + #[structable()] pub volume_count: String, } diff --git a/types/block-storage/src/v3/host/response/list.rs b/types/block-storage/src/v3/host/response/list.rs index 19d2ed54c..5c6f941c2 100644 --- a/types/block-storage/src/v3/host/response/list.rs +++ b/types/block-storage/src/v3/host/response/list.rs @@ -22,17 +22,90 @@ use structable::{StructTable, StructTableOptions}; /// Host response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct HostResponse { - #[structable(serialize)] - pub resource: Resource, + /// The name of the host that hosts the storage backend, may take the + /// format of `host@backend`. + #[structable()] + pub host_name: String, + + /// The date and time when the resource was updated. + /// + /// The date and time stamp format is + /// [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601): + /// + /// ```text + /// CCYY-MM-DDThh:mm:ss±hh:mm + /// ``` + /// + /// For example, `2015-08-27T09:49:58-05:00`. + /// + /// The `±hh:mm` value, if included, is the time zone as an offset from + /// UTC. In the previous example, the offset value is `-05:00`. + /// + /// If the `updated_at` date and time stamp is not set, its value is + /// `null`. + #[serde(rename = "last-update")] + #[structable(optional, title = "last-update", wide)] + pub last_update: Option, + + /// The name of the service which is running on the host. + #[structable()] + pub service: String, + + /// The state of the service. One of `enabled` or `disabled`. + #[serde(rename = "service-state")] + #[structable(serialize, title = "service-state", wide)] + pub service_state: ServiceState, + + /// The status of the service. One of `available` or `unavailable`. + #[serde(rename = "service-status")] + #[structable(serialize, title = "service-status", wide)] + pub service_status: ServiceStatus, + + /// The availability zone name. + #[structable()] + pub zone: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ServiceState { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for ServiceState { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ServiceStatus { + // Available + #[serde(rename = "available")] + Available, + + // Unavailable + #[serde(rename = "unavailable")] + Unavailable, } -/// `Resource` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Resource { - pub host: String, - pub project: String, - pub snapshot_count: String, - pub total_snapshot_gb: String, - pub total_volume_gb: String, - pub volume_count: String, +impl std::str::FromStr for ServiceStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "available" => Ok(Self::Available), + "unavailable" => Ok(Self::Unavailable), + _ => Err(()), + } + } } diff --git a/types/compute/src/v2/server/response/list_21.rs b/types/compute/src/v2/server/response/list_21.rs index d3a3c1958..c969300b2 100644 --- a/types/compute/src/v2/server/response/list_21.rs +++ b/types/compute/src/v2/server/response/list_21.rs @@ -22,7 +22,6 @@ use structable::{StructTable, StructTableOptions}; /// Server response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServerResponse { - /// The UUID of the server. #[structable()] pub id: String, diff --git a/types/compute/src/v2/server/response/list_detailed_29.rs b/types/compute/src/v2/server/response/list_detailed_29.rs index 725741830..2bcd48255 100644 --- a/types/compute/src/v2/server/response/list_detailed_29.rs +++ b/types/compute/src/v2/server/response/list_detailed_29.rs @@ -23,6 +23,8 @@ use structable::{StructTable, StructTableOptions}; /// Server response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServerResponse { + /// IPv4 address that should be used to access this server. May be + /// automatically set by the provider. #[serde(rename = "accessIPv4")] #[structable(title = "accessIPv4", wide)] pub access_ipv4: String, diff --git a/types/load-balancer/src/v2/flavor_profile/response/list.rs b/types/load-balancer/src/v2/flavor_profile/response/list.rs index 1a741d380..07af4e1ec 100644 --- a/types/load-balancer/src/v2/flavor_profile/response/list.rs +++ b/types/load-balancer/src/v2/flavor_profile/response/list.rs @@ -23,34 +23,18 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct FlavorProfileResponse { #[serde(default)] - #[structable(optional, serialize)] - pub flavorprofile_links: Option>, - - #[serde(default)] - #[structable(optional, serialize)] - pub flavorprofiles: Option>, -} - -/// Base type for complex types -/// `FlavorprofileLinks` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct FlavorprofileLinks { - #[serde(default)] - pub href: Option, - #[serde(default)] - pub rel: Option, -} - -/// Defines which attributes are to be shown on any response. -/// `Flavorprofiles` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Flavorprofiles { - #[serde(default)] + #[structable(optional, wide)] pub flavor_data: Option, + #[serde(default)] + #[structable(optional)] pub id: Option, + #[serde(default)] + #[structable(optional)] pub name: Option, + #[serde(default)] + #[structable(optional, wide)] pub provider_name: Option, }