diff --git a/cli-cmd/api/src/lib.rs b/cli-cmd/api/src/lib.rs index e8fd53dda..b590021d3 100644 --- a/cli-cmd/api/src/lib.rs +++ b/cli-cmd/api/src/lib.rs @@ -141,8 +141,7 @@ impl ApiCommand { })?, )) }) - .collect::, _>>()? - .into_iter(), + .collect::, _>>()?, ) } diff --git a/cli-cmd/block-storage/src/v3/attachment/create_327.rs b/cli-cmd/block-storage/src/v3/attachment/create_327.rs index 33e2e706d..6003aac4e 100644 --- a/cli-cmd/block-storage/src/v3/attachment/create_327.rs +++ b/cli-cmd/block-storage/src/v3/attachment/create_327.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::attachment::create_327; -use openstack_types::block_storage::v3::attachment::response::create::AttachmentResponse; +use openstack_types::block_storage::v3::attachment::response; use serde_json::Value; /// Create an attachment. @@ -177,8 +177,9 @@ impl AttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/attachment/create_354.rs b/cli-cmd/block-storage/src/v3/attachment/create_354.rs index a25daa1dc..7e1859a57 100644 --- a/cli-cmd/block-storage/src/v3/attachment/create_354.rs +++ b/cli-cmd/block-storage/src/v3/attachment/create_354.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::attachment::create_354; -use openstack_types::block_storage::v3::attachment::response::create::AttachmentResponse; +use openstack_types::block_storage::v3::attachment::response; use serde_json::Value; /// Create an attachment. @@ -200,8 +200,9 @@ impl AttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/attachment/list.rs b/cli-cmd/block-storage/src/v3/attachment/list.rs index cdad36d63..29cefdf43 100644 --- a/cli-cmd/block-storage/src/v3/attachment/list.rs +++ b/cli-cmd/block-storage/src/v3/attachment/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::attachment::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::attachment::response::list_detailed::AttachmentResponse; +use openstack_types::block_storage::v3::attachment::response; /// Return a detailed list of attachments. #[derive(Args)] @@ -146,7 +146,8 @@ impl AttachmentsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/attachment/set_327.rs b/cli-cmd/block-storage/src/v3/attachment/set_327.rs index d72887323..ae9c67f13 100644 --- a/cli-cmd/block-storage/src/v3/attachment/set_327.rs +++ b/cli-cmd/block-storage/src/v3/attachment/set_327.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::attachment::set_327; -use openstack_types::block_storage::v3::attachment::response::set::AttachmentResponse; +use openstack_types::block_storage::v3::attachment::response; use serde_json::Value; /// Update an attachment record. @@ -133,8 +133,9 @@ impl AttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/attachment/show.rs b/cli-cmd/block-storage/src/v3/attachment/show.rs index 0eeea426a..fe73d982b 100644 --- a/cli-cmd/block-storage/src/v3/attachment/show.rs +++ b/cli-cmd/block-storage/src/v3/attachment/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::attachment::get; -use openstack_types::block_storage::v3::attachment::response::get::AttachmentResponse; +use openstack_types::block_storage::v3::attachment::response; /// Return data about the given attachment. #[derive(Args)] @@ -80,8 +80,9 @@ impl AttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/availability_zone/list.rs b/cli-cmd/block-storage/src/v3/availability_zone/list.rs index dc0bd37a6..f7c23b387 100644 --- a/cli-cmd/block-storage/src/v3/availability_zone/list.rs +++ b/cli-cmd/block-storage/src/v3/availability_zone/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::availability_zone::list; -use openstack_types::block_storage::v3::availability_zone::response::list::AvailabilityZoneResponse; +use openstack_types::block_storage::v3::availability_zone::response; /// Describe all known availability zones. #[derive(Args)] @@ -74,7 +74,8 @@ impl AvailabilityZonesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/backup/create_30.rs b/cli-cmd/block-storage/src/v3/backup/create_30.rs index 4b072bf42..d6b3de00e 100644 --- a/cli-cmd/block-storage/src/v3/backup/create_30.rs +++ b/cli-cmd/block-storage/src/v3/backup/create_30.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::create_30; -use openstack_types::block_storage::v3::backup::response::create::BackupResponse; +use openstack_types::block_storage::v3::backup::response; /// Create a new backup. #[derive(Args)] @@ -172,8 +172,9 @@ impl BackupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/backup/create_343.rs b/cli-cmd/block-storage/src/v3/backup/create_343.rs index f6de177b8..988e9cb98 100644 --- a/cli-cmd/block-storage/src/v3/backup/create_343.rs +++ b/cli-cmd/block-storage/src/v3/backup/create_343.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::create_343; -use openstack_types::block_storage::v3::backup::response::create::BackupResponse; +use openstack_types::block_storage::v3::backup::response; /// Create a new backup. #[derive(Args)] @@ -183,8 +183,9 @@ impl BackupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/backup/create_351.rs b/cli-cmd/block-storage/src/v3/backup/create_351.rs index 6292fea70..36d8a8b99 100644 --- a/cli-cmd/block-storage/src/v3/backup/create_351.rs +++ b/cli-cmd/block-storage/src/v3/backup/create_351.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::create_351; -use openstack_types::block_storage::v3::backup::response::create::BackupResponse; +use openstack_types::block_storage::v3::backup::response; /// Create a new backup. #[derive(Args)] @@ -199,8 +199,9 @@ impl BackupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/backup/export_record/get.rs b/cli-cmd/block-storage/src/v3/backup/export_record/get.rs index 9276d9b55..842be1922 100644 --- a/cli-cmd/block-storage/src/v3/backup/export_record/get.rs +++ b/cli-cmd/block-storage/src/v3/backup/export_record/get.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::export_record::get; -use openstack_types::block_storage::v3::backup::export_record::response::get::ExportRecordResponse; +use openstack_types::block_storage::v3::backup::export_record::response; /// Export a backup. #[derive(Args)] @@ -83,8 +83,9 @@ impl ExportRecordCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/backup/import_record/create.rs b/cli-cmd/block-storage/src/v3/backup/import_record/create.rs index 333866c82..fbfd72eb5 100644 --- a/cli-cmd/block-storage/src/v3/backup/import_record/create.rs +++ b/cli-cmd/block-storage/src/v3/backup/import_record/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::import_record::create; -use openstack_types::block_storage::v3::backup::import_record::response::create::ImportRecordResponse; +use openstack_types::block_storage::v3::backup::import_record::response; /// Import a backup. #[derive(Args)] @@ -105,8 +105,9 @@ impl ImportRecordCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/backup/list.rs b/cli-cmd/block-storage/src/v3/backup/list.rs index 275e77eec..4f327d207 100644 --- a/cli-cmd/block-storage/src/v3/backup/list.rs +++ b/cli-cmd/block-storage/src/v3/backup/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::backup::response::list_detailed::BackupResponse; +use openstack_types::block_storage::v3::backup::response; /// Returns a detailed list of backups. #[derive(Args)] @@ -153,7 +153,8 @@ impl BackupsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/backup/restore/create.rs b/cli-cmd/block-storage/src/v3/backup/restore/create.rs index 440d0e52f..f4be5cce3 100644 --- a/cli-cmd/block-storage/src/v3/backup/restore/create.rs +++ b/cli-cmd/block-storage/src/v3/backup/restore/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::restore::create; -use openstack_types::block_storage::v3::backup::restore::response::create::RestoreResponse; +use openstack_types::block_storage::v3::backup::restore::response; /// Restore an existing backup to a volume. #[derive(Args)] @@ -121,8 +121,9 @@ impl RestoreCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/backup/set_343.rs b/cli-cmd/block-storage/src/v3/backup/set_343.rs index 888a6ff77..15c5a2256 100644 --- a/cli-cmd/block-storage/src/v3/backup/set_343.rs +++ b/cli-cmd/block-storage/src/v3/backup/set_343.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::find; use openstack_sdk::api::block_storage::v3::backup::set_343; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::backup::response::set::BackupResponse; +use openstack_types::block_storage::v3::backup::response; /// Update a backup. #[derive(Args)] @@ -147,8 +147,9 @@ impl BackupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/backup/set_39.rs b/cli-cmd/block-storage/src/v3/backup/set_39.rs index 7a63a5815..ad3f870c4 100644 --- a/cli-cmd/block-storage/src/v3/backup/set_39.rs +++ b/cli-cmd/block-storage/src/v3/backup/set_39.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::find; use openstack_sdk::api::block_storage::v3::backup::set_39; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::backup::response::set::BackupResponse; +use openstack_types::block_storage::v3::backup::response; /// Update a backup. #[derive(Args)] @@ -140,8 +140,9 @@ impl BackupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/backup/show.rs b/cli-cmd/block-storage/src/v3/backup/show.rs index 76a599fc3..45dd0d9df 100644 --- a/cli-cmd/block-storage/src/v3/backup/show.rs +++ b/cli-cmd/block-storage/src/v3/backup/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::backup::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::backup::response::get::BackupResponse; +use openstack_types::block_storage::v3::backup::response; /// Return data about the given backup. #[derive(Args)] @@ -82,7 +82,7 @@ impl BackupCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/capability/show.rs b/cli-cmd/block-storage/src/v3/capability/show.rs index 3601c0d77..534f2a99a 100644 --- a/cli-cmd/block-storage/src/v3/capability/show.rs +++ b/cli-cmd/block-storage/src/v3/capability/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::capability::get; -use openstack_types::block_storage::v3::capability::response::get::CapabilityResponse; +use openstack_types::block_storage::v3::capability::response; /// Return capabilities list of given backend. #[derive(Args)] @@ -81,8 +81,9 @@ impl CapabilityCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/cgsnapshot/create.rs b/cli-cmd/block-storage/src/v3/cgsnapshot/create.rs index fe4813a4c..159a4a509 100644 --- a/cli-cmd/block-storage/src/v3/cgsnapshot/create.rs +++ b/cli-cmd/block-storage/src/v3/cgsnapshot/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::cgsnapshot::create; -use openstack_types::block_storage::v3::cgsnapshot::response::create::CgsnapshotResponse; +use openstack_types::block_storage::v3::cgsnapshot::response; use serde_json::Value; /// Create a new cgsnapshot. @@ -124,8 +124,9 @@ impl CgsnapshotCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/cgsnapshot/list.rs b/cli-cmd/block-storage/src/v3/cgsnapshot/list.rs index 71ef0e072..6e7728b6f 100644 --- a/cli-cmd/block-storage/src/v3/cgsnapshot/list.rs +++ b/cli-cmd/block-storage/src/v3/cgsnapshot/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::cgsnapshot::list_detailed; -use openstack_types::block_storage::v3::cgsnapshot::response::list_detailed::CgsnapshotResponse; +use openstack_types::block_storage::v3::cgsnapshot::response; /// Returns a detailed list of cgsnapshots. #[derive(Args)] @@ -71,8 +71,9 @@ impl CgsnapshotsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/cgsnapshot/show.rs b/cli-cmd/block-storage/src/v3/cgsnapshot/show.rs index 749bcb091..160764ed0 100644 --- a/cli-cmd/block-storage/src/v3/cgsnapshot/show.rs +++ b/cli-cmd/block-storage/src/v3/cgsnapshot/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::cgsnapshot::get; -use openstack_types::block_storage::v3::cgsnapshot::response::get::CgsnapshotResponse; +use openstack_types::block_storage::v3::cgsnapshot::response; /// Return data about the given cgsnapshot. #[derive(Args)] @@ -81,8 +81,9 @@ impl CgsnapshotCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/cluster/list.rs b/cli-cmd/block-storage/src/v3/cluster/list.rs index 0d3133be9..5bbee47cd 100644 --- a/cli-cmd/block-storage/src/v3/cluster/list.rs +++ b/cli-cmd/block-storage/src/v3/cluster/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::cluster::list_detailed; -use openstack_types::block_storage::v3::cluster::response::list_detailed::ClusterResponse; +use openstack_types::block_storage::v3::cluster::response; /// Return a detailed list of all existing clusters. /// @@ -140,7 +140,8 @@ impl ClustersCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/cluster/show.rs b/cli-cmd/block-storage/src/v3/cluster/show.rs index 19b12621c..39ab4f3cf 100644 --- a/cli-cmd/block-storage/src/v3/cluster/show.rs +++ b/cli-cmd/block-storage/src/v3/cluster/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::cluster::get; -use openstack_types::block_storage::v3::cluster::response::get::ClusterResponse; +use openstack_types::block_storage::v3::cluster::response; /// Return data for a given cluster name with optional binary. #[derive(Args)] @@ -80,8 +80,9 @@ impl ClusterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/consistencygroup/create.rs b/cli-cmd/block-storage/src/v3/consistencygroup/create.rs index ea1a15e43..f45d60d29 100644 --- a/cli-cmd/block-storage/src/v3/consistencygroup/create.rs +++ b/cli-cmd/block-storage/src/v3/consistencygroup/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::consistencygroup::create; -use openstack_types::block_storage::v3::consistencygroup::response::create::ConsistencygroupResponse; +use openstack_types::block_storage::v3::consistencygroup::response; use serde_json::Value; /// Create a new consistency group. @@ -143,8 +143,9 @@ impl ConsistencygroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/consistencygroup/create_from_src/create.rs b/cli-cmd/block-storage/src/v3/consistencygroup/create_from_src/create.rs index 051d8fbe8..16677dfc2 100644 --- a/cli-cmd/block-storage/src/v3/consistencygroup/create_from_src/create.rs +++ b/cli-cmd/block-storage/src/v3/consistencygroup/create_from_src/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::consistencygroup::create_from_src::create; -use openstack_types::block_storage::v3::consistencygroup::create_from_src::response::create::CreateFromSrcResponse; +use openstack_types::block_storage::v3::consistencygroup::create_from_src::response; use serde_json::Value; /// Create a new consistency group from a source. @@ -149,8 +149,9 @@ impl CreateFromSrcCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/consistencygroup/delete/create.rs b/cli-cmd/block-storage/src/v3/consistencygroup/delete/create.rs index 8c20f6bee..867b5cce2 100644 --- a/cli-cmd/block-storage/src/v3/consistencygroup/delete/create.rs +++ b/cli-cmd/block-storage/src/v3/consistencygroup/delete/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::consistencygroup::delete::create; -use openstack_types::block_storage::v3::consistencygroup::delete::response::create::DeleteResponse; +use openstack_types::block_storage::v3::consistencygroup::delete::response; /// Delete a consistency group. #[derive(Args)] @@ -84,8 +84,9 @@ impl DeleteCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/consistencygroup/list.rs b/cli-cmd/block-storage/src/v3/consistencygroup/list.rs index 2911220fa..c6c909e71 100644 --- a/cli-cmd/block-storage/src/v3/consistencygroup/list.rs +++ b/cli-cmd/block-storage/src/v3/consistencygroup/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::consistencygroup::list_detailed; -use openstack_types::block_storage::v3::consistencygroup::response::list_detailed::ConsistencygroupResponse; +use openstack_types::block_storage::v3::consistencygroup::response; /// Returns a detailed list of consistency groups. #[derive(Args)] @@ -74,8 +74,9 @@ impl ConsistencygroupsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/consistencygroup/set.rs b/cli-cmd/block-storage/src/v3/consistencygroup/set.rs index 97d61aebf..db5e1e429 100644 --- a/cli-cmd/block-storage/src/v3/consistencygroup/set.rs +++ b/cli-cmd/block-storage/src/v3/consistencygroup/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::consistencygroup::set; -use openstack_types::block_storage::v3::consistencygroup::response::set::ConsistencygroupResponse; +use openstack_types::block_storage::v3::consistencygroup::response; use serde_json::Value; /// Update the consistency group. @@ -176,8 +176,9 @@ impl ConsistencygroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/consistencygroup/show.rs b/cli-cmd/block-storage/src/v3/consistencygroup/show.rs index 1e6167abc..a80a16e54 100644 --- a/cli-cmd/block-storage/src/v3/consistencygroup/show.rs +++ b/cli-cmd/block-storage/src/v3/consistencygroup/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::consistencygroup::get; -use openstack_types::block_storage::v3::consistencygroup::response::get::ConsistencygroupResponse; +use openstack_types::block_storage::v3::consistencygroup::response; /// Return data about the given consistency group. #[derive(Args)] @@ -84,8 +84,9 @@ impl ConsistencygroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/default_type/list.rs b/cli-cmd/block-storage/src/v3/default_type/list.rs index b2b052d69..f2c1b9048 100644 --- a/cli-cmd/block-storage/src/v3/default_type/list.rs +++ b/cli-cmd/block-storage/src/v3/default_type/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::default_type::list; -use openstack_types::block_storage::v3::default_type::response::list::DefaultTypeResponse; +use openstack_types::block_storage::v3::default_type::response; /// Return a list of default types. #[derive(Args)] @@ -74,7 +74,8 @@ impl DefaultTypesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/default_type/set_362.rs b/cli-cmd/block-storage/src/v3/default_type/set_362.rs index e8fd45109..73b4cd267 100644 --- a/cli-cmd/block-storage/src/v3/default_type/set_362.rs +++ b/cli-cmd/block-storage/src/v3/default_type/set_362.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::default_type::set_362; -use openstack_types::block_storage::v3::default_type::response::set::DefaultTypeResponse; +use openstack_types::block_storage::v3::default_type::response; /// Set a default volume type for the specified project. #[derive(Args)] @@ -110,8 +110,9 @@ impl DefaultTypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/default_type/show.rs b/cli-cmd/block-storage/src/v3/default_type/show.rs index 7ec0a5b61..b253ca3d7 100644 --- a/cli-cmd/block-storage/src/v3/default_type/show.rs +++ b/cli-cmd/block-storage/src/v3/default_type/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::default_type::get; -use openstack_types::block_storage::v3::default_type::response::get::DefaultTypeResponse; +use openstack_types::block_storage::v3::default_type::response; /// Return detail of a default type. #[derive(Args)] @@ -83,8 +83,9 @@ impl DefaultTypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/extension/list.rs b/cli-cmd/block-storage/src/v3/extension/list.rs index 6bad81f33..cc370744c 100644 --- a/cli-cmd/block-storage/src/v3/extension/list.rs +++ b/cli-cmd/block-storage/src/v3/extension/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::extension::list; -use openstack_types::block_storage::v3::extension::response::list::ExtensionResponse; +use openstack_types::block_storage::v3::extension::response; /// Command without description in OpenAPI #[derive(Args)] @@ -71,7 +71,8 @@ impl ExtensionsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/group/create_313.rs b/cli-cmd/block-storage/src/v3/group/create_313.rs index ae340a8f7..a566e23e1 100644 --- a/cli-cmd/block-storage/src/v3/group/create_313.rs +++ b/cli-cmd/block-storage/src/v3/group/create_313.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group::create_313; -use openstack_types::block_storage::v3::group::response::create::GroupResponse; +use openstack_types::block_storage::v3::group::response; /// Create a new group. #[derive(Args)] @@ -152,8 +152,9 @@ impl GroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/group/list.rs b/cli-cmd/block-storage/src/v3/group/list.rs index 9f4297b33..3c6daba15 100644 --- a/cli-cmd/block-storage/src/v3/group/list.rs +++ b/cli-cmd/block-storage/src/v3/group/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::group::response::list_detailed::GroupResponse; +use openstack_types::block_storage::v3::group::response; /// Returns a detailed list of groups. #[derive(Args)] @@ -145,7 +145,8 @@ impl GroupsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/group/set_313.rs b/cli-cmd/block-storage/src/v3/group/set_313.rs index c934b15df..990fd63ab 100644 --- a/cli-cmd/block-storage/src/v3/group/set_313.rs +++ b/cli-cmd/block-storage/src/v3/group/set_313.rs @@ -32,7 +32,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group::find; use openstack_sdk::api::block_storage::v3::group::set_313; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::group::response::set::GroupResponse; /// Update the group. /// @@ -184,9 +183,7 @@ impl GroupCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/group/show.rs b/cli-cmd/block-storage/src/v3/group/show.rs index 2024d5e8d..826247505 100644 --- a/cli-cmd/block-storage/src/v3/group/show.rs +++ b/cli-cmd/block-storage/src/v3/group/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::group::response::get::GroupResponse; +use openstack_types::block_storage::v3::group::response; /// Return data about the given group. #[derive(Args)] @@ -81,7 +81,7 @@ impl GroupCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/group_snapshot/create_314.rs b/cli-cmd/block-storage/src/v3/group_snapshot/create_314.rs index e893de4eb..8b42dffbe 100644 --- a/cli-cmd/block-storage/src/v3/group_snapshot/create_314.rs +++ b/cli-cmd/block-storage/src/v3/group_snapshot/create_314.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_snapshot::create_314; -use openstack_types::block_storage::v3::group_snapshot::response::create::GroupSnapshotResponse; +use openstack_types::block_storage::v3::group_snapshot::response; /// Create a new group_snapshot. #[derive(Args)] @@ -129,8 +129,9 @@ impl GroupSnapshotCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/group_snapshot/list.rs b/cli-cmd/block-storage/src/v3/group_snapshot/list.rs index 03c564eb3..2bee36867 100644 --- a/cli-cmd/block-storage/src/v3/group_snapshot/list.rs +++ b/cli-cmd/block-storage/src/v3/group_snapshot/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_snapshot::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::group_snapshot::response::list_detailed::GroupSnapshotResponse; +use openstack_types::block_storage::v3::group_snapshot::response; /// Returns a detailed list of group_snapshots. #[derive(Args)] @@ -149,7 +149,8 @@ impl GroupSnapshotsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/group_snapshot/show.rs b/cli-cmd/block-storage/src/v3/group_snapshot/show.rs index 523520fe6..f15e57d7e 100644 --- a/cli-cmd/block-storage/src/v3/group_snapshot/show.rs +++ b/cli-cmd/block-storage/src/v3/group_snapshot/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_snapshot::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::group_snapshot::response::get::GroupSnapshotResponse; +use openstack_types::block_storage::v3::group_snapshot::response; /// Return data about the given group_snapshot. #[derive(Args)] @@ -85,7 +85,7 @@ impl GroupSnapshotCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/group_type/create_311.rs b/cli-cmd/block-storage/src/v3/group_type/create_311.rs index 92a820aef..f5a352084 100644 --- a/cli-cmd/block-storage/src/v3/group_type/create_311.rs +++ b/cli-cmd/block-storage/src/v3/group_type/create_311.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_type::create_311; -use openstack_types::block_storage::v3::group_type::response::create::GroupTypeResponse; +use openstack_types::block_storage::v3::group_type::response; /// Creates a new group type. #[derive(Args)] @@ -134,8 +134,9 @@ impl GroupTypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/group_type/group_spec/create_311.rs b/cli-cmd/block-storage/src/v3/group_type/group_spec/create_311.rs index 9b826f23a..2870c3e9a 100644 --- a/cli-cmd/block-storage/src/v3/group_type/group_spec/create_311.rs +++ b/cli-cmd/block-storage/src/v3/group_type/group_spec/create_311.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val_opt; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_type::group_spec::create_311; -use openstack_types::block_storage::v3::group_type::group_spec::response::create::GroupSpecResponse; +use openstack_types::block_storage::v3::group_type::group_spec::response; /// Command without description in OpenAPI #[derive(Args)] @@ -104,8 +104,9 @@ impl GroupSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/group_type/group_spec/list.rs b/cli-cmd/block-storage/src/v3/group_type/group_spec/list.rs index cf10526d3..ff3f3e98b 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 @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_type::group_spec::list; -use openstack_types::block_storage::v3::group_type::group_spec::response::list::GroupSpecResponse; +use openstack_types::block_storage::v3::group_type::group_spec::response; /// Returns the list of group specs for a given group type. #[derive(Args)] @@ -84,8 +84,9 @@ impl GroupSpecsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/group_type/group_spec/set_311.rs b/cli-cmd/block-storage/src/v3/group_type/group_spec/set_311.rs index e62b0efd8..673a2b3e3 100644 --- a/cli-cmd/block-storage/src/v3/group_type/group_spec/set_311.rs +++ b/cli-cmd/block-storage/src/v3/group_type/group_spec/set_311.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val_opt; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_type::group_spec::set_311; -use openstack_types::block_storage::v3::group_type::group_spec::response::set::GroupSpecResponse; /// Command without description in OpenAPI #[derive(Args)] @@ -110,9 +109,7 @@ impl GroupSpecCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/group_type/group_spec/show.rs b/cli-cmd/block-storage/src/v3/group_type/group_spec/show.rs index e70e9b623..58961a037 100644 --- a/cli-cmd/block-storage/src/v3/group_type/group_spec/show.rs +++ b/cli-cmd/block-storage/src/v3/group_type/group_spec/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_type::group_spec::get; -use openstack_types::block_storage::v3::group_type::group_spec::response::get::GroupSpecResponse; +use openstack_types::block_storage::v3::group_type::group_spec::response; /// Return a single extra spec item. #[derive(Args)] @@ -93,8 +93,9 @@ impl GroupSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/group_type/list.rs b/cli-cmd/block-storage/src/v3/group_type/list.rs index 44ce379c6..05b896129 100644 --- a/cli-cmd/block-storage/src/v3/group_type/list.rs +++ b/cli-cmd/block-storage/src/v3/group_type/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_type::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::group_type::response::list::GroupTypeResponse; +use openstack_types::block_storage::v3::group_type::response; /// Returns the list of group types. #[derive(Args)] @@ -146,7 +146,8 @@ impl GroupTypesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/group_type/set_311.rs b/cli-cmd/block-storage/src/v3/group_type/set_311.rs index aa164aa2c..b348ebca9 100644 --- a/cli-cmd/block-storage/src/v3/group_type/set_311.rs +++ b/cli-cmd/block-storage/src/v3/group_type/set_311.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_type::find; use openstack_sdk::api::block_storage::v3::group_type::set_311; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::group_type::response::set::GroupTypeResponse; +use openstack_types::block_storage::v3::group_type::response; /// Command without description in OpenAPI #[derive(Args)] @@ -153,8 +153,9 @@ impl GroupTypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/group_type/show.rs b/cli-cmd/block-storage/src/v3/group_type/show.rs index 5e319305d..4280c21c0 100644 --- a/cli-cmd/block-storage/src/v3/group_type/show.rs +++ b/cli-cmd/block-storage/src/v3/group_type/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::group_type::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::group_type::response::get::GroupTypeResponse; +use openstack_types::block_storage::v3::group_type::response; /// Return a single group type item. #[derive(Args)] @@ -82,7 +82,7 @@ impl GroupTypeCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/host/list.rs b/cli-cmd/block-storage/src/v3/host/list.rs index b32117ceb..ef0ba6bc4 100644 --- a/cli-cmd/block-storage/src/v3/host/list.rs +++ b/cli-cmd/block-storage/src/v3/host/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::host::list; -use openstack_types::block_storage::v3::host::response::list::HostResponse; +use openstack_types::block_storage::v3::host::response; /// List all hosts for a project #[derive(Args)] @@ -71,7 +71,8 @@ impl HostsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + 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 91ea0aa9a..d7d2597a9 100644 --- a/cli-cmd/block-storage/src/v3/host/show.rs +++ b/cli-cmd/block-storage/src/v3/host/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::host::get; -use openstack_types::block_storage::v3::host::response::get::HostResponse; +use openstack_types::block_storage::v3::host::response; /// Show Host Details for a project #[derive(Args)] @@ -80,8 +80,9 @@ impl HostCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/limit/list.rs b/cli-cmd/block-storage/src/v3/limit/list.rs index d3552b0da..a8d0e7354 100644 --- a/cli-cmd/block-storage/src/v3/limit/list.rs +++ b/cli-cmd/block-storage/src/v3/limit/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::limit::list; -use openstack_types::block_storage::v3::limit::response::list::LimitResponse; +use openstack_types::block_storage::v3::limit::response; /// Return all global and rate limit information. #[derive(Args)] @@ -69,8 +69,9 @@ impl LimitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/manageable_snapshot/create.rs b/cli-cmd/block-storage/src/v3/manageable_snapshot/create.rs index dd6452eca..acb7e7087 100644 --- a/cli-cmd/block-storage/src/v3/manageable_snapshot/create.rs +++ b/cli-cmd/block-storage/src/v3/manageable_snapshot/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::manageable_snapshot::create; -use openstack_types::block_storage::v3::manageable_snapshot::response::create::ManageableSnapshotResponse; +use openstack_types::block_storage::v3::manageable_snapshot::response; use serde_json::Value; /// Instruct Cinder to manage a storage snapshot object. @@ -186,8 +186,9 @@ impl ManageableSnapshotCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/manageable_snapshot/get.rs b/cli-cmd/block-storage/src/v3/manageable_snapshot/get.rs index 13e1113e9..102ac7325 100644 --- a/cli-cmd/block-storage/src/v3/manageable_snapshot/get.rs +++ b/cli-cmd/block-storage/src/v3/manageable_snapshot/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::manageable_snapshot::get; -use openstack_types::block_storage::v3::manageable_snapshot::response::get::ManageableSnapshotResponse; +use openstack_types::block_storage::v3::manageable_snapshot::response; /// Returns a summary list of volumes available to manage. #[derive(Args)] @@ -136,7 +136,7 @@ impl ManageableSnapshotCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/manageable_snapshot/list.rs b/cli-cmd/block-storage/src/v3/manageable_snapshot/list.rs index 3f2f20bd9..1c9e379b0 100644 --- a/cli-cmd/block-storage/src/v3/manageable_snapshot/list.rs +++ b/cli-cmd/block-storage/src/v3/manageable_snapshot/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::manageable_snapshot::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::manageable_snapshot::response::list_detailed::ManageableSnapshotResponse; +use openstack_types::block_storage::v3::manageable_snapshot::response; /// Returns a detailed list of volumes available to manage. #[derive(Args)] @@ -143,7 +143,8 @@ impl ManageableSnapshotsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/manageable_volume/create_30.rs b/cli-cmd/block-storage/src/v3/manageable_volume/create_30.rs index 6d57faee3..a1702a955 100644 --- a/cli-cmd/block-storage/src/v3/manageable_volume/create_30.rs +++ b/cli-cmd/block-storage/src/v3/manageable_volume/create_30.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::manageable_volume::create_30; -use openstack_types::block_storage::v3::manageable_volume::response::create::ManageableVolumeResponse; use serde_json::Value; /// Instruct Cinder to manage a storage object. @@ -245,9 +244,7 @@ impl ManageableVolumeCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/manageable_volume/create_316.rs b/cli-cmd/block-storage/src/v3/manageable_volume/create_316.rs index 1e4f958f5..76b1df1e5 100644 --- a/cli-cmd/block-storage/src/v3/manageable_volume/create_316.rs +++ b/cli-cmd/block-storage/src/v3/manageable_volume/create_316.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::manageable_volume::create_316; -use openstack_types::block_storage::v3::manageable_volume::response::create::ManageableVolumeResponse; use serde_json::Value; /// Instruct Cinder to manage a storage object. @@ -260,9 +259,7 @@ impl ManageableVolumeCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/manageable_volume/get.rs b/cli-cmd/block-storage/src/v3/manageable_volume/get.rs index 911514f9f..548b7bd91 100644 --- a/cli-cmd/block-storage/src/v3/manageable_volume/get.rs +++ b/cli-cmd/block-storage/src/v3/manageable_volume/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::manageable_volume::get; -use openstack_types::block_storage::v3::manageable_volume::response::get::ManageableVolumeResponse; +use openstack_types::block_storage::v3::manageable_volume::response; /// Returns a summary list of volumes available to manage. #[derive(Args)] @@ -136,7 +136,7 @@ impl ManageableVolumeCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/manageable_volume/list.rs b/cli-cmd/block-storage/src/v3/manageable_volume/list.rs index 847230837..d946ed67e 100644 --- a/cli-cmd/block-storage/src/v3/manageable_volume/list.rs +++ b/cli-cmd/block-storage/src/v3/manageable_volume/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::manageable_volume::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::manageable_volume::response::list_detailed::ManageableVolumeResponse; +use openstack_types::block_storage::v3::manageable_volume::response; /// Returns a detailed list of volumes available to manage. #[derive(Args)] @@ -143,7 +143,8 @@ impl ManageableVolumesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/message/list.rs b/cli-cmd/block-storage/src/v3/message/list.rs index ed731957a..2b4b7bb00 100644 --- a/cli-cmd/block-storage/src/v3/message/list.rs +++ b/cli-cmd/block-storage/src/v3/message/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::message::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::message::response::list::MessageResponse; +use openstack_types::block_storage::v3::message::response; /// Returns a list of messages, transformed through view builder. #[derive(Args)] @@ -139,7 +139,8 @@ impl MessagesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/message/show.rs b/cli-cmd/block-storage/src/v3/message/show.rs index 7e790e5ac..21c821403 100644 --- a/cli-cmd/block-storage/src/v3/message/show.rs +++ b/cli-cmd/block-storage/src/v3/message/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::message::get; -use openstack_types::block_storage::v3::message::response::get::MessageResponse; +use openstack_types::block_storage::v3::message::response; /// Return the given message. #[derive(Args)] @@ -80,8 +80,9 @@ impl MessageCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/os_volume_transfer/accept.rs b/cli-cmd/block-storage/src/v3/os_volume_transfer/accept.rs index b37aa60f5..014498409 100644 --- a/cli-cmd/block-storage/src/v3/os_volume_transfer/accept.rs +++ b/cli-cmd/block-storage/src/v3/os_volume_transfer/accept.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::os_volume_transfer::accept; -use openstack_types::block_storage::v3::os_volume_transfer::response::accept::OsVolumeTransferResponse; +use openstack_types::block_storage::v3::os_volume_transfer::response; /// Accept a new volume transfer. #[derive(Args)] @@ -106,8 +106,9 @@ impl OsVolumeTransferCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/os_volume_transfer/create.rs b/cli-cmd/block-storage/src/v3/os_volume_transfer/create.rs index 85806cc56..6e1902090 100644 --- a/cli-cmd/block-storage/src/v3/os_volume_transfer/create.rs +++ b/cli-cmd/block-storage/src/v3/os_volume_transfer/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::os_volume_transfer::create; -use openstack_types::block_storage::v3::os_volume_transfer::response::create::OsVolumeTransferResponse; +use openstack_types::block_storage::v3::os_volume_transfer::response; /// Create a new volume transfer. #[derive(Args)] @@ -111,8 +111,9 @@ impl OsVolumeTransferCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/os_volume_transfer/list.rs b/cli-cmd/block-storage/src/v3/os_volume_transfer/list.rs index 114c30f3e..a5580b166 100644 --- a/cli-cmd/block-storage/src/v3/os_volume_transfer/list.rs +++ b/cli-cmd/block-storage/src/v3/os_volume_transfer/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::os_volume_transfer::list_detailed; -use openstack_types::block_storage::v3::os_volume_transfer::response::list_detailed::OsVolumeTransferResponse; +use openstack_types::block_storage::v3::os_volume_transfer::response; /// Returns a detailed list of transfers. #[derive(Args)] @@ -74,7 +74,8 @@ impl OsVolumeTransfersCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/os_volume_transfer/show.rs b/cli-cmd/block-storage/src/v3/os_volume_transfer/show.rs index 20353b195..851b71407 100644 --- a/cli-cmd/block-storage/src/v3/os_volume_transfer/show.rs +++ b/cli-cmd/block-storage/src/v3/os_volume_transfer/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::os_volume_transfer::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::os_volume_transfer::response::get::OsVolumeTransferResponse; +use openstack_types::block_storage::v3::os_volume_transfer::response; /// Return data about active transfers. #[derive(Args)] @@ -85,7 +85,7 @@ impl OsVolumeTransferCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/qos_spec/association/list.rs b/cli-cmd/block-storage/src/v3/qos_spec/association/list.rs index 5e25e9314..684d3d873 100644 --- a/cli-cmd/block-storage/src/v3/qos_spec/association/list.rs +++ b/cli-cmd/block-storage/src/v3/qos_spec/association/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::qos_spec::association::list; -use openstack_types::block_storage::v3::qos_spec::association::response::list::AssociationResponse; +use openstack_types::block_storage::v3::qos_spec::association::response; /// List all associations of given qos specs. #[derive(Args)] @@ -84,7 +84,8 @@ impl AssociationsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/qos_spec/create.rs b/cli-cmd/block-storage/src/v3/qos_spec/create.rs index 21d499339..41a0df61e 100644 --- a/cli-cmd/block-storage/src/v3/qos_spec/create.rs +++ b/cli-cmd/block-storage/src/v3/qos_spec/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::qos_spec::create; -use openstack_types::block_storage::v3::qos_spec::response::create::QosSpecResponse; +use openstack_types::block_storage::v3::qos_spec::response; /// Command without description in OpenAPI #[derive(Args)] @@ -95,8 +95,9 @@ impl QosSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/qos_spec/delete_keys.rs b/cli-cmd/block-storage/src/v3/qos_spec/delete_keys.rs index 38a68d2d3..42a06c234 100644 --- a/cli-cmd/block-storage/src/v3/qos_spec/delete_keys.rs +++ b/cli-cmd/block-storage/src/v3/qos_spec/delete_keys.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::qos_spec::delete_keys; -use openstack_types::block_storage::v3::qos_spec::response::delete_keys::QosSpecResponse; +use openstack_types::block_storage::v3::qos_spec::response; /// Deletes specified keys in qos specs. #[derive(Args)] @@ -92,8 +92,9 @@ impl QosSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/qos_spec/list.rs b/cli-cmd/block-storage/src/v3/qos_spec/list.rs index 528c56587..93dbc5a07 100644 --- a/cli-cmd/block-storage/src/v3/qos_spec/list.rs +++ b/cli-cmd/block-storage/src/v3/qos_spec/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::qos_spec::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::qos_spec::response::list::QosSpecResponse; +use openstack_types::block_storage::v3::qos_spec::response; /// Returns the list of qos_specs. #[derive(Args)] @@ -139,7 +139,8 @@ impl QosSpecsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/qos_spec/set.rs b/cli-cmd/block-storage/src/v3/qos_spec/set.rs index a15fa6fed..24a7c4b43 100644 --- a/cli-cmd/block-storage/src/v3/qos_spec/set.rs +++ b/cli-cmd/block-storage/src/v3/qos_spec/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::qos_spec::find; use openstack_sdk::api::block_storage::v3::qos_spec::set; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::qos_spec::response::set::QosSpecResponse; +use openstack_types::block_storage::v3::qos_spec::response; /// Command without description in OpenAPI #[derive(Args)] @@ -109,8 +109,9 @@ impl QosSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/qos_spec/show.rs b/cli-cmd/block-storage/src/v3/qos_spec/show.rs index 2903ff62d..638bfad80 100644 --- a/cli-cmd/block-storage/src/v3/qos_spec/show.rs +++ b/cli-cmd/block-storage/src/v3/qos_spec/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::qos_spec::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::qos_spec::response::get::QosSpecResponse; +use openstack_types::block_storage::v3::qos_spec::response; /// Return a single qos spec item. #[derive(Args)] @@ -82,7 +82,7 @@ impl QosSpecCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/quota_class_set/set.rs b/cli-cmd/block-storage/src/v3/quota_class_set/set.rs index 556cac999..04c2e65d2 100644 --- a/cli-cmd/block-storage/src/v3/quota_class_set/set.rs +++ b/cli-cmd/block-storage/src/v3/quota_class_set/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::quota_class_set::set; -use openstack_types::block_storage::v3::quota_class_set::response::set::QuotaClassSetResponse; +use openstack_types::block_storage::v3::quota_class_set::response; /// Update quota classes for a project #[derive(Args)] @@ -93,8 +93,9 @@ impl QuotaClassSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/quota_class_set/show.rs b/cli-cmd/block-storage/src/v3/quota_class_set/show.rs index 56aad735e..9b96b0b94 100644 --- a/cli-cmd/block-storage/src/v3/quota_class_set/show.rs +++ b/cli-cmd/block-storage/src/v3/quota_class_set/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::quota_class_set::get; -use openstack_types::block_storage::v3::quota_class_set::response::get::QuotaClassSetResponse; +use openstack_types::block_storage::v3::quota_class_set::response; /// Show quota classes for a project #[derive(Args)] @@ -84,8 +84,9 @@ impl QuotaClassSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/quota_set/defaults.rs b/cli-cmd/block-storage/src/v3/quota_set/defaults.rs index 3c80b0f09..91ce3acb0 100644 --- a/cli-cmd/block-storage/src/v3/quota_set/defaults.rs +++ b/cli-cmd/block-storage/src/v3/quota_set/defaults.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::quota_set::defaults; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::block_storage::v3::quota_set::response::defaults::QuotaSetResponse; +use openstack_types::block_storage::v3::quota_set::response; use tracing::warn; /// Command without description in OpenAPI @@ -147,8 +147,9 @@ impl QuotaSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/quota_set/set.rs b/cli-cmd/block-storage/src/v3/quota_set/set.rs index 3f19b1ca9..b00b70541 100644 --- a/cli-cmd/block-storage/src/v3/quota_set/set.rs +++ b/cli-cmd/block-storage/src/v3/quota_set/set.rs @@ -34,7 +34,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::quota_set::set; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::block_storage::v3::quota_set::response::set::QuotaSetResponse; +use openstack_types::block_storage::v3::quota_set::response; use serde_json::Value; use tracing::warn; @@ -156,8 +156,9 @@ impl QuotaSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/quota_set/show.rs b/cli-cmd/block-storage/src/v3/quota_set/show.rs index 0aa408077..f1eb51aa0 100644 --- a/cli-cmd/block-storage/src/v3/quota_set/show.rs +++ b/cli-cmd/block-storage/src/v3/quota_set/show.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::quota_set::get; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::block_storage::v3::quota_set::response::get::QuotaSetResponse; +use openstack_types::block_storage::v3::quota_set::response; use tracing::warn; /// Show quota for a particular tenant @@ -153,8 +153,9 @@ impl QuotaSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/resource_filter/list.rs b/cli-cmd/block-storage/src/v3/resource_filter/list.rs index 3ae21604e..6d6a04881 100644 --- a/cli-cmd/block-storage/src/v3/resource_filter/list.rs +++ b/cli-cmd/block-storage/src/v3/resource_filter/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::resource_filter::list; -use openstack_types::block_storage::v3::resource_filter::response::list::ResourceFilterResponse; +use openstack_types::block_storage::v3::resource_filter::response; /// Return a list of resource filters. #[derive(Args)] @@ -74,7 +74,8 @@ impl ResourceFiltersCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/scheduler_stat/pool/list.rs b/cli-cmd/block-storage/src/v3/scheduler_stat/pool/list.rs index 890866b39..142925d89 100644 --- a/cli-cmd/block-storage/src/v3/scheduler_stat/pool/list.rs +++ b/cli-cmd/block-storage/src/v3/scheduler_stat/pool/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::scheduler_stat::pool::list; -use openstack_types::block_storage::v3::scheduler_stat::pool::response::list::PoolResponse; +use openstack_types::block_storage::v3::scheduler_stat::pool::response; /// List all active pools in scheduler. #[derive(Args)] @@ -85,7 +85,8 @@ impl PoolsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/service/list.rs b/cli-cmd/block-storage/src/v3/service/list.rs index 2ce7003e0..d59be726e 100644 --- a/cli-cmd/block-storage/src/v3/service/list.rs +++ b/cli-cmd/block-storage/src/v3/service/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::service::list; -use openstack_types::block_storage::v3::service::response::list::ServiceResponse; +use openstack_types::block_storage::v3::service::response; /// Return a list of all running services. /// @@ -72,8 +72,9 @@ impl ServicesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot/create.rs b/cli-cmd/block-storage/src/v3/snapshot/create.rs index 26145a5d8..d241ab96e 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/create.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot::create; -use openstack_types::block_storage::v3::snapshot::response::create::SnapshotResponse; +use openstack_types::block_storage::v3::snapshot::response; /// Creates a new snapshot. #[derive(Args)] @@ -154,8 +154,9 @@ impl SnapshotCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot/list.rs b/cli-cmd/block-storage/src/v3/snapshot/list.rs index d793c47d8..adcaa4f02 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/list.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::snapshot::response::list_detailed::SnapshotResponse; +use openstack_types::block_storage::v3::snapshot::response; /// Returns a detailed list of snapshots. #[derive(Args)] @@ -164,7 +164,8 @@ impl SnapshotsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + 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/create.rs b/cli-cmd/block-storage/src/v3/snapshot/metadata/create.rs index 4b37f91e5..1a4658e2f 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/metadata/create.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/metadata/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot::metadata::create; -use openstack_types::block_storage::v3::snapshot::metadata::response::create::MetadataResponse; +use openstack_types::block_storage::v3::snapshot::metadata::response; use serde_json::Value; /// Command without description in OpenAPI @@ -103,8 +103,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot/metadata/list.rs b/cli-cmd/block-storage/src/v3/snapshot/metadata/list.rs index bd45d6918..f686c3699 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/metadata/list.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/metadata/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot::metadata::list; -use openstack_types::block_storage::v3::snapshot::metadata::response::list::MetadataResponse; +use openstack_types::block_storage::v3::snapshot::metadata::response; /// Returns the list of metadata for a given snapshot. #[derive(Args)] @@ -84,8 +84,9 @@ impl MetadatasCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot/metadata/replace.rs b/cli-cmd/block-storage/src/v3/snapshot/metadata/replace.rs index 6102ccf97..a94068e66 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/metadata/replace.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/metadata/replace.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot::metadata::replace; -use openstack_types::block_storage::v3::snapshot::metadata::response::replace::MetadataResponse; +use openstack_types::block_storage::v3::snapshot::metadata::response; use serde_json::Value; /// Command without description in OpenAPI @@ -103,8 +103,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot/metadata/set.rs b/cli-cmd/block-storage/src/v3/snapshot/metadata/set.rs index 3463d71df..3b910705c 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/metadata/set.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/metadata/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot::metadata::set; -use openstack_types::block_storage::v3::snapshot::metadata::response::set::MetadataResponse; +use openstack_types::block_storage::v3::snapshot::metadata::response; use serde_json::Value; /// Command without description in OpenAPI @@ -111,8 +111,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot/metadata/show.rs b/cli-cmd/block-storage/src/v3/snapshot/metadata/show.rs index f179e8980..9b3f9e391 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/metadata/show.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/metadata/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot::metadata::get; -use openstack_types::block_storage::v3::snapshot::metadata::response::get::MetadataResponse; +use openstack_types::block_storage::v3::snapshot::metadata::response; /// Return a single metadata item. #[derive(Args)] @@ -93,8 +93,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot/set.rs b/cli-cmd/block-storage/src/v3/snapshot/set.rs index 5ea5e8228..594b24b6d 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/set.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot::find; use openstack_sdk::api::block_storage::v3::snapshot::set; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::snapshot::response::set::SnapshotResponse; +use openstack_types::block_storage::v3::snapshot::response; /// Update a snapshot. #[derive(Args)] @@ -164,8 +164,9 @@ impl SnapshotCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot/show.rs b/cli-cmd/block-storage/src/v3/snapshot/show.rs index aee61aa05..44eef18d4 100644 --- a/cli-cmd/block-storage/src/v3/snapshot/show.rs +++ b/cli-cmd/block-storage/src/v3/snapshot/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::snapshot::response::get::SnapshotResponse; +use openstack_types::block_storage::v3::snapshot::response; /// Return data about the given snapshot. #[derive(Args)] @@ -82,7 +82,7 @@ impl SnapshotCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/snapshot_manage/create.rs b/cli-cmd/block-storage/src/v3/snapshot_manage/create.rs index 324a85311..ed6eb4360 100644 --- a/cli-cmd/block-storage/src/v3/snapshot_manage/create.rs +++ b/cli-cmd/block-storage/src/v3/snapshot_manage/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot_manage::create; -use openstack_types::block_storage::v3::snapshot_manage::response::create::SnapshotManageResponse; +use openstack_types::block_storage::v3::snapshot_manage::response; use serde_json::Value; /// Instruct Cinder to manage a storage snapshot object. @@ -177,8 +177,9 @@ impl SnapshotManageCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot_manage/get.rs b/cli-cmd/block-storage/src/v3/snapshot_manage/get.rs index 1bce8156f..906af8cd9 100644 --- a/cli-cmd/block-storage/src/v3/snapshot_manage/get.rs +++ b/cli-cmd/block-storage/src/v3/snapshot_manage/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot_manage::get; -use openstack_types::block_storage::v3::snapshot_manage::response::get::SnapshotManageResponse; +use openstack_types::block_storage::v3::snapshot_manage::response; /// Returns a summary list of snapshots available to manage. #[derive(Args)] @@ -74,8 +74,9 @@ impl SnapshotManageCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/snapshot_manage/list.rs b/cli-cmd/block-storage/src/v3/snapshot_manage/list.rs index a1684411a..0f5afb62e 100644 --- a/cli-cmd/block-storage/src/v3/snapshot_manage/list.rs +++ b/cli-cmd/block-storage/src/v3/snapshot_manage/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::snapshot_manage::list_detailed; -use openstack_types::block_storage::v3::snapshot_manage::response::list_detailed::SnapshotManageResponse; +use openstack_types::block_storage::v3::snapshot_manage::response; /// Returns a detailed list of snapshots available to manage. #[derive(Args)] @@ -73,8 +73,9 @@ impl SnapshotManagesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/create.rs b/cli-cmd/block-storage/src/v3/type/create.rs index 05af3a8a0..153735137 100644 --- a/cli-cmd/block-storage/src/v3/type/create.rs +++ b/cli-cmd/block-storage/src/v3/type/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val_opt; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::create; -use openstack_types::block_storage::v3::r#type::response::create::TypeResponse; +use openstack_types::block_storage::v3::r#type::response; /// Command without description in OpenAPI #[derive(Args)] @@ -131,8 +131,9 @@ impl TypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/encryption/create.rs b/cli-cmd/block-storage/src/v3/type/encryption/create.rs index d5724f55b..7ebecccc8 100644 --- a/cli-cmd/block-storage/src/v3/type/encryption/create.rs +++ b/cli-cmd/block-storage/src/v3/type/encryption/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::encryption::create; -use openstack_types::block_storage::v3::r#type::encryption::response::create::EncryptionResponse; +use openstack_types::block_storage::v3::r#type::encryption::response; /// Create encryption specs for an existing volume type. #[derive(Args)] @@ -142,8 +142,9 @@ impl EncryptionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/encryption/list.rs b/cli-cmd/block-storage/src/v3/type/encryption/list.rs index e3c99846b..8f74121e9 100644 --- a/cli-cmd/block-storage/src/v3/type/encryption/list.rs +++ b/cli-cmd/block-storage/src/v3/type/encryption/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::encryption::list; -use openstack_types::block_storage::v3::r#type::encryption::response::list::EncryptionResponse; +use openstack_types::block_storage::v3::r#type::encryption::response; /// Returns the encryption specs for a given volume type. #[derive(Args)] @@ -83,8 +83,9 @@ impl EncryptionsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/encryption/set.rs b/cli-cmd/block-storage/src/v3/type/encryption/set.rs index d6405726f..29011f197 100644 --- a/cli-cmd/block-storage/src/v3/type/encryption/set.rs +++ b/cli-cmd/block-storage/src/v3/type/encryption/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::encryption::set; -use openstack_types::block_storage::v3::r#type::encryption::response::set::EncryptionResponse; +use openstack_types::block_storage::v3::r#type::encryption::response; /// Update encryption specs for a given volume type. #[derive(Args)] @@ -155,8 +155,9 @@ impl EncryptionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/encryption/show.rs b/cli-cmd/block-storage/src/v3/type/encryption/show.rs index 421cb7297..b90e7403f 100644 --- a/cli-cmd/block-storage/src/v3/type/encryption/show.rs +++ b/cli-cmd/block-storage/src/v3/type/encryption/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::encryption::get; -use openstack_types::block_storage::v3::r#type::encryption::response::get::EncryptionResponse; +use openstack_types::block_storage::v3::r#type::encryption::response; /// Return a single encryption item. #[derive(Args)] @@ -92,8 +92,9 @@ impl EncryptionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/extra_spec/create.rs b/cli-cmd/block-storage/src/v3/type/extra_spec/create.rs index d8ee8a3cf..db53560f7 100644 --- a/cli-cmd/block-storage/src/v3/type/extra_spec/create.rs +++ b/cli-cmd/block-storage/src/v3/type/extra_spec/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val_opt; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::extra_spec::create; -use openstack_types::block_storage::v3::r#type::extra_spec::response::create::ExtraSpecResponse; +use openstack_types::block_storage::v3::r#type::extra_spec::response; /// Command without description in OpenAPI #[derive(Args)] @@ -97,8 +97,9 @@ impl ExtraSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/extra_spec/list.rs b/cli-cmd/block-storage/src/v3/type/extra_spec/list.rs index c57fb0775..3460bbc20 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 @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::extra_spec::list; -use openstack_types::block_storage::v3::r#type::extra_spec::response::list::ExtraSpecResponse; +use openstack_types::block_storage::v3::r#type::extra_spec::response; /// Returns the list of extra specs for a given volume type. #[derive(Args)] @@ -83,8 +83,9 @@ impl ExtraSpecsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/extra_spec/set.rs b/cli-cmd/block-storage/src/v3/type/extra_spec/set.rs index 71e806656..547875dea 100644 --- a/cli-cmd/block-storage/src/v3/type/extra_spec/set.rs +++ b/cli-cmd/block-storage/src/v3/type/extra_spec/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val_opt; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::extra_spec::set; -use openstack_types::block_storage::v3::r#type::extra_spec::response::set::ExtraSpecResponse; +use openstack_types::block_storage::v3::r#type::extra_spec::response; /// Command without description in OpenAPI #[derive(Args)] @@ -106,8 +106,9 @@ impl ExtraSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/extra_spec/show.rs b/cli-cmd/block-storage/src/v3/type/extra_spec/show.rs index 8555e70bf..71dc7d5b6 100644 --- a/cli-cmd/block-storage/src/v3/type/extra_spec/show.rs +++ b/cli-cmd/block-storage/src/v3/type/extra_spec/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::extra_spec::get; -use openstack_types::block_storage::v3::r#type::extra_spec::response::get::ExtraSpecResponse; +use openstack_types::block_storage::v3::r#type::extra_spec::response; /// Return a single extra spec item. #[derive(Args)] @@ -92,8 +92,9 @@ impl ExtraSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/list.rs b/cli-cmd/block-storage/src/v3/type/list.rs index 0c8440f3b..94f9178c3 100644 --- a/cli-cmd/block-storage/src/v3/type/list.rs +++ b/cli-cmd/block-storage/src/v3/type/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::list; -use openstack_types::block_storage::v3::r#type::response::list::TypeResponse; +use openstack_types::block_storage::v3::r#type::response; /// Returns the list of volume types. #[derive(Args)] @@ -70,7 +70,8 @@ impl TypesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/type/set.rs b/cli-cmd/block-storage/src/v3/type/set.rs index bb6f1ce54..e5aefc187 100644 --- a/cli-cmd/block-storage/src/v3/type/set.rs +++ b/cli-cmd/block-storage/src/v3/type/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::find; use openstack_sdk::api::block_storage::v3::r#type::set; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::r#type::response::set::TypeResponse; +use openstack_types::block_storage::v3::r#type::response; /// Command without description in OpenAPI #[derive(Args)] @@ -144,8 +144,9 @@ impl TypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/type/show.rs b/cli-cmd/block-storage/src/v3/type/show.rs index 68df2a9d4..22bbdc12e 100644 --- a/cli-cmd/block-storage/src/v3/type/show.rs +++ b/cli-cmd/block-storage/src/v3/type/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::r#type::response::get::TypeResponse; +use openstack_types::block_storage::v3::r#type::response; /// Return a single volume type item. #[derive(Args)] @@ -81,7 +81,7 @@ impl TypeCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/type/volume_type_access/get.rs b/cli-cmd/block-storage/src/v3/type/volume_type_access/get.rs index c8c0ddc30..98c4f3686 100644 --- a/cli-cmd/block-storage/src/v3/type/volume_type_access/get.rs +++ b/cli-cmd/block-storage/src/v3/type/volume_type_access/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::r#type::volume_type_access::get; -use openstack_types::block_storage::v3::r#type::volume_type_access::response::get::VolumeTypeAccessResponse; +use openstack_types::block_storage::v3::r#type::volume_type_access::response; /// Command without description in OpenAPI #[derive(Args)] @@ -86,7 +86,7 @@ impl VolumeTypeAccessCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/version/get.rs b/cli-cmd/block-storage/src/v3/version/get.rs index df5bf4385..44f3db46b 100644 --- a/cli-cmd/block-storage/src/v3/version/get.rs +++ b/cli-cmd/block-storage/src/v3/version/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::version::get; -use openstack_types::block_storage::v3::version::response::get::VersionResponse; +use openstack_types::block_storage::v3::version::response; /// Shows details for Block Storage API v3. #[derive(Args)] @@ -72,8 +72,9 @@ impl VersionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/create_30.rs b/cli-cmd/block-storage/src/v3/volume/create_30.rs index 1473e748f..1df9aff3a 100644 --- a/cli-cmd/block-storage/src/v3/volume/create_30.rs +++ b/cli-cmd/block-storage/src/v3/volume/create_30.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::create_30; -use openstack_types::block_storage::v3::volume::response::create::VolumeResponse; +use openstack_types::block_storage::v3::volume::response; use serde_json::Value; /// Creates a new volume. @@ -299,8 +299,9 @@ impl VolumeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/create_313.rs b/cli-cmd/block-storage/src/v3/volume/create_313.rs index 9abd8ce09..6c2b2fcf9 100644 --- a/cli-cmd/block-storage/src/v3/volume/create_313.rs +++ b/cli-cmd/block-storage/src/v3/volume/create_313.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::create_313; -use openstack_types::block_storage::v3::volume::response::create::VolumeResponse; +use openstack_types::block_storage::v3::volume::response; use serde_json::Value; /// Creates a new volume. @@ -312,8 +312,9 @@ impl VolumeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/create_347.rs b/cli-cmd/block-storage/src/v3/volume/create_347.rs index 8656e0487..e2a3c4c4b 100644 --- a/cli-cmd/block-storage/src/v3/volume/create_347.rs +++ b/cli-cmd/block-storage/src/v3/volume/create_347.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::create_347; -use openstack_types::block_storage::v3::volume::response::create::VolumeResponse; +use openstack_types::block_storage::v3::volume::response; use serde_json::Value; /// Creates a new volume. @@ -328,8 +328,9 @@ impl VolumeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/create_353.rs b/cli-cmd/block-storage/src/v3/volume/create_353.rs index 47c85f0e1..10d3b56ad 100644 --- a/cli-cmd/block-storage/src/v3/volume/create_353.rs +++ b/cli-cmd/block-storage/src/v3/volume/create_353.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::create_353; -use openstack_types::block_storage::v3::volume::response::create::VolumeResponse; +use openstack_types::block_storage::v3::volume::response; use serde_json::Value; /// Creates a new volume. @@ -328,8 +328,9 @@ impl VolumeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/encryption/list.rs b/cli-cmd/block-storage/src/v3/volume/encryption/list.rs index fc562a521..5d0788a47 100644 --- a/cli-cmd/block-storage/src/v3/volume/encryption/list.rs +++ b/cli-cmd/block-storage/src/v3/volume/encryption/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::encryption::list; -use openstack_types::block_storage::v3::volume::encryption::response::list::EncryptionResponse; +use openstack_types::block_storage::v3::volume::encryption::response; /// Returns the encryption metadata for a given volume. #[derive(Args)] @@ -84,8 +84,9 @@ impl EncryptionsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/encryption/show.rs b/cli-cmd/block-storage/src/v3/volume/encryption/show.rs index 8ffa1c794..ad3a377a5 100644 --- a/cli-cmd/block-storage/src/v3/volume/encryption/show.rs +++ b/cli-cmd/block-storage/src/v3/volume/encryption/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::encryption::get; -use openstack_types::block_storage::v3::volume::encryption::response::get::EncryptionResponse; +use openstack_types::block_storage::v3::volume::encryption::response; /// Return a single encryption item. #[derive(Args)] @@ -93,8 +93,9 @@ impl EncryptionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/list.rs b/cli-cmd/block-storage/src/v3/volume/list.rs index fae691d96..32bf939fe 100644 --- a/cli-cmd/block-storage/src/v3/volume/list.rs +++ b/cli-cmd/block-storage/src/v3/volume/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::volume::response::list_detailed::VolumeResponse; +use openstack_types::block_storage::v3::volume::response; /// Returns a detailed list of volumes. #[derive(Args)] @@ -180,7 +180,8 @@ impl VolumesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + 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/create.rs b/cli-cmd/block-storage/src/v3/volume/metadata/create.rs index b43a2a3fe..22778f172 100644 --- a/cli-cmd/block-storage/src/v3/volume/metadata/create.rs +++ b/cli-cmd/block-storage/src/v3/volume/metadata/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::metadata::create; -use openstack_types::block_storage::v3::volume::metadata::response::create::MetadataResponse; +use openstack_types::block_storage::v3::volume::metadata::response; /// Command without description in OpenAPI #[derive(Args)] @@ -94,8 +94,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/metadata/list.rs b/cli-cmd/block-storage/src/v3/volume/metadata/list.rs index 582625d6f..1b22abd94 100644 --- a/cli-cmd/block-storage/src/v3/volume/metadata/list.rs +++ b/cli-cmd/block-storage/src/v3/volume/metadata/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::metadata::list; -use openstack_types::block_storage::v3::volume::metadata::response::list::MetadataResponse; +use openstack_types::block_storage::v3::volume::metadata::response; /// Command without description in OpenAPI #[derive(Args)] @@ -83,8 +83,9 @@ impl MetadatasCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/metadata/replace.rs b/cli-cmd/block-storage/src/v3/volume/metadata/replace.rs index d77602d52..157839382 100644 --- a/cli-cmd/block-storage/src/v3/volume/metadata/replace.rs +++ b/cli-cmd/block-storage/src/v3/volume/metadata/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::metadata::replace; -use openstack_types::block_storage::v3::volume::metadata::response::replace::MetadataResponse; +use openstack_types::block_storage::v3::volume::metadata::response; /// Command without description in OpenAPI #[derive(Args)] @@ -94,8 +94,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/metadata/set.rs b/cli-cmd/block-storage/src/v3/volume/metadata/set.rs index 4c6418656..0b00d55dd 100644 --- a/cli-cmd/block-storage/src/v3/volume/metadata/set.rs +++ b/cli-cmd/block-storage/src/v3/volume/metadata/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::metadata::set; -use openstack_types::block_storage::v3::volume::metadata::response::set::MetadataResponse; +use openstack_types::block_storage::v3::volume::metadata::response; /// Command without description in OpenAPI #[derive(Args)] @@ -101,8 +101,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/metadata/show.rs b/cli-cmd/block-storage/src/v3/volume/metadata/show.rs index b05cdde07..442d2b1c8 100644 --- a/cli-cmd/block-storage/src/v3/volume/metadata/show.rs +++ b/cli-cmd/block-storage/src/v3/volume/metadata/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::metadata::get; -use openstack_types::block_storage::v3::volume::metadata::response::get::MetadataResponse; +use openstack_types::block_storage::v3::volume::metadata::response; /// Return a single metadata item. #[derive(Args)] @@ -92,8 +92,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/os_extend_volume_completion.rs b/cli-cmd/block-storage/src/v3/volume/os_extend_volume_completion.rs index 609a013ca..4816d3679 100644 --- a/cli-cmd/block-storage/src/v3/volume/os_extend_volume_completion.rs +++ b/cli-cmd/block-storage/src/v3/volume/os_extend_volume_completion.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::os_extend_volume_completion; -use openstack_types::block_storage::v3::volume::response::os_extend_volume_completion::VolumeResponse; +use openstack_types::block_storage::v3::volume::response; /// Command without description in OpenAPI #[derive(Args)] @@ -108,8 +108,9 @@ impl VolumeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/set_30.rs b/cli-cmd/block-storage/src/v3/volume/set_30.rs index f5ebf7f7b..7bc3d5c5a 100644 --- a/cli-cmd/block-storage/src/v3/volume/set_30.rs +++ b/cli-cmd/block-storage/src/v3/volume/set_30.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::find; use openstack_sdk::api::block_storage::v3::volume::set_30; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::volume::response::set::VolumeResponse; +use openstack_types::block_storage::v3::volume::response; /// Update a volume. #[derive(Args)] @@ -179,8 +179,9 @@ impl VolumeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/set_353.rs b/cli-cmd/block-storage/src/v3/volume/set_353.rs index 080dcd960..aa46f68b6 100644 --- a/cli-cmd/block-storage/src/v3/volume/set_353.rs +++ b/cli-cmd/block-storage/src/v3/volume/set_353.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::find; use openstack_sdk::api::block_storage::v3::volume::set_353; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::volume::response::set::VolumeResponse; +use openstack_types::block_storage::v3::volume::response; /// Update a volume. #[derive(Args)] @@ -179,8 +179,9 @@ impl VolumeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume/show.rs b/cli-cmd/block-storage/src/v3/volume/show.rs index 8ecfbe75f..31ae409db 100644 --- a/cli-cmd/block-storage/src/v3/volume/show.rs +++ b/cli-cmd/block-storage/src/v3/volume/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::volume::response::get::VolumeResponse; +use openstack_types::block_storage::v3::volume::response; /// Return data about the given volume. #[derive(Args)] @@ -82,7 +82,7 @@ impl VolumeCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/volume/summary/get.rs b/cli-cmd/block-storage/src/v3/volume/summary/get.rs index 89cdfebfb..f7b1e0368 100644 --- a/cli-cmd/block-storage/src/v3/volume/summary/get.rs +++ b/cli-cmd/block-storage/src/v3/volume/summary/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume::summary::get; -use openstack_types::block_storage::v3::volume::summary::response::get::SummaryResponse; +use openstack_types::block_storage::v3::volume::summary::response; /// Return summary of volumes. #[derive(Args)] @@ -74,8 +74,9 @@ impl SummaryCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume_manage/create_30.rs b/cli-cmd/block-storage/src/v3/volume_manage/create_30.rs index 415a813ad..9577780b7 100644 --- a/cli-cmd/block-storage/src/v3/volume_manage/create_30.rs +++ b/cli-cmd/block-storage/src/v3/volume_manage/create_30.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume_manage::create_30; -use openstack_types::block_storage::v3::volume_manage::response::create::VolumeManageResponse; use serde_json::Value; /// Instruct Cinder to manage a storage object. @@ -229,9 +228,7 @@ impl VolumeManageCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/volume_manage/create_316.rs b/cli-cmd/block-storage/src/v3/volume_manage/create_316.rs index cb313422b..85dfbf2b6 100644 --- a/cli-cmd/block-storage/src/v3/volume_manage/create_316.rs +++ b/cli-cmd/block-storage/src/v3/volume_manage/create_316.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume_manage::create_316; -use openstack_types::block_storage::v3::volume_manage::response::create::VolumeManageResponse; use serde_json::Value; /// Instruct Cinder to manage a storage object. @@ -242,9 +241,7 @@ impl VolumeManageCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/volume_manage/get.rs b/cli-cmd/block-storage/src/v3/volume_manage/get.rs index ec6c1f126..4e7e5e9a6 100644 --- a/cli-cmd/block-storage/src/v3/volume_manage/get.rs +++ b/cli-cmd/block-storage/src/v3/volume_manage/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume_manage::get; -use openstack_types::block_storage::v3::volume_manage::response::get::VolumeManageResponse; +use openstack_types::block_storage::v3::volume_manage::response; /// Returns a summary list of volumes available to manage. #[derive(Args)] @@ -74,8 +74,9 @@ impl VolumeManageCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume_manage/list.rs b/cli-cmd/block-storage/src/v3/volume_manage/list.rs index b0e87b81a..bada0043b 100644 --- a/cli-cmd/block-storage/src/v3/volume_manage/list.rs +++ b/cli-cmd/block-storage/src/v3/volume_manage/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume_manage::list_detailed; -use openstack_types::block_storage::v3::volume_manage::response::list_detailed::VolumeManageResponse; +use openstack_types::block_storage::v3::volume_manage::response; /// Returns a detailed list of volumes available to manage. #[derive(Args)] @@ -73,8 +73,9 @@ impl VolumeManagesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume_transfer/accept.rs b/cli-cmd/block-storage/src/v3/volume_transfer/accept.rs index ac0f64112..853e60c3c 100644 --- a/cli-cmd/block-storage/src/v3/volume_transfer/accept.rs +++ b/cli-cmd/block-storage/src/v3/volume_transfer/accept.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume_transfer::accept; -use openstack_types::block_storage::v3::volume_transfer::response::accept::VolumeTransferResponse; +use openstack_types::block_storage::v3::volume_transfer::response; /// Accept a new volume transfer. #[derive(Args)] @@ -106,8 +106,9 @@ impl VolumeTransferCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume_transfer/create_30.rs b/cli-cmd/block-storage/src/v3/volume_transfer/create_30.rs index 08ac8ac70..3361fea2e 100644 --- a/cli-cmd/block-storage/src/v3/volume_transfer/create_30.rs +++ b/cli-cmd/block-storage/src/v3/volume_transfer/create_30.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume_transfer::create_30; -use openstack_types::block_storage::v3::volume_transfer::response::create::VolumeTransferResponse; +use openstack_types::block_storage::v3::volume_transfer::response; /// Create a new volume transfer. #[derive(Args)] @@ -115,8 +115,9 @@ impl VolumeTransferCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume_transfer/create_355.rs b/cli-cmd/block-storage/src/v3/volume_transfer/create_355.rs index bd0ff2fa3..60ddab1bd 100644 --- a/cli-cmd/block-storage/src/v3/volume_transfer/create_355.rs +++ b/cli-cmd/block-storage/src/v3/volume_transfer/create_355.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume_transfer::create_355; -use openstack_types::block_storage::v3::volume_transfer::response::create::VolumeTransferResponse; +use openstack_types::block_storage::v3::volume_transfer::response; /// Create a new volume transfer. #[derive(Args)] @@ -125,8 +125,9 @@ impl VolumeTransferCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/block-storage/src/v3/volume_transfer/list.rs b/cli-cmd/block-storage/src/v3/volume_transfer/list.rs index 175576dcd..2bfa33cd6 100644 --- a/cli-cmd/block-storage/src/v3/volume_transfer/list.rs +++ b/cli-cmd/block-storage/src/v3/volume_transfer/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume_transfer::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::block_storage::v3::volume_transfer::response::list_detailed::VolumeTransferResponse; +use openstack_types::block_storage::v3::volume_transfer::response; /// Returns a detailed list of transfers. #[derive(Args)] @@ -156,7 +156,8 @@ impl VolumeTransfersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/volume_transfer/show.rs b/cli-cmd/block-storage/src/v3/volume_transfer/show.rs index c8c99d00a..d2cba9a10 100644 --- a/cli-cmd/block-storage/src/v3/volume_transfer/show.rs +++ b/cli-cmd/block-storage/src/v3/volume_transfer/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::volume_transfer::find; use openstack_sdk::api::find; -use openstack_types::block_storage::v3::volume_transfer::response::get::VolumeTransferResponse; +use openstack_types::block_storage::v3::volume_transfer::response; /// Return data about active transfers. #[derive(Args)] @@ -85,7 +85,7 @@ impl VolumeTransferCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/block-storage/src/v3/worker/cleanup/create_324.rs b/cli-cmd/block-storage/src/v3/worker/cleanup/create_324.rs index d19e7cc65..ab7704c8c 100644 --- a/cli-cmd/block-storage/src/v3/worker/cleanup/create_324.rs +++ b/cli-cmd/block-storage/src/v3/worker/cleanup/create_324.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::block_storage::v3::worker::cleanup::create_324; -use openstack_types::block_storage::v3::worker::cleanup::response::create::CleanupResponse; /// Do the cleanup on resources from a specific service/host/node. #[derive(Args)] @@ -153,9 +152,7 @@ impl CleanupCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/aggregate/add_host.rs b/cli-cmd/compute/src/v2/aggregate/add_host.rs index 1b98364ca..292dfe6bd 100644 --- a/cli-cmd/compute/src/v2/aggregate/add_host.rs +++ b/cli-cmd/compute/src/v2/aggregate/add_host.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::aggregate::add_host; -use openstack_types::compute::v2::aggregate::response::add_host::AggregateResponse; +use openstack_types::compute::v2::aggregate::response; /// Command without description in OpenAPI #[derive(Args)] @@ -103,8 +103,12 @@ impl AggregateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/aggregate/create_20.rs b/cli-cmd/compute/src/v2/aggregate/create_20.rs index fe9bb8566..a7cd51678 100644 --- a/cli-cmd/compute/src/v2/aggregate/create_20.rs +++ b/cli-cmd/compute/src/v2/aggregate/create_20.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::aggregate::create_20; -use openstack_types::compute::v2::aggregate::response::create::AggregateResponse; /// Creates an aggregate. If specifying an option availability_zone, the /// aggregate is created as an availability zone and the availability zone is @@ -121,9 +120,7 @@ impl AggregateCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/aggregate/create_21.rs b/cli-cmd/compute/src/v2/aggregate/create_21.rs index 709317850..125dbf2ed 100644 --- a/cli-cmd/compute/src/v2/aggregate/create_21.rs +++ b/cli-cmd/compute/src/v2/aggregate/create_21.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::aggregate::create_21; -use openstack_types::compute::v2::aggregate::response::create::AggregateResponse; +use openstack_types::compute::v2::aggregate::response; /// Creates an aggregate. If specifying an option availability_zone, the /// aggregate is created as an availability zone and the availability zone is @@ -122,8 +122,9 @@ impl AggregateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/aggregate/list.rs b/cli-cmd/compute/src/v2/aggregate/list.rs index 9d7308a6e..447089b24 100644 --- a/cli-cmd/compute/src/v2/aggregate/list.rs +++ b/cli-cmd/compute/src/v2/aggregate/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::aggregate::list; -use openstack_types::compute::v2::aggregate::response::list::AggregateResponse; +use openstack_types::compute::v2::aggregate::response; /// Lists all aggregates. Includes the ID, name, and availability zone for each /// aggregate. @@ -76,7 +76,9 @@ impl AggregatesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| op.output_list::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/aggregate/remove_host.rs b/cli-cmd/compute/src/v2/aggregate/remove_host.rs index 7643b5c7b..0b25c353a 100644 --- a/cli-cmd/compute/src/v2/aggregate/remove_host.rs +++ b/cli-cmd/compute/src/v2/aggregate/remove_host.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::aggregate::remove_host; -use openstack_types::compute::v2::aggregate::response::remove_host::AggregateResponse; +use openstack_types::compute::v2::aggregate::response; /// Command without description in OpenAPI #[derive(Args)] @@ -103,8 +103,12 @@ impl AggregateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/aggregate/set_20.rs b/cli-cmd/compute/src/v2/aggregate/set_20.rs index b71fe88dd..91bb1c203 100644 --- a/cli-cmd/compute/src/v2/aggregate/set_20.rs +++ b/cli-cmd/compute/src/v2/aggregate/set_20.rs @@ -32,7 +32,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::aggregate::find; use openstack_sdk::api::compute::v2::aggregate::set_20; use openstack_sdk::api::find; -use openstack_types::compute::v2::aggregate::response::set::AggregateResponse; /// Updates either or both the name and availability zone for an aggregate. If /// the aggregate to be updated has host that already in the given availability @@ -158,9 +157,7 @@ impl AggregateCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/aggregate/set_21.rs b/cli-cmd/compute/src/v2/aggregate/set_21.rs index 55bb3d6ca..7bfced0e4 100644 --- a/cli-cmd/compute/src/v2/aggregate/set_21.rs +++ b/cli-cmd/compute/src/v2/aggregate/set_21.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::aggregate::find; use openstack_sdk::api::compute::v2::aggregate::set_21; use openstack_sdk::api::find; -use openstack_types::compute::v2::aggregate::response::set::AggregateResponse; +use openstack_types::compute::v2::aggregate::response; /// Updates either or both the name and availability zone for an aggregate. If /// the aggregate to be updated has host that already in the given availability @@ -159,8 +159,9 @@ impl AggregateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/aggregate/set_metadata.rs b/cli-cmd/compute/src/v2/aggregate/set_metadata.rs index ee601b2b7..816bcb656 100644 --- a/cli-cmd/compute/src/v2/aggregate/set_metadata.rs +++ b/cli-cmd/compute/src/v2/aggregate/set_metadata.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val_opt; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::aggregate::set_metadata; -use openstack_types::compute::v2::aggregate::response::set_metadata::AggregateResponse; +use openstack_types::compute::v2::aggregate::response; /// Command without description in OpenAPI #[derive(Args)] @@ -112,8 +112,12 @@ impl AggregateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/aggregate/show.rs b/cli-cmd/compute/src/v2/aggregate/show.rs index eba1e23e5..7b18690b1 100644 --- a/cli-cmd/compute/src/v2/aggregate/show.rs +++ b/cli-cmd/compute/src/v2/aggregate/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::aggregate::find; use openstack_sdk::api::find; -use openstack_types::compute::v2::aggregate::response::get::AggregateResponse; +use openstack_types::compute::v2::aggregate::response; /// Shows details for an aggregate. Details include hosts and metadata. /// @@ -86,7 +86,10 @@ impl AggregateCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone()) + .or_else(|_| { + op.output_single::(find_data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/assisted_volume_snapshot/create.rs b/cli-cmd/compute/src/v2/assisted_volume_snapshot/create.rs index d5f5b6beb..a6bf5bf7d 100644 --- a/cli-cmd/compute/src/v2/assisted_volume_snapshot/create.rs +++ b/cli-cmd/compute/src/v2/assisted_volume_snapshot/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::assisted_volume_snapshot::create; -use openstack_types::compute::v2::assisted_volume_snapshot::response::create::AssistedVolumeSnapshotResponse; +use openstack_types::compute::v2::assisted_volume_snapshot::response; /// Creates an assisted volume snapshot. /// @@ -156,8 +156,9 @@ impl AssistedVolumeSnapshotCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/availability_zone/list.rs b/cli-cmd/compute/src/v2/availability_zone/list.rs index a8d48a691..3b33d93b1 100644 --- a/cli-cmd/compute/src/v2/availability_zone/list.rs +++ b/cli-cmd/compute/src/v2/availability_zone/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::availability_zone::list; -use openstack_types::compute::v2::availability_zone::response::list::AvailabilityZoneResponse; +use openstack_types::compute::v2::availability_zone::response; /// Lists availability zone information. /// @@ -79,7 +79,8 @@ impl AvailabilityZonesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/availability_zone/list_detail.rs b/cli-cmd/compute/src/v2/availability_zone/list_detail.rs index cc1f1f9f2..f44409401 100644 --- a/cli-cmd/compute/src/v2/availability_zone/list_detail.rs +++ b/cli-cmd/compute/src/v2/availability_zone/list_detail.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::availability_zone::list_detail; -use openstack_types::compute::v2::availability_zone::response::list_detail::AvailabilityZoneResponse; +use openstack_types::compute::v2::availability_zone::response; /// Gets detailed availability zone information. Policy defaults enable only /// users with the administrative role to perform this operation. Cloud @@ -81,7 +81,8 @@ impl AvailabilityZonesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/console_auth_token/show.rs b/cli-cmd/compute/src/v2/console_auth_token/show.rs index 4b00e5f7b..eabad7d4b 100644 --- a/cli-cmd/compute/src/v2/console_auth_token/show.rs +++ b/cli-cmd/compute/src/v2/console_auth_token/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::console_auth_token::get; -use openstack_types::compute::v2::console_auth_token::response::get::ConsoleAuthTokenResponse; +use openstack_types::compute::v2::console_auth_token::response; /// Given the console authentication token for a server, shows the related /// connection information. @@ -95,8 +95,12 @@ impl ConsoleAuthTokenCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/extension/list.rs b/cli-cmd/compute/src/v2/extension/list.rs index 6282e19fa..066157e74 100644 --- a/cli-cmd/compute/src/v2/extension/list.rs +++ b/cli-cmd/compute/src/v2/extension/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::extension::list; -use openstack_types::compute::v2::extension::response::list::ExtensionResponse; +use openstack_types::compute::v2::extension::response; /// Lists all extensions to the API. /// @@ -75,7 +75,8 @@ impl ExtensionsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/extension/show.rs b/cli-cmd/compute/src/v2/extension/show.rs index 8da2c9bae..495ecb126 100644 --- a/cli-cmd/compute/src/v2/extension/show.rs +++ b/cli-cmd/compute/src/v2/extension/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::extension::get; -use openstack_types::compute::v2::extension::response::get::ExtensionResponse; +use openstack_types::compute::v2::extension::response; /// Shows details for an extension, by alias. /// @@ -84,8 +84,9 @@ impl ExtensionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/add_tenant_access.rs b/cli-cmd/compute/src/v2/flavor/add_tenant_access.rs index 62111d6eb..1a728064d 100644 --- a/cli-cmd/compute/src/v2/flavor/add_tenant_access.rs +++ b/cli-cmd/compute/src/v2/flavor/add_tenant_access.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::add_tenant_access; -use openstack_types::compute::v2::flavor::response::add_tenant_access::FlavorResponse; +use openstack_types::compute::v2::flavor::response; /// Adds flavor access to a tenant and flavor. /// @@ -117,7 +117,7 @@ impl FlavorCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/flavor/create_20.rs b/cli-cmd/compute/src/v2/flavor/create_20.rs index f5302899d..060c6d214 100644 --- a/cli-cmd/compute/src/v2/flavor/create_20.rs +++ b/cli-cmd/compute/src/v2/flavor/create_20.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::create_20; -use openstack_types::compute::v2::flavor::response::create::FlavorResponse; +use openstack_types::compute::v2::flavor::response; /// Creates a flavor. /// @@ -181,8 +181,9 @@ impl FlavorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/create_21.rs b/cli-cmd/compute/src/v2/flavor/create_21.rs index b0e21bfe0..3797ca54e 100644 --- a/cli-cmd/compute/src/v2/flavor/create_21.rs +++ b/cli-cmd/compute/src/v2/flavor/create_21.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::create_21; -use openstack_types::compute::v2::flavor::response::create::FlavorResponse; +use openstack_types::compute::v2::flavor::response; /// Creates a flavor. /// @@ -181,8 +181,9 @@ impl FlavorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/create_2102.rs b/cli-cmd/compute/src/v2/flavor/create_2102.rs index 49c84e227..44361cc65 100644 --- a/cli-cmd/compute/src/v2/flavor/create_2102.rs +++ b/cli-cmd/compute/src/v2/flavor/create_2102.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::create_2102; -use openstack_types::compute::v2::flavor::response::create::FlavorResponse; +use openstack_types::compute::v2::flavor::response; /// Creates a flavor. /// @@ -186,8 +186,9 @@ impl FlavorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/create_255.rs b/cli-cmd/compute/src/v2/flavor/create_255.rs index 73b94e690..ae552dcae 100644 --- a/cli-cmd/compute/src/v2/flavor/create_255.rs +++ b/cli-cmd/compute/src/v2/flavor/create_255.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::create_255; -use openstack_types::compute::v2::flavor::response::create::FlavorResponse; +use openstack_types::compute::v2::flavor::response; /// Creates a flavor. /// @@ -198,8 +198,9 @@ impl FlavorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/extra_spec/create.rs b/cli-cmd/compute/src/v2/flavor/extra_spec/create.rs index 3232f88fe..9a2f57d1c 100644 --- a/cli-cmd/compute/src/v2/flavor/extra_spec/create.rs +++ b/cli-cmd/compute/src/v2/flavor/extra_spec/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::extra_spec::create; -use openstack_types::compute::v2::flavor::extra_spec::response::create::ExtraSpecResponse; +use openstack_types::compute::v2::flavor::extra_spec::response; /// Creates extra specs for a flavor, by ID. /// @@ -102,8 +102,9 @@ impl ExtraSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/extra_spec/list.rs b/cli-cmd/compute/src/v2/flavor/extra_spec/list.rs index 7ed566556..1f0c9627f 100644 --- a/cli-cmd/compute/src/v2/flavor/extra_spec/list.rs +++ b/cli-cmd/compute/src/v2/flavor/extra_spec/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::extra_spec::list; -use openstack_types::compute::v2::flavor::extra_spec::response::list::ExtraSpecResponse; +use openstack_types::compute::v2::flavor::extra_spec::response; /// Lists all extra specs for a flavor, by ID. /// @@ -89,8 +89,9 @@ impl ExtraSpecsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/extra_spec/set.rs b/cli-cmd/compute/src/v2/flavor/extra_spec/set.rs index d4f34b267..aa57560f3 100644 --- a/cli-cmd/compute/src/v2/flavor/extra_spec/set.rs +++ b/cli-cmd/compute/src/v2/flavor/extra_spec/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::extra_spec::set; -use openstack_types::compute::v2::flavor::extra_spec::response::set::ExtraSpecResponse; +use openstack_types::compute::v2::flavor::extra_spec::response; /// Updates an extra spec, by key, for a flavor, by ID. /// @@ -106,8 +106,9 @@ impl ExtraSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/extra_spec/show.rs b/cli-cmd/compute/src/v2/flavor/extra_spec/show.rs index 917fa3574..53531252d 100644 --- a/cli-cmd/compute/src/v2/flavor/extra_spec/show.rs +++ b/cli-cmd/compute/src/v2/flavor/extra_spec/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::extra_spec::get; -use openstack_types::compute::v2::flavor::extra_spec::response::get::ExtraSpecResponse; +use openstack_types::compute::v2::flavor::extra_spec::response; /// Shows an extra spec, by key, for a flavor, by ID. /// @@ -98,8 +98,9 @@ impl ExtraSpecCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/flavor_access/list.rs b/cli-cmd/compute/src/v2/flavor/flavor_access/list.rs index f79228f0a..423f9b490 100644 --- a/cli-cmd/compute/src/v2/flavor/flavor_access/list.rs +++ b/cli-cmd/compute/src/v2/flavor/flavor_access/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::flavor_access::list; -use openstack_types::compute::v2::flavor::flavor_access::response::list::FlavorAccessResponse; +use openstack_types::compute::v2::flavor::flavor_access::response; /// Lists flavor access information. /// @@ -89,7 +89,8 @@ impl FlavorAccessesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/flavor/list.rs b/cli-cmd/compute/src/v2/flavor/list.rs index 754b3dbf7..9ad51e219 100644 --- a/cli-cmd/compute/src/v2/flavor/list.rs +++ b/cli-cmd/compute/src/v2/flavor/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::compute::v2::flavor::response::list_detailed::FlavorResponse; +use openstack_types::compute::v2::flavor::response; /// Lists flavors with details. /// @@ -143,7 +143,17 @@ impl FlavorsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/flavor/remove_tenant_access.rs b/cli-cmd/compute/src/v2/flavor/remove_tenant_access.rs index 5ec9fe129..1c84d509e 100644 --- a/cli-cmd/compute/src/v2/flavor/remove_tenant_access.rs +++ b/cli-cmd/compute/src/v2/flavor/remove_tenant_access.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::remove_tenant_access; -use openstack_types::compute::v2::flavor::response::remove_tenant_access::FlavorResponse; +use openstack_types::compute::v2::flavor::response; /// Removes flavor access from a tenant and flavor. /// @@ -119,7 +119,7 @@ impl FlavorCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/flavor/set_255.rs b/cli-cmd/compute/src/v2/flavor/set_255.rs index b42bd9e8a..736cb0254 100644 --- a/cli-cmd/compute/src/v2/flavor/set_255.rs +++ b/cli-cmd/compute/src/v2/flavor/set_255.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::find; use openstack_sdk::api::compute::v2::flavor::set_255; use openstack_sdk::api::find; -use openstack_types::compute::v2::flavor::response::set::FlavorResponse; +use openstack_types::compute::v2::flavor::response; /// Updates a flavor description. /// @@ -141,8 +141,9 @@ impl FlavorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/flavor/show.rs b/cli-cmd/compute/src/v2/flavor/show.rs index ce1aa16dd..0d2027db5 100644 --- a/cli-cmd/compute/src/v2/flavor/show.rs +++ b/cli-cmd/compute/src/v2/flavor/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::flavor::find; use openstack_sdk::api::find; -use openstack_types::compute::v2::flavor::response::get::FlavorResponse; +use openstack_types::compute::v2::flavor::response; /// Shows details for a flavor. /// @@ -86,7 +86,13 @@ impl FlavorCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone()) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| { + op.output_single::(find_data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/floating_ip/create.rs b/cli-cmd/compute/src/v2/floating_ip/create.rs index 2f6927e77..0ff72fdf6 100644 --- a/cli-cmd/compute/src/v2/floating_ip/create.rs +++ b/cli-cmd/compute/src/v2/floating_ip/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::floating_ip::create; -use openstack_types::compute::v2::floating_ip::response::create::FloatingIpResponse; +use openstack_types::compute::v2::floating_ip::response; /// Creates, or allocates, a floating IP address for the current project. By /// default, the floating IP address is allocated from the public pool. @@ -85,8 +85,9 @@ impl FloatingIpCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/floating_ip/list.rs b/cli-cmd/compute/src/v2/floating_ip/list.rs index 6c2e346ca..44c143d42 100644 --- a/cli-cmd/compute/src/v2/floating_ip/list.rs +++ b/cli-cmd/compute/src/v2/floating_ip/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::floating_ip::list; -use openstack_types::compute::v2::floating_ip::response::list::FloatingIpResponse; +use openstack_types::compute::v2::floating_ip::response; /// Lists floating IP addresses associated with the tenant or account. /// @@ -80,7 +80,8 @@ impl FloatingIpsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/floating_ip/show.rs b/cli-cmd/compute/src/v2/floating_ip/show.rs index 8599036b7..43c548e81 100644 --- a/cli-cmd/compute/src/v2/floating_ip/show.rs +++ b/cli-cmd/compute/src/v2/floating_ip/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::floating_ip::get; -use openstack_types::compute::v2::floating_ip::response::get::FloatingIpResponse; +use openstack_types::compute::v2::floating_ip::response; /// Shows details for a floating IP address, by ID, that is associated with the /// tenant or account. @@ -91,8 +91,9 @@ impl FloatingIpCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/hypervisor/list.rs b/cli-cmd/compute/src/v2/hypervisor/list.rs index b9ef8adef..aafabb212 100644 --- a/cli-cmd/compute/src/v2/hypervisor/list.rs +++ b/cli-cmd/compute/src/v2/hypervisor/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::hypervisor::list_detailed; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::compute::v2::hypervisor::response::list_detailed::HypervisorResponse; +use openstack_types::compute::v2::hypervisor::response; /// Lists hypervisors details. /// @@ -123,7 +123,20 @@ impl HypervisorsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/hypervisor/search/get.rs b/cli-cmd/compute/src/v2/hypervisor/search/get.rs index ae17ca0ab..8438d55a0 100644 --- a/cli-cmd/compute/src/v2/hypervisor/search/get.rs +++ b/cli-cmd/compute/src/v2/hypervisor/search/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::hypervisor::search::get; -use openstack_types::compute::v2::hypervisor::search::response::get::SearchResponse; +use openstack_types::compute::v2::hypervisor::search::response; /// Search hypervisor by a given hypervisor host name or portion of it. /// @@ -91,7 +91,7 @@ impl SearchCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + 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 c6f308382..407874fb0 100644 --- a/cli-cmd/compute/src/v2/hypervisor/server/get.rs +++ b/cli-cmd/compute/src/v2/hypervisor/server/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::hypervisor::server::get; -use openstack_types::compute::v2::hypervisor::server::response::get::ServerResponse; +use openstack_types::compute::v2::hypervisor::server::response; /// List all servers belong to each hypervisor whose host name is matching a /// given hypervisor host name or portion of it. @@ -92,7 +92,7 @@ impl ServerCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/hypervisor/show.rs b/cli-cmd/compute/src/v2/hypervisor/show.rs index d7275c273..137d6377d 100644 --- a/cli-cmd/compute/src/v2/hypervisor/show.rs +++ b/cli-cmd/compute/src/v2/hypervisor/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::hypervisor::get; -use openstack_types::compute::v2::hypervisor::response::get::HypervisorResponse; +use openstack_types::compute::v2::hypervisor::response; /// Shows details for a given hypervisor. /// @@ -96,8 +96,12 @@ impl HypervisorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/hypervisor/statistic/get.rs b/cli-cmd/compute/src/v2/hypervisor/statistic/get.rs index 65a57b4ca..a01ff939b 100644 --- a/cli-cmd/compute/src/v2/hypervisor/statistic/get.rs +++ b/cli-cmd/compute/src/v2/hypervisor/statistic/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::hypervisor::statistic::get; -use openstack_types::compute::v2::hypervisor::statistic::response::get::StatisticResponse; +use openstack_types::compute::v2::hypervisor::statistic::response; /// Shows summary statistics for all enabled hypervisors over all compute /// nodes. @@ -84,8 +84,9 @@ impl StatisticCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/hypervisor/uptime/get.rs b/cli-cmd/compute/src/v2/hypervisor/uptime/get.rs index 90f948b75..1622e9f10 100644 --- a/cli-cmd/compute/src/v2/hypervisor/uptime/get.rs +++ b/cli-cmd/compute/src/v2/hypervisor/uptime/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::hypervisor::uptime::get; -use openstack_types::compute::v2::hypervisor::uptime::response::get::UptimeResponse; +use openstack_types::compute::v2::hypervisor::uptime::response; /// Shows the uptime for a given hypervisor. /// @@ -91,8 +91,10 @@ impl UptimeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| 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 10fadd0c7..bedcd680f 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 @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::instance_usage_audit_log::list; -use openstack_types::compute::v2::instance_usage_audit_log::response::list::InstanceUsageAuditLogResponse; +use openstack_types::compute::v2::instance_usage_audit_log::response; /// Lists usage audits for all servers on all compute hosts where usage /// auditing is configured. @@ -79,8 +79,9 @@ impl InstanceUsageAuditLogsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/show.rs b/cli-cmd/compute/src/v2/instance_usage_audit_log/show.rs index 15876f03a..1e31f3ba2 100644 --- a/cli-cmd/compute/src/v2/instance_usage_audit_log/show.rs +++ b/cli-cmd/compute/src/v2/instance_usage_audit_log/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::instance_usage_audit_log::get; -use openstack_types::compute::v2::instance_usage_audit_log::response::get::InstanceUsageAuditLogResponse; +use openstack_types::compute::v2::instance_usage_audit_log::response; /// Lists usage audits that occurred before a specified time. /// @@ -89,8 +89,9 @@ impl InstanceUsageAuditLogCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/keypair/create_20.rs b/cli-cmd/compute/src/v2/keypair/create_20.rs index 4c2476078..77b6ef31c 100644 --- a/cli-cmd/compute/src/v2/keypair/create_20.rs +++ b/cli-cmd/compute/src/v2/keypair/create_20.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::keypair::create_20; -use openstack_types::compute::v2::keypair::response::create::KeypairResponse; +use openstack_types::compute::v2::keypair::response; /// Imports (or generates) a keypair. /// @@ -119,8 +119,9 @@ impl KeypairCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/keypair/create_21.rs b/cli-cmd/compute/src/v2/keypair/create_21.rs index 697206661..1bc32ab2c 100644 --- a/cli-cmd/compute/src/v2/keypair/create_21.rs +++ b/cli-cmd/compute/src/v2/keypair/create_21.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::keypair::create_21; -use openstack_types::compute::v2::keypair::response::create::KeypairResponse; +use openstack_types::compute::v2::keypair::response; /// Imports (or generates) a keypair. /// @@ -119,8 +119,9 @@ impl KeypairCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/keypair/create_210.rs b/cli-cmd/compute/src/v2/keypair/create_210.rs index 7f0b1f179..7b7922b3d 100644 --- a/cli-cmd/compute/src/v2/keypair/create_210.rs +++ b/cli-cmd/compute/src/v2/keypair/create_210.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::keypair::create_210; -use openstack_types::compute::v2::keypair::response::create::KeypairResponse; +use openstack_types::compute::v2::keypair::response; /// Imports (or generates) a keypair. /// @@ -152,8 +152,9 @@ impl KeypairCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/keypair/create_22.rs b/cli-cmd/compute/src/v2/keypair/create_22.rs index b9e57e9c3..c08f781ae 100644 --- a/cli-cmd/compute/src/v2/keypair/create_22.rs +++ b/cli-cmd/compute/src/v2/keypair/create_22.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::keypair::create_22; -use openstack_types::compute::v2::keypair::response::create::KeypairResponse; +use openstack_types::compute::v2::keypair::response; /// Imports (or generates) a keypair. /// @@ -141,8 +141,9 @@ impl KeypairCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/keypair/create_292.rs b/cli-cmd/compute/src/v2/keypair/create_292.rs index 4ca58f2e5..564574a1b 100644 --- a/cli-cmd/compute/src/v2/keypair/create_292.rs +++ b/cli-cmd/compute/src/v2/keypair/create_292.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::keypair::create_292; -use openstack_types::compute::v2::keypair::response::create::KeypairResponse; +use openstack_types::compute::v2::keypair::response; /// Imports (or generates) a keypair. /// @@ -150,8 +150,9 @@ impl KeypairCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/keypair/list.rs b/cli-cmd/compute/src/v2/keypair/list.rs index ba59df7d9..0e293f5b5 100644 --- a/cli-cmd/compute/src/v2/keypair/list.rs +++ b/cli-cmd/compute/src/v2/keypair/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::compute::v2::keypair::list; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::compute::v2::keypair::response::list::KeypairResponse; +use openstack_types::compute::v2::keypair::response; use tracing::warn; /// Lists keypairs that are associated with the account. @@ -173,7 +173,10 @@ impl KeypairsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| op.output_list::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/keypair/show.rs b/cli-cmd/compute/src/v2/keypair/show.rs index cf4be0bd0..181e3b191 100644 --- a/cli-cmd/compute/src/v2/keypair/show.rs +++ b/cli-cmd/compute/src/v2/keypair/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::keypair::find; use openstack_sdk::api::find; -use openstack_types::compute::v2::keypair::response::get::KeypairResponse; +use openstack_types::compute::v2::keypair::response; /// Shows details for a keypair that is associated with the account. /// @@ -105,7 +105,10 @@ impl KeypairCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone()) + .or_else(|_| { + op.output_single::(find_data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/limit/list.rs b/cli-cmd/compute/src/v2/limit/list.rs index f04bc8fc6..d2774e059 100644 --- a/cli-cmd/compute/src/v2/limit/list.rs +++ b/cli-cmd/compute/src/v2/limit/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::limit::list; -use openstack_types::compute::v2::limit::response::list::LimitResponse; +use openstack_types::compute::v2::limit::response; /// Shows rate and absolute limits for the project. /// @@ -82,8 +82,12 @@ impl LimitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/migration/get.rs b/cli-cmd/compute/src/v2/migration/get.rs index 172bdadb3..d8f02344c 100644 --- a/cli-cmd/compute/src/v2/migration/get.rs +++ b/cli-cmd/compute/src/v2/migration/get.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::compute::v2::migration::get; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::compute::v2::migration::response::get::MigrationResponse; +use openstack_types::compute::v2::migration::response; use tracing::warn; /// Lists migrations. @@ -284,7 +284,10 @@ impl MigrationCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone()) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| op.output_list::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/quota_class_set/set_21.rs b/cli-cmd/compute/src/v2/quota_class_set/set_21.rs index 3a9760a77..6b736be1c 100644 --- a/cli-cmd/compute/src/v2/quota_class_set/set_21.rs +++ b/cli-cmd/compute/src/v2/quota_class_set/set_21.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_class_set::set_21; -use openstack_types::compute::v2::quota_class_set::response::set::QuotaClassSetResponse; +use openstack_types::compute::v2::quota_class_set::response; /// Update the quotas for the Quota Class. /// @@ -251,8 +251,9 @@ impl QuotaClassSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/quota_class_set/set_250.rs b/cli-cmd/compute/src/v2/quota_class_set/set_250.rs index 12cb2164e..9df9cabcb 100644 --- a/cli-cmd/compute/src/v2/quota_class_set/set_250.rs +++ b/cli-cmd/compute/src/v2/quota_class_set/set_250.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_class_set::set_250; -use openstack_types::compute::v2::quota_class_set::response::set::QuotaClassSetResponse; +use openstack_types::compute::v2::quota_class_set::response; /// Update the quotas for the Quota Class. /// @@ -211,8 +211,9 @@ impl QuotaClassSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/quota_class_set/set_257.rs b/cli-cmd/compute/src/v2/quota_class_set/set_257.rs index ce2bd3018..1901f90f6 100644 --- a/cli-cmd/compute/src/v2/quota_class_set/set_257.rs +++ b/cli-cmd/compute/src/v2/quota_class_set/set_257.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_class_set::set_257; -use openstack_types::compute::v2::quota_class_set::response::set::QuotaClassSetResponse; +use openstack_types::compute::v2::quota_class_set::response; /// Update the quotas for the Quota Class. /// @@ -167,8 +167,9 @@ impl QuotaClassSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/quota_class_set/show.rs b/cli-cmd/compute/src/v2/quota_class_set/show.rs index 6fc21997c..7bbd7d4ec 100644 --- a/cli-cmd/compute/src/v2/quota_class_set/show.rs +++ b/cli-cmd/compute/src/v2/quota_class_set/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_class_set::get; -use openstack_types::compute::v2::quota_class_set::response::get::QuotaClassSetResponse; +use openstack_types::compute::v2::quota_class_set::response; /// Show the quota for the Quota Class. /// @@ -85,8 +85,13 @@ impl QuotaClassSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/quota_set/defaults.rs b/cli-cmd/compute/src/v2/quota_set/defaults.rs index cff451b46..735b82b3b 100644 --- a/cli-cmd/compute/src/v2/quota_set/defaults.rs +++ b/cli-cmd/compute/src/v2/quota_set/defaults.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_set::defaults; -use openstack_types::compute::v2::quota_set::response::defaults::QuotaSetResponse; +use openstack_types::compute::v2::quota_set::response; /// Lists the default quotas for a project. /// @@ -85,8 +85,13 @@ impl QuotaSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/quota_set/details.rs b/cli-cmd/compute/src/v2/quota_set/details.rs index 13c19dbf9..719df9417 100644 --- a/cli-cmd/compute/src/v2/quota_set/details.rs +++ b/cli-cmd/compute/src/v2/quota_set/details.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_set::details; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::compute::v2::quota_set::response::details::QuotaSetResponse; +use openstack_types::compute::v2::quota_set::response; use tracing::warn; /// Show the detail of quota for a project or a project and a user. @@ -155,8 +155,13 @@ impl QuotaSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/quota_set/set_20.rs b/cli-cmd/compute/src/v2/quota_set/set_20.rs index 440d20bb7..3c7bcbf0e 100644 --- a/cli-cmd/compute/src/v2/quota_set/set_20.rs +++ b/cli-cmd/compute/src/v2/quota_set/set_20.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_set::set_20; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::compute::v2::quota_set::response::set::QuotaSetResponse; +use openstack_types::compute::v2::quota_set::response; use tracing::warn; /// Update the quotas for a project or a project and a user. @@ -328,8 +328,9 @@ impl QuotaSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/quota_set/set_236.rs b/cli-cmd/compute/src/v2/quota_set/set_236.rs index 13a34a9f5..21ff6c854 100644 --- a/cli-cmd/compute/src/v2/quota_set/set_236.rs +++ b/cli-cmd/compute/src/v2/quota_set/set_236.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_set::set_236; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::compute::v2::quota_set::response::set::QuotaSetResponse; +use openstack_types::compute::v2::quota_set::response; use tracing::warn; /// Update the quotas for a project or a project and a user. @@ -287,8 +287,9 @@ impl QuotaSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/quota_set/set_257.rs b/cli-cmd/compute/src/v2/quota_set/set_257.rs index 729cf5504..6f8c796f3 100644 --- a/cli-cmd/compute/src/v2/quota_set/set_257.rs +++ b/cli-cmd/compute/src/v2/quota_set/set_257.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_set::set_257; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::compute::v2::quota_set::response::set::QuotaSetResponse; +use openstack_types::compute::v2::quota_set::response; use tracing::warn; /// Update the quotas for a project or a project and a user. @@ -243,8 +243,9 @@ impl QuotaSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/quota_set/show.rs b/cli-cmd/compute/src/v2/quota_set/show.rs index baab117c1..d2459aa6c 100644 --- a/cli-cmd/compute/src/v2/quota_set/show.rs +++ b/cli-cmd/compute/src/v2/quota_set/show.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::quota_set::get; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::compute::v2::quota_set::response::get::QuotaSetResponse; +use openstack_types::compute::v2::quota_set::response; use tracing::warn; /// Show the quota for a project or a project and a user. @@ -151,8 +151,11 @@ impl QuotaSetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/add_fixed_ip.rs b/cli-cmd/compute/src/v2/server/add_fixed_ip.rs new file mode 100644 index 000000000..5cf531b20 --- /dev/null +++ b/cli-cmd/compute/src/v2/server/add_fixed_ip.rs @@ -0,0 +1,125 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +//! Action Server command +//! +//! Wraps invoking of the `v2.1/servers/{id}/action` with `POST` method + +use clap::Args; +use eyre::{OptionExt, WrapErr}; +use tracing::info; + +use openstack_cli_core::cli::CliArgs; +use openstack_cli_core::error::OpenStackCliError; +use openstack_cli_core::output::OutputProcessor; +use openstack_sdk::AsyncOpenStack; + +use openstack_sdk::api::QueryAsync; +use openstack_sdk::api::compute::v2::server::add_fixed_ip; + +/// Adds a fixed IP address to a server instance, which associates that address +/// with the server. The fixed IP address is retrieved from the network that +/// you specify in the request. +/// +/// Specify the `addFixedIp` action and the network ID in the request body. +/// +/// Policy defaults enable only users with the administrative role or the owner +/// of the server to perform this operation. Cloud providers can change these +/// permissions through the `policy.yaml` file. +/// +/// Normal response codes: 202 +/// +/// Error response codes: badRequest(400), unauthorized(401), forbidden(403), +/// itemNotFound(404) +#[derive(Args)] +#[command(about = "Add (Associate) Fixed Ip (addFixedIp Action) (DEPRECATED)")] +pub struct ServerCommand { + /// Request Query parameters + #[command(flatten)] + query: QueryParameters, + + /// Path parameters + #[command(flatten)] + path: PathParameters, + + /// The action to add a fixed ip address to a server. + #[command(flatten)] + add_fixed_ip: AddFixedIp, +} + +/// Query parameters +#[derive(Args)] +struct QueryParameters {} + +/// Path parameters +#[derive(Args)] +struct PathParameters { + /// id parameter for /v2.1/servers/{id}/action API + #[arg( + help_heading = "Path parameters", + id = "path_param_id", + value_name = "ID" + )] + id: String, +} +/// AddFixedIp Body data +#[derive(Args, Clone)] +struct AddFixedIp { + /// The network ID. + #[arg(help_heading = "Body parameters", long)] + network_id: String, +} + +impl ServerCommand { + /// Perform command action + pub async fn take_action( + &self, + parsed_args: &C, + client: &mut AsyncOpenStack, + ) -> Result<(), OpenStackCliError> { + info!("Action Server"); + + let op = + OutputProcessor::from_args(parsed_args, Some("compute.server"), Some("add_fixed_ip")); + op.validate_args(parsed_args)?; + + let mut ep_builder = add_fixed_ip::Request::builder(); + + ep_builder.id(&self.path.id); + + // Set body parameters + // Set Request.add_fixed_ip data + let args = &self.add_fixed_ip; + let mut add_fixed_ip_builder = add_fixed_ip::AddFixedIpBuilder::default(); + + add_fixed_ip_builder.network_id(&args.network_id); + + ep_builder.add_fixed_ip( + add_fixed_ip_builder + .build() + .wrap_err("error preparing the request data")?, + ); + + let ep = ep_builder + .build() + .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; + openstack_sdk::api::ignore(ep).query_async(client).await?; + // Show command specific hints + op.show_command_hint()?; + Ok(()) + } +} diff --git a/cli-cmd/compute/src/v2/server/add_floating_ip.rs b/cli-cmd/compute/src/v2/server/add_floating_ip.rs new file mode 100644 index 000000000..0621f52e9 --- /dev/null +++ b/cli-cmd/compute/src/v2/server/add_floating_ip.rs @@ -0,0 +1,151 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +//! Action Server command +//! +//! Wraps invoking of the `v2.1/servers/{id}/action` with `POST` method + +use clap::Args; +use eyre::{OptionExt, WrapErr}; +use tracing::info; + +use openstack_cli_core::cli::CliArgs; +use openstack_cli_core::error::OpenStackCliError; +use openstack_cli_core::output::OutputProcessor; +use openstack_sdk::AsyncOpenStack; + +use openstack_sdk::api::QueryAsync; +use openstack_sdk::api::compute::v2::server::add_floating_ip; + +/// Adds a floating IP address to a server, which associates that address with +/// the server. +/// +/// A pool of floating IP addresses, configured by the cloud administrator, is +/// available in OpenStack Compute. The project quota defines the maximum +/// number of floating IP addresses that you can allocate to the project. After +/// you +/// [create (allocate) a floating IPaddress](https://docs.openstack.org/api-ref/compute/#create-allocate-floating-ip-address) +/// for a project, you can associate that address with the server. Specify the +/// `addFloatingIp` action in the request body. +/// +/// If an instance is connected to multiple networks, you can associate a +/// floating IP address with a specific fixed IP address by using the optional +/// `fixed_address` parameter. +/// +/// **Preconditions** +/// +/// The server must exist. +/// +/// You can only add a floating IP address to the server when its status is +/// `ACTIVE` or `STOPPED` +/// +/// Normal response codes: 202 +/// +/// Error response codes: badRequest(400), unauthorized(401), forbidden(403), +/// itemNotFound(404) +#[derive(Args)] +#[command(about = "Add (Associate) Floating Ip (addFloatingIp Action) (DEPRECATED)")] +pub struct ServerCommand { + /// Request Query parameters + #[command(flatten)] + query: QueryParameters, + + /// Path parameters + #[command(flatten)] + path: PathParameters, + + /// The action. Contains required floating IP `address` and optional + /// `fixed_address`. + #[command(flatten)] + add_floating_ip: AddFloatingIp, +} + +/// Query parameters +#[derive(Args)] +struct QueryParameters {} + +/// Path parameters +#[derive(Args)] +struct PathParameters { + /// id parameter for /v2.1/servers/{id}/action API + #[arg( + help_heading = "Path parameters", + id = "path_param_id", + value_name = "ID" + )] + id: String, +} +/// AddFloatingIp Body data +#[derive(Args, Clone)] +struct AddFloatingIp { + /// The fixed IP address with which you want to associate the floating IP + /// address. + #[arg(help_heading = "Body parameters", long)] + address: String, + + /// The fixed IP address with which you want to associate the floating IP + /// address. + #[arg(help_heading = "Body parameters", long)] + fixed_address: Option, +} + +impl ServerCommand { + /// Perform command action + pub async fn take_action( + &self, + parsed_args: &C, + client: &mut AsyncOpenStack, + ) -> Result<(), OpenStackCliError> { + info!("Action Server"); + + let op = OutputProcessor::from_args( + parsed_args, + Some("compute.server"), + Some("add_floating_ip"), + ); + op.validate_args(parsed_args)?; + + let mut ep_builder = add_floating_ip::Request::builder(); + + ep_builder.id(&self.path.id); + + // Set body parameters + // Set Request.add_floating_ip data + let args = &self.add_floating_ip; + let mut add_floating_ip_builder = add_floating_ip::AddFloatingIpBuilder::default(); + + add_floating_ip_builder.address(&args.address); + + if let Some(val) = &args.fixed_address { + add_floating_ip_builder.fixed_address(val); + } + + ep_builder.add_floating_ip( + add_floating_ip_builder + .build() + .wrap_err("error preparing the request data")?, + ); + + let ep = ep_builder + .build() + .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; + openstack_sdk::api::ignore(ep).query_async(client).await?; + // Show command specific hints + op.show_command_hint()?; + Ok(()) + } +} diff --git a/cli-cmd/compute/src/v2/server/create_20.rs b/cli-cmd/compute/src/v2/server/create_20.rs index f72c876a2..ba4159053 100644 --- a/cli-cmd/compute/src/v2/server/create_20.rs +++ b/cli-cmd/compute/src/v2/server/create_20.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_20; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -585,8 +585,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_21.rs b/cli-cmd/compute/src/v2/server/create_21.rs index 00aa0eb0b..704ba4b0c 100644 --- a/cli-cmd/compute/src/v2/server/create_21.rs +++ b/cli-cmd/compute/src/v2/server/create_21.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_21; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -570,8 +570,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_219.rs b/cli-cmd/compute/src/v2/server/create_219.rs index ea35f8c12..98689b569 100644 --- a/cli-cmd/compute/src/v2/server/create_219.rs +++ b/cli-cmd/compute/src/v2/server/create_219.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_219; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -589,8 +589,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_232.rs b/cli-cmd/compute/src/v2/server/create_232.rs index 8c576f64f..257b6e1ec 100644 --- a/cli-cmd/compute/src/v2/server/create_232.rs +++ b/cli-cmd/compute/src/v2/server/create_232.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_232; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -589,8 +589,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_233.rs b/cli-cmd/compute/src/v2/server/create_233.rs index 96cf47025..34aa34150 100644 --- a/cli-cmd/compute/src/v2/server/create_233.rs +++ b/cli-cmd/compute/src/v2/server/create_233.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_233; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -589,8 +589,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_237.rs b/cli-cmd/compute/src/v2/server/create_237.rs index 3308c6f10..9f2646c2d 100644 --- a/cli-cmd/compute/src/v2/server/create_237.rs +++ b/cli-cmd/compute/src/v2/server/create_237.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_237; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -619,8 +619,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_242.rs b/cli-cmd/compute/src/v2/server/create_242.rs index 2f16b1b12..4fbcd07d2 100644 --- a/cli-cmd/compute/src/v2/server/create_242.rs +++ b/cli-cmd/compute/src/v2/server/create_242.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_242; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -619,8 +619,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_252.rs b/cli-cmd/compute/src/v2/server/create_252.rs index d8905edce..7fd190ceb 100644 --- a/cli-cmd/compute/src/v2/server/create_252.rs +++ b/cli-cmd/compute/src/v2/server/create_252.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_252; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -639,8 +639,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_257.rs b/cli-cmd/compute/src/v2/server/create_257.rs index 62bf67d01..4ce4b9782 100644 --- a/cli-cmd/compute/src/v2/server/create_257.rs +++ b/cli-cmd/compute/src/v2/server/create_257.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_257; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -620,8 +620,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_263.rs b/cli-cmd/compute/src/v2/server/create_263.rs index 642e39a57..1b0547a6f 100644 --- a/cli-cmd/compute/src/v2/server/create_263.rs +++ b/cli-cmd/compute/src/v2/server/create_263.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_263; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -637,8 +637,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_267.rs b/cli-cmd/compute/src/v2/server/create_267.rs index 1d2472bb5..cdaff402c 100644 --- a/cli-cmd/compute/src/v2/server/create_267.rs +++ b/cli-cmd/compute/src/v2/server/create_267.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_267; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -637,8 +637,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_274.rs b/cli-cmd/compute/src/v2/server/create_274.rs index 316987e13..9352bbaa2 100644 --- a/cli-cmd/compute/src/v2/server/create_274.rs +++ b/cli-cmd/compute/src/v2/server/create_274.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_274; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -661,8 +661,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_290.rs b/cli-cmd/compute/src/v2/server/create_290.rs index 03ad82b40..5aac024c6 100644 --- a/cli-cmd/compute/src/v2/server/create_290.rs +++ b/cli-cmd/compute/src/v2/server/create_290.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_290; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -680,8 +680,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_294.rs b/cli-cmd/compute/src/v2/server/create_294.rs index 257237cef..a1b2eceed 100644 --- a/cli-cmd/compute/src/v2/server/create_294.rs +++ b/cli-cmd/compute/src/v2/server/create_294.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_294; -use openstack_types::compute::v2::server::response::create::ServerResponse; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Creates a server. @@ -680,8 +680,10 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_backup_20.rs b/cli-cmd/compute/src/v2/server/create_backup_20.rs index 792845a2f..eafef877c 100644 --- a/cli-cmd/compute/src/v2/server/create_backup_20.rs +++ b/cli-cmd/compute/src/v2/server/create_backup_20.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_backup_20; -use openstack_types::compute::v2::server::response::create_backup::ServerResponse; /// Command without description in OpenAPI #[derive(Args)] @@ -132,9 +131,7 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_backup_21.rs b/cli-cmd/compute/src/v2/server/create_backup_21.rs index a50d0da3b..b69f3f4eb 100644 --- a/cli-cmd/compute/src/v2/server/create_backup_21.rs +++ b/cli-cmd/compute/src/v2/server/create_backup_21.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_backup_21; -use openstack_types::compute::v2::server::response::create_backup::ServerResponse; /// Command without description in OpenAPI #[derive(Args)] @@ -132,9 +131,7 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_image_20.rs b/cli-cmd/compute/src/v2/server/create_image_20.rs index 77e3a8ebb..db8140b16 100644 --- a/cli-cmd/compute/src/v2/server/create_image_20.rs +++ b/cli-cmd/compute/src/v2/server/create_image_20.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_image_20; -use openstack_types::compute::v2::server::response::create_image::ServerResponse; /// Command without description in OpenAPI #[derive(Args)] @@ -119,9 +118,7 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/create_image_21.rs b/cli-cmd/compute/src/v2/server/create_image_21.rs index 4024833fa..e292acf1c 100644 --- a/cli-cmd/compute/src/v2/server/create_image_21.rs +++ b/cli-cmd/compute/src/v2/server/create_image_21.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::create_image_21; -use openstack_types::compute::v2::server::response::create_image::ServerResponse; /// Command without description in OpenAPI #[derive(Args)] @@ -119,9 +118,7 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/diagnostic/get.rs b/cli-cmd/compute/src/v2/server/diagnostic/get.rs index ae1687e37..745b41e23 100644 --- a/cli-cmd/compute/src/v2/server/diagnostic/get.rs +++ b/cli-cmd/compute/src/v2/server/diagnostic/get.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::diagnostic::get; -use openstack_types::compute::v2::server::diagnostic::response::get::DiagnosticResponse; +use openstack_types::compute::v2::server::diagnostic::response; /// Shows basic usage data for a server. /// @@ -89,8 +89,10 @@ impl DiagnosticCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/evacuate_20.rs b/cli-cmd/compute/src/v2/server/evacuate_20.rs index b3fb14c56..310203574 100644 --- a/cli-cmd/compute/src/v2/server/evacuate_20.rs +++ b/cli-cmd/compute/src/v2/server/evacuate_20.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::evacuate_20; -use openstack_types::compute::v2::server::response::evacuate::ServerResponse; +use openstack_types::compute::v2::server::response; /// Command without description in OpenAPI #[derive(Args)] @@ -145,8 +145,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/evacuate_214.rs b/cli-cmd/compute/src/v2/server/evacuate_214.rs index 24b74b848..b8bdd43de 100644 --- a/cli-cmd/compute/src/v2/server/evacuate_214.rs +++ b/cli-cmd/compute/src/v2/server/evacuate_214.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::evacuate_214; -use openstack_types::compute::v2::server::response::evacuate::ServerResponse; +use openstack_types::compute::v2::server::response; /// Command without description in OpenAPI #[derive(Args)] @@ -131,8 +131,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/evacuate_229.rs b/cli-cmd/compute/src/v2/server/evacuate_229.rs index b8284b155..c018a573f 100644 --- a/cli-cmd/compute/src/v2/server/evacuate_229.rs +++ b/cli-cmd/compute/src/v2/server/evacuate_229.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::evacuate_229; -use openstack_types::compute::v2::server::response::evacuate::ServerResponse; +use openstack_types::compute::v2::server::response; /// Command without description in OpenAPI #[derive(Args)] @@ -156,8 +156,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/evacuate_268.rs b/cli-cmd/compute/src/v2/server/evacuate_268.rs index 8c0db2121..0a3099a3e 100644 --- a/cli-cmd/compute/src/v2/server/evacuate_268.rs +++ b/cli-cmd/compute/src/v2/server/evacuate_268.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::evacuate_268; -use openstack_types::compute::v2::server::response::evacuate::ServerResponse; +use openstack_types::compute::v2::server::response; /// Command without description in OpenAPI #[derive(Args)] @@ -131,8 +131,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/evacuate_295.rs b/cli-cmd/compute/src/v2/server/evacuate_295.rs index 4976c4a72..cfab841f6 100644 --- a/cli-cmd/compute/src/v2/server/evacuate_295.rs +++ b/cli-cmd/compute/src/v2/server/evacuate_295.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::evacuate_295; -use openstack_types::compute::v2::server::response::evacuate::ServerResponse; +use openstack_types::compute::v2::server::response; /// Command without description in OpenAPI #[derive(Args)] @@ -131,8 +131,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/instance_action/list.rs b/cli-cmd/compute/src/v2/server/instance_action/list.rs index b74d51141..fa5dba7d1 100644 --- a/cli-cmd/compute/src/v2/server/instance_action/list.rs +++ b/cli-cmd/compute/src/v2/server/instance_action/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::instance_action::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::compute::v2::server::instance_action::response::list::InstanceActionResponse; +use openstack_types::compute::v2::server::instance_action::response; /// Lists actions for a server. /// @@ -141,7 +141,11 @@ impl InstanceActionsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| { + op.output_list::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/instance_action/show.rs b/cli-cmd/compute/src/v2/server/instance_action/show.rs index 8805d83a3..27bcd5a83 100644 --- a/cli-cmd/compute/src/v2/server/instance_action/show.rs +++ b/cli-cmd/compute/src/v2/server/instance_action/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::instance_action::get; -use openstack_types::compute::v2::server::instance_action::response::get::InstanceActionResponse; +use openstack_types::compute::v2::server::instance_action::response; /// Shows details for a server action. /// @@ -105,8 +105,21 @@ impl InstanceActionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| { + op.output_single::(data.clone()) + }) + .or_else(|_| { + op.output_single::(data.clone()) + }) + .or_else(|_| { + op.output_single::(data.clone()) + }) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/interface/create_20.rs b/cli-cmd/compute/src/v2/server/interface/create_20.rs index e9efe10a3..0afccff04 100644 --- a/cli-cmd/compute/src/v2/server/interface/create_20.rs +++ b/cli-cmd/compute/src/v2/server/interface/create_20.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::interface::create_20; -use openstack_types::compute::v2::server::interface::response::create::InterfaceResponse; /// Creates a port interface and uses it to attach a port to a server. /// @@ -148,9 +147,7 @@ impl InterfaceCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/interface/create_249.rs b/cli-cmd/compute/src/v2/server/interface/create_249.rs index cbd87c9ff..be3c229f7 100644 --- a/cli-cmd/compute/src/v2/server/interface/create_249.rs +++ b/cli-cmd/compute/src/v2/server/interface/create_249.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::interface::create_249; -use openstack_types::compute::v2::server::interface::response::create::InterfaceResponse; +use openstack_types::compute::v2::server::interface::response; /// Creates a port interface and uses it to attach a port to a server. /// @@ -162,8 +162,9 @@ impl InterfaceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/interface/list.rs b/cli-cmd/compute/src/v2/server/interface/list.rs index b03c1c014..e37329b5a 100644 --- a/cli-cmd/compute/src/v2/server/interface/list.rs +++ b/cli-cmd/compute/src/v2/server/interface/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::interface::list; -use openstack_types::compute::v2::server::interface::response::list::InterfaceResponse; +use openstack_types::compute::v2::server::interface::response; /// Lists port interfaces that are attached to a server. /// @@ -87,7 +87,9 @@ impl InterfacesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| op.output_list::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/interface/show.rs b/cli-cmd/compute/src/v2/server/interface/show.rs index b66500c55..2e75251c8 100644 --- a/cli-cmd/compute/src/v2/server/interface/show.rs +++ b/cli-cmd/compute/src/v2/server/interface/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::interface::get; -use openstack_types::compute::v2::server::interface::response::get::InterfaceResponse; +use openstack_types::compute::v2::server::interface::response; /// Shows details for a port interface that is attached to a server. /// @@ -94,8 +94,10 @@ impl InterfaceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(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 4159c9887..62686428d 100644 --- a/cli-cmd/compute/src/v2/server/ip/list.rs +++ b/cli-cmd/compute/src/v2/server/ip/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::ip::list; -use openstack_types::compute::v2::server::ip::response::list::IpResponse; +use openstack_types::compute::v2::server::ip::response; /// Lists IP addresses that are assigned to an instance. /// @@ -88,8 +88,9 @@ impl IpsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/ip/show.rs b/cli-cmd/compute/src/v2/server/ip/show.rs index 9a88dc75f..dd9164eda 100644 --- a/cli-cmd/compute/src/v2/server/ip/show.rs +++ b/cli-cmd/compute/src/v2/server/ip/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::ip::get; -use openstack_types::compute::v2::server::ip::response::get::IpResponse; +use openstack_types::compute::v2::server::ip::response; /// Shows IP addresses details for a network label of a server instance. /// @@ -97,8 +97,9 @@ impl IpCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/list.rs b/cli-cmd/compute/src/v2/server/list.rs index 6bcc27623..6d1d0980b 100644 --- a/cli-cmd/compute/src/v2/server/list.rs +++ b/cli-cmd/compute/src/v2/server/list.rs @@ -34,7 +34,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::identity::v3::user::find as find_user; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::compute::v2::server::response::list_detailed::ServerResponse; +use openstack_types::compute::v2::server::response; use tracing::warn; /// For each server, shows server details including config drive, extended @@ -563,7 +563,61 @@ impl ServersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/metadata/create.rs b/cli-cmd/compute/src/v2/server/metadata/create.rs index 5d94745a6..cad03408c 100644 --- a/cli-cmd/compute/src/v2/server/metadata/create.rs +++ b/cli-cmd/compute/src/v2/server/metadata/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::metadata::create; -use openstack_types::compute::v2::server::metadata::response::create::MetadataResponse; +use openstack_types::compute::v2::server::metadata::response; /// Create or update one or more metadata items for a server. /// @@ -108,8 +108,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/metadata/list.rs b/cli-cmd/compute/src/v2/server/metadata/list.rs index 304af8b51..aacce8563 100644 --- a/cli-cmd/compute/src/v2/server/metadata/list.rs +++ b/cli-cmd/compute/src/v2/server/metadata/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::metadata::list; -use openstack_types::compute::v2::server::metadata::response::list::MetadataResponse; +use openstack_types::compute::v2::server::metadata::response; /// Lists all metadata for a server. /// @@ -89,8 +89,9 @@ impl MetadatasCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/metadata/replace.rs b/cli-cmd/compute/src/v2/server/metadata/replace.rs index ee2ce8dab..15132c2c7 100644 --- a/cli-cmd/compute/src/v2/server/metadata/replace.rs +++ b/cli-cmd/compute/src/v2/server/metadata/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::metadata::replace; -use openstack_types::compute::v2::server::metadata::response::replace::MetadataResponse; +use openstack_types::compute::v2::server::metadata::response; /// Replaces one or more metadata items for a server. /// @@ -108,8 +108,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/metadata/set.rs b/cli-cmd/compute/src/v2/server/metadata/set.rs index d0f3d6c91..86a7e1945 100644 --- a/cli-cmd/compute/src/v2/server/metadata/set.rs +++ b/cli-cmd/compute/src/v2/server/metadata/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::metadata::set; -use openstack_types::compute::v2::server::metadata::response::set::MetadataResponse; +use openstack_types::compute::v2::server::metadata::response; /// Creates or replaces a metadata item, by key, for a server. /// @@ -112,8 +112,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/metadata/show.rs b/cli-cmd/compute/src/v2/server/metadata/show.rs index 11764aaf4..3286ea997 100644 --- a/cli-cmd/compute/src/v2/server/metadata/show.rs +++ b/cli-cmd/compute/src/v2/server/metadata/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::metadata::get; -use openstack_types::compute::v2::server::metadata::response::get::MetadataResponse; +use openstack_types::compute::v2::server::metadata::response; /// Shows details for a metadata item, by key, for a server. /// @@ -98,8 +98,9 @@ impl MetadataCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/migration/force_complete.rs b/cli-cmd/compute/src/v2/server/migration/force_complete.rs new file mode 100644 index 000000000..131fd75d9 --- /dev/null +++ b/cli-cmd/compute/src/v2/server/migration/force_complete.rs @@ -0,0 +1,135 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +//! Action Migration command +//! +//! Wraps invoking of the `v2.1/servers/{server_id}/migrations/{id}/action` with `POST` method + +use clap::Args; +use eyre::{OptionExt, WrapErr}; +use tracing::info; + +use openstack_cli_core::cli::CliArgs; +use openstack_cli_core::error::OpenStackCliError; +use openstack_cli_core::output::OutputProcessor; +use openstack_sdk::AsyncOpenStack; + +use openstack_sdk::api::QueryAsync; +use openstack_sdk::api::compute::v2::server::migration::force_complete; + +/// Force an in-progress live migration for a given server to complete. +/// +/// Specify the `force_complete` action in the request body. +/// +/// Policy defaults enable only users with the administrative role to perform +/// this operation. Cloud providers can change these permissions through the +/// `policy.yaml` file. +/// +/// **Preconditions** +/// +/// The server OS-EXT-STS:vm_state value must be `active` and the server +/// OS-EXT-STS:task_state value must be `migrating`. +/// +/// If the server is locked, you must have administrator privileges to force +/// the completion of the server migration. +/// +/// The migration status must be `running`. +/// +/// **Asynchronous Postconditions** +/// +/// After you make this request, you typically must keep polling the server +/// status to determine whether the request succeeded. +/// +/// **Troubleshooting** +/// +/// If the server status remains `MIGRATING` for an inordinate amount of time, +/// the request may have failed. Ensure you meet the preconditions and run the +/// request again. If the request fails again, investigate the compute back +/// end. More details can be found in the +/// [admin guide](https://docs.openstack.org/nova/latest/admin/live-migration-usage.html#what-to-do-when-the-migration-times-out). +/// +/// Normal response codes: 202 +/// +/// Error response codes: badRequest(400), unauthorized(401), forbidden(403), +/// itemNotFound(404), conflict(409) +#[derive(Args)] +#[command(about = "Force Migration Complete Action (force_complete Action)")] +pub struct MigrationCommand { + /// Request Query parameters + #[command(flatten)] + query: QueryParameters, + + /// Path parameters + #[command(flatten)] + path: PathParameters, +} + +/// Query parameters +#[derive(Args)] +struct QueryParameters {} + +/// Path parameters +#[derive(Args)] +struct PathParameters { + /// id parameter for /v2.1/servers/{server_id}/migrations/{id}/action API + #[arg( + help_heading = "Path parameters", + id = "path_param_id", + value_name = "ID" + )] + id: String, + + /// server_id parameter for + /// /v2.1/servers/{server_id}/migrations/{id}/action API + #[arg( + help_heading = "Path parameters", + id = "path_param_server_id", + value_name = "SERVER_ID" + )] + server_id: String, +} + +impl MigrationCommand { + /// Perform command action + pub async fn take_action( + &self, + parsed_args: &C, + client: &mut AsyncOpenStack, + ) -> Result<(), OpenStackCliError> { + info!("Action Migration"); + + let op = OutputProcessor::from_args( + parsed_args, + Some("compute.server/migration"), + Some("force_complete"), + ); + op.validate_args(parsed_args)?; + + let mut ep_builder = force_complete::Request::builder(); + + ep_builder.id(&self.path.id); + ep_builder.server_id(&self.path.server_id); + + let ep = ep_builder + .build() + .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; + openstack_sdk::api::ignore(ep).query_async(client).await?; + // Show command specific hints + op.show_command_hint()?; + Ok(()) + } +} diff --git a/cli-cmd/compute/src/v2/server/migration/list.rs b/cli-cmd/compute/src/v2/server/migration/list.rs index 31e4a136c..705bddd99 100644 --- a/cli-cmd/compute/src/v2/server/migration/list.rs +++ b/cli-cmd/compute/src/v2/server/migration/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::migration::list; -use openstack_types::compute::v2::server::migration::response::list::MigrationResponse; +use openstack_types::compute::v2::server::migration::response; /// Lists in-progress live migrations for a given server. /// @@ -90,7 +90,10 @@ impl MigrationsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| op.output_list::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/migration/show.rs b/cli-cmd/compute/src/v2/server/migration/show.rs index 403e4891b..b57779993 100644 --- a/cli-cmd/compute/src/v2/server/migration/show.rs +++ b/cli-cmd/compute/src/v2/server/migration/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::migration::get; -use openstack_types::compute::v2::server::migration::response::get::MigrationResponse; +use openstack_types::compute::v2::server::migration::response; /// Show details for an in-progress live migration for a given server. /// @@ -98,8 +98,11 @@ impl MigrationCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/os_get_console_output.rs b/cli-cmd/compute/src/v2/server/os_get_console_output.rs index c9b72032c..a985781ac 100644 --- a/cli-cmd/compute/src/v2/server/os_get_console_output.rs +++ b/cli-cmd/compute/src/v2/server/os_get_console_output.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::os_get_console_output; -use openstack_types::compute::v2::server::response::os_get_console_output::ServerResponse; +use openstack_types::compute::v2::server::response; /// Shows console output for a server. /// @@ -129,8 +129,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/os_get_rdpconsole.rs b/cli-cmd/compute/src/v2/server/os_get_rdpconsole.rs index 8d7b4b73a..b131d527e 100644 --- a/cli-cmd/compute/src/v2/server/os_get_rdpconsole.rs +++ b/cli-cmd/compute/src/v2/server/os_get_rdpconsole.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::os_get_rdpconsole; -use openstack_types::compute::v2::server::response::os_get_rdpconsole::ServerResponse; +use openstack_types::compute::v2::server::response; /// Gets an [RDP](https://technet.microsoft.com/en-us/windowsserver/ee236407) /// console for a server. @@ -96,8 +96,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/os_get_serial_console.rs b/cli-cmd/compute/src/v2/server/os_get_serial_console.rs index 2a60dbab9..704b55bc5 100644 --- a/cli-cmd/compute/src/v2/server/os_get_serial_console.rs +++ b/cli-cmd/compute/src/v2/server/os_get_serial_console.rs @@ -11,29 +11,42 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +//! Action Server command +//! +//! Wraps invoking of the `v2.1/servers/{id}/action` with `POST` method -use async_trait::async_trait; use clap::Args; -use serde::{Deserialize, Serialize}; +use eyre::{OptionExt, WrapErr}; use tracing::info; -use crate::output::OutputProcessor; -use crate::Cli; -use structable::StructTableOptions; -use crate::StructTable; -use crate::{OSCCommand, OpenStackCliError}; - - +use openstack_cli_core::cli::CliArgs; +use openstack_cli_core::error::OpenStackCliError; +use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; -use bytes::Bytes; -use http::Response; +use clap::ValueEnum; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::os_get_serial_console; -use openstack_sdk::api::RawQueryAsync; - -/// Command arguments -#[derive(Args, Clone, Debug)] -pub struct ServerArgs { +use openstack_types::compute::v2::server::response; + +/// Gets a serial console for a server. +/// +/// Specify the `os-getSerialConsole` action in the request body. +/// +/// The only supported connection type is `serial`. The `type` parameter should +/// be set as `serial`. +/// +/// Normal response codes: 200 +/// +/// Error response codes: badRequest(400), unauthorized(401), forbidden(403), +/// itemNotFound(404), conflict(409), notImplemented(501) +#[derive(Args)] +#[command(about = "Get Serial Console (os-getSerialConsole Action) (DEPRECATED)")] +pub struct ServerCommand { /// Request Query parameters #[command(flatten)] query: QueryParameters, @@ -41,56 +54,87 @@ pub struct ServerArgs { /// Path parameters #[command(flatten)] path: PathParameters, + + /// The action. + #[command(flatten)] + os_get_serial_console: OsGetSerialConsole, } /// Query parameters -#[derive(Args, Clone, Debug)] -pub struct QueryParameters {} +#[derive(Args)] +struct QueryParameters {} /// Path parameters -#[derive(Args, Clone, Debug)] -pub struct PathParameters { +#[derive(Args)] +struct PathParameters { /// id parameter for /v2.1/servers/{id}/action API - #[arg()] + #[arg( + help_heading = "Path parameters", + id = "path_param_id", + value_name = "ID" + )] id: String, } -/// Server action command -pub struct ServerCmd { - pub args: ServerArgs, +#[derive(Clone, Eq, Ord, PartialEq, PartialOrd, ValueEnum)] +enum Type { + Serial, +} + +/// OsGetSerialConsole Body data +#[derive(Args, Clone)] +struct OsGetSerialConsole { + /// The type of serial console. The only valid value is `serial`. + #[arg(help_heading = "Body parameters", long)] + _type: Type, } -/// Server response representation -#[derive(Deserialize, Debug, Clone, Serialize, StructTable)] -pub struct ResponseData {} -#[async_trait] -impl OSCCommand for ServerCmd { - async fn take_action( +impl ServerCommand { + /// Perform command action + pub async fn take_action( &self, parsed_args: &C, client: &mut AsyncOpenStack, ) -> Result<(), OpenStackCliError> { - info!("Action Server with {:?}", self.args); + info!("Action Server"); - let op = OutputProcessor::from_args(parsed_args); + let op = OutputProcessor::from_args( + parsed_args, + Some("compute.server"), + Some("os_get_serial_console"), + ); op.validate_args(parsed_args)?; - info!("Parsed args: {:?}", self.args); let mut ep_builder = os_get_serial_console::Request::builder(); - // Set path parameters - ep_builder.id(&self.args.path.id); - // Set query parameters + ep_builder.id(&self.path.id); + // Set body parameters + // Set Request.os_get_serial_console data + let args = &self.os_get_serial_console; + let mut os_get_serial_console_builder = + os_get_serial_console::OsGetSerialConsoleBuilder::default(); + + let tmp = match &args._type { + Type::Serial => os_get_serial_console::Type::Serial, + }; + os_get_serial_console_builder._type(tmp); + + ep_builder.os_get_serial_console( + os_get_serial_console_builder + .build() + .wrap_err("error preparing the request data")?, + ); let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let rsp: Response = ep.raw_query_async(client).await?; - let data = ResponseData {}; - // Maybe output some headers metadata - op.output_human::(&data)?; + 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/server/os_get_serial_console_21.rs b/cli-cmd/compute/src/v2/server/os_get_serial_console_21.rs index fcfff4459..cfe2f9a9e 100644 --- a/cli-cmd/compute/src/v2/server/os_get_serial_console_21.rs +++ b/cli-cmd/compute/src/v2/server/os_get_serial_console_21.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::os_get_serial_console_21; -use openstack_types::compute::v2::server::response::os_get_serial_console::ServerResponse; +use openstack_types::compute::v2::server::response; /// Gets a serial console for a server. /// @@ -136,8 +136,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/os_get_spiceconsole.rs b/cli-cmd/compute/src/v2/server/os_get_spiceconsole.rs index 8f0278fc0..d92240069 100644 --- a/cli-cmd/compute/src/v2/server/os_get_spiceconsole.rs +++ b/cli-cmd/compute/src/v2/server/os_get_spiceconsole.rs @@ -11,29 +11,42 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +//! Action Server command +//! +//! Wraps invoking of the `v2.1/servers/{id}/action` with `POST` method -use async_trait::async_trait; use clap::Args; -use serde::{Deserialize, Serialize}; +use eyre::{OptionExt, WrapErr}; use tracing::info; -use crate::output::OutputProcessor; -use crate::Cli; -use structable::StructTableOptions; -use crate::StructTable; -use crate::{OSCCommand, OpenStackCliError}; - - +use openstack_cli_core::cli::CliArgs; +use openstack_cli_core::error::OpenStackCliError; +use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; -use bytes::Bytes; -use http::Response; +use clap::ValueEnum; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::os_get_spiceconsole; -use openstack_sdk::api::RawQueryAsync; - -/// Command arguments -#[derive(Args, Clone, Debug)] -pub struct ServerArgs { +use openstack_types::compute::v2::server::response; + +/// Gets a SPICE console for a server. +/// +/// Specify the `os-getSPICEConsole` action in the request body. +/// +/// The only supported connection type is `spice-html5`. The `type` parameter +/// should be set to `spice-html5`. +/// +/// Normal response codes: 200 +/// +/// Error response codes: badRequest(400), unauthorized(401), forbidden(403), +/// itemNotFound(404), conflict(409), notImplemented(501) +#[derive(Args)] +#[command(about = "Get SPICE Console (os-getSPICEConsole Action) (DEPRECATED)")] +pub struct ServerCommand { /// Request Query parameters #[command(flatten)] query: QueryParameters, @@ -41,56 +54,87 @@ pub struct ServerArgs { /// Path parameters #[command(flatten)] path: PathParameters, + + /// The action. + #[command(flatten)] + os_get_spiceconsole: OsGetSpiceconsole, } /// Query parameters -#[derive(Args, Clone, Debug)] -pub struct QueryParameters {} +#[derive(Args)] +struct QueryParameters {} /// Path parameters -#[derive(Args, Clone, Debug)] -pub struct PathParameters { +#[derive(Args)] +struct PathParameters { /// id parameter for /v2.1/servers/{id}/action API - #[arg()] + #[arg( + help_heading = "Path parameters", + id = "path_param_id", + value_name = "ID" + )] id: String, } -/// Server action command -pub struct ServerCmd { - pub args: ServerArgs, +#[derive(Clone, Eq, Ord, PartialEq, PartialOrd, ValueEnum)] +enum Type { + SpiceHtml5, +} + +/// OsGetSpiceconsole Body data +#[derive(Args, Clone)] +struct OsGetSpiceconsole { + /// The type of SPICE console. The only valid value is `spice-html5`. + #[arg(help_heading = "Body parameters", long)] + _type: Type, } -/// Server response representation -#[derive(Deserialize, Debug, Clone, Serialize, StructTable)] -pub struct ResponseData {} -#[async_trait] -impl OSCCommand for ServerCmd { - async fn take_action( +impl ServerCommand { + /// Perform command action + pub async fn take_action( &self, parsed_args: &C, client: &mut AsyncOpenStack, ) -> Result<(), OpenStackCliError> { - info!("Action Server with {:?}", self.args); + info!("Action Server"); - let op = OutputProcessor::from_args(parsed_args); + let op = OutputProcessor::from_args( + parsed_args, + Some("compute.server"), + Some("os_get_spiceconsole"), + ); op.validate_args(parsed_args)?; - info!("Parsed args: {:?}", self.args); let mut ep_builder = os_get_spiceconsole::Request::builder(); - // Set path parameters - ep_builder.id(&self.args.path.id); - // Set query parameters + ep_builder.id(&self.path.id); + // Set body parameters + // Set Request.os_get_spiceconsole data + let args = &self.os_get_spiceconsole; + let mut os_get_spiceconsole_builder = + os_get_spiceconsole::OsGetSpiceconsoleBuilder::default(); + + let tmp = match &args._type { + Type::SpiceHtml5 => os_get_spiceconsole::Type::SpiceHtml5, + }; + os_get_spiceconsole_builder._type(tmp); + + ep_builder.os_get_spiceconsole( + os_get_spiceconsole_builder + .build() + .wrap_err("error preparing the request data")?, + ); let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let rsp: Response = ep.raw_query_async(client).await?; - let data = ResponseData {}; - // Maybe output some headers metadata - op.output_human::(&data)?; + 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/server/os_get_spiceconsole_21.rs b/cli-cmd/compute/src/v2/server/os_get_spiceconsole_21.rs index 2dacf8623..14545fba2 100644 --- a/cli-cmd/compute/src/v2/server/os_get_spiceconsole_21.rs +++ b/cli-cmd/compute/src/v2/server/os_get_spiceconsole_21.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::os_get_spiceconsole_21; -use openstack_types::compute::v2::server::response::os_get_spiceconsole::ServerResponse; +use openstack_types::compute::v2::server::response; /// Gets a SPICE console for a server. /// @@ -136,8 +136,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/os_get_vncconsole.rs b/cli-cmd/compute/src/v2/server/os_get_vncconsole.rs index 6cafc860c..daa760e13 100644 --- a/cli-cmd/compute/src/v2/server/os_get_vncconsole.rs +++ b/cli-cmd/compute/src/v2/server/os_get_vncconsole.rs @@ -11,29 +11,39 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +//! Action Server command +//! +//! Wraps invoking of the `v2.1/servers/{id}/action` with `POST` method -use async_trait::async_trait; use clap::Args; -use serde::{Deserialize, Serialize}; +use eyre::{OptionExt, WrapErr}; use tracing::info; -use crate::output::OutputProcessor; -use crate::Cli; -use structable::StructTableOptions; -use crate::StructTable; -use crate::{OSCCommand, OpenStackCliError}; - - +use openstack_cli_core::cli::CliArgs; +use openstack_cli_core::error::OpenStackCliError; +use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; -use bytes::Bytes; -use http::Response; +use clap::ValueEnum; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::os_get_vncconsole; -use openstack_sdk::api::RawQueryAsync; - -/// Command arguments -#[derive(Args, Clone, Debug)] -pub struct ServerArgs { +use openstack_types::compute::v2::server::response; + +/// Gets a VNC console for a server. +/// +/// Specify the `os-getVNCConsole` action in the request body. +/// +/// Normal response codes: 200 +/// +/// Error response codes: badRequest(400), unauthorized(401), forbidden(403), +/// itemNotFound(404), conflict(409), notImplemented(501) +#[derive(Args)] +#[command(about = "Get VNC Console (os-getVNCConsole Action) (DEPRECATED)")] +pub struct ServerCommand { /// Request Query parameters #[command(flatten)] query: QueryParameters, @@ -41,56 +51,88 @@ pub struct ServerArgs { /// Path parameters #[command(flatten)] path: PathParameters, + + /// The action. + #[command(flatten)] + os_get_vncconsole: OsGetVncconsole, } /// Query parameters -#[derive(Args, Clone, Debug)] -pub struct QueryParameters {} +#[derive(Args)] +struct QueryParameters {} /// Path parameters -#[derive(Args, Clone, Debug)] -pub struct PathParameters { +#[derive(Args)] +struct PathParameters { /// id parameter for /v2.1/servers/{id}/action API - #[arg()] + #[arg( + help_heading = "Path parameters", + id = "path_param_id", + value_name = "ID" + )] id: String, } -/// Server action command -pub struct ServerCmd { - pub args: ServerArgs, +#[derive(Clone, Eq, Ord, PartialEq, PartialOrd, ValueEnum)] +enum Type { + Novnc, + Xvpvnc, +} + +/// OsGetVncconsole Body data +#[derive(Args, Clone)] +struct OsGetVncconsole { + /// The type of VNC console. The only valid value is `novnc`. + #[arg(help_heading = "Body parameters", long)] + _type: Type, } -/// Server response representation -#[derive(Deserialize, Debug, Clone, Serialize, StructTable)] -pub struct ResponseData {} -#[async_trait] -impl OSCCommand for ServerCmd { - async fn take_action( +impl ServerCommand { + /// Perform command action + pub async fn take_action( &self, parsed_args: &C, client: &mut AsyncOpenStack, ) -> Result<(), OpenStackCliError> { - info!("Action Server with {:?}", self.args); + info!("Action Server"); - let op = OutputProcessor::from_args(parsed_args); + let op = OutputProcessor::from_args( + parsed_args, + Some("compute.server"), + Some("os_get_vncconsole"), + ); op.validate_args(parsed_args)?; - info!("Parsed args: {:?}", self.args); let mut ep_builder = os_get_vncconsole::Request::builder(); - // Set path parameters - ep_builder.id(&self.args.path.id); - // Set query parameters + ep_builder.id(&self.path.id); + // Set body parameters + // Set Request.os_get_vncconsole data + let args = &self.os_get_vncconsole; + let mut os_get_vncconsole_builder = os_get_vncconsole::OsGetVncconsoleBuilder::default(); + + let tmp = match &args._type { + Type::Novnc => os_get_vncconsole::Type::Novnc, + Type::Xvpvnc => os_get_vncconsole::Type::Xvpvnc, + }; + os_get_vncconsole_builder._type(tmp); + + ep_builder.os_get_vncconsole( + os_get_vncconsole_builder + .build() + .wrap_err("error preparing the request data")?, + ); let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let rsp: Response = ep.raw_query_async(client).await?; - let data = ResponseData {}; - // Maybe output some headers metadata - op.output_human::(&data)?; + 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/server/os_get_vncconsole_21.rs b/cli-cmd/compute/src/v2/server/os_get_vncconsole_21.rs index af981509e..445d0128e 100644 --- a/cli-cmd/compute/src/v2/server/os_get_vncconsole_21.rs +++ b/cli-cmd/compute/src/v2/server/os_get_vncconsole_21.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::os_get_vncconsole_21; -use openstack_types::compute::v2::server::response::os_get_vncconsole::ServerResponse; +use openstack_types::compute::v2::server::response; /// Gets a VNC console for a server. /// @@ -132,8 +132,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/rebuild_20.rs b/cli-cmd/compute/src/v2/server/rebuild_20.rs index 785e79268..19672bdb8 100644 --- a/cli-cmd/compute/src/v2/server/rebuild_20.rs +++ b/cli-cmd/compute/src/v2/server/rebuild_20.rs @@ -32,6 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::rebuild_20; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Command without description in OpenAPI @@ -227,7 +228,10 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - openstack_sdk::api::ignore(ep).query_async(client).await?; + + 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/server/rebuild_21.rs b/cli-cmd/compute/src/v2/server/rebuild_21.rs index ea7af5d40..b6ee3a47c 100644 --- a/cli-cmd/compute/src/v2/server/rebuild_21.rs +++ b/cli-cmd/compute/src/v2/server/rebuild_21.rs @@ -32,6 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::rebuild_21; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Command without description in OpenAPI @@ -227,7 +228,10 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - openstack_sdk::api::ignore(ep).query_async(client).await?; + + 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/server/rebuild_219.rs b/cli-cmd/compute/src/v2/server/rebuild_219.rs index cd14f4406..da6bfbb95 100644 --- a/cli-cmd/compute/src/v2/server/rebuild_219.rs +++ b/cli-cmd/compute/src/v2/server/rebuild_219.rs @@ -32,6 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::rebuild_219; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Command without description in OpenAPI @@ -244,7 +245,10 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - openstack_sdk::api::ignore(ep).query_async(client).await?; + + 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/server/rebuild_254.rs b/cli-cmd/compute/src/v2/server/rebuild_254.rs index 27b0d5ecd..83a39e489 100644 --- a/cli-cmd/compute/src/v2/server/rebuild_254.rs +++ b/cli-cmd/compute/src/v2/server/rebuild_254.rs @@ -32,6 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::rebuild_254; +use openstack_types::compute::v2::server::response; use serde_json::Value; /// Command without description in OpenAPI @@ -269,7 +270,10 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - openstack_sdk::api::ignore(ep).query_async(client).await?; + + 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/server/rebuild_257.rs b/cli-cmd/compute/src/v2/server/rebuild_257.rs index 420661503..1e94c7bf4 100644 --- a/cli-cmd/compute/src/v2/server/rebuild_257.rs +++ b/cli-cmd/compute/src/v2/server/rebuild_257.rs @@ -32,6 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::rebuild_257; +use openstack_types::compute::v2::server::response; /// Command without description in OpenAPI #[derive(Args)] @@ -267,7 +268,10 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - openstack_sdk::api::ignore(ep).query_async(client).await?; + + 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/server/rebuild_263.rs b/cli-cmd/compute/src/v2/server/rebuild_263.rs index 132d7bc24..a583d8972 100644 --- a/cli-cmd/compute/src/v2/server/rebuild_263.rs +++ b/cli-cmd/compute/src/v2/server/rebuild_263.rs @@ -32,6 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::rebuild_263; +use openstack_types::compute::v2::server::response; /// Command without description in OpenAPI #[derive(Args)] @@ -287,7 +288,10 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - openstack_sdk::api::ignore(ep).query_async(client).await?; + + 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/server/rebuild_290.rs b/cli-cmd/compute/src/v2/server/rebuild_290.rs index 78cc3730b..4ff3031bf 100644 --- a/cli-cmd/compute/src/v2/server/rebuild_290.rs +++ b/cli-cmd/compute/src/v2/server/rebuild_290.rs @@ -32,6 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::rebuild_290; +use openstack_types::compute::v2::server::response; /// Command without description in OpenAPI #[derive(Args)] @@ -306,7 +307,10 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - openstack_sdk::api::ignore(ep).query_async(client).await?; + + 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/server/rebuild_294.rs b/cli-cmd/compute/src/v2/server/rebuild_294.rs index 5dcb6f049..9a3bccfcd 100644 --- a/cli-cmd/compute/src/v2/server/rebuild_294.rs +++ b/cli-cmd/compute/src/v2/server/rebuild_294.rs @@ -32,6 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::rebuild_294; +use openstack_types::compute::v2::server::response; /// Command without description in OpenAPI #[derive(Args)] @@ -306,7 +307,10 @@ impl ServerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - openstack_sdk::api::ignore(ep).query_async(client).await?; + + 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/server/remote_console/create_26.rs b/cli-cmd/compute/src/v2/server/remote_console/create_26.rs index 595d4e2a9..434897662 100644 --- a/cli-cmd/compute/src/v2/server/remote_console/create_26.rs +++ b/cli-cmd/compute/src/v2/server/remote_console/create_26.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::remote_console::create_26; -use openstack_types::compute::v2::server::remote_console::response::create::RemoteConsoleResponse; +use openstack_types::compute::v2::server::remote_console::response; /// The API provides a unified request for creating a remote console. The user /// can get a URL to connect the console from this API. The URL includes the @@ -167,8 +167,9 @@ impl RemoteConsoleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/remote_console/create_28.rs b/cli-cmd/compute/src/v2/server/remote_console/create_28.rs index ef8d3e9c8..e03b2f7e4 100644 --- a/cli-cmd/compute/src/v2/server/remote_console/create_28.rs +++ b/cli-cmd/compute/src/v2/server/remote_console/create_28.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::remote_console::create_28; -use openstack_types::compute::v2::server::remote_console::response::create::RemoteConsoleResponse; +use openstack_types::compute::v2::server::remote_console::response; /// The API provides a unified request for creating a remote console. The user /// can get a URL to connect the console from this API. The URL includes the @@ -171,8 +171,9 @@ impl RemoteConsoleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/remote_console/create_299.rs b/cli-cmd/compute/src/v2/server/remote_console/create_299.rs index fae3795c5..b890b436d 100644 --- a/cli-cmd/compute/src/v2/server/remote_console/create_299.rs +++ b/cli-cmd/compute/src/v2/server/remote_console/create_299.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::remote_console::create_299; -use openstack_types::compute::v2::server::remote_console::response::create::RemoteConsoleResponse; +use openstack_types::compute::v2::server::remote_console::response; /// The API provides a unified request for creating a remote console. The user /// can get a URL to connect the console from this API. The URL includes the @@ -173,8 +173,9 @@ impl RemoteConsoleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/remove_fixed_ip.rs b/cli-cmd/compute/src/v2/server/remove_fixed_ip.rs new file mode 100644 index 000000000..1311dc085 --- /dev/null +++ b/cli-cmd/compute/src/v2/server/remove_fixed_ip.rs @@ -0,0 +1,126 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +//! Action Server command +//! +//! Wraps invoking of the `v2.1/servers/{id}/action` with `POST` method + +use clap::Args; +use eyre::{OptionExt, WrapErr}; +use tracing::info; + +use openstack_cli_core::cli::CliArgs; +use openstack_cli_core::error::OpenStackCliError; +use openstack_cli_core::output::OutputProcessor; +use openstack_sdk::AsyncOpenStack; + +use openstack_sdk::api::QueryAsync; +use openstack_sdk::api::compute::v2::server::remove_fixed_ip; + +/// Removes, or disassociates, a fixed IP address from a server. +/// +/// Specify the `removeFixedIp` action in the request body. +/// +/// Policy defaults enable only users with the administrative role or the owner +/// of the server to perform this operation. Cloud providers can change these +/// permissions through the `policy.yaml` file. +/// +/// Normal response codes: 202 +/// +/// Error response codes: badRequest(400), unauthorized(401), forbidden(403), +/// itemNotFound(404) +#[derive(Args)] +#[command(about = "Remove (Disassociate) Fixed Ip (removeFixedIp Action) (DEPRECATED)")] +pub struct ServerCommand { + /// Request Query parameters + #[command(flatten)] + query: QueryParameters, + + /// Path parameters + #[command(flatten)] + path: PathParameters, + + /// The action to remove a fixed ip address from a server. + #[command(flatten)] + remove_fixed_ip: RemoveFixedIp, +} + +/// Query parameters +#[derive(Args)] +struct QueryParameters {} + +/// Path parameters +#[derive(Args)] +struct PathParameters { + /// id parameter for /v2.1/servers/{id}/action API + #[arg( + help_heading = "Path parameters", + id = "path_param_id", + value_name = "ID" + )] + id: String, +} +/// RemoveFixedIp Body data +#[derive(Args, Clone)] +struct RemoveFixedIp { + /// The IP address. + #[arg(help_heading = "Body parameters", long)] + address: String, +} + +impl ServerCommand { + /// Perform command action + pub async fn take_action( + &self, + parsed_args: &C, + client: &mut AsyncOpenStack, + ) -> Result<(), OpenStackCliError> { + info!("Action Server"); + + let op = OutputProcessor::from_args( + parsed_args, + Some("compute.server"), + Some("remove_fixed_ip"), + ); + op.validate_args(parsed_args)?; + + let mut ep_builder = remove_fixed_ip::Request::builder(); + + ep_builder.id(&self.path.id); + + // Set body parameters + // Set Request.remove_fixed_ip data + let args = &self.remove_fixed_ip; + let mut remove_fixed_ip_builder = remove_fixed_ip::RemoveFixedIpBuilder::default(); + + remove_fixed_ip_builder.address(&args.address); + + ep_builder.remove_fixed_ip( + remove_fixed_ip_builder + .build() + .wrap_err("error preparing the request data")?, + ); + + let ep = ep_builder + .build() + .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; + openstack_sdk::api::ignore(ep).query_async(client).await?; + // Show command specific hints + op.show_command_hint()?; + Ok(()) + } +} diff --git a/cli-cmd/compute/src/v2/server/remove_floating_ip.rs b/cli-cmd/compute/src/v2/server/remove_floating_ip.rs new file mode 100644 index 000000000..7ba68110f --- /dev/null +++ b/cli-cmd/compute/src/v2/server/remove_floating_ip.rs @@ -0,0 +1,128 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +//! Action Server command +//! +//! Wraps invoking of the `v2.1/servers/{id}/action` with `POST` method + +use clap::Args; +use eyre::{OptionExt, WrapErr}; +use tracing::info; + +use openstack_cli_core::cli::CliArgs; +use openstack_cli_core::error::OpenStackCliError; +use openstack_cli_core::output::OutputProcessor; +use openstack_sdk::AsyncOpenStack; + +use openstack_sdk::api::QueryAsync; +use openstack_sdk::api::compute::v2::server::remove_floating_ip; + +/// Removes, or disassociates, a floating IP address from a server. +/// +/// The IP address is returned to the pool of IP addresses that is available +/// for all projects. When you remove a floating IP address and that IP address +/// is still associated with a running instance, it is automatically +/// disassociated from that instance. +/// +/// Specify the `removeFloatingIp` action in the request body. +/// +/// Normal response codes: 202 +/// +/// Error response codes: badRequest(400), unauthorized(401), forbidden(403), +/// itemNotFound(404), conflict(409) +#[derive(Args)] +#[command(about = "Remove (Disassociate) Floating Ip (removeFloatingIp Action) (DEPRECATED)")] +pub struct ServerCommand { + /// Request Query parameters + #[command(flatten)] + query: QueryParameters, + + /// Path parameters + #[command(flatten)] + path: PathParameters, + + /// The action to remove or disassociate a floating IP address from the + /// server. + #[command(flatten)] + remove_floating_ip: RemoveFloatingIp, +} + +/// Query parameters +#[derive(Args)] +struct QueryParameters {} + +/// Path parameters +#[derive(Args)] +struct PathParameters { + /// id parameter for /v2.1/servers/{id}/action API + #[arg( + help_heading = "Path parameters", + id = "path_param_id", + value_name = "ID" + )] + id: String, +} +/// RemoveFloatingIp Body data +#[derive(Args, Clone)] +struct RemoveFloatingIp { + /// The floating IP address. + #[arg(help_heading = "Body parameters", long)] + address: String, +} + +impl ServerCommand { + /// Perform command action + pub async fn take_action( + &self, + parsed_args: &C, + client: &mut AsyncOpenStack, + ) -> Result<(), OpenStackCliError> { + info!("Action Server"); + + let op = OutputProcessor::from_args( + parsed_args, + Some("compute.server"), + Some("remove_floating_ip"), + ); + op.validate_args(parsed_args)?; + + let mut ep_builder = remove_floating_ip::Request::builder(); + + ep_builder.id(&self.path.id); + + // Set body parameters + // Set Request.remove_floating_ip data + let args = &self.remove_floating_ip; + let mut remove_floating_ip_builder = remove_floating_ip::RemoveFloatingIpBuilder::default(); + + remove_floating_ip_builder.address(&args.address); + + ep_builder.remove_floating_ip( + remove_floating_ip_builder + .build() + .wrap_err("error preparing the request data")?, + ); + + let ep = ep_builder + .build() + .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; + openstack_sdk::api::ignore(ep).query_async(client).await?; + // Show command specific hints + op.show_command_hint()?; + Ok(()) + } +} diff --git a/cli-cmd/compute/src/v2/server/rescue.rs b/cli-cmd/compute/src/v2/server/rescue.rs index 673a0bc5f..007f49056 100644 --- a/cli-cmd/compute/src/v2/server/rescue.rs +++ b/cli-cmd/compute/src/v2/server/rescue.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::rescue; -use openstack_types::compute::v2::server::response::rescue::ServerResponse; +use openstack_types::compute::v2::server::response; /// Puts a server in rescue mode and changes its status to `RESCUE`. /// @@ -127,8 +127,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/security_group/list.rs b/cli-cmd/compute/src/v2/server/security_group/list.rs index 147ca884b..0e16b5abf 100644 --- a/cli-cmd/compute/src/v2/server/security_group/list.rs +++ b/cli-cmd/compute/src/v2/server/security_group/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::security_group::list; -use openstack_types::compute::v2::server::security_group::response::list::SecurityGroupResponse; +use openstack_types::compute::v2::server::security_group::response; /// Lists security groups for a server. /// @@ -90,7 +90,8 @@ impl SecurityGroupsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/server_password/get.rs b/cli-cmd/compute/src/v2/server/server_password/get.rs index fac666742..1900a50b9 100644 --- a/cli-cmd/compute/src/v2/server/server_password/get.rs +++ b/cli-cmd/compute/src/v2/server/server_password/get.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::server_password::get; -use openstack_types::compute::v2::server::server_password::response::get::ServerPasswordResponse; +use openstack_types::compute::v2::server::server_password::response; /// Shows the administrative password for a server. /// @@ -100,8 +100,9 @@ impl ServerPasswordCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/set_20.rs b/cli-cmd/compute/src/v2/server/set_20.rs index ad3d0ec1d..e3963d402 100644 --- a/cli-cmd/compute/src/v2/server/set_20.rs +++ b/cli-cmd/compute/src/v2/server/set_20.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::find; use openstack_sdk::api::compute::v2::server::set_20; use openstack_sdk::api::find; -use openstack_types::compute::v2::server::response::set::ServerResponse; +use openstack_types::compute::v2::server::response; /// Updates the editable attributes of an existing server. /// @@ -185,8 +185,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/set_21.rs b/cli-cmd/compute/src/v2/server/set_21.rs index 82f807c44..910c9645e 100644 --- a/cli-cmd/compute/src/v2/server/set_21.rs +++ b/cli-cmd/compute/src/v2/server/set_21.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::find; use openstack_sdk::api::compute::v2::server::set_21; use openstack_sdk::api::find; -use openstack_types::compute::v2::server::response::set::ServerResponse; +use openstack_types::compute::v2::server::response; /// Updates the editable attributes of an existing server. /// @@ -185,8 +185,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/set_219.rs b/cli-cmd/compute/src/v2/server/set_219.rs index edf58f996..cb089abbf 100644 --- a/cli-cmd/compute/src/v2/server/set_219.rs +++ b/cli-cmd/compute/src/v2/server/set_219.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::find; use openstack_sdk::api::compute::v2::server::set_219; use openstack_sdk::api::find; -use openstack_types::compute::v2::server::response::set::ServerResponse; +use openstack_types::compute::v2::server::response; /// Updates the editable attributes of an existing server. /// @@ -202,8 +202,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/set_290.rs b/cli-cmd/compute/src/v2/server/set_290.rs index 4d2efe218..39bba4159 100644 --- a/cli-cmd/compute/src/v2/server/set_290.rs +++ b/cli-cmd/compute/src/v2/server/set_290.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::find; use openstack_sdk::api::compute::v2::server::set_290; use openstack_sdk::api::find; -use openstack_types::compute::v2::server::response::set::ServerResponse; +use openstack_types::compute::v2::server::response; /// Updates the editable attributes of an existing server. /// @@ -221,8 +221,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/set_294.rs b/cli-cmd/compute/src/v2/server/set_294.rs index b15896e7c..8dfd0bc05 100644 --- a/cli-cmd/compute/src/v2/server/set_294.rs +++ b/cli-cmd/compute/src/v2/server/set_294.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::find; use openstack_sdk::api::compute::v2::server::set_294; use openstack_sdk::api::find; -use openstack_types::compute::v2::server::response::set::ServerResponse; +use openstack_types::compute::v2::server::response; /// Updates the editable attributes of an existing server. /// @@ -221,8 +221,9 @@ impl ServerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/share/create_297.rs b/cli-cmd/compute/src/v2/server/share/create_297.rs index 27bd98ec5..162c099dd 100644 --- a/cli-cmd/compute/src/v2/server/share/create_297.rs +++ b/cli-cmd/compute/src/v2/server/share/create_297.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::share::create_297; -use openstack_types::compute::v2::server::share::response::create::ShareResponse; +use openstack_types::compute::v2::server::share::response; /// Attach a share to an instance. /// @@ -124,8 +124,9 @@ impl ShareCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/share/list.rs b/cli-cmd/compute/src/v2/server/share/list.rs index 2312315a2..90ed9c188 100644 --- a/cli-cmd/compute/src/v2/server/share/list.rs +++ b/cli-cmd/compute/src/v2/server/share/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::share::list; -use openstack_types::compute::v2::server::share::response::list::ShareResponse; +use openstack_types::compute::v2::server::share::response; /// List share attachments for an instance. /// @@ -87,7 +87,8 @@ impl SharesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/share/show.rs b/cli-cmd/compute/src/v2/server/share/show.rs index caa43fab2..bd09ecd30 100644 --- a/cli-cmd/compute/src/v2/server/share/show.rs +++ b/cli-cmd/compute/src/v2/server/share/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::share::get; -use openstack_types::compute::v2::server::share::response::get::ShareResponse; +use openstack_types::compute::v2::server::share::response; /// Show a detail of a share attachment. /// @@ -95,8 +95,9 @@ impl ShareCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/show.rs b/cli-cmd/compute/src/v2/server/show.rs index 1e038da54..0a79fdac8 100644 --- a/cli-cmd/compute/src/v2/server/show.rs +++ b/cli-cmd/compute/src/v2/server/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::find; use openstack_sdk::api::find; -use openstack_types::compute::v2::server::response::get::ServerResponse; +use openstack_types::compute::v2::server::response; /// Shows details for a server. /// @@ -101,7 +101,34 @@ impl ServerCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone()) + .or_else(|_| { + op.output_single::(find_data.clone()) + }) + .or_else(|_| { + op.output_single::(find_data.clone()) + }) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| op.output_single::(find_data.clone())) + .or_else(|_| { + op.output_single::(find_data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/tag/list.rs b/cli-cmd/compute/src/v2/server/tag/list.rs index 13de58b03..6d51bdd91 100644 --- a/cli-cmd/compute/src/v2/server/tag/list.rs +++ b/cli-cmd/compute/src/v2/server/tag/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::tag::list; -use openstack_types::compute::v2::server::tag::response::list::TagResponse; +use openstack_types::compute::v2::server::tag::response; /// Lists all tags for a server. /// @@ -85,7 +85,8 @@ impl TagsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/tag/replace_226.rs b/cli-cmd/compute/src/v2/server/tag/replace_226.rs index b56d98f9f..cca3618d8 100644 --- a/cli-cmd/compute/src/v2/server/tag/replace_226.rs +++ b/cli-cmd/compute/src/v2/server/tag/replace_226.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::tag::replace_226; -use openstack_types::compute::v2::server::tag::response::replace::TagResponse; +use openstack_types::compute::v2::server::tag::response; /// Replaces all tags on specified server with the new set of tags. /// @@ -102,7 +102,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/topology/list.rs b/cli-cmd/compute/src/v2/server/topology/list.rs index 15cfbb518..14f350caf 100644 --- a/cli-cmd/compute/src/v2/server/topology/list.rs +++ b/cli-cmd/compute/src/v2/server/topology/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::topology::list; -use openstack_types::compute::v2::server::topology::response::list::TopologyResponse; +use openstack_types::compute::v2::server::topology::response; /// Shows NUMA topology information for a server. /// @@ -90,7 +90,8 @@ impl TopologiesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/trigger_crash_dump.rs b/cli-cmd/compute/src/v2/server/trigger_crash_dump.rs new file mode 100644 index 000000000..164d4e0ef --- /dev/null +++ b/cli-cmd/compute/src/v2/server/trigger_crash_dump.rs @@ -0,0 +1,90 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +//! Action Server command +//! +//! Wraps invoking of the `v2.1/servers/{id}/action` with `POST` method + +use clap::Args; +use eyre::{OptionExt, WrapErr}; +use tracing::info; + +use openstack_cli_core::cli::CliArgs; +use openstack_cli_core::error::OpenStackCliError; +use openstack_cli_core::output::OutputProcessor; +use openstack_sdk::AsyncOpenStack; + +use openstack_sdk::api::QueryAsync; +use openstack_sdk::api::compute::v2::server::trigger_crash_dump; + +/// Command without description in OpenAPI +#[derive(Args)] +pub struct ServerCommand { + /// Request Query parameters + #[command(flatten)] + query: QueryParameters, + + /// Path parameters + #[command(flatten)] + path: PathParameters, +} + +/// Query parameters +#[derive(Args)] +struct QueryParameters {} + +/// Path parameters +#[derive(Args)] +struct PathParameters { + /// id parameter for /v2.1/servers/{id}/action API + #[arg( + help_heading = "Path parameters", + id = "path_param_id", + value_name = "ID" + )] + id: String, +} + +impl ServerCommand { + /// Perform command action + pub async fn take_action( + &self, + parsed_args: &C, + client: &mut AsyncOpenStack, + ) -> Result<(), OpenStackCliError> { + info!("Action Server"); + + let op = OutputProcessor::from_args( + parsed_args, + Some("compute.server"), + Some("trigger_crash_dump"), + ); + op.validate_args(parsed_args)?; + + let mut ep_builder = trigger_crash_dump::Request::builder(); + + ep_builder.id(&self.path.id); + + let ep = ep_builder + .build() + .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; + openstack_sdk::api::ignore(ep).query_async(client).await?; + // Show command specific hints + op.show_command_hint()?; + Ok(()) + } +} diff --git a/cli-cmd/compute/src/v2/server/volume_attachment/create_20.rs b/cli-cmd/compute/src/v2/server/volume_attachment/create_20.rs index f726717eb..9bf978f6e 100644 --- a/cli-cmd/compute/src/v2/server/volume_attachment/create_20.rs +++ b/cli-cmd/compute/src/v2/server/volume_attachment/create_20.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::volume_attachment::create_20; -use openstack_types::compute::v2::server::volume_attachment::response::create::VolumeAttachmentResponse; +use openstack_types::compute::v2::server::volume_attachment::response; /// Attach a volume to an instance. /// @@ -139,8 +139,9 @@ impl VolumeAttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/volume_attachment/create_249.rs b/cli-cmd/compute/src/v2/server/volume_attachment/create_249.rs index c376ed138..ecf04f851 100644 --- a/cli-cmd/compute/src/v2/server/volume_attachment/create_249.rs +++ b/cli-cmd/compute/src/v2/server/volume_attachment/create_249.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::volume_attachment::create_249; -use openstack_types::compute::v2::server::volume_attachment::response::create::VolumeAttachmentResponse; +use openstack_types::compute::v2::server::volume_attachment::response; /// Attach a volume to an instance. /// @@ -157,8 +157,9 @@ impl VolumeAttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/volume_attachment/create_279.rs b/cli-cmd/compute/src/v2/server/volume_attachment/create_279.rs index 15a93f522..31cdf588c 100644 --- a/cli-cmd/compute/src/v2/server/volume_attachment/create_279.rs +++ b/cli-cmd/compute/src/v2/server/volume_attachment/create_279.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::volume_attachment::create_279; -use openstack_types::compute::v2::server::volume_attachment::response::create::VolumeAttachmentResponse; +use openstack_types::compute::v2::server::volume_attachment::response; /// Attach a volume to an instance. /// @@ -168,8 +168,9 @@ impl VolumeAttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/volume_attachment/list.rs b/cli-cmd/compute/src/v2/server/volume_attachment/list.rs index 78b496910..dd0dc0898 100644 --- a/cli-cmd/compute/src/v2/server/volume_attachment/list.rs +++ b/cli-cmd/compute/src/v2/server/volume_attachment/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::volume_attachment::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::compute::v2::server::volume_attachment::response::list::VolumeAttachmentResponse; +use openstack_types::compute::v2::server::volume_attachment::response; /// List volume attachments for an instance. /// @@ -118,7 +118,17 @@ impl VolumeAttachmentsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + }) + .or_else(|_| { + op.output_list::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server/volume_attachment/set_20.rs b/cli-cmd/compute/src/v2/server/volume_attachment/set_20.rs index cba205b15..464a11b07 100644 --- a/cli-cmd/compute/src/v2/server/volume_attachment/set_20.rs +++ b/cli-cmd/compute/src/v2/server/volume_attachment/set_20.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::volume_attachment::set_20; -use openstack_types::compute::v2::server::volume_attachment::response::set::VolumeAttachmentResponse; +use openstack_types::compute::v2::server::volume_attachment::response; /// Update a volume attachment. /// @@ -136,8 +136,9 @@ impl VolumeAttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/volume_attachment/set_285.rs b/cli-cmd/compute/src/v2/server/volume_attachment/set_285.rs index 12b28e1ed..22483b5be 100644 --- a/cli-cmd/compute/src/v2/server/volume_attachment/set_285.rs +++ b/cli-cmd/compute/src/v2/server/volume_attachment/set_285.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::volume_attachment::set_285; -use openstack_types::compute::v2::server::volume_attachment::response::set::VolumeAttachmentResponse; +use openstack_types::compute::v2::server::volume_attachment::response; /// Update a volume attachment. /// @@ -192,8 +192,9 @@ impl VolumeAttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server/volume_attachment/show.rs b/cli-cmd/compute/src/v2/server/volume_attachment/show.rs index 61ec7d1e3..3fcb4c601 100644 --- a/cli-cmd/compute/src/v2/server/volume_attachment/show.rs +++ b/cli-cmd/compute/src/v2/server/volume_attachment/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server::volume_attachment::get; -use openstack_types::compute::v2::server::volume_attachment::response::get::VolumeAttachmentResponse; +use openstack_types::compute::v2::server::volume_attachment::response; /// Show a detail of a volume attachment. /// @@ -99,8 +99,18 @@ impl VolumeAttachmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| { + op.output_single::(data.clone()) + }) + .or_else(|_| { + op.output_single::(data.clone()) + }) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server_external_event/create_20.rs b/cli-cmd/compute/src/v2/server_external_event/create_20.rs index 9eff14ce3..80f7d7b42 100644 --- a/cli-cmd/compute/src/v2/server_external_event/create_20.rs +++ b/cli-cmd/compute/src/v2/server_external_event/create_20.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_external_event::create_20; -use openstack_types::compute::v2::server_external_event::response::create::ServerExternalEventResponse; +use openstack_types::compute::v2::server_external_event::response; use serde_json::Value; /// Creates one or more external events, which the API dispatches to the host a @@ -108,8 +108,9 @@ impl ServerExternalEventCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server_external_event/create_251.rs b/cli-cmd/compute/src/v2/server_external_event/create_251.rs index be4618d1b..100f70219 100644 --- a/cli-cmd/compute/src/v2/server_external_event/create_251.rs +++ b/cli-cmd/compute/src/v2/server_external_event/create_251.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_external_event::create_251; -use openstack_types::compute::v2::server_external_event::response::create::ServerExternalEventResponse; +use openstack_types::compute::v2::server_external_event::response; use serde_json::Value; /// Creates one or more external events, which the API dispatches to the host a @@ -108,8 +108,9 @@ impl ServerExternalEventCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server_external_event/create_276.rs b/cli-cmd/compute/src/v2/server_external_event/create_276.rs index f4df45bd7..74cd67041 100644 --- a/cli-cmd/compute/src/v2/server_external_event/create_276.rs +++ b/cli-cmd/compute/src/v2/server_external_event/create_276.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_external_event::create_276; -use openstack_types::compute::v2::server_external_event::response::create::ServerExternalEventResponse; +use openstack_types::compute::v2::server_external_event::response; use serde_json::Value; /// Creates one or more external events, which the API dispatches to the host a @@ -108,8 +108,9 @@ impl ServerExternalEventCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server_external_event/create_282.rs b/cli-cmd/compute/src/v2/server_external_event/create_282.rs index edcdd5db5..da76f1c34 100644 --- a/cli-cmd/compute/src/v2/server_external_event/create_282.rs +++ b/cli-cmd/compute/src/v2/server_external_event/create_282.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_external_event::create_282; -use openstack_types::compute::v2::server_external_event::response::create::ServerExternalEventResponse; +use openstack_types::compute::v2::server_external_event::response; use serde_json::Value; /// Creates one or more external events, which the API dispatches to the host a @@ -108,8 +108,9 @@ impl ServerExternalEventCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server_external_event/create_293.rs b/cli-cmd/compute/src/v2/server_external_event/create_293.rs index b3b8b0f31..169c75412 100644 --- a/cli-cmd/compute/src/v2/server_external_event/create_293.rs +++ b/cli-cmd/compute/src/v2/server_external_event/create_293.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_external_event::create_293; -use openstack_types::compute::v2::server_external_event::response::create::ServerExternalEventResponse; +use openstack_types::compute::v2::server_external_event::response; use serde_json::Value; /// Creates one or more external events, which the API dispatches to the host a @@ -108,8 +108,9 @@ impl ServerExternalEventCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server_group/create_20.rs b/cli-cmd/compute/src/v2/server_group/create_20.rs index 6b4669c79..4097ff86a 100644 --- a/cli-cmd/compute/src/v2/server_group/create_20.rs +++ b/cli-cmd/compute/src/v2/server_group/create_20.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_group::create_20; -use openstack_types::compute::v2::server_group::response::create::ServerGroupResponse; /// Creates a server group. /// @@ -144,9 +143,7 @@ impl ServerGroupCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server_group/create_215.rs b/cli-cmd/compute/src/v2/server_group/create_215.rs index 5bdcb62b8..6c92000e5 100644 --- a/cli-cmd/compute/src/v2/server_group/create_215.rs +++ b/cli-cmd/compute/src/v2/server_group/create_215.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_group::create_215; -use openstack_types::compute::v2::server_group::response::create::ServerGroupResponse; +use openstack_types::compute::v2::server_group::response; /// Creates a server group. /// @@ -149,8 +149,9 @@ impl ServerGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server_group/create_264.rs b/cli-cmd/compute/src/v2/server_group/create_264.rs index 19466d433..85e99db2b 100644 --- a/cli-cmd/compute/src/v2/server_group/create_264.rs +++ b/cli-cmd/compute/src/v2/server_group/create_264.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_group::create_264; -use openstack_types::compute::v2::server_group::response::create::ServerGroupResponse; +use openstack_types::compute::v2::server_group::response; /// Creates a server group. /// @@ -173,8 +173,9 @@ impl ServerGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/server_group/list.rs b/cli-cmd/compute/src/v2/server_group/list.rs index 87b0f2246..91a709ce5 100644 --- a/cli-cmd/compute/src/v2/server_group/list.rs +++ b/cli-cmd/compute/src/v2/server_group/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_group::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::compute::v2::server_group::response::list::ServerGroupResponse; +use openstack_types::compute::v2::server_group::response; /// Lists all server groups for the tenant. /// @@ -114,7 +114,11 @@ impl ServerGroupsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| op.output_list::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/server_group/show.rs b/cli-cmd/compute/src/v2/server_group/show.rs index aaaa109fa..aa46b585c 100644 --- a/cli-cmd/compute/src/v2/server_group/show.rs +++ b/cli-cmd/compute/src/v2/server_group/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::server_group::find; use openstack_sdk::api::find; -use openstack_types::compute::v2::server_group::response::get::ServerGroupResponse; +use openstack_types::compute::v2::server_group::response; /// Shows details for a server group. /// @@ -87,7 +87,16 @@ impl ServerGroupCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone()) + .or_else(|_| { + op.output_single::(find_data.clone()) + }) + .or_else(|_| { + op.output_single::(find_data.clone()) + }) + .or_else(|_| { + op.output_single::(find_data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/service/list.rs b/cli-cmd/compute/src/v2/service/list.rs index 69206590b..ce1d4d49a 100644 --- a/cli-cmd/compute/src/v2/service/list.rs +++ b/cli-cmd/compute/src/v2/service/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::service::list; -use openstack_types::compute::v2::service::response::list::ServiceResponse; +use openstack_types::compute::v2::service::response; /// Lists all running Compute services. /// @@ -91,7 +91,11 @@ impl ServicesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| op.output_list::(data.clone())) + .or_else(|_| op.output_list::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/service/set_20.rs b/cli-cmd/compute/src/v2/service/set_20.rs index ea889f596..d427831fd 100644 --- a/cli-cmd/compute/src/v2/service/set_20.rs +++ b/cli-cmd/compute/src/v2/service/set_20.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::service::set_20; -use openstack_types::compute::v2::service::response::set::ServiceResponse; +use openstack_types::compute::v2::service::response; /// Update a compute service to enable or disable scheduling, including /// recording a reason why a compute service was disabled from scheduling. Set @@ -118,8 +118,10 @@ impl ServiceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/service/set_211.rs b/cli-cmd/compute/src/v2/service/set_211.rs index dcf48a9cd..a4253e9bf 100644 --- a/cli-cmd/compute/src/v2/service/set_211.rs +++ b/cli-cmd/compute/src/v2/service/set_211.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::service::set_211; -use openstack_types::compute::v2::service::response::set::ServiceResponse; +use openstack_types::compute::v2::service::response; /// Update a compute service to enable or disable scheduling, including /// recording a reason why a compute service was disabled from scheduling. Set @@ -136,8 +136,10 @@ impl ServiceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/service/set_253.rs b/cli-cmd/compute/src/v2/service/set_253.rs index 9773edff6..73cd64d96 100644 --- a/cli-cmd/compute/src/v2/service/set_253.rs +++ b/cli-cmd/compute/src/v2/service/set_253.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::service::set_253; -use openstack_types::compute::v2::service::response::set::ServiceResponse; +use openstack_types::compute::v2::service::response; /// Update a compute service to enable or disable scheduling, including /// recording a reason why a compute service was disabled from scheduling. Set @@ -144,8 +144,9 @@ impl ServiceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/simple_tenant_usage/list.rs b/cli-cmd/compute/src/v2/simple_tenant_usage/list.rs index 401da456d..c8be01928 100644 --- a/cli-cmd/compute/src/v2/simple_tenant_usage/list.rs +++ b/cli-cmd/compute/src/v2/simple_tenant_usage/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::simple_tenant_usage::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::compute::v2::simple_tenant_usage::response::list::SimpleTenantUsageResponse; +use openstack_types::compute::v2::simple_tenant_usage::response; /// Lists usage statistics for all tenants. /// @@ -129,7 +129,11 @@ impl SimpleTenantUsagesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone()) + .or_else(|_| { + op.output_list::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/simple_tenant_usage/show.rs b/cli-cmd/compute/src/v2/simple_tenant_usage/show.rs index 83184e3c2..fbbdeaaf7 100644 --- a/cli-cmd/compute/src/v2/simple_tenant_usage/show.rs +++ b/cli-cmd/compute/src/v2/simple_tenant_usage/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::simple_tenant_usage::get; -use openstack_types::compute::v2::simple_tenant_usage::response::get::SimpleTenantUsageResponse; +use openstack_types::compute::v2::simple_tenant_usage::response; /// Shows usage statistics for a tenant. /// @@ -124,8 +124,18 @@ impl SimpleTenantUsageCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| { + op.output_single::(data.clone()) + }) + .or_else(|_| { + op.output_single::(data.clone()) + }) + .or_else(|_| { + op.output_single::(data.clone()) + })?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/compute/src/v2/version/get.rs b/cli-cmd/compute/src/v2/version/get.rs index c286a521c..25d5e9bb1 100644 --- a/cli-cmd/compute/src/v2/version/get.rs +++ b/cli-cmd/compute/src/v2/version/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::version::get; -use openstack_types::compute::v2::version::response::get::VersionResponse; +use openstack_types::compute::v2::version::response; /// This fetches all the information about all known major API versions in the /// deployment. Links to more specific information will be provided for each @@ -76,8 +76,9 @@ impl VersionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/version/show.rs b/cli-cmd/compute/src/v2/version/show.rs index e6f6eb31b..c3b347190 100644 --- a/cli-cmd/compute/src/v2/version/show.rs +++ b/cli-cmd/compute/src/v2/version/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::compute::v2::version::get; -use openstack_types::compute::v2::version::response::get::VersionResponse; +use openstack_types::compute::v2::version::response; /// Command without description in OpenAPI #[derive(Args)] @@ -80,8 +80,9 @@ impl VersionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/certificate/create.rs b/cli-cmd/container-infrastructure-management/src/v1/certificate/create.rs index e909690c2..6dbc8a613 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/certificate/create.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/certificate/create.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::certificate::create; -use openstack_types::container_infrastructure_management::v1::certificate::response::create::CertificateResponse; +use openstack_types::container_infrastructure_management::v1::certificate::response; use serde_json::Value; /// Sign a new certificate by the CA. @@ -139,8 +139,9 @@ impl CertificateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/certificate/show.rs b/cli-cmd/container-infrastructure-management/src/v1/certificate/show.rs index d96437305..a2651042b 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/certificate/show.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/certificate/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::certificate::get; -use openstack_types::container_infrastructure_management::v1::certificate::response::get::CertificateResponse; +use openstack_types::container_infrastructure_management::v1::certificate::response; /// Show CA certificate details that are associated with the created cluster /// based on the given CA certificate type. @@ -85,8 +85,9 @@ impl CertificateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/cluster/action/resize/create.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/action/resize/create.rs index bdf94787a..a2ce78595 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/action/resize/create.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/action/resize/create.rs @@ -28,9 +28,9 @@ use openstack_cli_core::error::OpenStackCliError; use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; -use openstack_sdk::api::container_infrastructure_management::v1::cluster::action::resize::create; use openstack_sdk::api::QueryAsync; -use openstack_types::container_infrastructure_management::v1::cluster::action::resize::response::create::ResizeResponse; +use openstack_sdk::api::container_infrastructure_management::v1::cluster::action::resize::create; +use openstack_types::container_infrastructure_management::v1::cluster::action::resize::response; /// Command without description in OpenAPI #[derive(Args)] @@ -114,8 +114,9 @@ impl ResizeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/cluster/action/upgrade/create.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/action/upgrade/create.rs index d637a5865..5d7685c14 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/action/upgrade/create.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/action/upgrade/create.rs @@ -28,9 +28,9 @@ use openstack_cli_core::error::OpenStackCliError; use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; -use openstack_sdk::api::container_infrastructure_management::v1::cluster::action::upgrade::create; use openstack_sdk::api::QueryAsync; -use openstack_types::container_infrastructure_management::v1::cluster::action::upgrade::response::create::UpgradeResponse; +use openstack_sdk::api::container_infrastructure_management::v1::cluster::action::upgrade::create; +use openstack_types::container_infrastructure_management::v1::cluster::action::upgrade::response; /// Command without description in OpenAPI #[derive(Args)] @@ -115,8 +115,9 @@ impl UpgradeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/cluster/create.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/create.rs index a9f3a5d24..51e588a81 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/create.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/create.rs @@ -31,7 +31,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::cluster::create; -use openstack_types::container_infrastructure_management::v1::cluster::response::create::ClusterResponse; +use openstack_types::container_infrastructure_management::v1::cluster::response; use serde_json::Value; /// Create new cluster based on cluster template. @@ -493,8 +493,10 @@ impl ClusterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/cluster/list.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/list.rs index ec85fe29f..609f5f49e 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/list.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::cluster::list; -use openstack_types::container_infrastructure_management::v1::cluster::response::list::ClusterResponse; +use openstack_types::container_infrastructure_management::v1::cluster::response; /// List all clusters in Magnum. #[derive(Args)] @@ -75,7 +75,8 @@ impl ClustersCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/create.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/create.rs index b6fe9a50d..fa8e398b0 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/create.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/create.rs @@ -29,9 +29,9 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; -use openstack_sdk::api::container_infrastructure_management::v1::cluster::nodegroup::create; use openstack_sdk::api::QueryAsync; -use openstack_types::container_infrastructure_management::v1::cluster::nodegroup::response::create::NodegroupResponse; +use openstack_sdk::api::container_infrastructure_management::v1::cluster::nodegroup::create; +use openstack_types::container_infrastructure_management::v1::cluster::nodegroup::response; use serde_json::Value; /// Retrieve a list of nodegroups. @@ -356,8 +356,12 @@ impl NodegroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + let data: serde_json::Value = ep.query_async(client).await?; + + op.output_single::(data.clone()) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| op.output_single::(data.clone())) + .or_else(|_| op.output_single::(data.clone()))?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/list.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/list.rs index 3f03f1d9d..ad2084802 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/list.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::cluster::nodegroup::list; -use openstack_types::container_infrastructure_management::v1::cluster::nodegroup::response::list::NodegroupResponse; +use openstack_types::container_infrastructure_management::v1::cluster::nodegroup::response; /// Retrieve a list of nodegroups. /// @@ -81,7 +81,8 @@ impl NodegroupsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/set.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/set.rs index 59b391d5d..e778b751f 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/set.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::cluster::nodegroup::find; use openstack_sdk::api::container_infrastructure_management::v1::cluster::nodegroup::set; use openstack_sdk::api::find; -use openstack_types::container_infrastructure_management::v1::cluster::nodegroup::response::set::NodegroupResponse; +use openstack_types::container_infrastructure_management::v1::cluster::nodegroup::response; /// Update NodeGroup. /// @@ -142,8 +142,9 @@ impl NodegroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/cluster/nodegroup/show.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/show.rs index 457aff1a5..03ec73791 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/show.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/nodegroup/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::cluster::nodegroup::find; use openstack_sdk::api::find; -use openstack_types::container_infrastructure_management::v1::cluster::nodegroup::response::get::NodegroupResponse; +use openstack_types::container_infrastructure_management::v1::cluster::nodegroup::response; /// Retrieve information for the given nodegroup in a cluster. /// @@ -88,7 +88,7 @@ impl NodegroupCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/cluster/set.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/set.rs index a59b0e3b2..7efaa25e5 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/set.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::cluster::set; -use openstack_types::container_infrastructure_management::v1::cluster::response::set::ClusterResponse; +use openstack_types::container_infrastructure_management::v1::cluster::response; /// Update information of one cluster attributes using operations including: /// `add`, `replace` or `remove`. The attributes to `add` and `replace` in the @@ -126,8 +126,9 @@ impl ClusterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/cluster/show.rs b/cli-cmd/container-infrastructure-management/src/v1/cluster/show.rs index af91481fd..af4d39a77 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/cluster/show.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/cluster/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::cluster::get; -use openstack_types::container_infrastructure_management::v1::cluster::response::get::ClusterResponse; +use openstack_types::container_infrastructure_management::v1::cluster::response; /// Get all information of a cluster in Magnum. #[derive(Args)] @@ -84,8 +84,9 @@ impl ClusterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/clustertemplate/create.rs b/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/create.rs index 29764414f..bd005d1ca 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/create.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/create.rs @@ -31,7 +31,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::clustertemplate::create; -use openstack_types::container_infrastructure_management::v1::clustertemplate::response::create::ClustertemplateResponse; +use openstack_types::container_infrastructure_management::v1::clustertemplate::response; use serde_json::Value; /// Create new cluster template. @@ -485,8 +485,9 @@ impl ClustertemplateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/clustertemplate/list.rs b/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/list.rs index 79f0e54a9..7aadc13d1 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/list.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::clustertemplate::list; -use openstack_types::container_infrastructure_management::v1::clustertemplate::response::list::ClustertemplateResponse; +use openstack_types::container_infrastructure_management::v1::clustertemplate::response; /// List all available cluster templates in Magnum. #[derive(Args)] @@ -75,7 +75,8 @@ impl ClustertemplatesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/show.rs b/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/show.rs index 214cb22f7..5de830b62 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/show.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/clustertemplate/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::clustertemplate::get; -use openstack_types::container_infrastructure_management::v1::clustertemplate::response::get::ClustertemplateResponse; +use openstack_types::container_infrastructure_management::v1::clustertemplate::response; /// Get all information of a cluster template in Magnum. #[derive(Args)] @@ -85,8 +85,9 @@ impl ClustertemplateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/federation/create.rs b/cli-cmd/container-infrastructure-management/src/v1/federation/create.rs index d51570c55..cc4a314ea 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/federation/create.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/federation/create.rs @@ -31,7 +31,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::federation::create; -use openstack_types::container_infrastructure_management::v1::federation::response::create::FederationResponse; +use openstack_types::container_infrastructure_management::v1::federation::response; use serde_json::Value; /// Create a new federation. @@ -190,8 +190,9 @@ impl FederationCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/federation/list.rs b/cli-cmd/container-infrastructure-management/src/v1/federation/list.rs index 458606565..fa50c113a 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/federation/list.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/federation/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::federation::list; -use openstack_types::container_infrastructure_management::v1::federation::response::list::FederationResponse; +use openstack_types::container_infrastructure_management::v1::federation::response; /// Retrieve a list of federations. /// @@ -79,7 +79,8 @@ impl FederationsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/federation/show.rs b/cli-cmd/container-infrastructure-management/src/v1/federation/show.rs index 1766939ff..40cda8861 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/federation/show.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/federation/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::federation::get; -use openstack_types::container_infrastructure_management::v1::federation::response::get::FederationResponse; +use openstack_types::container_infrastructure_management::v1::federation::response; /// Retrieve information about a given Federation. /// @@ -86,8 +86,9 @@ impl FederationCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/mservice/list.rs b/cli-cmd/container-infrastructure-management/src/v1/mservice/list.rs index 0b614c680..44112e522 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/mservice/list.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/mservice/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::mservice::list; -use openstack_types::container_infrastructure_management::v1::mservice::response::list::MserviceResponse; +use openstack_types::container_infrastructure_management::v1::mservice::response; /// Enables administrative users to list all Magnum services. /// @@ -79,7 +79,8 @@ impl MservicesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/quota/create.rs b/cli-cmd/container-infrastructure-management/src/v1/quota/create.rs index c6df1faf0..4e74c6cbd 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/quota/create.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/quota/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::quota::create; -use openstack_types::container_infrastructure_management::v1::quota::response::create::QuotaResponse; +use openstack_types::container_infrastructure_management::v1::quota::response; /// Create new quota for a project. #[derive(Args)] @@ -132,8 +132,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/quota/list.rs b/cli-cmd/container-infrastructure-management/src/v1/quota/list.rs index 081a68db4..9fbe0c224 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/quota/list.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/quota/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::quota::list; -use openstack_types::container_infrastructure_management::v1::quota::response::list::QuotaResponse; +use openstack_types::container_infrastructure_management::v1::quota::response; /// List all quotas in Magnum. #[derive(Args)] @@ -75,7 +75,8 @@ impl QuotasCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/container-infrastructure-management/src/v1/quota/show.rs b/cli-cmd/container-infrastructure-management/src/v1/quota/show.rs index 6901467ae..93c64cae3 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/quota/show.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/quota/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::quota::get; -use openstack_types::container_infrastructure_management::v1::quota::response::get::QuotaResponse; +use openstack_types::container_infrastructure_management::v1::quota::response; /// Retrieve Quota information for the given project_id. /// @@ -86,8 +86,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/stat/get.rs b/cli-cmd/container-infrastructure-management/src/v1/stat/get.rs index 3233621b7..16ca6a63f 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/stat/get.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/stat/get.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::stat::get; -use openstack_types::container_infrastructure_management::v1::stat::response::get::StatResponse; +use openstack_types::container_infrastructure_management::v1::stat::response; /// Show overall Magnum system stats. If the requester is non-admin user show /// self stats. @@ -75,8 +75,9 @@ impl StatCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/container-infrastructure-management/src/v1/version/get.rs b/cli-cmd/container-infrastructure-management/src/v1/version/get.rs index 574e30fed..4d82babf2 100644 --- a/cli-cmd/container-infrastructure-management/src/v1/version/get.rs +++ b/cli-cmd/container-infrastructure-management/src/v1/version/get.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::container_infrastructure_management::v1::version::get; -use openstack_types::container_infrastructure_management::v1::version::response::get::VersionResponse; +use openstack_types::container_infrastructure_management::v1::version::response; /// Command without description in OpenAPI #[derive(Args)] @@ -74,7 +74,7 @@ impl VersionCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/blacklist/create.rs b/cli-cmd/dns/src/v2/blacklist/create.rs index 2e81734db..639f9b4f0 100644 --- a/cli-cmd/dns/src/v2/blacklist/create.rs +++ b/cli-cmd/dns/src/v2/blacklist/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::blacklist::create; -use openstack_types::dns::v2::blacklist::response::create::BlacklistResponse; use serde_json::Value; /// Create a Blacklist @@ -81,9 +80,7 @@ impl BlacklistCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/blacklist/list.rs b/cli-cmd/dns/src/v2/blacklist/list.rs index dd6636d8a..6940a998e 100644 --- a/cli-cmd/dns/src/v2/blacklist/list.rs +++ b/cli-cmd/dns/src/v2/blacklist/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::blacklist::list; -use openstack_types::dns::v2::blacklist::response::list::BlacklistResponse; /// List all blacklists #[derive(Args)] @@ -101,9 +100,7 @@ impl BlacklistsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/blacklist/set.rs b/cli-cmd/dns/src/v2/blacklist/set.rs index 89fe73cb9..534594d69 100644 --- a/cli-cmd/dns/src/v2/blacklist/set.rs +++ b/cli-cmd/dns/src/v2/blacklist/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::blacklist::set; -use openstack_types::dns::v2::blacklist::response::set::BlacklistResponse; use serde_json::Value; /// Update a Blacklist @@ -95,9 +94,7 @@ impl BlacklistCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/blacklist/show.rs b/cli-cmd/dns/src/v2/blacklist/show.rs index 41b32baad..0f3fe68c1 100644 --- a/cli-cmd/dns/src/v2/blacklist/show.rs +++ b/cli-cmd/dns/src/v2/blacklist/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::blacklist::get; -use openstack_types::dns::v2::blacklist::response::get::BlacklistResponse; /// Show a blacklist #[derive(Args)] @@ -110,9 +109,7 @@ impl BlacklistCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/limit/get.rs b/cli-cmd/dns/src/v2/limit/get.rs index 758823d05..600fb6a74 100644 --- a/cli-cmd/dns/src/v2/limit/get.rs +++ b/cli-cmd/dns/src/v2/limit/get.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::limit::get; -use openstack_types::dns::v2::limit::response::get::LimitResponse; +use openstack_types::dns::v2::limit::response; /// List project limits #[derive(Args)] @@ -101,8 +101,9 @@ impl LimitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/pool/create.rs b/cli-cmd/dns/src/v2/pool/create.rs index 79625ddfb..a10fbcefa 100644 --- a/cli-cmd/dns/src/v2/pool/create.rs +++ b/cli-cmd/dns/src/v2/pool/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::pool::create; -use openstack_types::dns::v2::pool::response::create::PoolResponse; use serde_json::Value; /// Create a Pool @@ -80,9 +79,7 @@ impl PoolCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/pool/list.rs b/cli-cmd/dns/src/v2/pool/list.rs index 0fe3958c1..910a2f461 100644 --- a/cli-cmd/dns/src/v2/pool/list.rs +++ b/cli-cmd/dns/src/v2/pool/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::pool::list; -use openstack_types::dns::v2::pool::response::list::PoolResponse; /// Get the list of Pools. #[derive(Args)] @@ -101,9 +100,7 @@ impl PoolsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/pool/set.rs b/cli-cmd/dns/src/v2/pool/set.rs index dec1a96c3..69192e4d9 100644 --- a/cli-cmd/dns/src/v2/pool/set.rs +++ b/cli-cmd/dns/src/v2/pool/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::pool::set; -use openstack_types::dns::v2::pool::response::set::PoolResponse; use serde_json::Value; /// Update the specific pool @@ -90,9 +89,7 @@ impl PoolCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/pool/show.rs b/cli-cmd/dns/src/v2/pool/show.rs index 606eba993..7f163e76f 100644 --- a/cli-cmd/dns/src/v2/pool/show.rs +++ b/cli-cmd/dns/src/v2/pool/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::pool::get; -use openstack_types::dns::v2::pool::response::get::PoolResponse; /// Get a specific Pool /// @@ -114,9 +113,7 @@ impl PoolCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/quota/set.rs b/cli-cmd/dns/src/v2/quota/set.rs index efd40897c..227255ef0 100644 --- a/cli-cmd/dns/src/v2/quota/set.rs +++ b/cli-cmd/dns/src/v2/quota/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::quota::set; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::dns::v2::quota::response::set::QuotaResponse; +use openstack_types::dns::v2::quota::response; use tracing::warn; /// Set a projects quotas @@ -189,8 +189,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/quota/show.rs b/cli-cmd/dns/src/v2/quota/show.rs index 908aef58c..633df7ad4 100644 --- a/cli-cmd/dns/src/v2/quota/show.rs +++ b/cli-cmd/dns/src/v2/quota/show.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::quota::get; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::dns::v2::quota::response::get::QuotaResponse; +use openstack_types::dns::v2::quota::response; use tracing::warn; /// View a projects quotas @@ -177,8 +177,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/recordset/list.rs b/cli-cmd/dns/src/v2/recordset/list.rs index ccc77e4ed..c370d0d91 100644 --- a/cli-cmd/dns/src/v2/recordset/list.rs +++ b/cli-cmd/dns/src/v2/recordset/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::recordset::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::dns::v2::recordset::response::list::RecordsetResponse; +use openstack_types::dns::v2::recordset::response; /// This lists all recordsets owned by a project in Designate #[derive(Args)] @@ -206,7 +206,8 @@ impl RecordsetsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/recordset/show.rs b/cli-cmd/dns/src/v2/recordset/show.rs index 5831dc014..a158e2dbf 100644 --- a/cli-cmd/dns/src/v2/recordset/show.rs +++ b/cli-cmd/dns/src/v2/recordset/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::recordset::get; -use openstack_types::dns::v2::recordset::response::get::RecordsetResponse; /// Get RecordSet #[derive(Args)] @@ -109,9 +108,7 @@ impl RecordsetCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/reverse/floatingip/list.rs b/cli-cmd/dns/src/v2/reverse/floatingip/list.rs index 6a3cb134b..5ea2b96e1 100644 --- a/cli-cmd/dns/src/v2/reverse/floatingip/list.rs +++ b/cli-cmd/dns/src/v2/reverse/floatingip/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::reverse::floatingip::list; -use openstack_types::dns::v2::reverse::floatingip::response::list::FloatingipResponse; +use openstack_types::dns::v2::reverse::floatingip::response; /// List FloatingIP PTR records #[derive(Args)] @@ -103,7 +103,8 @@ impl FloatingipsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/reverse/floatingip/set.rs b/cli-cmd/dns/src/v2/reverse/floatingip/set.rs index b5933a305..afd818337 100644 --- a/cli-cmd/dns/src/v2/reverse/floatingip/set.rs +++ b/cli-cmd/dns/src/v2/reverse/floatingip/set.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::reverse::floatingip::set; -use openstack_types::dns::v2::reverse::floatingip::response::set::FloatingipResponse; +use openstack_types::dns::v2::reverse::floatingip::response; /// Set a PTR record for the given FloatingIP. The domain if it does not exist /// will be provisioned automatically. @@ -119,8 +119,9 @@ impl FloatingipCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/reverse/floatingip/show.rs b/cli-cmd/dns/src/v2/reverse/floatingip/show.rs index b52ce016b..ef1726c65 100644 --- a/cli-cmd/dns/src/v2/reverse/floatingip/show.rs +++ b/cli-cmd/dns/src/v2/reverse/floatingip/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::reverse::floatingip::get; -use openstack_types::dns::v2::reverse::floatingip::response::get::FloatingipResponse; +use openstack_types::dns::v2::reverse::floatingip::response; /// Shows a particular FloatingIP PTR #[derive(Args)] @@ -111,8 +111,9 @@ impl FloatingipCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/service_status/list.rs b/cli-cmd/dns/src/v2/service_status/list.rs index d2e084011..13b1d3ce7 100644 --- a/cli-cmd/dns/src/v2/service_status/list.rs +++ b/cli-cmd/dns/src/v2/service_status/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::service_status::list; -use openstack_types::dns::v2::service_status::response::list::ServiceStatusResponse; /// List all Services and statuses. #[derive(Args)] @@ -101,9 +100,7 @@ impl ServiceStatusesCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/service_status/show.rs b/cli-cmd/dns/src/v2/service_status/show.rs index eee238ac9..27f7d6820 100644 --- a/cli-cmd/dns/src/v2/service_status/show.rs +++ b/cli-cmd/dns/src/v2/service_status/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::service_status::get; -use openstack_types::dns::v2::service_status::response::get::ServiceStatusResponse; /// Show the status of a service. #[derive(Args)] @@ -110,9 +109,7 @@ impl ServiceStatusCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/tld/create.rs b/cli-cmd/dns/src/v2/tld/create.rs index 101daeb54..0657d3fd5 100644 --- a/cli-cmd/dns/src/v2/tld/create.rs +++ b/cli-cmd/dns/src/v2/tld/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::tld::create; -use openstack_types::dns::v2::tld::response::create::TldResponse; use serde_json::Value; /// Create a tld @@ -81,9 +80,7 @@ impl TldCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/tld/list.rs b/cli-cmd/dns/src/v2/tld/list.rs index 00de7526d..f3a38743e 100644 --- a/cli-cmd/dns/src/v2/tld/list.rs +++ b/cli-cmd/dns/src/v2/tld/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::tld::list; -use openstack_types::dns::v2::tld::response::list::TldResponse; /// List the tlds associated with the Project #[derive(Args)] @@ -101,9 +100,7 @@ impl TldsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/tld/set.rs b/cli-cmd/dns/src/v2/tld/set.rs index d1e6596d4..66b228fe2 100644 --- a/cli-cmd/dns/src/v2/tld/set.rs +++ b/cli-cmd/dns/src/v2/tld/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::tld::set; -use openstack_types::dns::v2::tld::response::set::TldResponse; use serde_json::Value; /// Update a tld @@ -91,9 +90,7 @@ impl TldCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/tld/show.rs b/cli-cmd/dns/src/v2/tld/show.rs index 7fa4cb074..68a6cb82d 100644 --- a/cli-cmd/dns/src/v2/tld/show.rs +++ b/cli-cmd/dns/src/v2/tld/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::tld::get; -use openstack_types::dns::v2::tld::response::get::TldResponse; /// Show a tld #[derive(Args)] @@ -110,9 +109,7 @@ impl TldCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/tsigkey/create.rs b/cli-cmd/dns/src/v2/tsigkey/create.rs index 53611acb9..5c4d7e10e 100644 --- a/cli-cmd/dns/src/v2/tsigkey/create.rs +++ b/cli-cmd/dns/src/v2/tsigkey/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::tsigkey::create; -use openstack_types::dns::v2::tsigkey::response::create::TsigkeyResponse; use serde_json::Value; /// Create a new Tsigkey @@ -81,9 +80,7 @@ impl TsigkeyCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/tsigkey/list.rs b/cli-cmd/dns/src/v2/tsigkey/list.rs index 9b325e8c1..15272c68f 100644 --- a/cli-cmd/dns/src/v2/tsigkey/list.rs +++ b/cli-cmd/dns/src/v2/tsigkey/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::tsigkey::list; -use openstack_types::dns::v2::tsigkey::response::list::TsigkeyResponse; /// List all tsigkeys #[derive(Args)] @@ -101,9 +100,7 @@ impl TsigkeiesCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/tsigkey/set.rs b/cli-cmd/dns/src/v2/tsigkey/set.rs index 90db26787..d7f52064a 100644 --- a/cli-cmd/dns/src/v2/tsigkey/set.rs +++ b/cli-cmd/dns/src/v2/tsigkey/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::tsigkey::set; -use openstack_types::dns::v2::tsigkey::response::set::TsigkeyResponse; use serde_json::Value; /// Update the attribute(s) of an existing tsigkey @@ -91,9 +90,7 @@ impl TsigkeyCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/tsigkey/show.rs b/cli-cmd/dns/src/v2/tsigkey/show.rs index 5289f72a6..51ff7d2a1 100644 --- a/cli-cmd/dns/src/v2/tsigkey/show.rs +++ b/cli-cmd/dns/src/v2/tsigkey/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::tsigkey::get; -use openstack_types::dns::v2::tsigkey::response::get::TsigkeyResponse; /// Show a tsigkey #[derive(Args)] @@ -110,9 +109,7 @@ impl TsigkeyCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/create.rs b/cli-cmd/dns/src/v2/zone/create.rs index 4a03c0ac9..7d789c39f 100644 --- a/cli-cmd/dns/src/v2/zone/create.rs +++ b/cli-cmd/dns/src/v2/zone/create.rs @@ -31,7 +31,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::create; -use openstack_types::dns::v2::zone::response::create::ZoneResponse; +use openstack_types::dns::v2::zone::response; /// Create a zone #[derive(Args)] @@ -155,8 +155,9 @@ impl ZoneCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/list.rs b/cli-cmd/dns/src/v2/zone/list.rs index f65c475dc..3c90c3d87 100644 --- a/cli-cmd/dns/src/v2/zone/list.rs +++ b/cli-cmd/dns/src/v2/zone/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::dns::v2::zone::response::list::ZoneResponse; +use openstack_types::dns::v2::zone::response; /// List all zones #[derive(Args)] @@ -199,7 +199,8 @@ impl ZonesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/nameserver/list.rs b/cli-cmd/dns/src/v2/zone/nameserver/list.rs index 1e82d3106..71ded58af 100644 --- a/cli-cmd/dns/src/v2/zone/nameserver/list.rs +++ b/cli-cmd/dns/src/v2/zone/nameserver/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::nameserver::list; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::nameserver::response::list::NameserverResponse; +use openstack_types::dns::v2::zone::nameserver::response; use tracing::warn; /// Show the nameservers for a zone @@ -157,7 +157,8 @@ impl NameserversCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/recordset/create.rs b/cli-cmd/dns/src/v2/zone/recordset/create.rs index 3d789c0f5..8b312db06 100644 --- a/cli-cmd/dns/src/v2/zone/recordset/create.rs +++ b/cli-cmd/dns/src/v2/zone/recordset/create.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::recordset::create; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::recordset::response::create::RecordsetResponse; +use openstack_types::dns::v2::zone::recordset::response; use tracing::warn; /// Create a recordset in a zone @@ -212,8 +212,9 @@ impl RecordsetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/recordset/list.rs b/cli-cmd/dns/src/v2/zone/recordset/list.rs index d0efca3f7..9b8636893 100644 --- a/cli-cmd/dns/src/v2/zone/recordset/list.rs +++ b/cli-cmd/dns/src/v2/zone/recordset/list.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::recordset::list; use openstack_sdk::api::find_by_name; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::dns::v2::zone::recordset::response::list::RecordsetResponse; +use openstack_types::dns::v2::zone::recordset::response; use tracing::warn; /// This lists all recordsets in a zone @@ -254,7 +254,8 @@ impl RecordsetsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/recordset/set.rs b/cli-cmd/dns/src/v2/zone/recordset/set.rs index 8e65e5765..7197ca136 100644 --- a/cli-cmd/dns/src/v2/zone/recordset/set.rs +++ b/cli-cmd/dns/src/v2/zone/recordset/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::dns::v2::zone::recordset::find; use openstack_sdk::api::dns::v2::zone::recordset::set; use openstack_sdk::api::find; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::recordset::response::set::RecordsetResponse; +use openstack_types::dns::v2::zone::recordset::response; use tracing::warn; /// Update a recordset @@ -220,8 +220,9 @@ impl RecordsetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/recordset/show.rs b/cli-cmd/dns/src/v2/zone/recordset/show.rs index fda07f2f4..01015ff61 100644 --- a/cli-cmd/dns/src/v2/zone/recordset/show.rs +++ b/cli-cmd/dns/src/v2/zone/recordset/show.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::recordset::find; use openstack_sdk::api::find; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::recordset::response::get::RecordsetResponse; +use openstack_types::dns::v2::zone::recordset::response; use tracing::warn; /// Show an single recordset @@ -166,7 +166,7 @@ impl RecordsetCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/set.rs b/cli-cmd/dns/src/v2/zone/set.rs index 9acaa6a63..6508fe504 100644 --- a/cli-cmd/dns/src/v2/zone/set.rs +++ b/cli-cmd/dns/src/v2/zone/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find; use openstack_sdk::api::dns::v2::zone::set; use openstack_sdk::api::find; -use openstack_types::dns::v2::zone::response::set::ZoneResponse; +use openstack_types::dns::v2::zone::response; /// Update the attribute(s) for an existing zone. #[derive(Args)] @@ -124,8 +124,9 @@ impl ZoneCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/create.rs b/cli-cmd/dns/src/v2/zone/share/create.rs index fa45efbc3..1660e4610 100644 --- a/cli-cmd/dns/src/v2/zone/share/create.rs +++ b/cli-cmd/dns/src/v2/zone/share/create.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::share::create; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::share::response::create::ShareResponse; +use openstack_types::dns::v2::zone::share::response; use tracing::warn; /// Share a zone with another project. @@ -139,8 +139,9 @@ impl ShareCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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 03be43610..428563528 100644 --- a/cli-cmd/dns/src/v2/zone/share/list.rs +++ b/cli-cmd/dns/src/v2/zone/share/list.rs @@ -34,7 +34,7 @@ use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::share::list; use openstack_sdk::api::find_by_name; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::dns::v2::zone::share::response::list::ShareResponse; +use openstack_types::dns::v2::zone::share::response; use tracing::warn; /// List all zone shares. @@ -196,8 +196,9 @@ impl SharesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/show.rs b/cli-cmd/dns/src/v2/zone/share/show.rs index 37d32b200..7439cd5bd 100644 --- a/cli-cmd/dns/src/v2/zone/share/show.rs +++ b/cli-cmd/dns/src/v2/zone/share/show.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::share::get; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::share::response::get::ShareResponse; +use openstack_types::dns::v2::zone::share::response; use tracing::warn; /// Show a single zone share. @@ -170,8 +170,9 @@ impl ShareCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/show.rs b/cli-cmd/dns/src/v2/zone/show.rs index 30b563d95..0eb532cb0 100644 --- a/cli-cmd/dns/src/v2/zone/show.rs +++ b/cli-cmd/dns/src/v2/zone/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find; use openstack_sdk::api::find; -use openstack_types::dns::v2::zone::response::get::ZoneResponse; +use openstack_types::dns::v2::zone::response; /// Show a zone #[derive(Args)] @@ -110,7 +110,7 @@ impl ZoneCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/abandon.rs b/cli-cmd/dns/src/v2/zone/task/abandon.rs index 06fe82332..09a4a0b93 100644 --- a/cli-cmd/dns/src/v2/zone/task/abandon.rs +++ b/cli-cmd/dns/src/v2/zone/task/abandon.rs @@ -34,7 +34,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::task::abandon; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::task::response::abandon::TaskResponse; use serde_json::Value; use tracing::warn; @@ -137,9 +136,7 @@ impl TaskCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/export/create.rs b/cli-cmd/dns/src/v2/zone/task/export/create.rs index 68339b057..4d9b06ac4 100644 --- a/cli-cmd/dns/src/v2/zone/task/export/create.rs +++ b/cli-cmd/dns/src/v2/zone/task/export/create.rs @@ -34,7 +34,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::task::export::create; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::task::export::response::create::ExportResponse; use serde_json::Value; use tracing::warn; @@ -138,9 +137,7 @@ impl ExportCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/export/export/get.rs b/cli-cmd/dns/src/v2/zone/task/export/export/get.rs index c175d9861..3edf928bb 100644 --- a/cli-cmd/dns/src/v2/zone/task/export/export/get.rs +++ b/cli-cmd/dns/src/v2/zone/task/export/export/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::export::export::get; -use openstack_types::dns::v2::zone::task::export::export::response::get::ExportResponse; /// Command without description in OpenAPI #[derive(Args)] @@ -114,9 +113,7 @@ impl ExportCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/export/list.rs b/cli-cmd/dns/src/v2/zone/task/export/list.rs index aecd12c90..b91f6189b 100644 --- a/cli-cmd/dns/src/v2/zone/task/export/list.rs +++ b/cli-cmd/dns/src/v2/zone/task/export/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::export::list; -use openstack_types::dns::v2::zone::task::export::response::list::ExportResponse; /// Command without description in OpenAPI #[derive(Args)] @@ -102,9 +101,7 @@ impl ExportsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/export/show.rs b/cli-cmd/dns/src/v2/zone/task/export/show.rs index 5e48615e3..d4925afa6 100644 --- a/cli-cmd/dns/src/v2/zone/task/export/show.rs +++ b/cli-cmd/dns/src/v2/zone/task/export/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::export::get; -use openstack_types::dns::v2::zone::task::export::response::get::ExportResponse; /// Get Zone Exports #[derive(Args)] @@ -110,9 +109,7 @@ impl ExportCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/import/create.rs b/cli-cmd/dns/src/v2/zone/task/import/create.rs index ec4fed6d0..59b7ae469 100644 --- a/cli-cmd/dns/src/v2/zone/task/import/create.rs +++ b/cli-cmd/dns/src/v2/zone/task/import/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::import::create; -use openstack_types::dns::v2::zone::task::import::response::create::ImportResponse; use serde_json::Value; /// Import a zone. @@ -82,9 +81,7 @@ impl ImportCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/import/list.rs b/cli-cmd/dns/src/v2/zone/task/import/list.rs index 5c79057d3..a7a44f2bf 100644 --- a/cli-cmd/dns/src/v2/zone/task/import/list.rs +++ b/cli-cmd/dns/src/v2/zone/task/import/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::import::list; -use openstack_types::dns::v2::zone::task::import::response::list::ImportResponse; /// Command without description in OpenAPI #[derive(Args)] @@ -102,9 +101,7 @@ impl ImportsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/import/show.rs b/cli-cmd/dns/src/v2/zone/task/import/show.rs index b700e9262..43d281566 100644 --- a/cli-cmd/dns/src/v2/zone/task/import/show.rs +++ b/cli-cmd/dns/src/v2/zone/task/import/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::import::get; -use openstack_types::dns::v2::zone::task::import::response::get::ImportResponse; /// Get Zone Imports #[derive(Args)] @@ -110,9 +109,7 @@ impl ImportCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/pool_move.rs b/cli-cmd/dns/src/v2/zone/task/pool_move.rs index c10575516..ccb02bb73 100644 --- a/cli-cmd/dns/src/v2/zone/task/pool_move.rs +++ b/cli-cmd/dns/src/v2/zone/task/pool_move.rs @@ -34,7 +34,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::task::pool_move; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::task::response::pool_move::TaskResponse; use serde_json::Value; use tracing::warn; @@ -137,9 +136,7 @@ impl TaskCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/transfer_accept/create.rs b/cli-cmd/dns/src/v2/zone/task/transfer_accept/create.rs index ae4d8f356..ef93c7526 100644 --- a/cli-cmd/dns/src/v2/zone/task/transfer_accept/create.rs +++ b/cli-cmd/dns/src/v2/zone/task/transfer_accept/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::transfer_accept::create; -use openstack_types::dns::v2::zone::task::transfer_accept::response::create::TransferAcceptResponse; use serde_json::Value; /// This accepts an offer of a ownership transfer @@ -85,9 +84,7 @@ impl TransferAcceptCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/transfer_accept/list.rs b/cli-cmd/dns/src/v2/zone/task/transfer_accept/list.rs index 6a0aff363..da5e59fd3 100644 --- a/cli-cmd/dns/src/v2/zone/task/transfer_accept/list.rs +++ b/cli-cmd/dns/src/v2/zone/task/transfer_accept/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::transfer_accept::list; -use openstack_types::dns::v2::zone::task::transfer_accept::response::list::TransferAcceptResponse; /// This will list all your accepted ownership transfer. #[derive(Args)] @@ -105,9 +104,7 @@ impl TransferAcceptsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/transfer_accept/show.rs b/cli-cmd/dns/src/v2/zone/task/transfer_accept/show.rs index 4069680d2..ce7105fba 100644 --- a/cli-cmd/dns/src/v2/zone/task/transfer_accept/show.rs +++ b/cli-cmd/dns/src/v2/zone/task/transfer_accept/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::transfer_accept::get; -use openstack_types::dns::v2::zone::task::transfer_accept::response::get::TransferAcceptResponse; /// Get transfer_accepts #[derive(Args)] @@ -114,9 +113,7 @@ impl TransferAcceptCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/transfer_request/create.rs b/cli-cmd/dns/src/v2/zone/task/transfer_request/create.rs index 98af1f688..08776ed7d 100644 --- a/cli-cmd/dns/src/v2/zone/task/transfer_request/create.rs +++ b/cli-cmd/dns/src/v2/zone/task/transfer_request/create.rs @@ -34,7 +34,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::task::transfer_request::create; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::task::transfer_request::response::create::TransferRequestResponse; use serde_json::Value; use tracing::warn; @@ -143,9 +142,7 @@ impl TransferRequestCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/transfer_request/list.rs b/cli-cmd/dns/src/v2/zone/task/transfer_request/list.rs index adcfa9542..6b13ae82a 100644 --- a/cli-cmd/dns/src/v2/zone/task/transfer_request/list.rs +++ b/cli-cmd/dns/src/v2/zone/task/transfer_request/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::transfer_request::list; -use openstack_types::dns::v2::zone::task::transfer_request::response::list::TransferRequestResponse; /// This will list all your outgoing requests, and any incoming requests that /// have been scoped to your project. @@ -106,9 +105,7 @@ impl TransferRequestsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/transfer_request/set.rs b/cli-cmd/dns/src/v2/zone/task/transfer_request/set.rs index bb64281a3..5fce5acac 100644 --- a/cli-cmd/dns/src/v2/zone/task/transfer_request/set.rs +++ b/cli-cmd/dns/src/v2/zone/task/transfer_request/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::transfer_request::set; -use openstack_types::dns::v2::zone::task::transfer_request::response::set::TransferRequestResponse; use serde_json::Value; /// Command without description in OpenAPI @@ -96,9 +95,7 @@ impl TransferRequestCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/transfer_request/show.rs b/cli-cmd/dns/src/v2/zone/task/transfer_request/show.rs index f40337d7f..5d33eb349 100644 --- a/cli-cmd/dns/src/v2/zone/task/transfer_request/show.rs +++ b/cli-cmd/dns/src/v2/zone/task/transfer_request/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::task::transfer_request::get; -use openstack_types::dns::v2::zone::task::transfer_request::response::get::TransferRequestResponse; /// Command without description in OpenAPI #[derive(Args)] @@ -115,9 +114,7 @@ impl TransferRequestCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/dns/src/v2/zone/task/xfr.rs b/cli-cmd/dns/src/v2/zone/task/xfr.rs index 72fa8a37d..bf116a7b7 100644 --- a/cli-cmd/dns/src/v2/zone/task/xfr.rs +++ b/cli-cmd/dns/src/v2/zone/task/xfr.rs @@ -34,7 +34,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::dns::v2::zone::find as find_zone; use openstack_sdk::api::dns::v2::zone::task::xfr; use openstack_sdk::api::find_by_name; -use openstack_types::dns::v2::zone::task::response::xfr::TaskResponse; use serde_json::Value; use tracing::warn; @@ -137,9 +136,7 @@ impl TaskCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/auth/catalog/list.rs b/cli-cmd/identity/src/v3/auth/catalog/list.rs index 3c36dfb94..8d3d31f7e 100644 --- a/cli-cmd/identity/src/v3/auth/catalog/list.rs +++ b/cli-cmd/identity/src/v3/auth/catalog/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::catalog::list; -use openstack_types::identity::v3::auth::catalog::response::list::CatalogResponse; +use openstack_types::identity::v3::auth::catalog::response; /// New in version 3.3 /// @@ -82,7 +82,8 @@ impl CatalogsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/auth/domain/list.rs b/cli-cmd/identity/src/v3/auth/domain/list.rs index 2c7b935d8..2b7be9650 100644 --- a/cli-cmd/identity/src/v3/auth/domain/list.rs +++ b/cli-cmd/identity/src/v3/auth/domain/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::domain::list; -use openstack_types::identity::v3::auth::domain::response::list::DomainResponse; +use openstack_types::identity::v3::auth::domain::response; /// New in version 3.3 /// @@ -80,7 +80,8 @@ impl DomainsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/create.rs b/cli-cmd/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/create.rs index b599f3e14..4f3252bc5 100644 --- a/cli-cmd/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/create.rs +++ b/cli-cmd/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/create.rs @@ -27,9 +27,9 @@ use openstack_cli_core::error::OpenStackCliError; use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; -use openstack_sdk::api::identity::v3::auth::os_federation::identity_provider::protocol::websso::create; use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::auth::os_federation::identity_provider::protocol::websso::response::create::WebssoResponse; +use openstack_sdk::api::identity::v3::auth::os_federation::identity_provider::protocol::websso::create; +use openstack_types::identity::v3::auth::os_federation::identity_provider::protocol::websso::response; /// POST operation on /// /v3/auth/OS-FEDERATION/identity_providers/{idp_id}/protocols/{protocol_id}/websso @@ -97,8 +97,9 @@ impl WebssoCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/get.rs b/cli-cmd/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/get.rs index 3c375bfdd..04112e477 100644 --- a/cli-cmd/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/get.rs +++ b/cli-cmd/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/get.rs @@ -27,9 +27,9 @@ use openstack_cli_core::error::OpenStackCliError; use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; -use openstack_sdk::api::identity::v3::auth::os_federation::identity_provider::protocol::websso::get; use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::auth::os_federation::identity_provider::protocol::websso::response::get::WebssoResponse; +use openstack_sdk::api::identity::v3::auth::os_federation::identity_provider::protocol::websso::get; +use openstack_types::identity::v3::auth::os_federation::identity_provider::protocol::websso::response; /// GET operation on /// /v3/auth/OS-FEDERATION/identity_providers/{idp_id}/protocols/{protocol_id}/websso @@ -97,8 +97,9 @@ impl WebssoCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/auth/os_federation/saml2/ecp/get.rs b/cli-cmd/identity/src/v3/auth/os_federation/saml2/ecp/get.rs index b10fe7f48..d421668f6 100644 --- a/cli-cmd/identity/src/v3/auth/os_federation/saml2/ecp/get.rs +++ b/cli-cmd/identity/src/v3/auth/os_federation/saml2/ecp/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::os_federation::saml2::ecp::get; -use openstack_types::identity::v3::auth::os_federation::saml2::ecp::response::get::EcpResponse; /// GET operation on /v3/auth/OS-FEDERATION/saml2/ecp #[derive(Args)] @@ -73,9 +72,7 @@ impl EcpCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/auth/os_federation/saml2/get.rs b/cli-cmd/identity/src/v3/auth/os_federation/saml2/get.rs index efee391d7..5c1ded705 100644 --- a/cli-cmd/identity/src/v3/auth/os_federation/saml2/get.rs +++ b/cli-cmd/identity/src/v3/auth/os_federation/saml2/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::os_federation::saml2::get; -use openstack_types::identity::v3::auth::os_federation::saml2::response::get::Saml2Response; /// GET operation on /v3/auth/OS-FEDERATION/saml2 #[derive(Args)] @@ -73,9 +72,7 @@ impl Saml2Command { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/auth/os_federation/websso/create.rs b/cli-cmd/identity/src/v3/auth/os_federation/websso/create.rs index 0a926826f..dc22b6ea8 100644 --- a/cli-cmd/identity/src/v3/auth/os_federation/websso/create.rs +++ b/cli-cmd/identity/src/v3/auth/os_federation/websso/create.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::os_federation::websso::create; -use openstack_types::identity::v3::auth::os_federation::websso::response::create::WebssoResponse; +use openstack_types::identity::v3::auth::os_federation::websso::response; /// POST operation on /v3/auth/OS-FEDERATION/websso/{protocol_id} #[derive(Args)] @@ -84,8 +84,9 @@ impl WebssoCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/auth/os_federation/websso/show.rs b/cli-cmd/identity/src/v3/auth/os_federation/websso/show.rs index c234a3e1e..6908037ad 100644 --- a/cli-cmd/identity/src/v3/auth/os_federation/websso/show.rs +++ b/cli-cmd/identity/src/v3/auth/os_federation/websso/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::os_federation::websso::get; -use openstack_types::identity::v3::auth::os_federation::websso::response::get::WebssoResponse; +use openstack_types::identity::v3::auth::os_federation::websso::response; /// GET operation on /v3/auth/OS-FEDERATION/websso/{protocol_id} #[derive(Args)] @@ -84,8 +84,9 @@ impl WebssoCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/auth/project/list.rs b/cli-cmd/identity/src/v3/auth/project/list.rs index ec3b01970..28f4b17bf 100644 --- a/cli-cmd/identity/src/v3/auth/project/list.rs +++ b/cli-cmd/identity/src/v3/auth/project/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::project::list; -use openstack_types::identity::v3::auth::project::response::list::ProjectResponse; +use openstack_types::identity::v3::auth::project::response; /// New in version 3.3 /// @@ -81,7 +81,8 @@ impl ProjectsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/auth/system/list.rs b/cli-cmd/identity/src/v3/auth/system/list.rs index 9fff9a079..febdb946d 100644 --- a/cli-cmd/identity/src/v3/auth/system/list.rs +++ b/cli-cmd/identity/src/v3/auth/system/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::system::list; -use openstack_types::identity::v3::auth::system::response::list::SystemResponse; +use openstack_types::identity::v3::auth::system::response; /// New in version 3.10 /// @@ -78,7 +78,8 @@ impl SystemsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/auth/token/create.rs b/cli-cmd/identity/src/v3/auth/token/create.rs index b85e1ddd4..9202de568 100644 --- a/cli-cmd/identity/src/v3/auth/token/create.rs +++ b/cli-cmd/identity/src/v3/auth/token/create.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use dialoguer::Password; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::token::create; -use openstack_types::identity::v3::auth::token::response::create::TokenResponse; +use openstack_types::identity::v3::auth::token::response; use serde_json::Value; /// Authenticates an identity and generates a token. Uses the password @@ -447,8 +447,9 @@ impl TokenCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/auth/token/get.rs b/cli-cmd/identity/src/v3/auth/token/get.rs index 225e9ded9..fb4340052 100644 --- a/cli-cmd/identity/src/v3/auth/token/get.rs +++ b/cli-cmd/identity/src/v3/auth/token/get.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::token::get; -use openstack_types::identity::v3::auth::token::response::get::TokenResponse; +use openstack_types::identity::v3::auth::token::response; /// Validates and shows information for a token, including its expiration date /// and authorization scope. @@ -100,8 +100,9 @@ impl TokenCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/auth/token/os_pki/revoked/get.rs b/cli-cmd/identity/src/v3/auth/token/os_pki/revoked/get.rs index 6c6b367e5..7bf278506 100644 --- a/cli-cmd/identity/src/v3/auth/token/os_pki/revoked/get.rs +++ b/cli-cmd/identity/src/v3/auth/token/os_pki/revoked/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::auth::token::os_pki::revoked::get; -use openstack_types::identity::v3::auth::token::os_pki::revoked::response::get::RevokedResponse; /// Lists revoked PKI tokens. /// @@ -77,9 +76,7 @@ impl RevokedCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/credential/create.rs b/cli-cmd/identity/src/v3/credential/create.rs index 7d2fed9fb..34c29deef 100644 --- a/cli-cmd/identity/src/v3/credential/create.rs +++ b/cli-cmd/identity/src/v3/credential/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::credential::create; -use openstack_types::identity::v3::credential::response::create::CredentialResponse; +use openstack_types::identity::v3::credential::response; /// Creates a credential. /// @@ -140,8 +140,9 @@ impl CredentialCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/credential/list.rs b/cli-cmd/identity/src/v3/credential/list.rs index ee20aac76..2a07e5a56 100644 --- a/cli-cmd/identity/src/v3/credential/list.rs +++ b/cli-cmd/identity/src/v3/credential/list.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::credential::list; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::credential::response::list::CredentialResponse; +use openstack_types::identity::v3::credential::response; use tracing::warn; /// Lists all credentials. @@ -153,7 +153,8 @@ impl CredentialsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/credential/set.rs b/cli-cmd/identity/src/v3/credential/set.rs index 5dbee16b1..2f1e96725 100644 --- a/cli-cmd/identity/src/v3/credential/set.rs +++ b/cli-cmd/identity/src/v3/credential/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::credential::set; -use openstack_types::identity::v3::credential::response::set::CredentialResponse; +use openstack_types::identity::v3::credential::response; /// Updates a credential. /// @@ -140,8 +140,9 @@ impl CredentialCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/credential/show.rs b/cli-cmd/identity/src/v3/credential/show.rs index ec60596bf..a4846d79f 100644 --- a/cli-cmd/identity/src/v3/credential/show.rs +++ b/cli-cmd/identity/src/v3/credential/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::credential::get; -use openstack_types::identity::v3::credential::response::get::CredentialResponse; +use openstack_types::identity::v3::credential::response; /// Shows details for a credential. /// @@ -83,8 +83,9 @@ impl CredentialCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/default.rs b/cli-cmd/identity/src/v3/domain/config/default.rs index 09a12a8ef..ae1284b25 100644 --- a/cli-cmd/identity/src/v3/domain/config/default.rs +++ b/cli-cmd/identity/src/v3/domain/config/default.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::domain::config::default; -use openstack_types::identity::v3::domain::config::response::default::ConfigResponse; +use openstack_types::identity::v3::domain::config::response; /// The default configuration settings for the options that can be overridden /// can be retrieved. @@ -78,8 +78,9 @@ impl ConfigCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/group/default.rs b/cli-cmd/identity/src/v3/domain/config/group/default.rs index 7069a4d83..d997944d2 100644 --- a/cli-cmd/identity/src/v3/domain/config/group/default.rs +++ b/cli-cmd/identity/src/v3/domain/config/group/default.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::domain::config::group::default; -use openstack_types::identity::v3::domain::config::group::response::default::GroupResponse; +use openstack_types::identity::v3::domain::config::group::response; /// Reads the default configuration settings for a specific group. /// @@ -89,8 +89,9 @@ impl GroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/group/option/default.rs b/cli-cmd/identity/src/v3/domain/config/group/option/default.rs index f705804fa..358ea7170 100644 --- a/cli-cmd/identity/src/v3/domain/config/group/option/default.rs +++ b/cli-cmd/identity/src/v3/domain/config/group/option/default.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::domain::config::group::option::default; -use openstack_types::identity::v3::domain::config::group::option::response::default::OptionResponse; +use openstack_types::identity::v3::domain::config::group::option::response; /// Reads the default configuration setting for an option within a group. /// @@ -100,8 +100,9 @@ impl OptionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/group/option/set.rs b/cli-cmd/identity/src/v3/domain/config/group/option/set.rs index 569de45ee..2a750765f 100644 --- a/cli-cmd/identity/src/v3/domain/config/group/option/set.rs +++ b/cli-cmd/identity/src/v3/domain/config/group/option/set.rs @@ -34,7 +34,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::config::group::option::set; use openstack_sdk::api::identity::v3::domain::find as find_domain; -use openstack_types::identity::v3::domain::config::group::option::response::set::OptionResponse; +use openstack_types::identity::v3::domain::config::group::option::response; use serde_json::Value; use tracing::warn; @@ -189,8 +189,9 @@ impl OptionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/group/option/show.rs b/cli-cmd/identity/src/v3/domain/config/group/option/show.rs index c22031cb4..ab2cc0d24 100644 --- a/cli-cmd/identity/src/v3/domain/config/group/option/show.rs +++ b/cli-cmd/identity/src/v3/domain/config/group/option/show.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::config::group::option::get; use openstack_sdk::api::identity::v3::domain::find as find_domain; -use openstack_types::identity::v3::domain::config::group::option::response::get::OptionResponse; +use openstack_types::identity::v3::domain::config::group::option::response; use tracing::warn; /// Shows details for a domain group option configuration. @@ -178,8 +178,9 @@ impl OptionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/group/set.rs b/cli-cmd/identity/src/v3/domain/config/group/set.rs index d434f7728..6404518d3 100644 --- a/cli-cmd/identity/src/v3/domain/config/group/set.rs +++ b/cli-cmd/identity/src/v3/domain/config/group/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::config::group::set; use openstack_sdk::api::identity::v3::domain::find as find_domain; -use openstack_types::identity::v3::domain::config::group::response::set::GroupResponse; +use openstack_types::identity::v3::domain::config::group::response; use serde_json::Value; use std::collections::BTreeMap; use tracing::warn; @@ -185,8 +185,9 @@ impl GroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/group/show.rs b/cli-cmd/identity/src/v3/domain/config/group/show.rs index 02e6d75ef..8de4f0d63 100644 --- a/cli-cmd/identity/src/v3/domain/config/group/show.rs +++ b/cli-cmd/identity/src/v3/domain/config/group/show.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::config::group::get; use openstack_sdk::api::identity::v3::domain::find as find_domain; -use openstack_types::identity::v3::domain::config::group::response::get::GroupResponse; +use openstack_types::identity::v3::domain::config::group::response; use tracing::warn; /// Shows details for a domain group configuration. @@ -166,8 +166,9 @@ impl GroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/list.rs b/cli-cmd/identity/src/v3/domain/config/list.rs index 928b7b05f..1e332b0ed 100644 --- a/cli-cmd/identity/src/v3/domain/config/list.rs +++ b/cli-cmd/identity/src/v3/domain/config/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::config::list; use openstack_sdk::api::identity::v3::domain::find as find_domain; -use openstack_types::identity::v3::domain::config::response::list::ConfigResponse; +use openstack_types::identity::v3::domain::config::response; use tracing::warn; /// Shows details for a domain configuration. @@ -152,8 +152,9 @@ impl ConfigsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/replace.rs b/cli-cmd/identity/src/v3/domain/config/replace.rs index 8cd25e42b..654a6bc47 100644 --- a/cli-cmd/identity/src/v3/domain/config/replace.rs +++ b/cli-cmd/identity/src/v3/domain/config/replace.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::config::replace; use openstack_sdk::api::identity::v3::domain::find as find_domain; -use openstack_types::identity::v3::domain::config::response::replace::ConfigResponse; +use openstack_types::identity::v3::domain::config::response; use serde_json::Value; use std::collections::BTreeMap; use tracing::warn; @@ -172,8 +172,9 @@ impl ConfigCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/config/set.rs b/cli-cmd/identity/src/v3/domain/config/set.rs index 3857aaadc..0716480f5 100644 --- a/cli-cmd/identity/src/v3/domain/config/set.rs +++ b/cli-cmd/identity/src/v3/domain/config/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::config::set; use openstack_sdk::api::identity::v3::domain::find as find_domain; -use openstack_types::identity::v3::domain::config::response::set::ConfigResponse; +use openstack_types::identity::v3::domain::config::response; use serde_json::Value; use std::collections::BTreeMap; use tracing::warn; @@ -169,8 +169,9 @@ impl ConfigCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/create.rs b/cli-cmd/identity/src/v3/domain/create.rs index 73dbd4bb9..332821b59 100644 --- a/cli-cmd/identity/src/v3/domain/create.rs +++ b/cli-cmd/identity/src/v3/domain/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::domain::create; -use openstack_types::identity::v3::domain::response::create::DomainResponse; +use openstack_types::identity::v3::domain::response; /// Creates a domain. /// @@ -169,8 +169,9 @@ impl DomainCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/group/role/list.rs b/cli-cmd/identity/src/v3/domain/group/role/list.rs index 6c6302af2..c1e370e2f 100644 --- a/cli-cmd/identity/src/v3/domain/group/role/list.rs +++ b/cli-cmd/identity/src/v3/domain/group/role/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::domain::group::role::list; -use openstack_types::identity::v3::domain::group::role::response::list::RoleResponse; +use openstack_types::identity::v3::domain::group::role::response; use tracing::warn; /// Lists role assignments for a group on a domain. @@ -166,7 +166,8 @@ impl RolesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/domain/list.rs b/cli-cmd/identity/src/v3/domain/list.rs index 68f1dcf1a..7b29b598f 100644 --- a/cli-cmd/identity/src/v3/domain/list.rs +++ b/cli-cmd/identity/src/v3/domain/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::domain::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::identity::v3::domain::response::list::DomainResponse; +use openstack_types::identity::v3::domain::response; /// Lists all domains. /// @@ -120,7 +120,8 @@ impl DomainsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/domain/set.rs b/cli-cmd/identity/src/v3/domain/set.rs index 365b4cc96..a418c4142 100644 --- a/cli-cmd/identity/src/v3/domain/set.rs +++ b/cli-cmd/identity/src/v3/domain/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::domain::find; use openstack_sdk::api::identity::v3::domain::set; -use openstack_types::identity::v3::domain::response::set::DomainResponse; +use openstack_types::identity::v3::domain::response; /// Updates a domain. /// @@ -187,8 +187,9 @@ impl DomainCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/domain/show.rs b/cli-cmd/identity/src/v3/domain/show.rs index f6fb32a75..d3f5f1a98 100644 --- a/cli-cmd/identity/src/v3/domain/show.rs +++ b/cli-cmd/identity/src/v3/domain/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::domain::find; -use openstack_types::identity::v3::domain::response::get::DomainResponse; +use openstack_types::identity::v3::domain::response; /// Shows details for a domain. /// @@ -85,7 +85,7 @@ impl DomainCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/domain/user/role/list.rs b/cli-cmd/identity/src/v3/domain/user/role/list.rs index fd192d18d..19f1618de 100644 --- a/cli-cmd/identity/src/v3/domain/user/role/list.rs +++ b/cli-cmd/identity/src/v3/domain/user/role/list.rs @@ -34,7 +34,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::domain::user::role::list; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::domain::user::role::response::list::RoleResponse; +use openstack_types::identity::v3::domain::user::role::response; use tracing::warn; /// Lists role assignments for a user on a domain. @@ -221,7 +221,8 @@ impl RolesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/ec2token/create.rs b/cli-cmd/identity/src/v3/ec2token/create.rs index 0dbb769d3..c07a69e86 100644 --- a/cli-cmd/identity/src/v3/ec2token/create.rs +++ b/cli-cmd/identity/src/v3/ec2token/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::ec2token::create; -use openstack_types::identity::v3::ec2token::response::create::Ec2tokenResponse; use serde_json::Value; /// Authenticate ec2 token. @@ -82,9 +81,7 @@ impl Ec2TokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/ec2token/get.rs b/cli-cmd/identity/src/v3/ec2token/get.rs index e3b8eb7cf..bfb52bccd 100644 --- a/cli-cmd/identity/src/v3/ec2token/get.rs +++ b/cli-cmd/identity/src/v3/ec2token/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::ec2token::get; -use openstack_types::identity::v3::ec2token::response::get::Ec2tokenResponse; /// GET operation on /v3/ec2tokens #[derive(Args)] @@ -69,9 +68,7 @@ impl Ec2TokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/endpoint/create.rs b/cli-cmd/identity/src/v3/endpoint/create.rs index cd745afe9..89cbaa034 100644 --- a/cli-cmd/identity/src/v3/endpoint/create.rs +++ b/cli-cmd/identity/src/v3/endpoint/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::endpoint::create; -use openstack_types::identity::v3::endpoint::response::create::EndpointResponse; +use openstack_types::identity::v3::endpoint::response; /// Creates an endpoint. /// @@ -200,8 +200,9 @@ impl EndpointCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/endpoint/list.rs b/cli-cmd/identity/src/v3/endpoint/list.rs index 12cabc0a9..31226e706 100644 --- a/cli-cmd/identity/src/v3/endpoint/list.rs +++ b/cli-cmd/identity/src/v3/endpoint/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::endpoint::list; -use openstack_types::identity::v3::endpoint::response::list::EndpointResponse; +use openstack_types::identity::v3::endpoint::response; /// Lists all available endpoints. /// @@ -101,7 +101,8 @@ impl EndpointsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/endpoint/os_endpoint_policy/policy/get.rs b/cli-cmd/identity/src/v3/endpoint/os_endpoint_policy/policy/get.rs index b687aa94d..f792a9945 100644 --- a/cli-cmd/identity/src/v3/endpoint/os_endpoint_policy/policy/get.rs +++ b/cli-cmd/identity/src/v3/endpoint/os_endpoint_policy/policy/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::endpoint::os_endpoint_policy::policy::get; -use openstack_types::identity::v3::endpoint::os_endpoint_policy::policy::response::get::PolicyResponse; /// GET operation on /v3/endpoints/{endpoint_id}/OS-ENDPOINT-POLICY/policy #[derive(Args)] @@ -84,9 +83,7 @@ impl PolicyCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/endpoint/set.rs b/cli-cmd/identity/src/v3/endpoint/set.rs index 39fdd1e19..2238d55cb 100644 --- a/cli-cmd/identity/src/v3/endpoint/set.rs +++ b/cli-cmd/identity/src/v3/endpoint/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::endpoint::set; -use openstack_types::identity::v3::endpoint::response::set::EndpointResponse; +use openstack_types::identity::v3::endpoint::response; /// Updates an endpoint. /// @@ -208,8 +208,9 @@ impl EndpointCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/endpoint/show.rs b/cli-cmd/identity/src/v3/endpoint/show.rs index 01b15ba72..4a2cc9089 100644 --- a/cli-cmd/identity/src/v3/endpoint/show.rs +++ b/cli-cmd/identity/src/v3/endpoint/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::endpoint::get; -use openstack_types::identity::v3::endpoint::response::get::EndpointResponse; +use openstack_types::identity::v3::endpoint::response; /// Shows details for an endpoint. /// @@ -83,8 +83,9 @@ impl EndpointCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/group/create.rs b/cli-cmd/identity/src/v3/group/create.rs index 9bc06e311..be7375acc 100644 --- a/cli-cmd/identity/src/v3/group/create.rs +++ b/cli-cmd/identity/src/v3/group/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::group::create; -use openstack_types::identity::v3::group::response::create::GroupResponse; +use openstack_types::identity::v3::group::response; /// Creates a group. /// @@ -122,8 +122,9 @@ impl GroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/group/list.rs b/cli-cmd/identity/src/v3/group/list.rs index 23f781209..f7298e41b 100644 --- a/cli-cmd/identity/src/v3/group/list.rs +++ b/cli-cmd/identity/src/v3/group/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::group::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::identity::v3::group::response::list::GroupResponse; +use openstack_types::identity::v3::group::response; use tracing::warn; /// Lists groups. @@ -191,7 +191,8 @@ impl GroupsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/group/set.rs b/cli-cmd/identity/src/v3/group/set.rs index 25d13e3c4..91a4c7fbb 100644 --- a/cli-cmd/identity/src/v3/group/set.rs +++ b/cli-cmd/identity/src/v3/group/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::group::find; use openstack_sdk::api::identity::v3::group::set; -use openstack_types::identity::v3::group::response::set::GroupResponse; +use openstack_types::identity::v3::group::response; /// Updates a group. /// @@ -141,8 +141,9 @@ impl GroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/group/show.rs b/cli-cmd/identity/src/v3/group/show.rs index 19fea6d53..2f17126be 100644 --- a/cli-cmd/identity/src/v3/group/show.rs +++ b/cli-cmd/identity/src/v3/group/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::group::find; -use openstack_types::identity::v3::group::response::get::GroupResponse; +use openstack_types::identity::v3::group::response; /// Shows details for a group. /// @@ -85,7 +85,7 @@ impl GroupCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/group/user/list.rs b/cli-cmd/identity/src/v3/group/user/list.rs index bd8e3ed44..bd914c24f 100644 --- a/cli-cmd/identity/src/v3/group/user/list.rs +++ b/cli-cmd/identity/src/v3/group/user/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::group::user::list; -use openstack_types::identity::v3::group::user::response::list::UserResponse; +use openstack_types::identity::v3::group::user::response; /// Lists the users that belong to a group. /// @@ -96,7 +96,8 @@ impl UsersCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/limit/create.rs b/cli-cmd/identity/src/v3/limit/create.rs index 0dbb0662f..3c3628b76 100644 --- a/cli-cmd/identity/src/v3/limit/create.rs +++ b/cli-cmd/identity/src/v3/limit/create.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::limit::create; -use openstack_types::identity::v3::limit::response::create::LimitResponse; +use openstack_types::identity::v3::limit::response; use serde_json::Value; /// Creates limits. It supports to create more than one limit in one request. @@ -90,8 +90,9 @@ impl LimitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/limit/list.rs b/cli-cmd/identity/src/v3/limit/list.rs index b43c15e38..b0422e96b 100644 --- a/cli-cmd/identity/src/v3/limit/list.rs +++ b/cli-cmd/identity/src/v3/limit/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::limit::list; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::identity::v3::limit::response::list::LimitResponse; +use openstack_types::identity::v3::limit::response; use tracing::warn; /// Lists Limits. @@ -226,7 +226,8 @@ impl LimitsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/limit/model/get.rs b/cli-cmd/identity/src/v3/limit/model/get.rs index a941edd3b..3c3c03a15 100644 --- a/cli-cmd/identity/src/v3/limit/model/get.rs +++ b/cli-cmd/identity/src/v3/limit/model/get.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::limit::model::get; -use openstack_types::identity::v3::limit::model::response::get::ModelResponse; +use openstack_types::identity::v3::limit::model::response; /// Return the configured limit enforcement model. /// @@ -73,8 +73,9 @@ impl ModelCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/limit/set.rs b/cli-cmd/identity/src/v3/limit/set.rs index d94718ea9..9d92613fe 100644 --- a/cli-cmd/identity/src/v3/limit/set.rs +++ b/cli-cmd/identity/src/v3/limit/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::limit::set; -use openstack_types::identity::v3::limit::response::set::LimitResponse; +use openstack_types::identity::v3::limit::response; /// Updates the specified limit. It only supports to update `resource_limit` or /// `description` for the limit. @@ -124,8 +124,9 @@ impl LimitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/limit/show.rs b/cli-cmd/identity/src/v3/limit/show.rs index 55a961a2e..711aafb31 100644 --- a/cli-cmd/identity/src/v3/limit/show.rs +++ b/cli-cmd/identity/src/v3/limit/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::limit::get; -use openstack_types::identity::v3::limit::response::get::LimitResponse; +use openstack_types::identity::v3::limit::response; /// Shows details for a limit. /// @@ -83,8 +83,9 @@ impl LimitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_ep_filter/endpoint/project/get.rs b/cli-cmd/identity/src/v3/os_ep_filter/endpoint/project/get.rs index b496d2b3e..5408b635f 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/endpoint/project/get.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/endpoint/project/get.rs @@ -29,7 +29,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_ep_filter::endpoint::project::get; -use openstack_types::identity::v3::os_ep_filter::endpoint::project::response::get::ProjectResponse; /// Return a list of projects associated with the endpoint. #[derive(Args)] @@ -83,9 +82,7 @@ impl ProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/create.rs b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/create.rs index ab6752c9a..47d6e4d69 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/create.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_ep_filter::endpoint_group::create; -use openstack_types::identity::v3::os_ep_filter::endpoint_group::response::create::EndpointGroupResponse; +use openstack_types::identity::v3::os_ep_filter::endpoint_group::response; /// Create new endpoint groups. /// @@ -179,8 +179,9 @@ impl EndpointGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_ep_filter/endpoint_group/endpoint/get.rs b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/endpoint/get.rs index 94309fd97..0e0aaa9e9 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/endpoint/get.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/endpoint/get.rs @@ -29,7 +29,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_ep_filter::endpoint_group::endpoint::get; -use openstack_types::identity::v3::os_ep_filter::endpoint_group::endpoint::response::get::EndpointResponse; /// GET operation on /// /v3/OS-EP-FILTER/endpoint_groups/{endpoint_group_id}/endpoints @@ -84,9 +83,7 @@ impl EndpointCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/list.rs b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/list.rs index 6e0148318..638b6b0a4 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/list.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_ep_filter::endpoint_group::list; -use openstack_types::identity::v3::os_ep_filter::endpoint_group::response::list::EndpointGroupResponse; +use openstack_types::identity::v3::os_ep_filter::endpoint_group::response; /// List all endpoint groups. /// @@ -85,7 +85,8 @@ impl EndpointGroupsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/list.rs b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/list.rs index c62b42393..ad9b3a701 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/list.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/list.rs @@ -29,7 +29,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_ep_filter::endpoint_group::project::list; -use openstack_types::identity::v3::os_ep_filter::endpoint_group::project::response::list::ProjectResponse; /// GET operation on /// /v3/OS-EP-FILTER/endpoint_groups/{endpoint_group_id}/projects @@ -85,9 +84,7 @@ impl ProjectsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/set.rs b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/set.rs index 74d56e49f..fecb3347e 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/set.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/set.rs @@ -32,7 +32,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_ep_filter::endpoint_group::project::set; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::identity::v3::os_ep_filter::endpoint_group::project::response::set::ProjectResponse; use serde_json::Value; use tracing::warn; @@ -154,9 +153,7 @@ impl ProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/show.rs b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/show.rs index 9fa395186..39758f32c 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/show.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/project/show.rs @@ -31,7 +31,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_ep_filter::endpoint_group::project::get; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::identity::v3::os_ep_filter::endpoint_group::project::response::get::ProjectResponse; use tracing::warn; /// GET operation on @@ -143,9 +142,7 @@ impl ProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/set.rs b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/set.rs index b590e3d0a..a17acf214 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/set.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_ep_filter::endpoint_group::set; -use openstack_types::identity::v3::os_ep_filter::endpoint_group::response::set::EndpointGroupResponse; +use openstack_types::identity::v3::os_ep_filter::endpoint_group::response; /// Update existing endpoint groups /// @@ -194,8 +194,9 @@ impl EndpointGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_ep_filter/endpoint_group/show.rs b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/show.rs index 2dfeb5e0b..95306956c 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/show.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/endpoint_group/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_ep_filter::endpoint_group::get; -use openstack_types::identity::v3::os_ep_filter::endpoint_group::response::get::EndpointGroupResponse; +use openstack_types::identity::v3::os_ep_filter::endpoint_group::response; /// Get Endpoint Group /// @@ -86,8 +86,9 @@ impl EndpointGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_ep_filter/project/endpoint/list.rs b/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/list.rs index 4b12b3a09..d6e06b3dd 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/list.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/list.rs @@ -33,7 +33,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_ep_filter::project::endpoint::list; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::identity::v3::os_ep_filter::project::endpoint::response::list::EndpointResponse; use tracing::warn; /// GET operation on /v3/OS-EP-FILTER/projects/{project_id}/endpoints @@ -146,9 +145,7 @@ impl EndpointsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/set.rs b/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/set.rs index 0196d278c..bc01d9306 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/set.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/set.rs @@ -34,7 +34,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_ep_filter::project::endpoint::set; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::identity::v3::os_ep_filter::project::endpoint::response::set::EndpointResponse; use serde_json::Value; use tracing::warn; @@ -169,9 +168,7 @@ impl EndpointCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/show.rs b/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/show.rs index 1b15d3121..6f62a914d 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/show.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint/show.rs @@ -33,7 +33,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_ep_filter::project::endpoint::get; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::identity::v3::os_ep_filter::project::endpoint::response::get::EndpointResponse; use tracing::warn; /// GET operation on @@ -158,9 +157,7 @@ impl EndpointCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint_group/get.rs b/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint_group/get.rs index 75a66885b..f6d30b644 100644 --- a/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint_group/get.rs +++ b/cli-cmd/identity/src/v3/os_ep_filter/project/endpoint_group/get.rs @@ -33,7 +33,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_ep_filter::project::endpoint_group::get; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_types::identity::v3::os_ep_filter::project::endpoint_group::response::get::EndpointGroupResponse; use tracing::warn; /// GET operation on /v3/OS-EP-FILTER/projects/{project_id}/endpoint_groups @@ -146,9 +145,7 @@ impl EndpointGroupCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_federation/domain/list.rs b/cli-cmd/identity/src/v3/os_federation/domain/list.rs index 9c9ee98b4..bf983b7a2 100644 --- a/cli-cmd/identity/src/v3/os_federation/domain/list.rs +++ b/cli-cmd/identity/src/v3/os_federation/domain/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::domain::list; -use openstack_types::identity::v3::os_federation::domain::response::list::DomainResponse; +use openstack_types::identity::v3::os_federation::domain::response; /// Get possible domain scopes for token. /// @@ -77,7 +77,8 @@ impl DomainsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + 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/create.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/create.rs index 860aa8be6..120941bb0 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/create.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::identity_provider::create; -use openstack_types::identity::v3::os_federation::identity_provider::response::create::IdentityProviderResponse; +use openstack_types::identity::v3::os_federation::identity_provider::response; /// Create an idp resource for federated authentication. /// @@ -160,8 +160,9 @@ impl IdentityProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/identity_provider/list.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/list.rs index bf75ca9f4..81093d78b 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/list.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::identity_provider::list; -use openstack_types::identity::v3::os_federation::identity_provider::response::list::IdentityProviderResponse; +use openstack_types::identity::v3::os_federation::identity_provider::response; /// List all identity providers. /// @@ -92,7 +92,8 @@ impl IdentityProvidersCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + 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/protocol/auth/create.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/auth/create.rs index d52ff0c2e..6f98010e3 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/auth/create.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/auth/create.rs @@ -29,9 +29,9 @@ use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; -use openstack_sdk::api::identity::v3::os_federation::identity_provider::protocol::auth::create; use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_federation::identity_provider::protocol::auth::response::create::AuthResponse; +use openstack_sdk::api::identity::v3::os_federation::identity_provider::protocol::auth::create; +use openstack_types::identity::v3::os_federation::identity_provider::protocol::auth::response; use serde_json::Value; /// Authenticate from dedicated uri endpoint. @@ -111,8 +111,9 @@ impl AuthCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/identity_provider/protocol/auth/get.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/auth/get.rs index f6a518d24..331e4f92c 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/auth/get.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/auth/get.rs @@ -28,9 +28,9 @@ use openstack_cli_core::error::OpenStackCliError; use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; -use openstack_sdk::api::identity::v3::os_federation::identity_provider::protocol::auth::get; use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_federation::identity_provider::protocol::auth::response::get::AuthResponse; +use openstack_sdk::api::identity::v3::os_federation::identity_provider::protocol::auth::get; +use openstack_types::identity::v3::os_federation::identity_provider::protocol::auth::response; /// Authenticate from dedicated uri endpoint. /// @@ -100,8 +100,9 @@ impl AuthCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/identity_provider/protocol/create.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/create.rs index aab4d9afa..606b6e4e1 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/create.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::identity_provider::protocol::create; -use openstack_types::identity::v3::os_federation::identity_provider::protocol::response::create::ProtocolResponse; +use openstack_types::identity::v3::os_federation::identity_provider::protocol::response; /// Create protocol for an IDP. /// @@ -133,8 +133,9 @@ impl ProtocolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/identity_provider/protocol/list.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/list.rs index 505b0e4e4..6eab0ea9f 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/list.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::identity_provider::protocol::list; -use openstack_types::identity::v3::os_federation::identity_provider::protocol::response::list::ProtocolResponse; +use openstack_types::identity::v3::os_federation::identity_provider::protocol::response; /// List protocols for an IDP. /// @@ -87,7 +87,8 @@ impl ProtocolsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + 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/protocol/set.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/set.rs index d0f53467f..d4b23e649 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/set.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::identity_provider::protocol::set; -use openstack_types::identity::v3::os_federation::identity_provider::protocol::response::set::ProtocolResponse; +use openstack_types::identity::v3::os_federation::identity_provider::protocol::response; /// Update protocol for an IDP. /// @@ -127,8 +127,9 @@ impl ProtocolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/identity_provider/protocol/show.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/show.rs index 9f04a4799..6886aeddb 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/show.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/protocol/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::identity_provider::protocol::get; -use openstack_types::identity::v3::os_federation::identity_provider::protocol::response::get::ProtocolResponse; +use openstack_types::identity::v3::os_federation::identity_provider::protocol::response; /// Get protocols for an IDP. /// @@ -98,8 +98,9 @@ impl ProtocolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/identity_provider/set.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/set.rs index 635aaf226..642ff0843 100644 --- a/cli-cmd/identity/src/v3/os_federation/identity_provider/set.rs +++ b/cli-cmd/identity/src/v3/os_federation/identity_provider/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::identity_provider::set; -use openstack_types::identity::v3::os_federation::identity_provider::response::set::IdentityProviderResponse; +use openstack_types::identity::v3::os_federation::identity_provider::response; /// PATCH operation on /v3/OS-FEDERATION/identity_providers/{idp_id} #[derive(Args)] @@ -142,8 +142,9 @@ impl IdentityProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/identity_provider/show.rs b/cli-cmd/identity/src/v3/os_federation/identity_provider/show.rs index 11a572ca6..cb787b7fa 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 @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::identity_provider::get; -use openstack_types::identity::v3::os_federation::identity_provider::response::get::IdentityProviderResponse; +use openstack_types::identity::v3::os_federation::identity_provider::response; /// Get an IDP resource. /// @@ -85,8 +85,9 @@ impl IdentityProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/mapping/create.rs b/cli-cmd/identity/src/v3/os_federation/mapping/create.rs index 2728abfed..26f014a2e 100644 --- a/cli-cmd/identity/src/v3/os_federation/mapping/create.rs +++ b/cli-cmd/identity/src/v3/os_federation/mapping/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::mapping::create; -use openstack_types::identity::v3::os_federation::mapping::response::create::MappingResponse; +use openstack_types::identity::v3::os_federation::mapping::response; use serde_json::Value; /// Create a mapping. @@ -123,8 +123,9 @@ impl MappingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/mapping/list.rs b/cli-cmd/identity/src/v3/os_federation/mapping/list.rs index 166c3772a..701972b57 100644 --- a/cli-cmd/identity/src/v3/os_federation/mapping/list.rs +++ b/cli-cmd/identity/src/v3/os_federation/mapping/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::mapping::list; -use openstack_types::identity::v3::os_federation::mapping::response::list::MappingResponse; +use openstack_types::identity::v3::os_federation::mapping::response; /// GET operation on /v3/OS-FEDERATION/mappings #[derive(Args)] @@ -74,7 +74,8 @@ impl MappingsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_federation/mapping/set.rs b/cli-cmd/identity/src/v3/os_federation/mapping/set.rs index c1368505c..e01d0bf88 100644 --- a/cli-cmd/identity/src/v3/os_federation/mapping/set.rs +++ b/cli-cmd/identity/src/v3/os_federation/mapping/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::mapping::set; -use openstack_types::identity::v3::os_federation::mapping::response::set::MappingResponse; +use openstack_types::identity::v3::os_federation::mapping::response; use serde_json::Value; /// Update an attribute mapping for identity federation. @@ -123,8 +123,9 @@ impl MappingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/mapping/show.rs b/cli-cmd/identity/src/v3/os_federation/mapping/show.rs index 820a6b7ff..034324dd4 100644 --- a/cli-cmd/identity/src/v3/os_federation/mapping/show.rs +++ b/cli-cmd/identity/src/v3/os_federation/mapping/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::mapping::get; -use openstack_types::identity::v3::os_federation::mapping::response::get::MappingResponse; +use openstack_types::identity::v3::os_federation::mapping::response; /// GET operation on /v3/OS-FEDERATION/mappings/{mapping_id} #[derive(Args)] @@ -83,8 +83,9 @@ impl MappingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/project/list.rs b/cli-cmd/identity/src/v3/os_federation/project/list.rs index cf77d5fc3..2380530e6 100644 --- a/cli-cmd/identity/src/v3/os_federation/project/list.rs +++ b/cli-cmd/identity/src/v3/os_federation/project/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::project::list; -use openstack_types::identity::v3::os_federation::project::response::list::ProjectResponse; +use openstack_types::identity::v3::os_federation::project::response; /// Get possible project scopes for token. /// @@ -77,7 +77,8 @@ impl ProjectsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_federation/service_provider/create.rs b/cli-cmd/identity/src/v3/os_federation/service_provider/create.rs index d4345e62c..1e02b3de6 100644 --- a/cli-cmd/identity/src/v3/os_federation/service_provider/create.rs +++ b/cli-cmd/identity/src/v3/os_federation/service_provider/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::service_provider::create; -use openstack_types::identity::v3::os_federation::service_provider::response::create::ServiceProviderResponse; +use openstack_types::identity::v3::os_federation::service_provider::response; /// Create a service provider. /// @@ -152,8 +152,9 @@ impl ServiceProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/service_provider/list.rs b/cli-cmd/identity/src/v3/os_federation/service_provider/list.rs index 732b8beab..2bdac3630 100644 --- a/cli-cmd/identity/src/v3/os_federation/service_provider/list.rs +++ b/cli-cmd/identity/src/v3/os_federation/service_provider/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::service_provider::list; -use openstack_types::identity::v3::os_federation::service_provider::response::list::ServiceProviderResponse; +use openstack_types::identity::v3::os_federation::service_provider::response; /// List service providers. /// @@ -92,7 +92,8 @@ impl ServiceProvidersCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_federation/service_provider/set.rs b/cli-cmd/identity/src/v3/os_federation/service_provider/set.rs index 35d1bca73..4c5612a75 100644 --- a/cli-cmd/identity/src/v3/os_federation/service_provider/set.rs +++ b/cli-cmd/identity/src/v3/os_federation/service_provider/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::service_provider::set; -use openstack_types::identity::v3::os_federation::service_provider::response::set::ServiceProviderResponse; +use openstack_types::identity::v3::os_federation::service_provider::response; /// Update a service provider. /// @@ -155,8 +155,9 @@ impl ServiceProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_federation/service_provider/show.rs b/cli-cmd/identity/src/v3/os_federation/service_provider/show.rs index 9e8f750de..469cf20f5 100644 --- a/cli-cmd/identity/src/v3/os_federation/service_provider/show.rs +++ b/cli-cmd/identity/src/v3/os_federation/service_provider/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_federation::service_provider::get; -use openstack_types::identity::v3::os_federation::service_provider::response::get::ServiceProviderResponse; +use openstack_types::identity::v3::os_federation::service_provider::response; /// Get a service provider. /// @@ -86,8 +86,9 @@ impl ServiceProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_inherit/domain/group/role/inherited_to_project/get.rs b/cli-cmd/identity/src/v3/os_inherit/domain/group/role/inherited_to_project/get.rs index f7c88ca6b..3130c7c41 100644 --- a/cli-cmd/identity/src/v3/os_inherit/domain/group/role/inherited_to_project/get.rs +++ b/cli-cmd/identity/src/v3/os_inherit/domain/group/role/inherited_to_project/get.rs @@ -29,11 +29,10 @@ use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; use eyre::eyre; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::os_inherit::domain::group::role::inherited_to_project::get; -use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_inherit::domain::group::role::inherited_to_project::response::get::InheritedToProjectResponse; use tracing::warn; /// The list only contains those role assignments to the domain that were @@ -166,9 +165,7 @@ impl InheritedToProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_inherit/domain/group/role/inherited_to_project/inherited_to_projects.rs b/cli-cmd/identity/src/v3/os_inherit/domain/group/role/inherited_to_project/inherited_to_projects.rs index 3cf67eacf..8c4bf64e3 100644 --- a/cli-cmd/identity/src/v3/os_inherit/domain/group/role/inherited_to_project/inherited_to_projects.rs +++ b/cli-cmd/identity/src/v3/os_inherit/domain/group/role/inherited_to_project/inherited_to_projects.rs @@ -30,11 +30,10 @@ use openstack_sdk::AsyncOpenStack; use eyre::eyre; use openstack_cli_core::common::parse_key_val; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::os_inherit::domain::group::role::inherited_to_project::inherited_to_projects; -use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_inherit::domain::group::role::inherited_to_project::response::inherited_to_projects::InheritedToProjectResponse; use serde_json::Value; use tracing::warn; @@ -186,9 +185,7 @@ impl InheritedToProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_inherit/domain/user/role/inherited_to_project/get.rs b/cli-cmd/identity/src/v3/os_inherit/domain/user/role/inherited_to_project/get.rs index f50933454..30d66fb91 100644 --- a/cli-cmd/identity/src/v3/os_inherit/domain/user/role/inherited_to_project/get.rs +++ b/cli-cmd/identity/src/v3/os_inherit/domain/user/role/inherited_to_project/get.rs @@ -29,12 +29,11 @@ use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; use eyre::eyre; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::os_inherit::domain::user::role::inherited_to_project::get; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_inherit::domain::user::role::inherited_to_project::response::get::InheritedToProjectResponse; use tracing::warn; /// The list only contains those role assignments to the domain that were @@ -220,9 +219,7 @@ impl InheritedToProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_inherit/domain/user/role/inherited_to_project/inherited_to_projects.rs b/cli-cmd/identity/src/v3/os_inherit/domain/user/role/inherited_to_project/inherited_to_projects.rs index 0473e925a..26e09526f 100644 --- a/cli-cmd/identity/src/v3/os_inherit/domain/user/role/inherited_to_project/inherited_to_projects.rs +++ b/cli-cmd/identity/src/v3/os_inherit/domain/user/role/inherited_to_project/inherited_to_projects.rs @@ -30,12 +30,11 @@ use openstack_sdk::AsyncOpenStack; use eyre::eyre; use openstack_cli_core::common::parse_key_val; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::os_inherit::domain::user::role::inherited_to_project::inherited_to_projects; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_inherit::domain::user::role::inherited_to_project::response::inherited_to_projects::InheritedToProjectResponse; use serde_json::Value; use tracing::warn; @@ -240,9 +239,7 @@ impl InheritedToProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_inherit/project/group/role/inherited_to_project/get.rs b/cli-cmd/identity/src/v3/os_inherit/project/group/role/inherited_to_project/get.rs index 7656e2d66..2315bfc5a 100644 --- a/cli-cmd/identity/src/v3/os_inherit/project/group/role/inherited_to_project/get.rs +++ b/cli-cmd/identity/src/v3/os_inherit/project/group/role/inherited_to_project/get.rs @@ -29,11 +29,10 @@ use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; use eyre::eyre; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_inherit::project::group::role::inherited_to_project::get; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_inherit::project::group::role::inherited_to_project::response::get::InheritedToProjectResponse; use tracing::warn; /// Check for an inherited grant for a group on a project. @@ -172,9 +171,7 @@ impl InheritedToProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_inherit/project/group/role/inherited_to_project/inherited_to_projects.rs b/cli-cmd/identity/src/v3/os_inherit/project/group/role/inherited_to_project/inherited_to_projects.rs index ad0396562..6990ed4bf 100644 --- a/cli-cmd/identity/src/v3/os_inherit/project/group/role/inherited_to_project/inherited_to_projects.rs +++ b/cli-cmd/identity/src/v3/os_inherit/project/group/role/inherited_to_project/inherited_to_projects.rs @@ -30,11 +30,10 @@ use openstack_sdk::AsyncOpenStack; use eyre::eyre; use openstack_cli_core::common::parse_key_val; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_inherit::project::group::role::inherited_to_project::inherited_to_projects; use openstack_sdk::api::identity::v3::project::find as find_project; -use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_inherit::project::group::role::inherited_to_project::response::inherited_to_projects::InheritedToProjectResponse; use serde_json::Value; use tracing::warn; @@ -183,9 +182,7 @@ impl InheritedToProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_inherit/project/user/role/inherited_to_project/get.rs b/cli-cmd/identity/src/v3/os_inherit/project/user/role/inherited_to_project/get.rs index 0047ac987..973e58bcd 100644 --- a/cli-cmd/identity/src/v3/os_inherit/project/user/role/inherited_to_project/get.rs +++ b/cli-cmd/identity/src/v3/os_inherit/project/user/role/inherited_to_project/get.rs @@ -29,12 +29,11 @@ use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; use eyre::eyre; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_inherit::project::user::role::inherited_to_project::get; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_inherit::project::user::role::inherited_to_project::response::get::InheritedToProjectResponse; use tracing::warn; /// Check for an inherited grant for a user on a project. @@ -225,9 +224,7 @@ impl InheritedToProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_inherit/project/user/role/inherited_to_project/inherited_to_projects.rs b/cli-cmd/identity/src/v3/os_inherit/project/user/role/inherited_to_project/inherited_to_projects.rs index 715d26e4c..9f2df2b9f 100644 --- a/cli-cmd/identity/src/v3/os_inherit/project/user/role/inherited_to_project/inherited_to_projects.rs +++ b/cli-cmd/identity/src/v3/os_inherit/project/user/role/inherited_to_project/inherited_to_projects.rs @@ -30,12 +30,11 @@ use openstack_sdk::AsyncOpenStack; use eyre::eyre; use openstack_cli_core::common::parse_key_val; +use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::os_inherit::project::user::role::inherited_to_project::inherited_to_projects; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_sdk::api::QueryAsync; -use openstack_types::identity::v3::os_inherit::project::user::role::inherited_to_project::response::inherited_to_projects::InheritedToProjectResponse; use serde_json::Value; use tracing::warn; @@ -236,9 +235,7 @@ impl InheritedToProjectCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth1/access_token/create.rs b/cli-cmd/identity/src/v3/os_oauth1/access_token/create.rs index e6e9705bf..719a01e7c 100644 --- a/cli-cmd/identity/src/v3/os_oauth1/access_token/create.rs +++ b/cli-cmd/identity/src/v3/os_oauth1/access_token/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth1::access_token::create; -use openstack_types::identity::v3::os_oauth1::access_token::response::create::AccessTokenResponse; use serde_json::Value; /// POST operation on /v3/OS-OAUTH1/access_token @@ -84,9 +83,7 @@ impl AccessTokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth1/access_token/get.rs b/cli-cmd/identity/src/v3/os_oauth1/access_token/get.rs index f312b4475..b86c5b49d 100644 --- a/cli-cmd/identity/src/v3/os_oauth1/access_token/get.rs +++ b/cli-cmd/identity/src/v3/os_oauth1/access_token/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth1::access_token::get; -use openstack_types::identity::v3::os_oauth1::access_token::response::get::AccessTokenResponse; /// GET operation on /v3/OS-OAUTH1/access_token #[derive(Args)] @@ -73,9 +72,7 @@ impl AccessTokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth1/authorize/set.rs b/cli-cmd/identity/src/v3/os_oauth1/authorize/set.rs index 6c9d599eb..2a52a2ed0 100644 --- a/cli-cmd/identity/src/v3/os_oauth1/authorize/set.rs +++ b/cli-cmd/identity/src/v3/os_oauth1/authorize/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth1::authorize::set; -use openstack_types::identity::v3::os_oauth1::authorize::response::set::AuthorizeResponse; use serde_json::Value; /// PUT operation on /v3/OS-OAUTH1/authorize/{request_token_id} @@ -95,9 +94,7 @@ impl AuthorizeCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth1/consumer/create.rs b/cli-cmd/identity/src/v3/os_oauth1/consumer/create.rs index 6c0e89f26..3b8e8d8da 100644 --- a/cli-cmd/identity/src/v3/os_oauth1/consumer/create.rs +++ b/cli-cmd/identity/src/v3/os_oauth1/consumer/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth1::consumer::create; -use openstack_types::identity::v3::os_oauth1::consumer::response::create::ConsumerResponse; use serde_json::Value; /// POST operation on /v3/OS-OAUTH1/consumers @@ -84,9 +83,7 @@ impl ConsumerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth1/consumer/list.rs b/cli-cmd/identity/src/v3/os_oauth1/consumer/list.rs index d5f2df0c3..9935b8e21 100644 --- a/cli-cmd/identity/src/v3/os_oauth1/consumer/list.rs +++ b/cli-cmd/identity/src/v3/os_oauth1/consumer/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth1::consumer::list; -use openstack_types::identity::v3::os_oauth1::consumer::response::list::ConsumerResponse; /// GET operation on /v3/OS-OAUTH1/consumers #[derive(Args)] @@ -73,9 +72,7 @@ impl ConsumersCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth1/consumer/set.rs b/cli-cmd/identity/src/v3/os_oauth1/consumer/set.rs index 15706995f..ad51d3a8b 100644 --- a/cli-cmd/identity/src/v3/os_oauth1/consumer/set.rs +++ b/cli-cmd/identity/src/v3/os_oauth1/consumer/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth1::consumer::set; -use openstack_types::identity::v3::os_oauth1::consumer::response::set::ConsumerResponse; use serde_json::Value; /// PATCH operation on /v3/OS-OAUTH1/consumers/{consumer_id} @@ -94,9 +93,7 @@ impl ConsumerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth1/consumer/show.rs b/cli-cmd/identity/src/v3/os_oauth1/consumer/show.rs index e9e3c32a9..f18452776 100644 --- a/cli-cmd/identity/src/v3/os_oauth1/consumer/show.rs +++ b/cli-cmd/identity/src/v3/os_oauth1/consumer/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth1::consumer::get; -use openstack_types::identity::v3::os_oauth1::consumer::response::get::ConsumerResponse; /// GET operation on /v3/OS-OAUTH1/consumers/{consumer_id} #[derive(Args)] @@ -83,9 +82,7 @@ impl ConsumerCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth1/request_token/create.rs b/cli-cmd/identity/src/v3/os_oauth1/request_token/create.rs index ce39ff1f3..30b3bc2b9 100644 --- a/cli-cmd/identity/src/v3/os_oauth1/request_token/create.rs +++ b/cli-cmd/identity/src/v3/os_oauth1/request_token/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth1::request_token::create; -use openstack_types::identity::v3::os_oauth1::request_token::response::create::RequestTokenResponse; use serde_json::Value; /// POST operation on /v3/OS-OAUTH1/request_token @@ -84,9 +83,7 @@ impl RequestTokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth1/request_token/get.rs b/cli-cmd/identity/src/v3/os_oauth1/request_token/get.rs index 74f65e850..803e23491 100644 --- a/cli-cmd/identity/src/v3/os_oauth1/request_token/get.rs +++ b/cli-cmd/identity/src/v3/os_oauth1/request_token/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth1::request_token::get; -use openstack_types::identity::v3::os_oauth1::request_token::response::get::RequestTokenResponse; /// GET operation on /v3/OS-OAUTH1/request_token #[derive(Args)] @@ -73,9 +72,7 @@ impl RequestTokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth2/token/create.rs b/cli-cmd/identity/src/v3/os_oauth2/token/create.rs index 0b6a42f99..574544db2 100644 --- a/cli-cmd/identity/src/v3/os_oauth2/token/create.rs +++ b/cli-cmd/identity/src/v3/os_oauth2/token/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth2::token::create; -use openstack_types::identity::v3::os_oauth2::token::response::create::TokenResponse; use serde_json::Value; /// Get an OAuth2.0 Access Token. @@ -86,9 +85,7 @@ impl TokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth2/token/get.rs b/cli-cmd/identity/src/v3/os_oauth2/token/get.rs index 751c31566..e284d416a 100644 --- a/cli-cmd/identity/src/v3/os_oauth2/token/get.rs +++ b/cli-cmd/identity/src/v3/os_oauth2/token/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth2::token::get; -use openstack_types::identity::v3::os_oauth2::token::response::get::TokenResponse; /// The method is not allowed. #[derive(Args)] @@ -70,9 +69,7 @@ impl TokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth2/token/set.rs b/cli-cmd/identity/src/v3/os_oauth2/token/set.rs index 6287209c0..59c789ac3 100644 --- a/cli-cmd/identity/src/v3/os_oauth2/token/set.rs +++ b/cli-cmd/identity/src/v3/os_oauth2/token/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth2::token::set; -use openstack_types::identity::v3::os_oauth2::token::response::set::TokenResponse; use serde_json::Value; /// The method is not allowed. @@ -81,9 +80,7 @@ impl TokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_oauth2/token/token.rs b/cli-cmd/identity/src/v3/os_oauth2/token/token.rs index bfe6d51a7..7903a2a4d 100644 --- a/cli-cmd/identity/src/v3/os_oauth2/token/token.rs +++ b/cli-cmd/identity/src/v3/os_oauth2/token/token.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_oauth2::token::token; -use openstack_types::identity::v3::os_oauth2::token::response::token::TokenResponse; use serde_json::Value; /// Request of the OS-OAUTH2/token:put operation @@ -84,9 +83,7 @@ impl TokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_revoke/event/get.rs b/cli-cmd/identity/src/v3/os_revoke/event/get.rs index c4be041de..2035ab150 100644 --- a/cli-cmd/identity/src/v3/os_revoke/event/get.rs +++ b/cli-cmd/identity/src/v3/os_revoke/event/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_revoke::event::get; -use openstack_types::identity::v3::os_revoke::event::response::get::EventResponse; /// GET operation on /v3/OS-REVOKE/events #[derive(Args)] @@ -70,9 +69,7 @@ impl EventCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_simple_cert/ca/get.rs b/cli-cmd/identity/src/v3/os_simple_cert/ca/get.rs index 502b2d37b..99ef61512 100644 --- a/cli-cmd/identity/src/v3/os_simple_cert/ca/get.rs +++ b/cli-cmd/identity/src/v3/os_simple_cert/ca/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_simple_cert::ca::get; -use openstack_types::identity::v3::os_simple_cert::ca::response::get::CaResponse; /// GET operation on /v3/OS-SIMPLE-CERT/ca #[derive(Args)] @@ -73,9 +72,7 @@ impl CaCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_simple_cert/certificate/get.rs b/cli-cmd/identity/src/v3/os_simple_cert/certificate/get.rs index 80e6f4a99..79a237fe7 100644 --- a/cli-cmd/identity/src/v3/os_simple_cert/certificate/get.rs +++ b/cli-cmd/identity/src/v3/os_simple_cert/certificate/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_simple_cert::certificate::get; -use openstack_types::identity::v3::os_simple_cert::certificate::response::get::CertificateResponse; /// GET operation on /v3/OS-SIMPLE-CERT/certificates #[derive(Args)] @@ -73,9 +72,7 @@ impl CertificateCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_trust/trust/create.rs b/cli-cmd/identity/src/v3/os_trust/trust/create.rs index 8cec64baa..31cbda1ba 100644 --- a/cli-cmd/identity/src/v3/os_trust/trust/create.rs +++ b/cli-cmd/identity/src/v3/os_trust/trust/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_trust::trust::create; -use openstack_types::identity::v3::os_trust::trust::response::create::TrustResponse; +use openstack_types::identity::v3::os_trust::trust::response; use serde_json::Value; /// Create a new trust. @@ -228,8 +228,9 @@ impl TrustCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/os_trust/trust/list.rs b/cli-cmd/identity/src/v3/os_trust/trust/list.rs index 1a743b727..087382c36 100644 --- a/cli-cmd/identity/src/v3/os_trust/trust/list.rs +++ b/cli-cmd/identity/src/v3/os_trust/trust/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_trust::trust::list; -use openstack_types::identity::v3::os_trust::trust::response::list::TrustResponse; +use openstack_types::identity::v3::os_trust::trust::response; /// Dispatch for LIST trusts. /// @@ -91,7 +91,8 @@ impl TrustsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_trust/trust/role/list.rs b/cli-cmd/identity/src/v3/os_trust/trust/role/list.rs index 8738b4eeb..4c52e5c8e 100644 --- a/cli-cmd/identity/src/v3/os_trust/trust/role/list.rs +++ b/cli-cmd/identity/src/v3/os_trust/trust/role/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_trust::trust::role::list; -use openstack_types::identity::v3::os_trust::trust::role::response::list::RoleResponse; /// GET operation on /v3/OS-TRUST/trusts/{trust_id}/roles #[derive(Args)] @@ -84,9 +83,7 @@ impl RolesCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_trust/trust/role/show.rs b/cli-cmd/identity/src/v3/os_trust/trust/role/show.rs index fd54aa9b5..cf2a8b95e 100644 --- a/cli-cmd/identity/src/v3/os_trust/trust/role/show.rs +++ b/cli-cmd/identity/src/v3/os_trust/trust/role/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_trust::trust::role::get; -use openstack_types::identity::v3::os_trust::trust::role::response::get::RoleResponse; /// Get a role that has been assigned to a trust. #[derive(Args)] @@ -94,9 +93,7 @@ impl RoleCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/os_trust/trust/show.rs b/cli-cmd/identity/src/v3/os_trust/trust/show.rs index 56c0bfa6a..5283dd55d 100644 --- a/cli-cmd/identity/src/v3/os_trust/trust/show.rs +++ b/cli-cmd/identity/src/v3/os_trust/trust/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::os_trust::trust::get; -use openstack_types::identity::v3::os_trust::trust::response::get::TrustResponse; +use openstack_types::identity::v3::os_trust::trust::response; /// Get trust. /// @@ -83,8 +83,9 @@ impl TrustCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/policy/create.rs b/cli-cmd/identity/src/v3/policy/create.rs index 8fad143e5..b87fa4cc0 100644 --- a/cli-cmd/identity/src/v3/policy/create.rs +++ b/cli-cmd/identity/src/v3/policy/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::create; -use openstack_types::identity::v3::policy::response::create::PolicyResponse; use serde_json::Value; /// Creates a policy. @@ -84,9 +83,7 @@ impl PolicyCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/list.rs b/cli-cmd/identity/src/v3/policy/list.rs index 399d14ca4..6bea28ab7 100644 --- a/cli-cmd/identity/src/v3/policy/list.rs +++ b/cli-cmd/identity/src/v3/policy/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::list; -use openstack_types::identity::v3::policy::response::list::PolicyResponse; /// Lists policies. /// @@ -73,9 +72,7 @@ impl PoliciesCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/list.rs b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/list.rs index f6bd69903..ee7a7bde3 100644 --- a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/list.rs +++ b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::os_endpoint_policy::endpoint::list; -use openstack_types::identity::v3::policy::os_endpoint_policy::endpoint::response::list::EndpointResponse; /// GET operation on /v3/policies/{policy_id}/OS-ENDPOINT-POLICY/endpoints #[derive(Args)] @@ -84,9 +83,7 @@ impl EndpointsCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/set.rs b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/set.rs index 8b16146c2..29069a443 100644 --- a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/set.rs +++ b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::os_endpoint_policy::endpoint::set; -use openstack_types::identity::v3::policy::os_endpoint_policy::endpoint::response::set::EndpointResponse; use serde_json::Value; /// PUT operation on @@ -106,9 +105,7 @@ impl EndpointCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/show.rs b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/show.rs index 758ccf7b7..c2f601bf7 100644 --- a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/show.rs +++ b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/endpoint/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::os_endpoint_policy::endpoint::get; -use openstack_types::identity::v3::policy::os_endpoint_policy::endpoint::response::get::EndpointResponse; /// GET operation on /// /v3/policies/{policy_id}/OS-ENDPOINT-POLICY/endpoints/{endpoint_id} @@ -95,9 +94,7 @@ impl EndpointCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/region/set.rs b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/region/set.rs index 66e52293c..d2e2c1e54 100644 --- a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/region/set.rs +++ b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/region/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::os_endpoint_policy::service::region::set; -use openstack_types::identity::v3::policy::os_endpoint_policy::service::region::response::set::RegionResponse; use serde_json::Value; /// PUT operation on @@ -119,9 +118,7 @@ impl RegionCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/region/show.rs b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/region/show.rs index 84e1825bb..4e967df54 100644 --- a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/region/show.rs +++ b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/region/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::os_endpoint_policy::service::region::get; -use openstack_types::identity::v3::policy::os_endpoint_policy::service::region::response::get::RegionResponse; /// GET operation on /// /v3/policies/{policy_id}/OS-ENDPOINT-POLICY/services/{service_id}/regions/{region_id} @@ -108,9 +107,7 @@ impl RegionCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/set.rs b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/set.rs index 8b00897aa..9f549a5d7 100644 --- a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/set.rs +++ b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::os_endpoint_policy::service::set; -use openstack_types::identity::v3::policy::os_endpoint_policy::service::response::set::ServiceResponse; use serde_json::Value; /// PUT operation on @@ -106,9 +105,7 @@ impl ServiceCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/show.rs b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/show.rs index c037c2b75..49aefc6b6 100644 --- a/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/show.rs +++ b/cli-cmd/identity/src/v3/policy/os_endpoint_policy/service/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::os_endpoint_policy::service::get; -use openstack_types::identity::v3::policy::os_endpoint_policy::service::response::get::ServiceResponse; /// GET operation on /// /v3/policies/{policy_id}/OS-ENDPOINT-POLICY/services/{service_id} @@ -95,9 +94,7 @@ impl ServiceCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/set.rs b/cli-cmd/identity/src/v3/policy/set.rs index d7e372dba..470e1948e 100644 --- a/cli-cmd/identity/src/v3/policy/set.rs +++ b/cli-cmd/identity/src/v3/policy/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::set; -use openstack_types::identity::v3::policy::response::set::PolicyResponse; use serde_json::Value; /// Updates a policy. @@ -94,9 +93,7 @@ impl PolicyCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/policy/show.rs b/cli-cmd/identity/src/v3/policy/show.rs index 00a96b2ed..237341da9 100644 --- a/cli-cmd/identity/src/v3/policy/show.rs +++ b/cli-cmd/identity/src/v3/policy/show.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::policy::get; -use openstack_types::identity::v3::policy::response::get::PolicyResponse; /// Shows details for a policy. /// @@ -83,9 +82,7 @@ impl PolicyCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/project/create.rs b/cli-cmd/identity/src/v3/project/create.rs index 8dd2608ed..55f92a12c 100644 --- a/cli-cmd/identity/src/v3/project/create.rs +++ b/cli-cmd/identity/src/v3/project/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::project::create; -use openstack_types::identity::v3::project::response::create::ProjectResponse; +use openstack_types::identity::v3::project::response; /// Creates a project, where the project may act as a domain. /// @@ -218,8 +218,9 @@ impl ProjectCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/project/group/role/list.rs b/cli-cmd/identity/src/v3/project/group/role/list.rs index a9b8e5455..11c6c1ced 100644 --- a/cli-cmd/identity/src/v3/project/group/role/list.rs +++ b/cli-cmd/identity/src/v3/project/group/role/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::identity::v3::project::group::role::list; -use openstack_types::identity::v3::project::group::role::response::list::RoleResponse; +use openstack_types::identity::v3::project::group::role::response; use tracing::warn; /// Lists role assignments for a group on a project. @@ -163,7 +163,8 @@ impl RolesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/project/list.rs b/cli-cmd/identity/src/v3/project/list.rs index 9afd8408e..f06e630b4 100644 --- a/cli-cmd/identity/src/v3/project/list.rs +++ b/cli-cmd/identity/src/v3/project/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::project::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::identity::v3::project::response::list::ProjectResponse; +use openstack_types::identity::v3::project::response; use tracing::warn; /// Lists projects. @@ -219,7 +219,8 @@ impl ProjectsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/project/set.rs b/cli-cmd/identity/src/v3/project/set.rs index 61d98154b..ca2a76e81 100644 --- a/cli-cmd/identity/src/v3/project/set.rs +++ b/cli-cmd/identity/src/v3/project/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::project::find; use openstack_sdk::api::identity::v3::project::set; -use openstack_types::identity::v3::project::response::set::ProjectResponse; +use openstack_types::identity::v3::project::response; /// Updates a project. /// @@ -184,8 +184,9 @@ impl ProjectCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/project/show.rs b/cli-cmd/identity/src/v3/project/show.rs index 8a143dcf3..3fccc2639 100644 --- a/cli-cmd/identity/src/v3/project/show.rs +++ b/cli-cmd/identity/src/v3/project/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::project::find; -use openstack_types::identity::v3::project::response::get::ProjectResponse; +use openstack_types::identity::v3::project::response; /// Shows details for a project. /// @@ -85,7 +85,7 @@ impl ProjectCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/project/tag/list.rs b/cli-cmd/identity/src/v3/project/tag/list.rs index 8274f602c..8966d4e0b 100644 --- a/cli-cmd/identity/src/v3/project/tag/list.rs +++ b/cli-cmd/identity/src/v3/project/tag/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::identity::v3::project::tag::list; -use openstack_types::identity::v3::project::tag::response::list::TagResponse; +use openstack_types::identity::v3::project::tag::response; use tracing::warn; /// Lists all tags within a project. @@ -149,7 +149,8 @@ impl TagsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/project/tag/replace.rs b/cli-cmd/identity/src/v3/project/tag/replace.rs index 56a4c2fbd..cb0c3f7b7 100644 --- a/cli-cmd/identity/src/v3/project/tag/replace.rs +++ b/cli-cmd/identity/src/v3/project/tag/replace.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::identity::v3::project::tag::replace; -use openstack_types::identity::v3::project::tag::response::replace::TagResponse; +use openstack_types::identity::v3::project::tag::response; use tracing::warn; /// Modifies the tags for a project. Any existing tags not specified will be @@ -161,7 +161,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/project/user/role/list.rs b/cli-cmd/identity/src/v3/project/user/role/list.rs index 28549a95f..ba82276a6 100644 --- a/cli-cmd/identity/src/v3/project/user/role/list.rs +++ b/cli-cmd/identity/src/v3/project/user/role/list.rs @@ -34,7 +34,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::identity::v3::project::user::role::list; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::project::user::role::response::list::RoleResponse; +use openstack_types::identity::v3::project::user::role::response; use tracing::warn; /// Lists role assignments for a user on a project. @@ -217,7 +217,8 @@ impl RolesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/region/create.rs b/cli-cmd/identity/src/v3/region/create.rs index 4283bbc22..77a0ed579 100644 --- a/cli-cmd/identity/src/v3/region/create.rs +++ b/cli-cmd/identity/src/v3/region/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::region::create; -use openstack_types::identity::v3::region::response::create::RegionResponse; +use openstack_types::identity::v3::region::response; /// Creates a region. /// @@ -140,8 +140,9 @@ impl RegionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/region/list.rs b/cli-cmd/identity/src/v3/region/list.rs index ca4f6520a..8862018d9 100644 --- a/cli-cmd/identity/src/v3/region/list.rs +++ b/cli-cmd/identity/src/v3/region/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::region::list; -use openstack_types::identity::v3::region::response::list::RegionResponse; +use openstack_types::identity::v3::region::response; /// Lists regions. /// @@ -83,7 +83,8 @@ impl RegionsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/region/set.rs b/cli-cmd/identity/src/v3/region/set.rs index 0da214c5a..affc67806 100644 --- a/cli-cmd/identity/src/v3/region/set.rs +++ b/cli-cmd/identity/src/v3/region/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::region::set; -use openstack_types::identity::v3::region::response::set::RegionResponse; +use openstack_types::identity::v3::region::response; /// Updates a region. /// @@ -149,8 +149,9 @@ impl RegionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/region/show.rs b/cli-cmd/identity/src/v3/region/show.rs index 61f8de6b8..593edecef 100644 --- a/cli-cmd/identity/src/v3/region/show.rs +++ b/cli-cmd/identity/src/v3/region/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::region::get; -use openstack_types::identity::v3::region::response::get::RegionResponse; +use openstack_types::identity::v3::region::response; /// Shows details for a region, by ID. /// @@ -83,8 +83,9 @@ impl RegionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/registered_limit/create.rs b/cli-cmd/identity/src/v3/registered_limit/create.rs index fea28708b..c75aa9648 100644 --- a/cli-cmd/identity/src/v3/registered_limit/create.rs +++ b/cli-cmd/identity/src/v3/registered_limit/create.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::registered_limit::create; -use openstack_types::identity::v3::registered_limit::response::create::RegisteredLimitResponse; +use openstack_types::identity::v3::registered_limit::response; use serde_json::Value; /// Creates registered limits. It supports to create more than one registered @@ -95,8 +95,9 @@ impl RegisteredLimitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/registered_limit/list.rs b/cli-cmd/identity/src/v3/registered_limit/list.rs index bd7a4f972..1a6987de5 100644 --- a/cli-cmd/identity/src/v3/registered_limit/list.rs +++ b/cli-cmd/identity/src/v3/registered_limit/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::registered_limit::list; -use openstack_types::identity::v3::registered_limit::response::list::RegisteredLimitResponse; +use openstack_types::identity::v3::registered_limit::response; /// Lists Registered Limits. /// @@ -101,7 +101,8 @@ impl RegisteredLimitsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/registered_limit/set.rs b/cli-cmd/identity/src/v3/registered_limit/set.rs index 70e86affa..f6e5cf094 100644 --- a/cli-cmd/identity/src/v3/registered_limit/set.rs +++ b/cli-cmd/identity/src/v3/registered_limit/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::registered_limit::set; -use openstack_types::identity::v3::registered_limit::response::set::RegisteredLimitResponse; +use openstack_types::identity::v3::registered_limit::response; /// Updates the specified registered limit. /// @@ -160,8 +160,9 @@ impl RegisteredLimitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/registered_limit/show.rs b/cli-cmd/identity/src/v3/registered_limit/show.rs index 9bc39ab38..9dea69b99 100644 --- a/cli-cmd/identity/src/v3/registered_limit/show.rs +++ b/cli-cmd/identity/src/v3/registered_limit/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::registered_limit::get; -use openstack_types::identity::v3::registered_limit::response::get::RegisteredLimitResponse; +use openstack_types::identity::v3::registered_limit::response; /// Shows details for a registered limit. /// @@ -88,8 +88,9 @@ impl RegisteredLimitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/role/create.rs b/cli-cmd/identity/src/v3/role/create.rs index 0cca2c891..95c93c1c6 100644 --- a/cli-cmd/identity/src/v3/role/create.rs +++ b/cli-cmd/identity/src/v3/role/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::role::create; -use openstack_types::identity::v3::role::response::create::RoleResponse; +use openstack_types::identity::v3::role::response; /// Creates a role. /// @@ -150,8 +150,9 @@ impl RoleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/role/imply/list.rs b/cli-cmd/identity/src/v3/role/imply/list.rs index 1cdfcad4b..ccafc5c88 100644 --- a/cli-cmd/identity/src/v3/role/imply/list.rs +++ b/cli-cmd/identity/src/v3/role/imply/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::role::imply::list; -use openstack_types::identity::v3::role::imply::response::list::ImplyResponse; +use openstack_types::identity::v3::role::imply::response; /// Lists implied (inference) roles for a role. /// @@ -84,8 +84,9 @@ impl ImpliesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/role/imply/set.rs b/cli-cmd/identity/src/v3/role/imply/set.rs index 657398f59..3dc3b0b82 100644 --- a/cli-cmd/identity/src/v3/role/imply/set.rs +++ b/cli-cmd/identity/src/v3/role/imply/set.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::role::imply::set; -use openstack_types::identity::v3::role::imply::response::set::ImplyResponse; +use openstack_types::identity::v3::role::imply::response; /// Creates a role inference rule. /// @@ -94,8 +94,9 @@ impl ImplyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/role/imply/show.rs b/cli-cmd/identity/src/v3/role/imply/show.rs index df4ab9a06..defc5f51e 100644 --- a/cli-cmd/identity/src/v3/role/imply/show.rs +++ b/cli-cmd/identity/src/v3/role/imply/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::role::imply::get; -use openstack_types::identity::v3::role::imply::response::get::ImplyResponse; +use openstack_types::identity::v3::role::imply::response; /// Gets a role inference rule. /// @@ -94,8 +94,9 @@ impl ImplyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/role/list.rs b/cli-cmd/identity/src/v3/role/list.rs index c926f8f64..6f7ed2cde 100644 --- a/cli-cmd/identity/src/v3/role/list.rs +++ b/cli-cmd/identity/src/v3/role/list.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::role::list; -use openstack_types::identity::v3::role::response::list::RoleResponse; +use openstack_types::identity::v3::role::response; use tracing::warn; /// Lists roles. @@ -149,7 +149,8 @@ impl RolesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/role/set.rs b/cli-cmd/identity/src/v3/role/set.rs index b5426416f..6406a01ad 100644 --- a/cli-cmd/identity/src/v3/role/set.rs +++ b/cli-cmd/identity/src/v3/role/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::role::find; use openstack_sdk::api::identity::v3::role::set; -use openstack_types::identity::v3::role::response::set::RoleResponse; +use openstack_types::identity::v3::role::response; /// Updates a role. /// @@ -177,8 +177,9 @@ impl RoleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/role/show.rs b/cli-cmd/identity/src/v3/role/show.rs index c3f3c9dcf..83cc97708 100644 --- a/cli-cmd/identity/src/v3/role/show.rs +++ b/cli-cmd/identity/src/v3/role/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::role::find; -use openstack_types::identity::v3::role::response::get::RoleResponse; +use openstack_types::identity::v3::role::response; /// Shows details for a role. /// @@ -85,7 +85,7 @@ impl RoleCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/role_assignment/list.rs b/cli-cmd/identity/src/v3/role_assignment/list.rs index f26c2bd65..dde0d1e3c 100644 --- a/cli-cmd/identity/src/v3/role_assignment/list.rs +++ b/cli-cmd/identity/src/v3/role_assignment/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::role_assignment::list; -use openstack_types::identity::v3::role_assignment::response::list::RoleAssignmentResponse; +use openstack_types::identity::v3::role_assignment::response; /// Get a list of role assignments. /// @@ -207,7 +207,8 @@ impl RoleAssignmentsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/role_inference/list.rs b/cli-cmd/identity/src/v3/role_inference/list.rs index de18a65e2..218061568 100644 --- a/cli-cmd/identity/src/v3/role_inference/list.rs +++ b/cli-cmd/identity/src/v3/role_inference/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::role_inference::list; -use openstack_types::identity::v3::role_inference::response::list::RoleInferenceResponse; +use openstack_types::identity::v3::role_inference::response; /// Lists all role inference rules. /// @@ -75,7 +75,8 @@ impl RoleInferencesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/s3token/create.rs b/cli-cmd/identity/src/v3/s3token/create.rs index 28b0c3605..a7e629e5e 100644 --- a/cli-cmd/identity/src/v3/s3token/create.rs +++ b/cli-cmd/identity/src/v3/s3token/create.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::s3token::create; -use openstack_types::identity::v3::s3token::response::create::S3tokenResponse; use serde_json::Value; /// Authenticate s3token. @@ -82,9 +81,7 @@ impl S3TokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/s3token/get.rs b/cli-cmd/identity/src/v3/s3token/get.rs index de9016ce1..05b65aa69 100644 --- a/cli-cmd/identity/src/v3/s3token/get.rs +++ b/cli-cmd/identity/src/v3/s3token/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::s3token::get; -use openstack_types::identity::v3::s3token::response::get::S3tokenResponse; /// GET operation on /v3/s3tokens #[derive(Args)] @@ -69,9 +68,7 @@ impl S3TokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/service/create.rs b/cli-cmd/identity/src/v3/service/create.rs index 49371e2e1..5d63bf24a 100644 --- a/cli-cmd/identity/src/v3/service/create.rs +++ b/cli-cmd/identity/src/v3/service/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::service::create; -use openstack_types::identity::v3::service::response::create::ServiceResponse; +use openstack_types::identity::v3::service::response; /// Creates a service. /// @@ -117,8 +117,9 @@ impl ServiceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/service/list.rs b/cli-cmd/identity/src/v3/service/list.rs index 1521be910..b3e29bde8 100644 --- a/cli-cmd/identity/src/v3/service/list.rs +++ b/cli-cmd/identity/src/v3/service/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::service::list; -use openstack_types::identity::v3::service::response::list::ServiceResponse; +use openstack_types::identity::v3::service::response; /// Lists all services. /// @@ -83,7 +83,8 @@ impl ServicesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/service/set.rs b/cli-cmd/identity/src/v3/service/set.rs index 6ec5b0b54..db17cbd72 100644 --- a/cli-cmd/identity/src/v3/service/set.rs +++ b/cli-cmd/identity/src/v3/service/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::service::find; use openstack_sdk::api::identity::v3::service::set; -use openstack_types::identity::v3::service::response::set::ServiceResponse; +use openstack_types::identity::v3::service::response; /// Updates a service. /// @@ -147,8 +147,9 @@ impl ServiceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/service/show.rs b/cli-cmd/identity/src/v3/service/show.rs index e543f44fd..32aaa29d9 100644 --- a/cli-cmd/identity/src/v3/service/show.rs +++ b/cli-cmd/identity/src/v3/service/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::service::find; -use openstack_types::identity::v3::service::response::get::ServiceResponse; +use openstack_types::identity::v3::service::response; /// Shows details for a service. /// @@ -85,7 +85,7 @@ impl ServiceCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/system/group/role/list.rs b/cli-cmd/identity/src/v3/system/group/role/list.rs index ffb94e867..a344adc5e 100644 --- a/cli-cmd/identity/src/v3/system/group/role/list.rs +++ b/cli-cmd/identity/src/v3/system/group/role/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::system::group::role::list; -use openstack_types::identity::v3::system::group::role::response::list::RoleResponse; +use openstack_types::identity::v3::system::group::role::response; /// Lists all system role assignment a group has. /// @@ -89,7 +89,8 @@ impl RolesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/system/user/role/list.rs b/cli-cmd/identity/src/v3/system/user/role/list.rs index 5e42beb9c..aaba0e1ea 100644 --- a/cli-cmd/identity/src/v3/system/user/role/list.rs +++ b/cli-cmd/identity/src/v3/system/user/role/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::system::user::role::list; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::system::user::role::response::list::RoleResponse; +use openstack_types::identity::v3::system::user::role::response; use tracing::warn; /// Lists all system role assignment a user has. @@ -147,7 +147,8 @@ impl RolesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/access_rule/list.rs b/cli-cmd/identity/src/v3/user/access_rule/list.rs index 92dd26a7f..b3c026be6 100644 --- a/cli-cmd/identity/src/v3/user/access_rule/list.rs +++ b/cli-cmd/identity/src/v3/user/access_rule/list.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::access_rule::list; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::user::access_rule::response::list::AccessRuleResponse; +use openstack_types::identity::v3::user::access_rule::response; use tracing::warn; /// List all access rules for a user. @@ -170,7 +170,8 @@ impl AccessRulesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/access_rule/show.rs b/cli-cmd/identity/src/v3/user/access_rule/show.rs index dbd33a3d8..9f0c87fcb 100644 --- a/cli-cmd/identity/src/v3/user/access_rule/show.rs +++ b/cli-cmd/identity/src/v3/user/access_rule/show.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::access_rule::get; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::user::access_rule::response::get::AccessRuleResponse; +use openstack_types::identity::v3::user::access_rule::response; use tracing::warn; /// Show details of an access rule. @@ -156,8 +156,9 @@ impl AccessRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/user/application_credential/create.rs b/cli-cmd/identity/src/v3/user/application_credential/create.rs index 996d6e1a7..9e08add45 100644 --- a/cli-cmd/identity/src/v3/user/application_credential/create.rs +++ b/cli-cmd/identity/src/v3/user/application_credential/create.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::application_credential::create; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::user::application_credential::response::create::ApplicationCredentialResponse; +use openstack_types::identity::v3::user::application_credential::response; use serde_json::Value; use tracing::warn; @@ -286,8 +286,9 @@ impl ApplicationCredentialCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/user/application_credential/list.rs b/cli-cmd/identity/src/v3/user/application_credential/list.rs index aaa53b9be..4b1d1d126 100644 --- a/cli-cmd/identity/src/v3/user/application_credential/list.rs +++ b/cli-cmd/identity/src/v3/user/application_credential/list.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::application_credential::list; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::user::application_credential::response::list::ApplicationCredentialResponse; +use openstack_types::identity::v3::user::application_credential::response; use tracing::warn; /// List all application credentials for a user. @@ -154,7 +154,8 @@ impl ApplicationCredentialsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/application_credential/show.rs b/cli-cmd/identity/src/v3/user/application_credential/show.rs index 6291d4d2c..297af6fdf 100644 --- a/cli-cmd/identity/src/v3/user/application_credential/show.rs +++ b/cli-cmd/identity/src/v3/user/application_credential/show.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::application_credential::find; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::user::application_credential::response::get::ApplicationCredentialResponse; +use openstack_types::identity::v3::user::application_credential::response; use tracing::warn; /// Show details of an application credential. @@ -159,7 +159,7 @@ impl ApplicationCredentialCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/create.rs b/cli-cmd/identity/src/v3/user/create.rs index d810018cc..9cafd0d01 100644 --- a/cli-cmd/identity/src/v3/user/create.rs +++ b/cli-cmd/identity/src/v3/user/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::user::create; -use openstack_types::identity::v3::user::response::create::UserResponse; +use openstack_types::identity::v3::user::response; use serde_json::Value; /// Creates a user. @@ -260,8 +260,9 @@ impl UserCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/user/credential/os_ec2/create.rs b/cli-cmd/identity/src/v3/user/credential/os_ec2/create.rs index 9f6df043b..ed4e2ec07 100644 --- a/cli-cmd/identity/src/v3/user/credential/os_ec2/create.rs +++ b/cli-cmd/identity/src/v3/user/credential/os_ec2/create.rs @@ -34,7 +34,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::credential::os_ec2::create; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::user::credential::os_ec2::response::create::OsEc2Response; use serde_json::Value; use tracing::warn; @@ -154,9 +153,7 @@ impl OsEc2Command { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/credential/os_ec2/list.rs b/cli-cmd/identity/src/v3/user/credential/os_ec2/list.rs index f0a959ad1..6f8de06e3 100644 --- a/cli-cmd/identity/src/v3/user/credential/os_ec2/list.rs +++ b/cli-cmd/identity/src/v3/user/credential/os_ec2/list.rs @@ -33,7 +33,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::credential::os_ec2::list; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::user::credential::os_ec2::response::list::OsEc2Response; use tracing::warn; /// List EC2 Credentials for user. @@ -143,9 +142,7 @@ impl OsEc2SCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/credential/os_ec2/show.rs b/cli-cmd/identity/src/v3/user/credential/os_ec2/show.rs index 756ec38a7..2fe79d77e 100644 --- a/cli-cmd/identity/src/v3/user/credential/os_ec2/show.rs +++ b/cli-cmd/identity/src/v3/user/credential/os_ec2/show.rs @@ -33,7 +33,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::credential::os_ec2::get; use openstack_sdk::api::identity::v3::user::find as find_user; -use openstack_types::identity::v3::user::credential::os_ec2::response::get::OsEc2Response; use tracing::warn; /// Get a specific EC2 credential. @@ -154,9 +153,7 @@ impl OsEc2Command { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/group/list.rs b/cli-cmd/identity/src/v3/user/group/list.rs index 4d26001aa..7a3afe4d4 100644 --- a/cli-cmd/identity/src/v3/user/group/list.rs +++ b/cli-cmd/identity/src/v3/user/group/list.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; use openstack_sdk::api::identity::v3::user::group::list; -use openstack_types::identity::v3::user::group::response::list::GroupResponse; +use openstack_types::identity::v3::user::group::response; use tracing::warn; /// Lists groups to which a user belongs. @@ -142,7 +142,8 @@ impl GroupsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/list.rs b/cli-cmd/identity/src/v3/user/list.rs index c78b6f6aa..07ad53ab6 100644 --- a/cli-cmd/identity/src/v3/user/list.rs +++ b/cli-cmd/identity/src/v3/user/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::domain::find as find_domain; use openstack_sdk::api::identity::v3::user::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::identity::v3::user::response::list::UserResponse; +use openstack_types::identity::v3::user::response; use tracing::warn; /// Lists users. @@ -241,7 +241,8 @@ impl UsersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/os_oauth1/access_token/list.rs b/cli-cmd/identity/src/v3/user/os_oauth1/access_token/list.rs index 7c8710aaf..f873f1cc9 100644 --- a/cli-cmd/identity/src/v3/user/os_oauth1/access_token/list.rs +++ b/cli-cmd/identity/src/v3/user/os_oauth1/access_token/list.rs @@ -33,7 +33,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; use openstack_sdk::api::identity::v3::user::os_oauth1::access_token::list; -use openstack_types::identity::v3::user::os_oauth1::access_token::response::list::AccessTokenResponse; use tracing::warn; /// List OAuth1 Access Tokens for user. @@ -143,9 +142,7 @@ impl AccessTokensCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/os_oauth1/access_token/role/list.rs b/cli-cmd/identity/src/v3/user/os_oauth1/access_token/role/list.rs index bd8d1eb55..b33fb9015 100644 --- a/cli-cmd/identity/src/v3/user/os_oauth1/access_token/role/list.rs +++ b/cli-cmd/identity/src/v3/user/os_oauth1/access_token/role/list.rs @@ -33,7 +33,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; use openstack_sdk::api::identity::v3::user::os_oauth1::access_token::role::list; -use openstack_types::identity::v3::user::os_oauth1::access_token::role::response::list::RoleResponse; use tracing::warn; /// List roles for a user access token. @@ -156,9 +155,7 @@ impl RolesCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/os_oauth1/access_token/role/show.rs b/cli-cmd/identity/src/v3/user/os_oauth1/access_token/role/show.rs index bb9490621..c6184e7bd 100644 --- a/cli-cmd/identity/src/v3/user/os_oauth1/access_token/role/show.rs +++ b/cli-cmd/identity/src/v3/user/os_oauth1/access_token/role/show.rs @@ -33,7 +33,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; use openstack_sdk::api::identity::v3::user::os_oauth1::access_token::role::get; -use openstack_types::identity::v3::user::os_oauth1::access_token::role::response::get::RoleResponse; use tracing::warn; /// Get role for access token. @@ -167,9 +166,7 @@ impl RoleCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/os_oauth1/access_token/show.rs b/cli-cmd/identity/src/v3/user/os_oauth1/access_token/show.rs index aabcbf322..196a9106c 100644 --- a/cli-cmd/identity/src/v3/user/os_oauth1/access_token/show.rs +++ b/cli-cmd/identity/src/v3/user/os_oauth1/access_token/show.rs @@ -33,7 +33,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; use openstack_sdk::api::identity::v3::user::os_oauth1::access_token::get; -use openstack_types::identity::v3::user::os_oauth1::access_token::response::get::AccessTokenResponse; use tracing::warn; /// Get specific access token. @@ -154,9 +153,7 @@ impl AccessTokenCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/project/list.rs b/cli-cmd/identity/src/v3/user/project/list.rs index 8b871be48..5b3101198 100644 --- a/cli-cmd/identity/src/v3/user/project/list.rs +++ b/cli-cmd/identity/src/v3/user/project/list.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::user::find as find_user; use openstack_sdk::api::identity::v3::user::project::list; -use openstack_types::identity::v3::user::project::response::list::ProjectResponse; +use openstack_types::identity::v3::user::project::response; use tracing::warn; /// List projects to which the user has authorization to access. @@ -143,7 +143,8 @@ impl ProjectsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/user/set.rs b/cli-cmd/identity/src/v3/user/set.rs index 08825cb00..e6cfaf1fb 100644 --- a/cli-cmd/identity/src/v3/user/set.rs +++ b/cli-cmd/identity/src/v3/user/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::user::find; use openstack_sdk::api::identity::v3::user::set; -use openstack_types::identity::v3::user::response::set::UserResponse; +use openstack_types::identity::v3::user::response; use serde_json::Value; /// Updates a user. @@ -287,8 +287,9 @@ impl UserCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v3/user/show.rs b/cli-cmd/identity/src/v3/user/show.rs index 98eae9201..8aab064b5 100644 --- a/cli-cmd/identity/src/v3/user/show.rs +++ b/cli-cmd/identity/src/v3/user/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::identity::v3::user::find; -use openstack_types::identity::v3::user::response::get::UserResponse; +use openstack_types::identity::v3::user::response; /// Shows details for a user. /// @@ -85,7 +85,7 @@ impl UserCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v3/version/get.rs b/cli-cmd/identity/src/v3/version/get.rs index 9aef53b9d..44fda900a 100644 --- a/cli-cmd/identity/src/v3/version/get.rs +++ b/cli-cmd/identity/src/v3/version/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v3::version::get; -use openstack_types::identity::v3::version::response::get::VersionResponse; /// GET operation on /v3 #[derive(Args)] @@ -69,9 +68,7 @@ impl VersionCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v4/federation/identity_provider/create.rs b/cli-cmd/identity/src/v4/federation/identity_provider/create.rs index e06271a92..e02c78308 100644 --- a/cli-cmd/identity/src/v4/federation/identity_provider/create.rs +++ b/cli-cmd/identity/src/v4/federation/identity_provider/create.rs @@ -20,7 +20,7 @@ //! Wraps invoking of the `v4/federation/identity_providers` with `POST` method use clap::Args; -use eyre::WrapErr; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v4::federation::identity_provider::create; -use openstack_types::identity::v4::federation::identity_provider::response::create::IdentityProviderResponse; +use openstack_types::identity::v4::federation::identity_provider::response; use serde_json::Value; /// Create the identity provider with the specified properties. @@ -213,8 +213,9 @@ impl IdentityProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v4/federation/identity_provider/delete.rs b/cli-cmd/identity/src/v4/federation/identity_provider/delete.rs index 2d2d571b6..569e483ac 100644 --- a/cli-cmd/identity/src/v4/federation/identity_provider/delete.rs +++ b/cli-cmd/identity/src/v4/federation/identity_provider/delete.rs @@ -20,6 +20,7 @@ //! Wraps invoking of the `v4/federation/identity_providers/{idp_id}` with `DELETE` method use clap::Args; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; diff --git a/cli-cmd/identity/src/v4/federation/identity_provider/list.rs b/cli-cmd/identity/src/v4/federation/identity_provider/list.rs index 8a4e2e34e..9283f9c7f 100644 --- a/cli-cmd/identity/src/v4/federation/identity_provider/list.rs +++ b/cli-cmd/identity/src/v4/federation/identity_provider/list.rs @@ -20,6 +20,7 @@ //! Wraps invoking of the `v4/federation/identity_providers` with `GET` method use clap::Args; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; @@ -30,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v4::federation::identity_provider::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::identity::v4::federation::identity_provider::response::list::IdentityProviderResponse; +use openstack_types::identity::v4::federation::identity_provider::response; /// List identity providers. Without any filters only global identity providers /// are returned. With the `domain_id` identity providers owned by the @@ -121,7 +122,8 @@ impl IdentityProvidersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v4/federation/identity_provider/set.rs b/cli-cmd/identity/src/v4/federation/identity_provider/set.rs index a60be7c4f..491306536 100644 --- a/cli-cmd/identity/src/v4/federation/identity_provider/set.rs +++ b/cli-cmd/identity/src/v4/federation/identity_provider/set.rs @@ -20,7 +20,7 @@ //! Wraps invoking of the `v4/federation/identity_providers/{idp_id}` with `PUT` method use clap::Args; -use eyre::WrapErr; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v4::federation::identity_provider::set; -use openstack_types::identity::v4::federation::identity_provider::response::set::IdentityProviderResponse; +use openstack_types::identity::v4::federation::identity_provider::response; use serde_json::Value; /// Updates the existing identity provider. @@ -257,8 +257,9 @@ impl IdentityProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v4/federation/identity_provider/show.rs b/cli-cmd/identity/src/v4/federation/identity_provider/show.rs index a17280875..be3e5d28e 100644 --- a/cli-cmd/identity/src/v4/federation/identity_provider/show.rs +++ b/cli-cmd/identity/src/v4/federation/identity_provider/show.rs @@ -20,6 +20,7 @@ //! Wraps invoking of the `v4/federation/identity_providers/{idp_id}` with `GET` method use clap::Args; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; @@ -29,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v4::federation::identity_provider::get; -use openstack_types::identity::v4::federation::identity_provider::response::get::IdentityProviderResponse; +use openstack_types::identity::v4::federation::identity_provider::response; /// Shows details of the existing identity provider. #[derive(Args)] @@ -84,8 +85,9 @@ impl IdentityProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v4/federation/mapping/create.rs b/cli-cmd/identity/src/v4/federation/mapping/create.rs index d2b362866..41b3c66ec 100644 --- a/cli-cmd/identity/src/v4/federation/mapping/create.rs +++ b/cli-cmd/identity/src/v4/federation/mapping/create.rs @@ -20,7 +20,7 @@ //! Wraps invoking of the `v4/federation/mappings` with `POST` method use clap::Args; -use eyre::WrapErr; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v4::federation::mapping::create; -use openstack_types::identity::v4::federation::mapping::response::create::MappingResponse; +use openstack_types::identity::v4::federation::mapping::response; use serde_json::Value; /// Command without description in OpenAPI @@ -258,8 +258,9 @@ impl MappingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v4/federation/mapping/delete.rs b/cli-cmd/identity/src/v4/federation/mapping/delete.rs index 5026422b8..1760744bf 100644 --- a/cli-cmd/identity/src/v4/federation/mapping/delete.rs +++ b/cli-cmd/identity/src/v4/federation/mapping/delete.rs @@ -20,6 +20,7 @@ //! Wraps invoking of the `v4/federation/mappings/{id}` with `DELETE` method use clap::Args; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; diff --git a/cli-cmd/identity/src/v4/federation/mapping/list.rs b/cli-cmd/identity/src/v4/federation/mapping/list.rs index 862abfa4d..e968cea62 100644 --- a/cli-cmd/identity/src/v4/federation/mapping/list.rs +++ b/cli-cmd/identity/src/v4/federation/mapping/list.rs @@ -20,6 +20,7 @@ //! Wraps invoking of the `v4/federation/mappings` with `GET` method use clap::Args; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; @@ -30,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v4::federation::mapping::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::identity::v4::federation::mapping::response::list::MappingResponse; +use openstack_types::identity::v4::federation::mapping::response; /// List available federation mappings. /// @@ -135,7 +136,8 @@ impl MappingsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/identity/src/v4/federation/mapping/set.rs b/cli-cmd/identity/src/v4/federation/mapping/set.rs index 3487f4997..36e65cfda 100644 --- a/cli-cmd/identity/src/v4/federation/mapping/set.rs +++ b/cli-cmd/identity/src/v4/federation/mapping/set.rs @@ -20,7 +20,7 @@ //! Wraps invoking of the `v4/federation/mappings/{id}` with `PUT` method use clap::Args; -use eyre::WrapErr; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v4::federation::mapping::set; -use openstack_types::identity::v4::federation::mapping::response::set::MappingResponse; +use openstack_types::identity::v4::federation::mapping::response; use serde_json::Value; /// TODO: describe domain_id update rules @@ -315,8 +315,9 @@ impl MappingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/identity/src/v4/federation/mapping/show.rs b/cli-cmd/identity/src/v4/federation/mapping/show.rs index fcad5d269..8789818b7 100644 --- a/cli-cmd/identity/src/v4/federation/mapping/show.rs +++ b/cli-cmd/identity/src/v4/federation/mapping/show.rs @@ -20,6 +20,7 @@ //! Wraps invoking of the `v4/federation/mappings/{id}` with `GET` method use clap::Args; +use eyre::{OptionExt, WrapErr}; use tracing::info; use openstack_cli_core::cli::CliArgs; @@ -29,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::identity::v4::federation::mapping::get; -use openstack_types::identity::v4::federation::mapping::response::get::MappingResponse; +use openstack_types::identity::v4::federation::mapping::response; /// Show the attribute mapping attribute by the ID. #[derive(Args)] @@ -84,8 +85,9 @@ impl MappingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/cache/list.rs b/cli-cmd/image/src/v2/cache/list.rs index 753af9064..83c52c4e0 100644 --- a/cli-cmd/image/src/v2/cache/list.rs +++ b/cli-cmd/image/src/v2/cache/list.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::cache::list; -use openstack_types::image::v2::cache::response::list::CacheResponse; /// Lists all images in cache or queue. *(Since Image API v2.14)* /// @@ -74,9 +73,7 @@ impl CachesCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/cache/set.rs b/cli-cmd/image/src/v2/cache/set.rs index e1f7577ef..08c7ba7df 100644 --- a/cli-cmd/image/src/v2/cache/set.rs +++ b/cli-cmd/image/src/v2/cache/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::cache::set; -use openstack_types::image::v2::cache::response::set::CacheResponse; use serde_json::Value; /// Queues image for caching. *(Since Image API v2.14)* @@ -95,9 +94,7 @@ impl CacheCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/image/create.rs b/cli-cmd/image/src/v2/image/create.rs index 556cd9071..1f490421e 100644 --- a/cli-cmd/image/src/v2/image/create.rs +++ b/cli-cmd/image/src/v2/image/create.rs @@ -31,7 +31,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::create; -use openstack_types::image::v2::image::response::create::ImageResponse; +use openstack_types::image::v2::image::response; use serde_json::Value; /// Creates a catalog record for an operating system disk image. *(Since Image @@ -330,8 +330,9 @@ impl ImageCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/image/deactivate.rs b/cli-cmd/image/src/v2/image/deactivate.rs index 9ed725737..72637111b 100644 --- a/cli-cmd/image/src/v2/image/deactivate.rs +++ b/cli-cmd/image/src/v2/image/deactivate.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::deactivate; -use openstack_types::image::v2::image::response::deactivate::ImageResponse; use serde_json::Value; /// Request of the images/image_id/actions/deactivate:post operation @@ -90,9 +89,7 @@ impl ImageCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/image/list.rs b/cli-cmd/image/src/v2/image/list.rs index 04892109a..ee7443890 100644 --- a/cli-cmd/image/src/v2/image/list.rs +++ b/cli-cmd/image/src/v2/image/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::image::v2::image::response::list::ImageResponse; +use openstack_types::image::v2::image::response; /// Lists public virtual machine (VM) images. *(Since Image API v2.0)* /// @@ -335,7 +335,8 @@ impl ImagesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/image/location/create.rs b/cli-cmd/image/src/v2/image/location/create.rs index 8b149cebe..834ea9574 100644 --- a/cli-cmd/image/src/v2/image/location/create.rs +++ b/cli-cmd/image/src/v2/image/location/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::location::create; -use openstack_types::image::v2::image::location::response::create::LocationResponse; +use openstack_types::image::v2::image::location::response; use serde_json::Value; /// Add location to an image which is in `queued` state. Accepts location url, @@ -154,8 +154,9 @@ impl LocationCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/image/location/list.rs b/cli-cmd/image/src/v2/image/location/list.rs index 320e2cd48..2db79e870 100644 --- a/cli-cmd/image/src/v2/image/location/list.rs +++ b/cli-cmd/image/src/v2/image/location/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::location::list; -use openstack_types::image::v2::image::location::response::list::LocationResponse; +use openstack_types::image::v2::image::location::response; /// Lists all locations associated to an image with location url and store-id, /// accessible to only service user, for non service users API will return @@ -88,8 +88,9 @@ impl LocationsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/image/member/create.rs b/cli-cmd/image/src/v2/image/member/create.rs index 6bc42043e..b92e31d9b 100644 --- a/cli-cmd/image/src/v2/image/member/create.rs +++ b/cli-cmd/image/src/v2/image/member/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::member::create; -use openstack_types::image::v2::image::member::response::create::MemberResponse; +use openstack_types::image::v2::image::member::response; use serde_json::Value; /// Adds a tenant ID as an image member. *(Since Image API v2.1)* @@ -103,8 +103,9 @@ impl MemberCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/image/member/list.rs b/cli-cmd/image/src/v2/image/member/list.rs index 3540565b5..ea98d77cf 100644 --- a/cli-cmd/image/src/v2/image/member/list.rs +++ b/cli-cmd/image/src/v2/image/member/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::member::list; -use openstack_types::image::v2::image::member::response::list::MemberResponse; +use openstack_types::image::v2::image::member::response; /// Lists the tenants that share this image. *(Since Image API v2.1)* /// @@ -96,7 +96,8 @@ impl MembersCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/image/member/set.rs b/cli-cmd/image/src/v2/image/member/set.rs index efff47efe..12666a6a2 100644 --- a/cli-cmd/image/src/v2/image/member/set.rs +++ b/cli-cmd/image/src/v2/image/member/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::member::set; -use openstack_types::image::v2::image::member::response::set::MemberResponse; +use openstack_types::image::v2::image::member::response; use serde_json::Value; /// Sets the status for an image member. *(Since Image API v2.1)* @@ -118,8 +118,9 @@ impl MemberCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/image/member/show.rs b/cli-cmd/image/src/v2/image/member/show.rs index b1edc8b4f..a264c31e2 100644 --- a/cli-cmd/image/src/v2/image/member/show.rs +++ b/cli-cmd/image/src/v2/image/member/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::member::get; -use openstack_types::image::v2::image::member::response::get::MemberResponse; +use openstack_types::image::v2::image::member::response; /// Shows image member details. *(Since Image API v2.1)* /// @@ -98,8 +98,9 @@ impl MemberCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/image/patch.rs b/cli-cmd/image/src/v2/image/patch.rs index a2f88bbcc..bc07abda8 100644 --- a/cli-cmd/image/src/v2/image/patch.rs +++ b/cli-cmd/image/src/v2/image/patch.rs @@ -35,7 +35,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::image::v2::image::find; use openstack_sdk::api::image::v2::image::patch; -use openstack_types::image::v2::image::response::patch::ImageResponse; +use openstack_types::image::v2::image::response::patch::*; use serde_json::Value; use serde_json::json; diff --git a/cli-cmd/image/src/v2/image/reactivate.rs b/cli-cmd/image/src/v2/image/reactivate.rs index 7e2adfc14..6232541ee 100644 --- a/cli-cmd/image/src/v2/image/reactivate.rs +++ b/cli-cmd/image/src/v2/image/reactivate.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::reactivate; -use openstack_types::image::v2::image::response::reactivate::ImageResponse; use serde_json::Value; /// Request of the images/image_id/actions/reactivate:post operation @@ -90,9 +89,7 @@ impl ImageCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/image/show.rs b/cli-cmd/image/src/v2/image/show.rs index 01c734529..4644e033e 100644 --- a/cli-cmd/image/src/v2/image/show.rs +++ b/cli-cmd/image/src/v2/image/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::image::v2::image::find; -use openstack_types::image::v2::image::response::get::ImageResponse; +use openstack_types::image::v2::image::response; /// Shows details for an image. *(Since Image API v2.0)* /// @@ -90,7 +90,7 @@ impl ImageCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/image/stage/stage.rs b/cli-cmd/image/src/v2/image/stage/stage.rs index 40cfac9c8..326c5fed6 100644 --- a/cli-cmd/image/src/v2/image/stage/stage.rs +++ b/cli-cmd/image/src/v2/image/stage/stage.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::stage::stage; -use openstack_types::image::v2::image::stage::response::stage::StageResponse; use serde_json::Value; /// Request of the images/image_id/stage:put operation @@ -91,9 +90,7 @@ impl StageCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/image/tag/set.rs b/cli-cmd/image/src/v2/image/tag/set.rs index 83abe64ca..59e8826f2 100644 --- a/cli-cmd/image/src/v2/image/tag/set.rs +++ b/cli-cmd/image/src/v2/image/tag/set.rs @@ -31,7 +31,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::tag::set; -use openstack_types::image::v2::image::tag::response::set::TagResponse; use serde_json::Value; /// Command without description in OpenAPI @@ -99,9 +98,7 @@ impl TagCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/image/task/list.rs b/cli-cmd/image/src/v2/image/task/list.rs index a5fd9534d..04e7fd42a 100644 --- a/cli-cmd/image/src/v2/image/task/list.rs +++ b/cli-cmd/image/src/v2/image/task/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::image::task::list; -use openstack_types::image::v2::image::task::response::list::TaskResponse; +use openstack_types::image::v2::image::task::response; /// Shows tasks associated with an image. *(Since Image API v2.12)* /// @@ -91,7 +91,8 @@ impl TasksCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/info/import/get.rs b/cli-cmd/image/src/v2/info/import/get.rs index eb139f93c..4eeeaf703 100644 --- a/cli-cmd/image/src/v2/info/import/get.rs +++ b/cli-cmd/image/src/v2/info/import/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::info::import::get; -use openstack_types::image::v2::info::import::response::get::ImportResponse; +use openstack_types::image::v2::info::import::response; /// Returns information concerning the constraints around image import in the /// cloud in which the call is made, for example, supported container formats, @@ -80,8 +80,9 @@ impl ImportCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/info/store/list.rs b/cli-cmd/image/src/v2/info/store/list.rs index 98727ae32..79ec3bf62 100644 --- a/cli-cmd/image/src/v2/info/store/list.rs +++ b/cli-cmd/image/src/v2/info/store/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::info::store::list_detailed; -use openstack_types::image::v2::info::store::response::list_detailed::StoreResponse; +use openstack_types::image::v2::info::store::response; /// Lists all the backend stores, with detail, accessible to admins, for /// non-admin user API will return bad request. @@ -77,7 +77,8 @@ impl StoresCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/info/usage/list.rs b/cli-cmd/image/src/v2/info/usage/list.rs index 71a5c38c3..553133552 100644 --- a/cli-cmd/image/src/v2/info/usage/list.rs +++ b/cli-cmd/image/src/v2/info/usage/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::info::usage::list; -use openstack_types::image::v2::info::usage::response::list::UsageResponse; +use openstack_types::image::v2::info::usage::response; /// The user’s quota and current usage are displayed, if enabled by server-side /// configuration. @@ -75,7 +75,8 @@ impl UsagesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/metadef/namespace/create.rs b/cli-cmd/image/src/v2/metadef/namespace/create.rs index 12912afad..c87570efd 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/create.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/create.rs @@ -31,7 +31,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::create; -use openstack_types::image::v2::metadef::namespace::response::create::NamespaceResponse; +use openstack_types::image::v2::metadef::namespace::response; use serde_json::Value; /// Command without description in OpenAPI @@ -195,8 +195,9 @@ impl NamespaceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/list.rs b/cli-cmd/image/src/v2/metadef/namespace/list.rs index 409b6d7b2..43a5d7c53 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/list.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::list; -use openstack_types::image::v2::metadef::namespace::response::list::NamespaceResponse; +use openstack_types::image::v2::metadef::namespace::response; /// Command without description in OpenAPI #[derive(Args)] @@ -71,7 +71,8 @@ impl NamespacesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/metadef/namespace/object/create.rs b/cli-cmd/image/src/v2/metadef/namespace/object/create.rs index 7ddac30ca..cf8d20c05 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/object/create.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/object/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::object::create; -use openstack_types::image::v2::metadef::namespace::object::response::create::ObjectResponse; +use openstack_types::image::v2::metadef::namespace::object::response; use serde_json::Value; /// Command without description in OpenAPI @@ -125,8 +125,9 @@ impl ObjectCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/object/list.rs b/cli-cmd/image/src/v2/metadef/namespace/object/list.rs index bf8939a45..00b24dc5c 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/object/list.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/object/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::object::list; -use openstack_types::image::v2::metadef::namespace::object::response::list::ObjectResponse; +use openstack_types::image::v2::metadef::namespace::object::response; /// Command without description in OpenAPI #[derive(Args)] @@ -85,7 +85,8 @@ impl ObjectsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/metadef/namespace/object/set.rs b/cli-cmd/image/src/v2/metadef/namespace/object/set.rs index 0e05763ba..5f2ff61bf 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/object/set.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/object/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::object::set; -use openstack_types::image::v2::metadef::namespace::object::response::set::ObjectResponse; +use openstack_types::image::v2::metadef::namespace::object::response; use serde_json::Value; /// Command without description in OpenAPI @@ -135,8 +135,9 @@ impl ObjectCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/object/show.rs b/cli-cmd/image/src/v2/metadef/namespace/object/show.rs index 815fbcb19..175cdd1c4 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/object/show.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/object/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::object::get; -use openstack_types::image::v2::metadef::namespace::object::response::get::ObjectResponse; +use openstack_types::image::v2::metadef::namespace::object::response; /// Command without description in OpenAPI #[derive(Args)] @@ -94,8 +94,9 @@ impl ObjectCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/property/create.rs b/cli-cmd/image/src/v2/metadef/namespace/property/create.rs index 73dde8ae0..7bccdf4db 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/property/create.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/property/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::property::create; -use openstack_types::image::v2::metadef::namespace::property::response::create::PropertyResponse; +use openstack_types::image::v2::metadef::namespace::property::response; use serde_json::Value; /// Command without description in OpenAPI @@ -255,8 +255,9 @@ impl PropertyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/property/list.rs b/cli-cmd/image/src/v2/metadef/namespace/property/list.rs index 8e7572f22..c7481b6ec 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/property/list.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/property/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::property::list; -use openstack_types::image::v2::metadef::namespace::property::response::list::PropertyResponse; +use openstack_types::image::v2::metadef::namespace::property::response; /// Command without description in OpenAPI #[derive(Args)] @@ -85,7 +85,8 @@ impl PropertyCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: serde_json::Value = ep.query_async(client).await?; - op.output_single::(data)?; + + op.output_single::(data)?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/metadef/namespace/property/set.rs b/cli-cmd/image/src/v2/metadef/namespace/property/set.rs index 3d6cdfffc..2505f09d2 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/property/set.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/property/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::property::set; -use openstack_types::image::v2::metadef::namespace::property::response::set::PropertyResponse; +use openstack_types::image::v2::metadef::namespace::property::response; use serde_json::Value; /// Command without description in OpenAPI @@ -265,8 +265,9 @@ impl PropertyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/property/show.rs b/cli-cmd/image/src/v2/metadef/namespace/property/show.rs index 8afc3d649..cdc3310d0 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/property/show.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/property/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::property::get; -use openstack_types::image::v2::metadef::namespace::property::response::get::PropertyResponse; +use openstack_types::image::v2::metadef::namespace::property::response; /// Command without description in OpenAPI #[derive(Args)] @@ -94,8 +94,9 @@ impl PropertyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/resource_type/create.rs b/cli-cmd/image/src/v2/metadef/namespace/resource_type/create.rs index 402be1960..cf2277bc1 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/resource_type/create.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/resource_type/create.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::resource_type::create; -use openstack_types::image::v2::metadef::namespace::resource_type::response::create::ResourceTypeResponse; +use openstack_types::image::v2::metadef::namespace::resource_type::response; /// Command without description in OpenAPI #[derive(Args)] @@ -119,8 +119,9 @@ impl ResourceTypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/resource_type/list.rs b/cli-cmd/image/src/v2/metadef/namespace/resource_type/list.rs index e36d17375..67f3972d5 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/resource_type/list.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/resource_type/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::resource_type::list; -use openstack_types::image::v2::metadef::namespace::resource_type::response::list::ResourceTypeResponse; +use openstack_types::image::v2::metadef::namespace::resource_type::response; /// Command without description in OpenAPI #[derive(Args)] @@ -86,7 +86,8 @@ impl ResourceTypesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/metadef/namespace/set.rs b/cli-cmd/image/src/v2/metadef/namespace/set.rs index 845dd39b1..c2751d3e8 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/set.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/set.rs @@ -31,7 +31,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::set; -use openstack_types::image::v2::metadef::namespace::response::set::NamespaceResponse; +use openstack_types::image::v2::metadef::namespace::response; use serde_json::Value; /// Command without description in OpenAPI @@ -201,8 +201,9 @@ impl NamespaceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/show.rs b/cli-cmd/image/src/v2/metadef/namespace/show.rs index a17a7cca8..20c63e995 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/show.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::get; -use openstack_types::image::v2::metadef::namespace::response::get::NamespaceResponse; +use openstack_types::image::v2::metadef::namespace::response; /// Command without description in OpenAPI #[derive(Args)] @@ -81,8 +81,9 @@ impl NamespaceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/tag/create.rs b/cli-cmd/image/src/v2/metadef/namespace/tag/create.rs index f04439623..e518f34ac 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/tag/create.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/tag/create.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::tag::create; -use openstack_types::image::v2::metadef::namespace::tag::response::create::TagResponse; +use openstack_types::image::v2::metadef::namespace::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -101,8 +101,9 @@ impl TagCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/tag/list.rs b/cli-cmd/image/src/v2/metadef/namespace/tag/list.rs index fdf257bae..e03d8fdbf 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/tag/list.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/tag/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::tag::list; -use openstack_types::image::v2::metadef::namespace::tag::response::list::TagResponse; +use openstack_types::image::v2::metadef::namespace::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -85,7 +85,8 @@ impl TagsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/metadef/namespace/tag/set.rs b/cli-cmd/image/src/v2/metadef/namespace/tag/set.rs index 4962c66af..8ae7e85a1 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/tag/set.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/tag/set.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::tag::set; -use openstack_types::image::v2::metadef::namespace::tag::response::set::TagResponse; +use openstack_types::image::v2::metadef::namespace::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -101,8 +101,9 @@ impl TagCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/namespace/tag/show.rs b/cli-cmd/image/src/v2/metadef/namespace/tag/show.rs index 1da02ec6b..0ed3fda9c 100644 --- a/cli-cmd/image/src/v2/metadef/namespace/tag/show.rs +++ b/cli-cmd/image/src/v2/metadef/namespace/tag/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::namespace::tag::get; -use openstack_types::image::v2::metadef::namespace::tag::response::get::TagResponse; +use openstack_types::image::v2::metadef::namespace::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -94,8 +94,9 @@ impl TagCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/metadef/resource_type/list.rs b/cli-cmd/image/src/v2/metadef/resource_type/list.rs index ce0bdde55..c7388b881 100644 --- a/cli-cmd/image/src/v2/metadef/resource_type/list.rs +++ b/cli-cmd/image/src/v2/metadef/resource_type/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::metadef::resource_type::list; -use openstack_types::image::v2::metadef::resource_type::response::list::ResourceTypeResponse; +use openstack_types::image::v2::metadef::resource_type::response; /// Command without description in OpenAPI #[derive(Args)] @@ -74,7 +74,8 @@ impl ResourceTypesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/schema/task/get.rs b/cli-cmd/image/src/v2/schema/task/get.rs index e3cff08c0..5a1e2bd59 100644 --- a/cli-cmd/image/src/v2/schema/task/get.rs +++ b/cli-cmd/image/src/v2/schema/task/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::schema::task::get; -use openstack_types::image::v2::schema::task::response::get::TaskResponse; +use openstack_types::image::v2::schema::task::response; /// *(Since Images v2.2)* /// diff --git a/cli-cmd/image/src/v2/schema/tasks/get.rs b/cli-cmd/image/src/v2/schema/tasks/get.rs index b4cc0af73..75cfb6528 100644 --- a/cli-cmd/image/src/v2/schema/tasks/get.rs +++ b/cli-cmd/image/src/v2/schema/tasks/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::schema::tasks::get; -use openstack_types::image::v2::schema::tasks::response::get::TasksResponse; +use openstack_types::image::v2::schema::tasks::response; /// *(Since Images v2.2)* /// diff --git a/cli-cmd/image/src/v2/task/create.rs b/cli-cmd/image/src/v2/task/create.rs index c51a34658..620312691 100644 --- a/cli-cmd/image/src/v2/task/create.rs +++ b/cli-cmd/image/src/v2/task/create.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::task::create; -use openstack_types::image::v2::task::response::create::TaskResponse; +use openstack_types::image::v2::task::response; use serde_json::Value; /// Creates a task. @@ -224,8 +224,9 @@ impl TaskCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/image/src/v2/task/list.rs b/cli-cmd/image/src/v2/task/list.rs index bfba3dfb1..392e4ba53 100644 --- a/cli-cmd/image/src/v2/task/list.rs +++ b/cli-cmd/image/src/v2/task/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::task::list; -use openstack_types::image::v2::task::response::list::TaskResponse; +use openstack_types::image::v2::task::response; /// Lists tasks. /// @@ -76,7 +76,8 @@ impl TasksCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/image/src/v2/task/show.rs b/cli-cmd/image/src/v2/task/show.rs index 7f9e26d8d..474d14394 100644 --- a/cli-cmd/image/src/v2/task/show.rs +++ b/cli-cmd/image/src/v2/task/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::image::v2::task::get; -use openstack_types::image::v2::task::response::get::TaskResponse; +use openstack_types::image::v2::task::response; /// Shows details for a task. /// @@ -85,8 +85,9 @@ impl TaskCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/amphorae/list.rs b/cli-cmd/load-balancer/src/v2/amphorae/list.rs index a9b3578f8..e5c01910c 100644 --- a/cli-cmd/load-balancer/src/v2/amphorae/list.rs +++ b/cli-cmd/load-balancer/src/v2/amphorae/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::amphorae::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::amphorae::response::list::AmphoraeResponse; +use openstack_types::load_balancer::v2::amphorae::response; /// Lists all amphora for the project. /// @@ -236,7 +236,8 @@ impl AmphoraesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/amphorae/show.rs b/cli-cmd/load-balancer/src/v2/amphorae/show.rs index 898fbce7f..3b9abd182 100644 --- a/cli-cmd/load-balancer/src/v2/amphorae/show.rs +++ b/cli-cmd/load-balancer/src/v2/amphorae/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::amphorae::get; -use openstack_types::load_balancer::v2::amphorae::response::get::AmphoraeResponse; +use openstack_types::load_balancer::v2::amphorae::response; /// Shows the details of an amphora. /// @@ -86,8 +86,9 @@ impl AmphoraeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/amphorae/stats.rs b/cli-cmd/load-balancer/src/v2/amphorae/stats.rs index 4408c5f76..cef7aceb9 100644 --- a/cli-cmd/load-balancer/src/v2/amphorae/stats.rs +++ b/cli-cmd/load-balancer/src/v2/amphorae/stats.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::amphorae::stats; -use openstack_types::load_balancer::v2::amphorae::response::stats::AmphoraeResponse; +use openstack_types::load_balancer::v2::amphorae::response; /// Show the statistics for an amphora. /// @@ -90,7 +90,7 @@ impl AmphoraeCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/availability_zone/create.rs b/cli-cmd/load-balancer/src/v2/availability_zone/create.rs index 81351bc7a..5853f0bf2 100644 --- a/cli-cmd/load-balancer/src/v2/availability_zone/create.rs +++ b/cli-cmd/load-balancer/src/v2/availability_zone/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::availability_zone::create; -use openstack_types::load_balancer::v2::availability_zone::response::create::AvailabilityZoneResponse; +use openstack_types::load_balancer::v2::availability_zone::response; /// Creates an Availability Zone. #[derive(Args)] @@ -116,8 +116,9 @@ impl AvailabilityZoneCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/availability_zone/list.rs b/cli-cmd/load-balancer/src/v2/availability_zone/list.rs index acc96466f..e5f014232 100644 --- a/cli-cmd/load-balancer/src/v2/availability_zone/list.rs +++ b/cli-cmd/load-balancer/src/v2/availability_zone/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::availability_zone::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::availability_zone::response::list::AvailabilityZoneResponse; +use openstack_types::load_balancer::v2::availability_zone::response; /// Lists all Availability Zones. #[derive(Args)] @@ -132,7 +132,8 @@ impl AvailabilityZonesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/availability_zone/set.rs b/cli-cmd/load-balancer/src/v2/availability_zone/set.rs index 3e8c21335..18a4d5ac5 100644 --- a/cli-cmd/load-balancer/src/v2/availability_zone/set.rs +++ b/cli-cmd/load-balancer/src/v2/availability_zone/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::availability_zone::set; -use openstack_types::load_balancer::v2::availability_zone::response::set::AvailabilityZoneResponse; +use openstack_types::load_balancer::v2::availability_zone::response; /// Command without description in OpenAPI #[derive(Args)] @@ -116,8 +116,9 @@ impl AvailabilityZoneCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/availability_zone/show.rs b/cli-cmd/load-balancer/src/v2/availability_zone/show.rs index 14a48849d..ea0897547 100644 --- a/cli-cmd/load-balancer/src/v2/availability_zone/show.rs +++ b/cli-cmd/load-balancer/src/v2/availability_zone/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::availability_zone::get; -use openstack_types::load_balancer::v2::availability_zone::response::get::AvailabilityZoneResponse; +use openstack_types::load_balancer::v2::availability_zone::response; /// Gets an Availability Zone's detail. #[derive(Args)] @@ -84,8 +84,9 @@ impl AvailabilityZoneCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/availability_zone_profile/create.rs b/cli-cmd/load-balancer/src/v2/availability_zone_profile/create.rs index db41bfc30..777d97438 100644 --- a/cli-cmd/load-balancer/src/v2/availability_zone_profile/create.rs +++ b/cli-cmd/load-balancer/src/v2/availability_zone_profile/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::availability_zone_profile::create; -use openstack_types::load_balancer::v2::availability_zone_profile::response::create::AvailabilityZoneProfileResponse; +use openstack_types::load_balancer::v2::availability_zone_profile::response; /// Creates an Availability Zone Profile. #[derive(Args)] @@ -108,8 +108,9 @@ impl AvailabilityZoneProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/availability_zone_profile/list.rs b/cli-cmd/load-balancer/src/v2/availability_zone_profile/list.rs index 4f3934d18..53fdc828b 100644 --- a/cli-cmd/load-balancer/src/v2/availability_zone_profile/list.rs +++ b/cli-cmd/load-balancer/src/v2/availability_zone_profile/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::availability_zone_profile::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::availability_zone_profile::response::list::AvailabilityZoneProfileResponse; +use openstack_types::load_balancer::v2::availability_zone_profile::response; /// Lists all Availability Zone Profiles. #[derive(Args)] @@ -132,7 +132,8 @@ impl AvailabilityZoneProfilesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/availability_zone_profile/set.rs b/cli-cmd/load-balancer/src/v2/availability_zone_profile/set.rs index c15fa96b4..75e970cae 100644 --- a/cli-cmd/load-balancer/src/v2/availability_zone_profile/set.rs +++ b/cli-cmd/load-balancer/src/v2/availability_zone_profile/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::availability_zone_profile::find; use openstack_sdk::api::load_balancer::v2::availability_zone_profile::set; -use openstack_types::load_balancer::v2::availability_zone_profile::response::set::AvailabilityZoneProfileResponse; +use openstack_types::load_balancer::v2::availability_zone_profile::response; /// Updates an Availability Zone Profile. #[derive(Args)] @@ -138,8 +138,9 @@ impl AvailabilityZoneProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/availability_zone_profile/show.rs b/cli-cmd/load-balancer/src/v2/availability_zone_profile/show.rs index 27c79a8b8..2400b33fa 100644 --- a/cli-cmd/load-balancer/src/v2/availability_zone_profile/show.rs +++ b/cli-cmd/load-balancer/src/v2/availability_zone_profile/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::availability_zone_profile::find; -use openstack_types::load_balancer::v2::availability_zone_profile::response::get::AvailabilityZoneProfileResponse; +use openstack_types::load_balancer::v2::availability_zone_profile::response; /// Gets an Availability Zone Profile's detail. #[derive(Args)] @@ -86,7 +86,7 @@ impl AvailabilityZoneProfileCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/flavor/create.rs b/cli-cmd/load-balancer/src/v2/flavor/create.rs index 23f8b7b0a..d1081b8ea 100644 --- a/cli-cmd/load-balancer/src/v2/flavor/create.rs +++ b/cli-cmd/load-balancer/src/v2/flavor/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::flavor::create; -use openstack_types::load_balancer::v2::flavor::response::create::FlavorResponse; +use openstack_types::load_balancer::v2::flavor::response; /// Creates a flavor. #[derive(Args)] @@ -112,8 +112,9 @@ impl FlavorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/flavor/list.rs b/cli-cmd/load-balancer/src/v2/flavor/list.rs index 8e7d81d88..ae38d996b 100644 --- a/cli-cmd/load-balancer/src/v2/flavor/list.rs +++ b/cli-cmd/load-balancer/src/v2/flavor/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::flavor::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::flavor::response::list::FlavorResponse; +use openstack_types::load_balancer::v2::flavor::response; /// Lists all flavors. #[derive(Args)] @@ -135,7 +135,8 @@ impl FlavorsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/flavor/set.rs b/cli-cmd/load-balancer/src/v2/flavor/set.rs index 828dc2940..34bc04aee 100644 --- a/cli-cmd/load-balancer/src/v2/flavor/set.rs +++ b/cli-cmd/load-balancer/src/v2/flavor/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::flavor::find; use openstack_sdk::api::load_balancer::v2::flavor::set; -use openstack_types::load_balancer::v2::flavor::response::set::FlavorResponse; +use openstack_types::load_balancer::v2::flavor::response; /// Command without description in OpenAPI #[derive(Args)] @@ -133,8 +133,9 @@ impl FlavorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/flavor/show.rs b/cli-cmd/load-balancer/src/v2/flavor/show.rs index 69ab3ccac..9f77d364a 100644 --- a/cli-cmd/load-balancer/src/v2/flavor/show.rs +++ b/cli-cmd/load-balancer/src/v2/flavor/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::flavor::find; -use openstack_types::load_balancer::v2::flavor::response::get::FlavorResponse; +use openstack_types::load_balancer::v2::flavor::response; /// Gets a flavor's detail. #[derive(Args)] @@ -82,7 +82,7 @@ impl FlavorCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/flavor_profile/create.rs b/cli-cmd/load-balancer/src/v2/flavor_profile/create.rs index 72ce1d8f7..054facc7a 100644 --- a/cli-cmd/load-balancer/src/v2/flavor_profile/create.rs +++ b/cli-cmd/load-balancer/src/v2/flavor_profile/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::flavor_profile::create; -use openstack_types::load_balancer::v2::flavor_profile::response::create::FlavorProfileResponse; +use openstack_types::load_balancer::v2::flavor_profile::response; /// Creates a flavor Profile. #[derive(Args)] @@ -107,8 +107,9 @@ impl FlavorProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/flavor_profile/list.rs b/cli-cmd/load-balancer/src/v2/flavor_profile/list.rs index cc6be29c4..61b6e83ae 100644 --- a/cli-cmd/load-balancer/src/v2/flavor_profile/list.rs +++ b/cli-cmd/load-balancer/src/v2/flavor_profile/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::flavor_profile::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::flavor_profile::response::list::FlavorProfileResponse; +use openstack_types::load_balancer::v2::flavor_profile::response; /// Lists all flavor profiles. #[derive(Args)] @@ -132,7 +132,8 @@ impl FlavorProfilesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/flavor_profile/set.rs b/cli-cmd/load-balancer/src/v2/flavor_profile/set.rs index 045cd2e0b..4b87c6ba4 100644 --- a/cli-cmd/load-balancer/src/v2/flavor_profile/set.rs +++ b/cli-cmd/load-balancer/src/v2/flavor_profile/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::flavor_profile::find; use openstack_sdk::api::load_balancer::v2::flavor_profile::set; -use openstack_types::load_balancer::v2::flavor_profile::response::set::FlavorProfileResponse; +use openstack_types::load_balancer::v2::flavor_profile::response; /// Updates a flavor Profile. #[derive(Args)] @@ -138,8 +138,9 @@ impl FlavorProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/flavor_profile/show.rs b/cli-cmd/load-balancer/src/v2/flavor_profile/show.rs index d85f125c8..f438da58c 100644 --- a/cli-cmd/load-balancer/src/v2/flavor_profile/show.rs +++ b/cli-cmd/load-balancer/src/v2/flavor_profile/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::flavor_profile::find; -use openstack_types::load_balancer::v2::flavor_profile::response::get::FlavorProfileResponse; +use openstack_types::load_balancer::v2::flavor_profile::response; /// Gets a flavor profile's detail. #[derive(Args)] @@ -86,7 +86,7 @@ impl FlavorProfileCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/healthmonitor/create.rs b/cli-cmd/load-balancer/src/v2/healthmonitor/create.rs index e234cd19c..bc7387387 100644 --- a/cli-cmd/load-balancer/src/v2/healthmonitor/create.rs +++ b/cli-cmd/load-balancer/src/v2/healthmonitor/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::healthmonitor::create; -use openstack_types::load_balancer::v2::healthmonitor::response::create::HealthmonitorResponse; +use openstack_types::load_balancer::v2::healthmonitor::response; /// Creates a health monitor on a pool. /// @@ -313,8 +313,9 @@ impl HealthmonitorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/healthmonitor/list.rs b/cli-cmd/load-balancer/src/v2/healthmonitor/list.rs index f7123f4d5..6d294ad3b 100644 --- a/cli-cmd/load-balancer/src/v2/healthmonitor/list.rs +++ b/cli-cmd/load-balancer/src/v2/healthmonitor/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::load_balancer::v2::healthmonitor::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::healthmonitor::response::list::HealthmonitorResponse; +use openstack_types::load_balancer::v2::healthmonitor::response; use tracing::warn; /// Lists all health monitors for the project. @@ -340,7 +340,8 @@ impl HealthmonitorsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/healthmonitor/set.rs b/cli-cmd/load-balancer/src/v2/healthmonitor/set.rs index b43364a76..461d8a1ff 100644 --- a/cli-cmd/load-balancer/src/v2/healthmonitor/set.rs +++ b/cli-cmd/load-balancer/src/v2/healthmonitor/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::healthmonitor::find; use openstack_sdk::api::load_balancer::v2::healthmonitor::set; -use openstack_types::load_balancer::v2::healthmonitor::response::set::HealthmonitorResponse; +use openstack_types::load_balancer::v2::healthmonitor::response; /// Update an existing health monitor. /// @@ -273,8 +273,9 @@ impl HealthmonitorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/healthmonitor/show.rs b/cli-cmd/load-balancer/src/v2/healthmonitor/show.rs index 76ed0cf5c..e087e19de 100644 --- a/cli-cmd/load-balancer/src/v2/healthmonitor/show.rs +++ b/cli-cmd/load-balancer/src/v2/healthmonitor/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::healthmonitor::find; -use openstack_types::load_balancer::v2::healthmonitor::response::get::HealthmonitorResponse; +use openstack_types::load_balancer::v2::healthmonitor::response; /// Shows the details of a health monitor. /// @@ -93,7 +93,7 @@ impl HealthmonitorCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/l7policy/create.rs b/cli-cmd/load-balancer/src/v2/l7policy/create.rs index d9a83715f..5eb323546 100644 --- a/cli-cmd/load-balancer/src/v2/l7policy/create.rs +++ b/cli-cmd/load-balancer/src/v2/l7policy/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::l7policy::create; -use openstack_types::load_balancer::v2::l7policy::response::create::L7policyResponse; +use openstack_types::load_balancer::v2::l7policy::response; use serde_json::Value; /// Creates a L7 policy. @@ -266,8 +266,9 @@ impl L7PolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/l7policy/list.rs b/cli-cmd/load-balancer/src/v2/l7policy/list.rs index 507e782ad..40283d79c 100644 --- a/cli-cmd/load-balancer/src/v2/l7policy/list.rs +++ b/cli-cmd/load-balancer/src/v2/l7policy/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::load_balancer::v2::l7policy::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::l7policy::response::list::L7policyResponse; +use openstack_types::load_balancer::v2::l7policy::response; use tracing::warn; /// Lists all L7 policies for the project. @@ -248,7 +248,8 @@ impl L7PoliciesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/l7policy/rule/create.rs b/cli-cmd/load-balancer/src/v2/l7policy/rule/create.rs index 6f2db8246..c0c6e7992 100644 --- a/cli-cmd/load-balancer/src/v2/l7policy/rule/create.rs +++ b/cli-cmd/load-balancer/src/v2/l7policy/rule/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::l7policy::rule::create; -use openstack_types::load_balancer::v2::l7policy::rule::response::create::RuleResponse; +use openstack_types::load_balancer::v2::l7policy::rule::response; /// Creates a L7 rule. /// @@ -243,8 +243,9 @@ impl RuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/l7policy/rule/list.rs b/cli-cmd/load-balancer/src/v2/l7policy/rule/list.rs index f36279289..8f39c5594 100644 --- a/cli-cmd/load-balancer/src/v2/l7policy/rule/list.rs +++ b/cli-cmd/load-balancer/src/v2/l7policy/rule/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::load_balancer::v2::l7policy::rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::l7policy::rule::response::list::RuleResponse; +use openstack_types::load_balancer::v2::l7policy::rule::response; use tracing::warn; /// Lists all L7 rules for the project. @@ -255,7 +255,8 @@ impl RulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/l7policy/rule/set.rs b/cli-cmd/load-balancer/src/v2/l7policy/rule/set.rs index 155eea2b5..59d9c575f 100644 --- a/cli-cmd/load-balancer/src/v2/l7policy/rule/set.rs +++ b/cli-cmd/load-balancer/src/v2/l7policy/rule/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::l7policy::rule::set; -use openstack_types::load_balancer::v2::l7policy::rule::response::set::RuleResponse; +use openstack_types::load_balancer::v2::l7policy::rule::response; /// Updates a L7 rule. /// @@ -227,8 +227,9 @@ impl RuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/l7policy/rule/show.rs b/cli-cmd/load-balancer/src/v2/l7policy/rule/show.rs index b630407b7..338d65205 100644 --- a/cli-cmd/load-balancer/src/v2/l7policy/rule/show.rs +++ b/cli-cmd/load-balancer/src/v2/l7policy/rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::l7policy::rule::get; -use openstack_types::load_balancer::v2::l7policy::rule::response::get::RuleResponse; +use openstack_types::load_balancer::v2::l7policy::rule::response; /// Shows the details of a L7 rule. /// @@ -101,8 +101,9 @@ impl RuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/l7policy/set.rs b/cli-cmd/load-balancer/src/v2/l7policy/set.rs index 7420c7121..2543df208 100644 --- a/cli-cmd/load-balancer/src/v2/l7policy/set.rs +++ b/cli-cmd/load-balancer/src/v2/l7policy/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::l7policy::find; use openstack_sdk::api::load_balancer::v2::l7policy::set; -use openstack_types::load_balancer::v2::l7policy::response::set::L7policyResponse; +use openstack_types::load_balancer::v2::l7policy::response; /// Updates a L7 policy. /// @@ -237,8 +237,9 @@ impl L7PolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/l7policy/show.rs b/cli-cmd/load-balancer/src/v2/l7policy/show.rs index 30cbedd4d..77d18cedd 100644 --- a/cli-cmd/load-balancer/src/v2/l7policy/show.rs +++ b/cli-cmd/load-balancer/src/v2/l7policy/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::l7policy::find; -use openstack_types::load_balancer::v2::l7policy::response::get::L7policyResponse; +use openstack_types::load_balancer::v2::l7policy::response; /// Shows the details of a L7 policy. /// @@ -89,7 +89,7 @@ impl L7PolicyCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/listener/create.rs b/cli-cmd/load-balancer/src/v2/listener/create.rs index 25dc43fbe..09356aafc 100644 --- a/cli-cmd/load-balancer/src/v2/listener/create.rs +++ b/cli-cmd/load-balancer/src/v2/listener/create.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::listener::create; -use openstack_types::load_balancer::v2::listener::response::create::ListenerResponse; +use openstack_types::load_balancer::v2::listener::response; use serde_json::Value; /// Creates a listener for a load balancer. @@ -457,8 +457,9 @@ impl ListenerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/listener/list.rs b/cli-cmd/load-balancer/src/v2/listener/list.rs index 0708c0fd8..8f9b0dc91 100644 --- a/cli-cmd/load-balancer/src/v2/listener/list.rs +++ b/cli-cmd/load-balancer/src/v2/listener/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::load_balancer::v2::listener::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::listener::response::list::ListenerResponse; +use openstack_types::load_balancer::v2::listener::response; use tracing::warn; /// Lists all listeners for the project. @@ -379,7 +379,8 @@ impl ListenersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/listener/set.rs b/cli-cmd/load-balancer/src/v2/listener/set.rs index 032b318eb..304727601 100644 --- a/cli-cmd/load-balancer/src/v2/listener/set.rs +++ b/cli-cmd/load-balancer/src/v2/listener/set.rs @@ -34,7 +34,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::listener::find; use openstack_sdk::api::load_balancer::v2::listener::set; -use openstack_types::load_balancer::v2::listener::response::set::ListenerResponse; +use openstack_types::load_balancer::v2::listener::response; /// Update an existing listener. /// @@ -396,8 +396,9 @@ impl ListenerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/listener/show.rs b/cli-cmd/load-balancer/src/v2/listener/show.rs index 02778afa4..b1b019216 100644 --- a/cli-cmd/load-balancer/src/v2/listener/show.rs +++ b/cli-cmd/load-balancer/src/v2/listener/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::listener::find; -use openstack_types::load_balancer::v2::listener::response::get::ListenerResponse; +use openstack_types::load_balancer::v2::listener::response; /// Shows the details of a listener. /// @@ -89,7 +89,7 @@ impl ListenerCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/listener/stats.rs b/cli-cmd/load-balancer/src/v2/listener/stats.rs index 079f209f0..69a3735dc 100644 --- a/cli-cmd/load-balancer/src/v2/listener/stats.rs +++ b/cli-cmd/load-balancer/src/v2/listener/stats.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::listener::stats; -use openstack_types::load_balancer::v2::listener::response::stats::ListenerResponse; +use openstack_types::load_balancer::v2::listener::response; /// Shows the current statistics for a listener. /// @@ -90,8 +90,9 @@ impl ListenerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/loadbalancer/create.rs b/cli-cmd/load-balancer/src/v2/loadbalancer/create.rs index 81fa4d881..4fb7b2a5e 100644 --- a/cli-cmd/load-balancer/src/v2/loadbalancer/create.rs +++ b/cli-cmd/load-balancer/src/v2/loadbalancer/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::loadbalancer::create; -use openstack_types::load_balancer::v2::loadbalancer::response::create::LoadbalancerResponse; +use openstack_types::load_balancer::v2::loadbalancer::response; use serde_json::Value; /// Creates a load balancer. @@ -321,8 +321,9 @@ impl LoadbalancerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/loadbalancer/list.rs b/cli-cmd/load-balancer/src/v2/loadbalancer/list.rs index a1f1cdfb7..7c280daf2 100644 --- a/cli-cmd/load-balancer/src/v2/loadbalancer/list.rs +++ b/cli-cmd/load-balancer/src/v2/loadbalancer/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::load_balancer::v2::loadbalancer::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::loadbalancer::response::list::LoadbalancerResponse; +use openstack_types::load_balancer::v2::loadbalancer::response; use tracing::warn; /// Lists all load balancers for the project. @@ -320,7 +320,8 @@ impl LoadbalancersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/loadbalancer/set.rs b/cli-cmd/load-balancer/src/v2/loadbalancer/set.rs index 2ce439464..65f652365 100644 --- a/cli-cmd/load-balancer/src/v2/loadbalancer/set.rs +++ b/cli-cmd/load-balancer/src/v2/loadbalancer/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::loadbalancer::find; use openstack_sdk::api::load_balancer::v2::loadbalancer::set; -use openstack_types::load_balancer::v2::loadbalancer::response::set::LoadbalancerResponse; +use openstack_types::load_balancer::v2::loadbalancer::response; /// Updates a load balancer. /// @@ -179,8 +179,9 @@ impl LoadbalancerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/loadbalancer/show.rs b/cli-cmd/load-balancer/src/v2/loadbalancer/show.rs index a6b4f5d33..282a68957 100644 --- a/cli-cmd/load-balancer/src/v2/loadbalancer/show.rs +++ b/cli-cmd/load-balancer/src/v2/loadbalancer/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::loadbalancer::find; -use openstack_types::load_balancer::v2::loadbalancer::response::get::LoadbalancerResponse; +use openstack_types::load_balancer::v2::loadbalancer::response; /// Shows the details of a load balancer. /// @@ -93,7 +93,7 @@ impl LoadbalancerCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/loadbalancer/stats.rs b/cli-cmd/load-balancer/src/v2/loadbalancer/stats.rs index 4eeac090a..458420463 100644 --- a/cli-cmd/load-balancer/src/v2/loadbalancer/stats.rs +++ b/cli-cmd/load-balancer/src/v2/loadbalancer/stats.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::loadbalancer::stats; -use openstack_types::load_balancer::v2::loadbalancer::response::stats::LoadbalancerResponse; +use openstack_types::load_balancer::v2::loadbalancer::response; /// Shows the current statistics for a load balancer. /// @@ -94,8 +94,9 @@ impl LoadbalancerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/loadbalancer/status.rs b/cli-cmd/load-balancer/src/v2/loadbalancer/status.rs index 1d0447495..69d5a6204 100644 --- a/cli-cmd/load-balancer/src/v2/loadbalancer/status.rs +++ b/cli-cmd/load-balancer/src/v2/loadbalancer/status.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::loadbalancer::status; -use openstack_types::load_balancer::v2::loadbalancer::response::status::LoadbalancerResponse; +use openstack_types::load_balancer::v2::loadbalancer::response; /// Shows the status tree for a load balancer. /// @@ -103,8 +103,9 @@ impl LoadbalancerCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/octavia/get.rs b/cli-cmd/load-balancer/src/v2/octavia/get.rs index 7b1972ed7..9a0c1defc 100644 --- a/cli-cmd/load-balancer/src/v2/octavia/get.rs +++ b/cli-cmd/load-balancer/src/v2/octavia/get.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::octavia::get; -use openstack_types::load_balancer::v2::octavia::response::get::OctaviaResponse; +use openstack_types::load_balancer::v2::octavia::response; /// Command without description in OpenAPI #[derive(Args)] @@ -71,8 +71,9 @@ impl OctaviaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/pool/create.rs b/cli-cmd/load-balancer/src/v2/pool/create.rs index a932ad17e..8bc6a9d55 100644 --- a/cli-cmd/load-balancer/src/v2/pool/create.rs +++ b/cli-cmd/load-balancer/src/v2/pool/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::pool::create; -use openstack_types::load_balancer::v2::pool::response::create::PoolResponse; +use openstack_types::load_balancer::v2::pool::response; use serde_json::Value; /// Creates a pool for a load balancer. @@ -406,8 +406,9 @@ impl PoolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/pool/list.rs b/cli-cmd/load-balancer/src/v2/pool/list.rs index 4812e8f0d..1638a0661 100644 --- a/cli-cmd/load-balancer/src/v2/pool/list.rs +++ b/cli-cmd/load-balancer/src/v2/pool/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::load_balancer::v2::pool::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::pool::response::list::PoolResponse; +use openstack_types::load_balancer::v2::pool::response; use tracing::warn; /// Lists all pools for the project. @@ -301,7 +301,8 @@ impl PoolsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/pool/member/create.rs b/cli-cmd/load-balancer/src/v2/pool/member/create.rs index 1f9c1e550..7b4478cf4 100644 --- a/cli-cmd/load-balancer/src/v2/pool/member/create.rs +++ b/cli-cmd/load-balancer/src/v2/pool/member/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::pool::member::create; -use openstack_types::load_balancer::v2::pool::member::response::create::MemberResponse; +use openstack_types::load_balancer::v2::pool::member::response; /// This operation provisions a member and adds it to a pool by using the /// configuration that you define in the request object. After the API @@ -258,8 +258,9 @@ impl MemberCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/pool/member/list.rs b/cli-cmd/load-balancer/src/v2/pool/member/list.rs index 5702c2a1a..9cfda2a9b 100644 --- a/cli-cmd/load-balancer/src/v2/pool/member/list.rs +++ b/cli-cmd/load-balancer/src/v2/pool/member/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::load_balancer::v2::pool::member::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::pool::member::response::list::MemberResponse; +use openstack_types::load_balancer::v2::pool::member::response; use tracing::warn; /// Lists all members for the project. @@ -330,7 +330,8 @@ impl MembersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/pool/member/replace.rs b/cli-cmd/load-balancer/src/v2/pool/member/replace.rs index 0103b557b..82bc2011a 100644 --- a/cli-cmd/load-balancer/src/v2/pool/member/replace.rs +++ b/cli-cmd/load-balancer/src/v2/pool/member/replace.rs @@ -32,7 +32,6 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::pool::member::find; use openstack_sdk::api::load_balancer::v2::pool::member::replace; -use openstack_types::load_balancer::v2::pool::member::response::replace::MemberResponse; use serde_json::Value; /// Set the state of members for a pool in one API call. This may include @@ -140,9 +139,7 @@ impl MemberCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/pool/member/set.rs b/cli-cmd/load-balancer/src/v2/pool/member/set.rs index be221daeb..d4d2b1bec 100644 --- a/cli-cmd/load-balancer/src/v2/pool/member/set.rs +++ b/cli-cmd/load-balancer/src/v2/pool/member/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::pool::member::find; use openstack_sdk::api::load_balancer::v2::pool::member::set; -use openstack_types::load_balancer::v2::pool::member::response::set::MemberResponse; +use openstack_types::load_balancer::v2::pool::member::response; /// Update an existing member. /// @@ -212,8 +212,9 @@ impl MemberCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/pool/member/show.rs b/cli-cmd/load-balancer/src/v2/pool/member/show.rs index 8b173cbd7..63be61f51 100644 --- a/cli-cmd/load-balancer/src/v2/pool/member/show.rs +++ b/cli-cmd/load-balancer/src/v2/pool/member/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::pool::member::find; -use openstack_types::load_balancer::v2::pool::member::response::get::MemberResponse; +use openstack_types::load_balancer::v2::pool::member::response; /// Shows the details of a pool member. /// @@ -102,7 +102,7 @@ impl MemberCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/pool/set.rs b/cli-cmd/load-balancer/src/v2/pool/set.rs index 0bb73d8d7..4fc90e67a 100644 --- a/cli-cmd/load-balancer/src/v2/pool/set.rs +++ b/cli-cmd/load-balancer/src/v2/pool/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::pool::find; use openstack_sdk::api::load_balancer::v2::pool::set; -use openstack_types::load_balancer::v2::pool::response::set::PoolResponse; +use openstack_types::load_balancer::v2::pool::response; /// Update an existing pool. /// @@ -324,8 +324,9 @@ impl PoolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/pool/show.rs b/cli-cmd/load-balancer/src/v2/pool/show.rs index ca633bf35..cf8593e2f 100644 --- a/cli-cmd/load-balancer/src/v2/pool/show.rs +++ b/cli-cmd/load-balancer/src/v2/pool/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::load_balancer::v2::pool::find; -use openstack_types::load_balancer::v2::pool::response::get::PoolResponse; +use openstack_types::load_balancer::v2::pool::response; /// Shows the details of a pool. /// @@ -88,7 +88,7 @@ impl PoolCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/provider/availability_zone_capability/list.rs b/cli-cmd/load-balancer/src/v2/provider/availability_zone_capability/list.rs index a248b52b2..fb08af217 100644 --- a/cli-cmd/load-balancer/src/v2/provider/availability_zone_capability/list.rs +++ b/cli-cmd/load-balancer/src/v2/provider/availability_zone_capability/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::provider::availability_zone_capability::list; -use openstack_types::load_balancer::v2::provider::availability_zone_capability::response::list::AvailabilityZoneCapabilityResponse; +use openstack_types::load_balancer::v2::provider::availability_zone_capability::response; /// Shows the provider driver availability zone capabilities. These are the /// features of the provider driver that can be configured in an Octavia @@ -94,7 +94,8 @@ impl AvailabilityZoneCapabilitiesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/provider/flavor_capability/list.rs b/cli-cmd/load-balancer/src/v2/provider/flavor_capability/list.rs index 845349c98..9c9fcb4b9 100644 --- a/cli-cmd/load-balancer/src/v2/provider/flavor_capability/list.rs +++ b/cli-cmd/load-balancer/src/v2/provider/flavor_capability/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::provider::flavor_capability::list; -use openstack_types::load_balancer::v2::provider::flavor_capability::response::list::FlavorCapabilityResponse; +use openstack_types::load_balancer::v2::provider::flavor_capability::response; /// Shows the provider driver flavor capabilities. These are the features of /// the provider driver that can be configured in an Octavia flavor. This API @@ -94,7 +94,8 @@ impl FlavorCapabilitiesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/provider/list.rs b/cli-cmd/load-balancer/src/v2/provider/list.rs index 0d48264a8..3634438cf 100644 --- a/cli-cmd/load-balancer/src/v2/provider/list.rs +++ b/cli-cmd/load-balancer/src/v2/provider/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::provider::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::load_balancer::v2::provider::response::list::ProviderResponse; +use openstack_types::load_balancer::v2::provider::response; /// Lists all enabled provider drivers. /// @@ -123,7 +123,8 @@ impl ProvidersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/quota/list.rs b/cli-cmd/load-balancer/src/v2/quota/list.rs index 50f137d2c..79f09eaa7 100644 --- a/cli-cmd/load-balancer/src/v2/quota/list.rs +++ b/cli-cmd/load-balancer/src/v2/quota/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::quota::list; -use openstack_types::load_balancer::v2::quota::response::list::QuotaResponse; +use openstack_types::load_balancer::v2::quota::response; /// Lists all quotas for the project. /// @@ -86,7 +86,8 @@ impl QuotasCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/load-balancer/src/v2/quota/set.rs b/cli-cmd/load-balancer/src/v2/quota/set.rs index f2f148055..cdbfad45f 100644 --- a/cli-cmd/load-balancer/src/v2/quota/set.rs +++ b/cli-cmd/load-balancer/src/v2/quota/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::load_balancer::v2::quota::set; -use openstack_types::load_balancer::v2::quota::response::set::QuotaResponse; +use openstack_types::load_balancer::v2::quota::response; use tracing::warn; /// Updates a quota for a project. @@ -61,7 +61,7 @@ pub struct QuotaCommand { #[command(flatten)] path: PathParameters, - /// Individual quota definitions. + /// Base type for complex types #[command(flatten)] quota: Quota, } @@ -253,8 +253,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/quota/show.rs b/cli-cmd/load-balancer/src/v2/quota/show.rs index 43a9a2ab0..55ab75a98 100644 --- a/cli-cmd/load-balancer/src/v2/quota/show.rs +++ b/cli-cmd/load-balancer/src/v2/quota/show.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::load_balancer::v2::quota::get; -use openstack_types::load_balancer::v2::quota::response::get::QuotaResponse; +use openstack_types::load_balancer::v2::quota::response; use tracing::warn; /// Show the quota for the project. @@ -154,8 +154,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/load-balancer/src/v2/version/get.rs b/cli-cmd/load-balancer/src/v2/version/get.rs index 64ea7534c..872174ff6 100644 --- a/cli-cmd/load-balancer/src/v2/version/get.rs +++ b/cli-cmd/load-balancer/src/v2/version/get.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::load_balancer::v2::version::get; -use openstack_types::load_balancer::v2::version::response::get::VersionResponse; +use openstack_types::load_balancer::v2::version::response; /// Command without description in OpenAPI #[derive(Args)] @@ -70,8 +70,9 @@ impl VersionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/address_group/add_addresses.rs b/cli-cmd/network/src/v2/address_group/add_addresses.rs index a599d0523..36ab6f4fe 100644 --- a/cli-cmd/network/src/v2/address_group/add_addresses.rs +++ b/cli-cmd/network/src/v2/address_group/add_addresses.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::address_group::add_addresses; -use openstack_types::network::v2::address_group::response::add_addresses::AddressGroupResponse; +use openstack_types::network::v2::address_group::response; /// Command without description in OpenAPI #[derive(Args)] @@ -110,8 +110,9 @@ impl AddressGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/address_group/create.rs b/cli-cmd/network/src/v2/address_group/create.rs index adebd97dd..6f8476c95 100644 --- a/cli-cmd/network/src/v2/address_group/create.rs +++ b/cli-cmd/network/src/v2/address_group/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::address_group::create; -use openstack_types::network::v2::address_group::response::create::AddressGroupResponse; +use openstack_types::network::v2::address_group::response; /// Creates an address group. /// @@ -126,8 +126,9 @@ impl AddressGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/address_group/list.rs b/cli-cmd/network/src/v2/address_group/list.rs index 4b4414648..e0b284260 100644 --- a/cli-cmd/network/src/v2/address_group/list.rs +++ b/cli-cmd/network/src/v2/address_group/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::address_group::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::address_group::response::list::AddressGroupResponse; +use openstack_types::network::v2::address_group::response; /// Lists address groups that the project has access to. /// @@ -183,7 +183,8 @@ impl AddressGroupsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/address_group/remove_addresses.rs b/cli-cmd/network/src/v2/address_group/remove_addresses.rs index 3c4f65433..5e6724b5c 100644 --- a/cli-cmd/network/src/v2/address_group/remove_addresses.rs +++ b/cli-cmd/network/src/v2/address_group/remove_addresses.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::address_group::remove_addresses; -use openstack_types::network::v2::address_group::response::remove_addresses::AddressGroupResponse; +use openstack_types::network::v2::address_group::response; /// Command without description in OpenAPI #[derive(Args)] @@ -110,8 +110,9 @@ impl AddressGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/address_group/set.rs b/cli-cmd/network/src/v2/address_group/set.rs index 2846326f5..21d85498b 100644 --- a/cli-cmd/network/src/v2/address_group/set.rs +++ b/cli-cmd/network/src/v2/address_group/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::address_group::find; use openstack_sdk::api::network::v2::address_group::set; -use openstack_types::network::v2::address_group::response::set::AddressGroupResponse; +use openstack_types::network::v2::address_group::response; /// Updates an address group. /// @@ -134,8 +134,9 @@ impl AddressGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/address_group/show.rs b/cli-cmd/network/src/v2/address_group/show.rs index 19a373ddf..b6aab9306 100644 --- a/cli-cmd/network/src/v2/address_group/show.rs +++ b/cli-cmd/network/src/v2/address_group/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::address_group::find; -use openstack_types::network::v2::address_group::response::get::AddressGroupResponse; +use openstack_types::network::v2::address_group::response; /// Shows information for an address group. /// @@ -90,7 +90,7 @@ impl AddressGroupCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/address_scope/create.rs b/cli-cmd/network/src/v2/address_scope/create.rs index 4d3bebcda..1ca4a7af9 100644 --- a/cli-cmd/network/src/v2/address_scope/create.rs +++ b/cli-cmd/network/src/v2/address_scope/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::address_scope::create; -use openstack_types::network::v2::address_scope::response::create::AddressScopeResponse; +use openstack_types::network::v2::address_scope::response; /// Creates an address scope. /// @@ -128,8 +128,9 @@ impl AddressScopeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/address_scope/list.rs b/cli-cmd/network/src/v2/address_scope/list.rs index 2f8dadc0b..fdfa21909 100644 --- a/cli-cmd/network/src/v2/address_scope/list.rs +++ b/cli-cmd/network/src/v2/address_scope/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::address_scope::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::address_scope::response::list::AddressScopeResponse; +use openstack_types::network::v2::address_scope::response; /// Lists address scopes that the project has access to. /// @@ -183,7 +183,8 @@ impl AddressScopesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/address_scope/set.rs b/cli-cmd/network/src/v2/address_scope/set.rs index 0622a57df..da647599d 100644 --- a/cli-cmd/network/src/v2/address_scope/set.rs +++ b/cli-cmd/network/src/v2/address_scope/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::address_scope::find; use openstack_sdk::api::network::v2::address_scope::set; -use openstack_types::network::v2::address_scope::response::set::AddressScopeResponse; +use openstack_types::network::v2::address_scope::response; /// Updates an address scope. /// @@ -135,8 +135,9 @@ impl AddressScopeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/address_scope/show.rs b/cli-cmd/network/src/v2/address_scope/show.rs index 1e66a8965..3b8ae7aae 100644 --- a/cli-cmd/network/src/v2/address_scope/show.rs +++ b/cli-cmd/network/src/v2/address_scope/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::address_scope::find; -use openstack_types::network::v2::address_scope::response::get::AddressScopeResponse; +use openstack_types::network::v2::address_scope::response; /// Shows information for an address scope. /// @@ -90,7 +90,7 @@ impl AddressScopeCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/agent/create.rs b/cli-cmd/network/src/v2/agent/create.rs index 176af75ac..2e730fed0 100644 --- a/cli-cmd/network/src/v2/agent/create.rs +++ b/cli-cmd/network/src/v2/agent/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::create; -use openstack_types::network::v2::agent::response::create::AgentResponse; +use openstack_types::network::v2::agent::response; use serde_json::Value; /// Command without description in OpenAPI @@ -79,8 +79,9 @@ impl AgentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/agent/dhcp_network/create.rs b/cli-cmd/network/src/v2/agent/dhcp_network/create.rs index 56a33bc2b..b027edb55 100644 --- a/cli-cmd/network/src/v2/agent/dhcp_network/create.rs +++ b/cli-cmd/network/src/v2/agent/dhcp_network/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::dhcp_network::create; -use openstack_types::network::v2::agent::dhcp_network::response::create::DhcpNetworkResponse; +use openstack_types::network::v2::agent::dhcp_network::response; use serde_json::Value; /// Add a network to a DHCP agent @@ -99,8 +99,9 @@ impl DhcpNetworkCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/agent/dhcp_network/list.rs b/cli-cmd/network/src/v2/agent/dhcp_network/list.rs index 1668d140f..eaef19915 100644 --- a/cli-cmd/network/src/v2/agent/dhcp_network/list.rs +++ b/cli-cmd/network/src/v2/agent/dhcp_network/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::dhcp_network::list; -use openstack_types::network::v2::agent::dhcp_network::response::list::DhcpNetworkResponse; +use openstack_types::network::v2::agent::dhcp_network::response; /// Lists networks that a DHCP agent hosts. /// @@ -152,8 +152,9 @@ impl DhcpNetworksCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/agent/dhcp_network/set.rs b/cli-cmd/network/src/v2/agent/dhcp_network/set.rs index 1503f77f7..d84b2b71b 100644 --- a/cli-cmd/network/src/v2/agent/dhcp_network/set.rs +++ b/cli-cmd/network/src/v2/agent/dhcp_network/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::dhcp_network::set; -use openstack_types::network::v2::agent::dhcp_network::response::set::DhcpNetworkResponse; +use openstack_types::network::v2::agent::dhcp_network::response; use serde_json::Value; /// Command without description in OpenAPI @@ -103,8 +103,9 @@ impl DhcpNetworkCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/agent/dhcp_network/show.rs b/cli-cmd/network/src/v2/agent/dhcp_network/show.rs index 7b58ab1cf..7c22ffc5a 100644 --- a/cli-cmd/network/src/v2/agent/dhcp_network/show.rs +++ b/cli-cmd/network/src/v2/agent/dhcp_network/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::dhcp_network::get; -use openstack_types::network::v2::agent::dhcp_network::response::get::DhcpNetworkResponse; +use openstack_types::network::v2::agent::dhcp_network::response; /// Command without description in OpenAPI #[derive(Args)] @@ -92,8 +92,9 @@ impl DhcpNetworkCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/agent/l3_router/create.rs b/cli-cmd/network/src/v2/agent/l3_router/create.rs index 562990904..caab145cd 100644 --- a/cli-cmd/network/src/v2/agent/l3_router/create.rs +++ b/cli-cmd/network/src/v2/agent/l3_router/create.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::l3_router::create; -use openstack_types::network::v2::agent::l3_router::response::create::L3RouterResponse; +use openstack_types::network::v2::agent::l3_router::response; /// Add a router to an l3 agent. /// @@ -96,8 +96,9 @@ impl L3RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/agent/l3_router/list.rs b/cli-cmd/network/src/v2/agent/l3_router/list.rs index fc00b73b4..dc9b40658 100644 --- a/cli-cmd/network/src/v2/agent/l3_router/list.rs +++ b/cli-cmd/network/src/v2/agent/l3_router/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::l3_router::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::agent::l3_router::response::list::L3RouterResponse; +use openstack_types::network::v2::agent::l3_router::response; /// Lists routers that an l3 agent hosts. /// @@ -153,7 +153,8 @@ impl L3RoutersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/agent/list.rs b/cli-cmd/network/src/v2/agent/list.rs index 6bbbe7a30..196ddaa3c 100644 --- a/cli-cmd/network/src/v2/agent/list.rs +++ b/cli-cmd/network/src/v2/agent/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::agent::response::list::AgentResponse; +use openstack_types::network::v2::agent::response; /// Lists all agents. /// @@ -206,7 +206,8 @@ impl AgentsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/agent/set.rs b/cli-cmd/network/src/v2/agent/set.rs index 8997dd09a..acd7e9550 100644 --- a/cli-cmd/network/src/v2/agent/set.rs +++ b/cli-cmd/network/src/v2/agent/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::set; -use openstack_types::network::v2::agent::response::set::AgentResponse; +use openstack_types::network::v2::agent::response; /// Updates an agent. /// @@ -125,8 +125,9 @@ impl AgentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/agent/show.rs b/cli-cmd/network/src/v2/agent/show.rs index 3515c2844..694c98a88 100644 --- a/cli-cmd/network/src/v2/agent/show.rs +++ b/cli-cmd/network/src/v2/agent/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::agent::get; -use openstack_types::network::v2::agent::response::get::AgentResponse; +use openstack_types::network::v2::agent::response; /// Shows details for an agent. /// @@ -87,8 +87,9 @@ impl AgentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/auto_allocated_topology/create.rs b/cli-cmd/network/src/v2/auto_allocated_topology/create.rs index 0f8246b63..93289e786 100644 --- a/cli-cmd/network/src/v2/auto_allocated_topology/create.rs +++ b/cli-cmd/network/src/v2/auto_allocated_topology/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::auto_allocated_topology::create; -use openstack_types::network::v2::auto_allocated_topology::response::create::AutoAllocatedTopologyResponse; +use openstack_types::network::v2::auto_allocated_topology::response; use serde_json::Value; /// Command without description in OpenAPI @@ -83,8 +83,9 @@ impl AutoAllocatedTopologyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/auto_allocated_topology/list.rs b/cli-cmd/network/src/v2/auto_allocated_topology/list.rs index 3a5f1ad8a..ed051e81c 100644 --- a/cli-cmd/network/src/v2/auto_allocated_topology/list.rs +++ b/cli-cmd/network/src/v2/auto_allocated_topology/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::auto_allocated_topology::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::auto_allocated_topology::response::list::AutoAllocatedTopologyResponse; +use openstack_types::network::v2::auto_allocated_topology::response; /// Command without description in OpenAPI #[derive(Args)] @@ -129,7 +129,8 @@ impl AutoAllocatedTopologiesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/auto_allocated_topology/set.rs b/cli-cmd/network/src/v2/auto_allocated_topology/set.rs index 683241109..55279f738 100644 --- a/cli-cmd/network/src/v2/auto_allocated_topology/set.rs +++ b/cli-cmd/network/src/v2/auto_allocated_topology/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::auto_allocated_topology::set; -use openstack_types::network::v2::auto_allocated_topology::response::set::AutoAllocatedTopologyResponse; +use openstack_types::network::v2::auto_allocated_topology::response; use serde_json::Value; /// Command without description in OpenAPI @@ -93,8 +93,9 @@ impl AutoAllocatedTopologyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/auto_allocated_topology/show.rs b/cli-cmd/network/src/v2/auto_allocated_topology/show.rs index 53993d5ba..7b70ca84c 100644 --- a/cli-cmd/network/src/v2/auto_allocated_topology/show.rs +++ b/cli-cmd/network/src/v2/auto_allocated_topology/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::auto_allocated_topology::get; -use openstack_types::network::v2::auto_allocated_topology::response::get::AutoAllocatedTopologyResponse; +use openstack_types::network::v2::auto_allocated_topology::response; /// Shows details for an auto allocated topology. /// @@ -91,8 +91,9 @@ impl AutoAllocatedTopologyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/availability_zone/list.rs b/cli-cmd/network/src/v2/availability_zone/list.rs index 6f812b288..99373cc53 100644 --- a/cli-cmd/network/src/v2/availability_zone/list.rs +++ b/cli-cmd/network/src/v2/availability_zone/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::availability_zone::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::availability_zone::response::list::AvailabilityZoneResponse; +use openstack_types::network::v2::availability_zone::response; /// Lists all availability zones. /// @@ -168,7 +168,8 @@ impl AvailabilityZonesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/default_security_group_rule/create.rs b/cli-cmd/network/src/v2/default_security_group_rule/create.rs index f660172cb..4895ae285 100644 --- a/cli-cmd/network/src/v2/default_security_group_rule/create.rs +++ b/cli-cmd/network/src/v2/default_security_group_rule/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::default_security_group_rule::create; -use openstack_types::network::v2::default_security_group_rule::response::create::DefaultSecurityGroupRuleResponse; +use openstack_types::network::v2::default_security_group_rule::response; /// Creates an Openstack Networking security group rule template. /// @@ -237,8 +237,9 @@ impl DefaultSecurityGroupRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/default_security_group_rule/list.rs b/cli-cmd/network/src/v2/default_security_group_rule/list.rs index 486725603..943e62c39 100644 --- a/cli-cmd/network/src/v2/default_security_group_rule/list.rs +++ b/cli-cmd/network/src/v2/default_security_group_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::default_security_group_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::default_security_group_rule::response::list::DefaultSecurityGroupRuleResponse; +use openstack_types::network::v2::default_security_group_rule::response; /// Lists a summary of all OpenStack Networking security group rules that are /// used for every newly created Security Group. @@ -244,7 +244,8 @@ impl DefaultSecurityGroupRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/default_security_group_rule/set.rs b/cli-cmd/network/src/v2/default_security_group_rule/set.rs index efe59b37f..7cfd8b9cd 100644 --- a/cli-cmd/network/src/v2/default_security_group_rule/set.rs +++ b/cli-cmd/network/src/v2/default_security_group_rule/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::default_security_group_rule::set; -use openstack_types::network::v2::default_security_group_rule::response::set::DefaultSecurityGroupRuleResponse; +use openstack_types::network::v2::default_security_group_rule::response; use serde_json::Value; /// Command without description in OpenAPI @@ -93,8 +93,9 @@ impl DefaultSecurityGroupRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/default_security_group_rule/show.rs b/cli-cmd/network/src/v2/default_security_group_rule/show.rs index a210bed4b..57480a6a9 100644 --- a/cli-cmd/network/src/v2/default_security_group_rule/show.rs +++ b/cli-cmd/network/src/v2/default_security_group_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::default_security_group_rule::get; -use openstack_types::network::v2::default_security_group_rule::response::get::DefaultSecurityGroupRuleResponse; +use openstack_types::network::v2::default_security_group_rule::response; /// Shows detailed information for a security group default rule. /// @@ -94,8 +94,9 @@ impl DefaultSecurityGroupRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/extension/list.rs b/cli-cmd/network/src/v2/extension/list.rs index 642ac2fee..f50856940 100644 --- a/cli-cmd/network/src/v2/extension/list.rs +++ b/cli-cmd/network/src/v2/extension/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::extension::list; -use openstack_types::network::v2::extension::response::list::ExtensionResponse; +use openstack_types::network::v2::extension::response; /// Lists available extensions. /// @@ -90,7 +90,8 @@ impl ExtensionsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/extension/show.rs b/cli-cmd/network/src/v2/extension/show.rs index c0e441c9e..8c9d1afbc 100644 --- a/cli-cmd/network/src/v2/extension/show.rs +++ b/cli-cmd/network/src/v2/extension/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::extension::get; -use openstack_types::network::v2::extension::response::get::ExtensionResponse; +use openstack_types::network::v2::extension::response; /// Shows details for an extension, by alias. The response shows the extension /// name and its alias. To show details for an extension, you specify the @@ -89,8 +89,9 @@ impl ExtensionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/flavor/create.rs b/cli-cmd/network/src/v2/flavor/create.rs index 5ecbde011..b2bedc36c 100644 --- a/cli-cmd/network/src/v2/flavor/create.rs +++ b/cli-cmd/network/src/v2/flavor/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::create; -use openstack_types::network::v2::flavor::response::create::FlavorResponse; +use openstack_types::network::v2::flavor::response; /// Creates a flavor. /// @@ -160,8 +160,9 @@ impl FlavorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/flavor/list.rs b/cli-cmd/network/src/v2/flavor/list.rs index 824b34bd3..62a2a1245 100644 --- a/cli-cmd/network/src/v2/flavor/list.rs +++ b/cli-cmd/network/src/v2/flavor/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::flavor::response::list::FlavorResponse; +use openstack_types::network::v2::flavor::response; /// Lists all flavors visible to the project. /// @@ -180,7 +180,8 @@ impl FlavorsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/flavor/next_provider/create.rs b/cli-cmd/network/src/v2/flavor/next_provider/create.rs index 85c483446..a6d085948 100644 --- a/cli-cmd/network/src/v2/flavor/next_provider/create.rs +++ b/cli-cmd/network/src/v2/flavor/next_provider/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::next_provider::create; -use openstack_types::network::v2::flavor::next_provider::response::create::NextProviderResponse; +use openstack_types::network::v2::flavor::next_provider::response; use serde_json::Value; /// Command without description in OpenAPI @@ -95,8 +95,9 @@ impl NextProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/flavor/next_provider/list.rs b/cli-cmd/network/src/v2/flavor/next_provider/list.rs index 1efba27e2..e7c8bffc8 100644 --- a/cli-cmd/network/src/v2/flavor/next_provider/list.rs +++ b/cli-cmd/network/src/v2/flavor/next_provider/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::next_provider::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::flavor::next_provider::response::list::NextProviderResponse; +use openstack_types::network::v2::flavor::next_provider::response; /// Command without description in OpenAPI #[derive(Args)] @@ -140,7 +140,8 @@ impl NextProvidersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/flavor/next_provider/set.rs b/cli-cmd/network/src/v2/flavor/next_provider/set.rs index a04970b7e..9e9db7019 100644 --- a/cli-cmd/network/src/v2/flavor/next_provider/set.rs +++ b/cli-cmd/network/src/v2/flavor/next_provider/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::next_provider::set; -use openstack_types::network::v2::flavor::next_provider::response::set::NextProviderResponse; +use openstack_types::network::v2::flavor::next_provider::response; use serde_json::Value; /// Command without description in OpenAPI @@ -104,8 +104,9 @@ impl NextProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/flavor/next_provider/show.rs b/cli-cmd/network/src/v2/flavor/next_provider/show.rs index f304f8411..ebe46ff4c 100644 --- a/cli-cmd/network/src/v2/flavor/next_provider/show.rs +++ b/cli-cmd/network/src/v2/flavor/next_provider/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::next_provider::get; -use openstack_types::network::v2::flavor::next_provider::response::get::NextProviderResponse; +use openstack_types::network::v2::flavor::next_provider::response; /// Command without description in OpenAPI #[derive(Args)] @@ -94,8 +94,9 @@ impl NextProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/flavor/service_profile/create.rs b/cli-cmd/network/src/v2/flavor/service_profile/create.rs index 547e1fc82..be44f62e1 100644 --- a/cli-cmd/network/src/v2/flavor/service_profile/create.rs +++ b/cli-cmd/network/src/v2/flavor/service_profile/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::service_profile::create; -use openstack_types::network::v2::flavor::service_profile::response::create::ServiceProfileResponse; +use openstack_types::network::v2::flavor::service_profile::response; /// Associate a flavor with a service profile. /// @@ -119,8 +119,9 @@ impl ServiceProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/flavor/service_profile/list.rs b/cli-cmd/network/src/v2/flavor/service_profile/list.rs index 39a6aa440..25fa7585e 100644 --- a/cli-cmd/network/src/v2/flavor/service_profile/list.rs +++ b/cli-cmd/network/src/v2/flavor/service_profile/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::service_profile::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::flavor::service_profile::response::list::ServiceProfileResponse; +use openstack_types::network::v2::flavor::service_profile::response; /// Command without description in OpenAPI #[derive(Args)] @@ -140,7 +140,8 @@ impl ServiceProfilesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/flavor/service_profile/set.rs b/cli-cmd/network/src/v2/flavor/service_profile/set.rs index 5dbeb6bd0..86eaea552 100644 --- a/cli-cmd/network/src/v2/flavor/service_profile/set.rs +++ b/cli-cmd/network/src/v2/flavor/service_profile/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::service_profile::set; -use openstack_types::network::v2::flavor::service_profile::response::set::ServiceProfileResponse; +use openstack_types::network::v2::flavor::service_profile::response; use serde_json::Value; /// Command without description in OpenAPI @@ -104,8 +104,9 @@ impl ServiceProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/flavor/service_profile/show.rs b/cli-cmd/network/src/v2/flavor/service_profile/show.rs index 8cb4b10ff..97fc6ade2 100644 --- a/cli-cmd/network/src/v2/flavor/service_profile/show.rs +++ b/cli-cmd/network/src/v2/flavor/service_profile/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::flavor::service_profile::get; -use openstack_types::network::v2::flavor::service_profile::response::get::ServiceProfileResponse; +use openstack_types::network::v2::flavor::service_profile::response; /// Command without description in OpenAPI #[derive(Args)] @@ -94,8 +94,9 @@ impl ServiceProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/flavor/set.rs b/cli-cmd/network/src/v2/flavor/set.rs index f83d9f225..60a311d12 100644 --- a/cli-cmd/network/src/v2/flavor/set.rs +++ b/cli-cmd/network/src/v2/flavor/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::flavor::find; use openstack_sdk::api::network::v2::flavor::set; -use openstack_types::network::v2::flavor::response::set::FlavorResponse; +use openstack_types::network::v2::flavor::response; /// Updates a flavor. /// @@ -158,8 +158,9 @@ impl FlavorCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/flavor/show.rs b/cli-cmd/network/src/v2/flavor/show.rs index c79a1a5fc..1989486c7 100644 --- a/cli-cmd/network/src/v2/flavor/show.rs +++ b/cli-cmd/network/src/v2/flavor/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::flavor::find; -use openstack_types::network::v2::flavor::response::get::FlavorResponse; +use openstack_types::network::v2::flavor::response; /// Shows details for a flavor. /// @@ -93,7 +93,7 @@ impl FlavorCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/floatingip/create.rs b/cli-cmd/network/src/v2/floatingip/create.rs index 1798ec9b0..cd59f8d95 100644 --- a/cli-cmd/network/src/v2/floatingip/create.rs +++ b/cli-cmd/network/src/v2/floatingip/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::create; -use openstack_types::network::v2::floatingip::response::create::FloatingipResponse; +use openstack_types::network::v2::floatingip::response; /// Creates a floating IP, and, if you specify port information, associates the /// floating IP with an internal port. @@ -243,8 +243,9 @@ impl FloatingipCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/floatingip/list.rs b/cli-cmd/network/src/v2/floatingip/list.rs index c0038221b..f6bcd6b0c 100644 --- a/cli-cmd/network/src/v2/floatingip/list.rs +++ b/cli-cmd/network/src/v2/floatingip/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::floatingip::response::list::FloatingipResponse; +use openstack_types::network::v2::floatingip::response; /// Lists floating IPs visible to the user. /// @@ -246,7 +246,8 @@ impl FloatingipsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/floatingip/port_forwarding/create.rs b/cli-cmd/network/src/v2/floatingip/port_forwarding/create.rs index 7a133546f..753671a25 100644 --- a/cli-cmd/network/src/v2/floatingip/port_forwarding/create.rs +++ b/cli-cmd/network/src/v2/floatingip/port_forwarding/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::port_forwarding::create; -use openstack_types::network::v2::floatingip::port_forwarding::response::create::PortForwardingResponse; +use openstack_types::network::v2::floatingip::port_forwarding::response; /// Creates a floating IP port forwarding. /// @@ -205,8 +205,9 @@ impl PortForwardingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/floatingip/port_forwarding/list.rs b/cli-cmd/network/src/v2/floatingip/port_forwarding/list.rs index 419856dba..841d0b1ab 100644 --- a/cli-cmd/network/src/v2/floatingip/port_forwarding/list.rs +++ b/cli-cmd/network/src/v2/floatingip/port_forwarding/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::port_forwarding::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::floatingip::port_forwarding::response::list::PortForwardingResponse; +use openstack_types::network::v2::floatingip::port_forwarding::response; /// Lists floating IP port forwardings that the project has access to. /// @@ -209,7 +209,8 @@ impl PortForwardingsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/floatingip/port_forwarding/set.rs b/cli-cmd/network/src/v2/floatingip/port_forwarding/set.rs index 8e46bd5da..b897b7c37 100644 --- a/cli-cmd/network/src/v2/floatingip/port_forwarding/set.rs +++ b/cli-cmd/network/src/v2/floatingip/port_forwarding/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::port_forwarding::set; -use openstack_types::network::v2::floatingip::port_forwarding::response::set::PortForwardingResponse; +use openstack_types::network::v2::floatingip::port_forwarding::response; /// Updates a floating IP port forwarding. /// @@ -206,8 +206,9 @@ impl PortForwardingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/floatingip/port_forwarding/show.rs b/cli-cmd/network/src/v2/floatingip/port_forwarding/show.rs index f663d1a5d..b74a27542 100644 --- a/cli-cmd/network/src/v2/floatingip/port_forwarding/show.rs +++ b/cli-cmd/network/src/v2/floatingip/port_forwarding/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::port_forwarding::get; -use openstack_types::network::v2::floatingip::port_forwarding::response::get::PortForwardingResponse; +use openstack_types::network::v2::floatingip::port_forwarding::response; /// Shows information for a floating IP port forwarding. /// @@ -102,8 +102,9 @@ impl PortForwardingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/floatingip/set.rs b/cli-cmd/network/src/v2/floatingip/set.rs index 058b591ab..e4acac16b 100644 --- a/cli-cmd/network/src/v2/floatingip/set.rs +++ b/cli-cmd/network/src/v2/floatingip/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::set; -use openstack_types::network::v2::floatingip::response::set::FloatingipResponse; +use openstack_types::network::v2::floatingip::response; /// Updates a floating IP and its association with an internal port. /// @@ -171,8 +171,9 @@ impl FloatingipCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/floatingip/show.rs b/cli-cmd/network/src/v2/floatingip/show.rs index 0bef0eb3d..5d40d72c4 100644 --- a/cli-cmd/network/src/v2/floatingip/show.rs +++ b/cli-cmd/network/src/v2/floatingip/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::get; -use openstack_types::network::v2::floatingip::response::get::FloatingipResponse; +use openstack_types::network::v2::floatingip::response; /// Shows details for a floating IP. /// @@ -91,8 +91,9 @@ impl FloatingipCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/floatingip/tag/list.rs b/cli-cmd/network/src/v2/floatingip/tag/list.rs index 714c1951a..aff81a255 100644 --- a/cli-cmd/network/src/v2/floatingip/tag/list.rs +++ b/cli-cmd/network/src/v2/floatingip/tag/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::floatingip::tag::response::list::TagResponse; +use openstack_types::network::v2::floatingip::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -136,7 +136,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/floatingip/tag/replace.rs b/cli-cmd/network/src/v2/floatingip/tag/replace.rs index 4d7c7c0d9..8e9fb3115 100644 --- a/cli-cmd/network/src/v2/floatingip/tag/replace.rs +++ b/cli-cmd/network/src/v2/floatingip/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip::tag::replace; -use openstack_types::network::v2::floatingip::tag::response::replace::TagResponse; +use openstack_types::network::v2::floatingip::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -95,7 +95,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/floatingip_pool/create.rs b/cli-cmd/network/src/v2/floatingip_pool/create.rs index c289ba087..dd86e4cdf 100644 --- a/cli-cmd/network/src/v2/floatingip_pool/create.rs +++ b/cli-cmd/network/src/v2/floatingip_pool/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip_pool::create; -use openstack_types::network::v2::floatingip_pool::response::create::FloatingipPoolResponse; +use openstack_types::network::v2::floatingip_pool::response; use serde_json::Value; /// Command without description in OpenAPI @@ -84,8 +84,9 @@ impl FloatingipPoolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/floatingip_pool/list.rs b/cli-cmd/network/src/v2/floatingip_pool/list.rs index 4f09efaf3..eeb147229 100644 --- a/cli-cmd/network/src/v2/floatingip_pool/list.rs +++ b/cli-cmd/network/src/v2/floatingip_pool/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip_pool::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::floatingip_pool::response::list::FloatingipPoolResponse; +use openstack_types::network::v2::floatingip_pool::response; /// Command without description in OpenAPI #[derive(Args)] @@ -126,7 +126,8 @@ impl FloatingipPoolsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/floatingip_pool/set.rs b/cli-cmd/network/src/v2/floatingip_pool/set.rs index ef718be2a..5567c1c79 100644 --- a/cli-cmd/network/src/v2/floatingip_pool/set.rs +++ b/cli-cmd/network/src/v2/floatingip_pool/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip_pool::set; -use openstack_types::network::v2::floatingip_pool::response::set::FloatingipPoolResponse; +use openstack_types::network::v2::floatingip_pool::response; use serde_json::Value; /// Command without description in OpenAPI @@ -91,8 +91,9 @@ impl FloatingipPoolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/floatingip_pool/show.rs b/cli-cmd/network/src/v2/floatingip_pool/show.rs index c2d3df75a..32ea9d382 100644 --- a/cli-cmd/network/src/v2/floatingip_pool/show.rs +++ b/cli-cmd/network/src/v2/floatingip_pool/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::floatingip_pool::get; -use openstack_types::network::v2::floatingip_pool::response::get::FloatingipPoolResponse; +use openstack_types::network::v2::floatingip_pool::response; /// Command without description in OpenAPI #[derive(Args)] @@ -81,8 +81,9 @@ impl FloatingipPoolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/local_ip/create.rs b/cli-cmd/network/src/v2/local_ip/create.rs index a09599744..1029cc3ba 100644 --- a/cli-cmd/network/src/v2/local_ip/create.rs +++ b/cli-cmd/network/src/v2/local_ip/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::local_ip::create; -use openstack_types::network::v2::local_ip::response::create::LocalIpResponse; +use openstack_types::network::v2::local_ip::response; /// Command without description in OpenAPI #[derive(Args)] @@ -153,8 +153,9 @@ impl LocalIpCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/local_ip/list.rs b/cli-cmd/network/src/v2/local_ip/list.rs index 3a5b1f32f..ab53bf0ba 100644 --- a/cli-cmd/network/src/v2/local_ip/list.rs +++ b/cli-cmd/network/src/v2/local_ip/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::local_ip::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::local_ip::response::list::LocalIpResponse; +use openstack_types::network::v2::local_ip::response; /// Command without description in OpenAPI #[derive(Args)] @@ -188,7 +188,8 @@ impl LocalIpsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/local_ip/port_association/create.rs b/cli-cmd/network/src/v2/local_ip/port_association/create.rs index ec3f77cfb..c5edef76a 100644 --- a/cli-cmd/network/src/v2/local_ip/port_association/create.rs +++ b/cli-cmd/network/src/v2/local_ip/port_association/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::local_ip::port_association::create; -use openstack_types::network::v2::local_ip::port_association::response::create::PortAssociationResponse; +use openstack_types::network::v2::local_ip::port_association::response; /// Creates a Local IP association with a given Port. If a Port has multiple /// fixed IPs user must specify which IP to use for association. @@ -139,8 +139,9 @@ impl PortAssociationCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/local_ip/port_association/list.rs b/cli-cmd/network/src/v2/local_ip/port_association/list.rs index 19c477799..9246b1987 100644 --- a/cli-cmd/network/src/v2/local_ip/port_association/list.rs +++ b/cli-cmd/network/src/v2/local_ip/port_association/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::local_ip::port_association::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::local_ip::port_association::response::list::PortAssociationResponse; +use openstack_types::network::v2::local_ip::port_association::response; /// Lists Associations for the given Local IP. /// @@ -189,7 +189,8 @@ impl PortAssociationsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/local_ip/port_association/set.rs b/cli-cmd/network/src/v2/local_ip/port_association/set.rs index c75b01ab4..badaa16fe 100644 --- a/cli-cmd/network/src/v2/local_ip/port_association/set.rs +++ b/cli-cmd/network/src/v2/local_ip/port_association/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::local_ip::port_association::set; -use openstack_types::network::v2::local_ip::port_association::response::set::PortAssociationResponse; +use openstack_types::network::v2::local_ip::port_association::response; use serde_json::Value; /// Command without description in OpenAPI @@ -105,8 +105,9 @@ impl PortAssociationCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/local_ip/port_association/show.rs b/cli-cmd/network/src/v2/local_ip/port_association/show.rs index bb1b9d7ca..037f0891c 100644 --- a/cli-cmd/network/src/v2/local_ip/port_association/show.rs +++ b/cli-cmd/network/src/v2/local_ip/port_association/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::local_ip::port_association::get; -use openstack_types::network::v2::local_ip::port_association::response::get::PortAssociationResponse; +use openstack_types::network::v2::local_ip::port_association::response; /// Command without description in OpenAPI #[derive(Args)] @@ -95,8 +95,9 @@ impl PortAssociationCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/local_ip/set.rs b/cli-cmd/network/src/v2/local_ip/set.rs index 5c0d5cf7e..16406ef97 100644 --- a/cli-cmd/network/src/v2/local_ip/set.rs +++ b/cli-cmd/network/src/v2/local_ip/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::local_ip::find; use openstack_sdk::api::network::v2::local_ip::set; -use openstack_types::network::v2::local_ip::response::set::LocalIpResponse; +use openstack_types::network::v2::local_ip::response; /// Command without description in OpenAPI #[derive(Args)] @@ -125,8 +125,9 @@ impl LocalIpCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/local_ip/show.rs b/cli-cmd/network/src/v2/local_ip/show.rs index e9f1671fd..e3dc941ba 100644 --- a/cli-cmd/network/src/v2/local_ip/show.rs +++ b/cli-cmd/network/src/v2/local_ip/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::local_ip::find; -use openstack_types::network::v2::local_ip::response::get::LocalIpResponse; +use openstack_types::network::v2::local_ip::response; /// Command without description in OpenAPI #[derive(Args)] @@ -81,7 +81,7 @@ impl LocalIpCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/log/log/create.rs b/cli-cmd/network/src/v2/log/log/create.rs index 757561b3b..571865f0c 100644 --- a/cli-cmd/network/src/v2/log/log/create.rs +++ b/cli-cmd/network/src/v2/log/log/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::log::log::create; -use openstack_types::network::v2::log::log::response::create::LogResponse; +use openstack_types::network::v2::log::log::response; /// Creates a log resource. /// @@ -197,8 +197,9 @@ impl LogCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/log/log/list.rs b/cli-cmd/network/src/v2/log/log/list.rs index 1c8d31f13..74eb8fb18 100644 --- a/cli-cmd/network/src/v2/log/log/list.rs +++ b/cli-cmd/network/src/v2/log/log/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::log::log::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::log::log::response::list::LogResponse; +use openstack_types::network::v2::log::log::response; /// Lists all log resources associated with your project. /// @@ -215,7 +215,8 @@ impl LogsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/log/log/set.rs b/cli-cmd/network/src/v2/log/log/set.rs index b8eb4b220..d19420910 100644 --- a/cli-cmd/network/src/v2/log/log/set.rs +++ b/cli-cmd/network/src/v2/log/log/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::log::log::find; use openstack_sdk::api::network::v2::log::log::set; -use openstack_types::network::v2::log::log::response::set::LogResponse; +use openstack_types::network::v2::log::log::response; /// Updates a log resource. /// @@ -142,8 +142,9 @@ impl LogCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/log/log/show.rs b/cli-cmd/network/src/v2/log/log/show.rs index 50b725410..ba3ae7cc1 100644 --- a/cli-cmd/network/src/v2/log/log/show.rs +++ b/cli-cmd/network/src/v2/log/log/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::log::log::find; -use openstack_types::network::v2::log::log::response::get::LogResponse; +use openstack_types::network::v2::log::log::response; /// Shows details log resource. /// @@ -89,7 +89,7 @@ impl LogCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/log/loggable_resource/create.rs b/cli-cmd/network/src/v2/log/loggable_resource/create.rs index b4321398b..5045e47ca 100644 --- a/cli-cmd/network/src/v2/log/loggable_resource/create.rs +++ b/cli-cmd/network/src/v2/log/loggable_resource/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::log::loggable_resource::create; -use openstack_types::network::v2::log::loggable_resource::response::create::LoggableResourceResponse; +use openstack_types::network::v2::log::loggable_resource::response; use serde_json::Value; /// Command without description in OpenAPI @@ -84,8 +84,9 @@ impl LoggableResourceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/log/loggable_resource/list.rs b/cli-cmd/network/src/v2/log/loggable_resource/list.rs index 3eadafe39..260b64543 100644 --- a/cli-cmd/network/src/v2/log/loggable_resource/list.rs +++ b/cli-cmd/network/src/v2/log/loggable_resource/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::log::loggable_resource::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::log::loggable_resource::response::list::LoggableResourceResponse; +use openstack_types::network::v2::log::loggable_resource::response; /// Lists all resource log types are supporting. /// @@ -147,7 +147,8 @@ impl LoggableResourcesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/log/loggable_resource/set.rs b/cli-cmd/network/src/v2/log/loggable_resource/set.rs index 0846fbd40..dd74ad298 100644 --- a/cli-cmd/network/src/v2/log/loggable_resource/set.rs +++ b/cli-cmd/network/src/v2/log/loggable_resource/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::log::loggable_resource::set; -use openstack_types::network::v2::log::loggable_resource::response::set::LoggableResourceResponse; +use openstack_types::network::v2::log::loggable_resource::response; use serde_json::Value; /// Command without description in OpenAPI @@ -94,8 +94,9 @@ impl LoggableResourceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/log/loggable_resource/show.rs b/cli-cmd/network/src/v2/log/loggable_resource/show.rs index 4913d0096..56c9be889 100644 --- a/cli-cmd/network/src/v2/log/loggable_resource/show.rs +++ b/cli-cmd/network/src/v2/log/loggable_resource/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::log::loggable_resource::get; -use openstack_types::network::v2::log::loggable_resource::response::get::LoggableResourceResponse; +use openstack_types::network::v2::log::loggable_resource::response; /// Command without description in OpenAPI #[derive(Args)] @@ -84,8 +84,9 @@ impl LoggableResourceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/metering/metering_label/create.rs b/cli-cmd/network/src/v2/metering/metering_label/create.rs index 769290a42..97573dbdf 100644 --- a/cli-cmd/network/src/v2/metering/metering_label/create.rs +++ b/cli-cmd/network/src/v2/metering/metering_label/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::metering::metering_label::create; -use openstack_types::network::v2::metering::metering_label::response::create::MeteringLabelResponse; +use openstack_types::network::v2::metering::metering_label::response; /// Creates an L3 metering label. /// @@ -131,8 +131,9 @@ impl MeteringLabelCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/metering/metering_label/list.rs b/cli-cmd/network/src/v2/metering/metering_label/list.rs index 1475156ec..ea2f66750 100644 --- a/cli-cmd/network/src/v2/metering/metering_label/list.rs +++ b/cli-cmd/network/src/v2/metering/metering_label/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::metering::metering_label::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::metering::metering_label::response::list::MeteringLabelResponse; +use openstack_types::network::v2::metering::metering_label::response; /// Lists all L3 metering labels that belong to the project. /// @@ -184,7 +184,8 @@ impl MeteringLabelsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/metering/metering_label/set.rs b/cli-cmd/network/src/v2/metering/metering_label/set.rs index 847ddf444..b611f72db 100644 --- a/cli-cmd/network/src/v2/metering/metering_label/set.rs +++ b/cli-cmd/network/src/v2/metering/metering_label/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::metering::metering_label::find; use openstack_sdk::api::network::v2::metering::metering_label::set; -use openstack_types::network::v2::metering::metering_label::response::set::MeteringLabelResponse; +use openstack_types::network::v2::metering::metering_label::response; use serde_json::Value; /// Command without description in OpenAPI @@ -109,8 +109,9 @@ impl MeteringLabelCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/metering/metering_label/show.rs b/cli-cmd/network/src/v2/metering/metering_label/show.rs index 609625daf..386e38c83 100644 --- a/cli-cmd/network/src/v2/metering/metering_label/show.rs +++ b/cli-cmd/network/src/v2/metering/metering_label/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::metering::metering_label::find; -use openstack_types::network::v2::metering::metering_label::response::get::MeteringLabelResponse; +use openstack_types::network::v2::metering::metering_label::response; /// Shows details for a metering label. /// @@ -93,7 +93,7 @@ impl MeteringLabelCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/metering/metering_label_rule/create.rs b/cli-cmd/network/src/v2/metering/metering_label_rule/create.rs index 719f7702e..7f70307c5 100644 --- a/cli-cmd/network/src/v2/metering/metering_label_rule/create.rs +++ b/cli-cmd/network/src/v2/metering/metering_label_rule/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::metering::metering_label_rule::create; -use openstack_types::network::v2::metering::metering_label_rule::response::create::MeteringLabelRuleResponse; +use openstack_types::network::v2::metering::metering_label_rule::response; /// Creates an L3 metering label rule. /// @@ -166,8 +166,9 @@ impl MeteringLabelRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/metering/metering_label_rule/list.rs b/cli-cmd/network/src/v2/metering/metering_label_rule/list.rs index 2f29da130..e6eddf1b5 100644 --- a/cli-cmd/network/src/v2/metering/metering_label_rule/list.rs +++ b/cli-cmd/network/src/v2/metering/metering_label_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::metering::metering_label_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::metering::metering_label_rule::response::list::MeteringLabelRuleResponse; +use openstack_types::network::v2::metering::metering_label_rule::response; /// Lists a summary of all L3 metering label rules that belong to the project. /// @@ -213,7 +213,8 @@ impl MeteringLabelRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/metering/metering_label_rule/set.rs b/cli-cmd/network/src/v2/metering/metering_label_rule/set.rs index 784f129b1..c32f41f13 100644 --- a/cli-cmd/network/src/v2/metering/metering_label_rule/set.rs +++ b/cli-cmd/network/src/v2/metering/metering_label_rule/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::metering::metering_label_rule::set; -use openstack_types::network::v2::metering::metering_label_rule::response::set::MeteringLabelRuleResponse; +use openstack_types::network::v2::metering::metering_label_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -114,8 +114,9 @@ impl MeteringLabelRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/metering/metering_label_rule/show.rs b/cli-cmd/network/src/v2/metering/metering_label_rule/show.rs index 367bd0711..5a5218873 100644 --- a/cli-cmd/network/src/v2/metering/metering_label_rule/show.rs +++ b/cli-cmd/network/src/v2/metering/metering_label_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::metering::metering_label_rule::get; -use openstack_types::network::v2::metering::metering_label_rule::response::get::MeteringLabelRuleResponse; +use openstack_types::network::v2::metering::metering_label_rule::response; /// Shows details for a metering label rule. /// @@ -93,8 +93,9 @@ impl MeteringLabelRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/ndp_proxy/create.rs b/cli-cmd/network/src/v2/ndp_proxy/create.rs index e93bc8fdd..86d3a5966 100644 --- a/cli-cmd/network/src/v2/ndp_proxy/create.rs +++ b/cli-cmd/network/src/v2/ndp_proxy/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::ndp_proxy::create; -use openstack_types::network::v2::ndp_proxy::response::create::NdpProxyResponse; +use openstack_types::network::v2::ndp_proxy::response; /// Command without description in OpenAPI #[derive(Args)] @@ -134,8 +134,9 @@ impl NdpProxyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/ndp_proxy/list.rs b/cli-cmd/network/src/v2/ndp_proxy/list.rs index afcfb1b13..a31af6f25 100644 --- a/cli-cmd/network/src/v2/ndp_proxy/list.rs +++ b/cli-cmd/network/src/v2/ndp_proxy/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::ndp_proxy::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::ndp_proxy::response::list::NdpProxyResponse; +use openstack_types::network::v2::ndp_proxy::response; /// Command without description in OpenAPI #[derive(Args)] @@ -146,7 +146,8 @@ impl NdpProxiesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/ndp_proxy/set.rs b/cli-cmd/network/src/v2/ndp_proxy/set.rs index 5f3b9547f..c3fd9aa16 100644 --- a/cli-cmd/network/src/v2/ndp_proxy/set.rs +++ b/cli-cmd/network/src/v2/ndp_proxy/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::ndp_proxy::find; use openstack_sdk::api::network::v2::ndp_proxy::set; -use openstack_types::network::v2::ndp_proxy::response::set::NdpProxyResponse; +use openstack_types::network::v2::ndp_proxy::response; /// Command without description in OpenAPI #[derive(Args)] @@ -125,8 +125,9 @@ impl NdpProxyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/ndp_proxy/show.rs b/cli-cmd/network/src/v2/ndp_proxy/show.rs index ac981b454..a4c715be1 100644 --- a/cli-cmd/network/src/v2/ndp_proxy/show.rs +++ b/cli-cmd/network/src/v2/ndp_proxy/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::ndp_proxy::find; -use openstack_types::network::v2::ndp_proxy::response::get::NdpProxyResponse; +use openstack_types::network::v2::ndp_proxy::response; /// Command without description in OpenAPI #[derive(Args)] @@ -81,7 +81,7 @@ impl NdpProxyCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/network/create.rs b/cli-cmd/network/src/v2/network/create.rs index a983a9e4e..bf36d0c2e 100644 --- a/cli-cmd/network/src/v2/network/create.rs +++ b/cli-cmd/network/src/v2/network/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network::create; -use openstack_types::network::v2::network::response::create::NetworkResponse; +use openstack_types::network::v2::network::response; use serde_json::Value; /// Creates a network. @@ -280,8 +280,9 @@ impl NetworkCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network/dhcp_agent/create.rs b/cli-cmd/network/src/v2/network/dhcp_agent/create.rs index 95aab0727..f59b16935 100644 --- a/cli-cmd/network/src/v2/network/dhcp_agent/create.rs +++ b/cli-cmd/network/src/v2/network/dhcp_agent/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network::dhcp_agent::create; -use openstack_types::network::v2::network::dhcp_agent::response::create::DhcpAgentResponse; +use openstack_types::network::v2::network::dhcp_agent::response; use serde_json::Value; /// Command without description in OpenAPI @@ -96,8 +96,9 @@ impl DhcpAgentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network/dhcp_agent/list.rs b/cli-cmd/network/src/v2/network/dhcp_agent/list.rs index 4d7180373..03b6804ee 100644 --- a/cli-cmd/network/src/v2/network/dhcp_agent/list.rs +++ b/cli-cmd/network/src/v2/network/dhcp_agent/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network::dhcp_agent::list; -use openstack_types::network::v2::network::dhcp_agent::response::list::DhcpAgentResponse; +use openstack_types::network::v2::network::dhcp_agent::response; /// Lists DHCP agents hosting a network. /// @@ -153,8 +153,9 @@ impl DhcpAgentsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network/dhcp_agent/set.rs b/cli-cmd/network/src/v2/network/dhcp_agent/set.rs index 2b79eae0d..38920afa3 100644 --- a/cli-cmd/network/src/v2/network/dhcp_agent/set.rs +++ b/cli-cmd/network/src/v2/network/dhcp_agent/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network::dhcp_agent::set; -use openstack_types::network::v2::network::dhcp_agent::response::set::DhcpAgentResponse; +use openstack_types::network::v2::network::dhcp_agent::response; use serde_json::Value; /// Command without description in OpenAPI @@ -105,8 +105,9 @@ impl DhcpAgentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network/dhcp_agent/show.rs b/cli-cmd/network/src/v2/network/dhcp_agent/show.rs index 8b1459f17..ba92d6da6 100644 --- a/cli-cmd/network/src/v2/network/dhcp_agent/show.rs +++ b/cli-cmd/network/src/v2/network/dhcp_agent/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network::dhcp_agent::get; -use openstack_types::network::v2::network::dhcp_agent::response::get::DhcpAgentResponse; +use openstack_types::network::v2::network::dhcp_agent::response; /// Command without description in OpenAPI #[derive(Args)] @@ -94,8 +94,9 @@ impl DhcpAgentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network/list.rs b/cli-cmd/network/src/v2/network/list.rs index df63f6049..0b0ce9eee 100644 --- a/cli-cmd/network/src/v2/network/list.rs +++ b/cli-cmd/network/src/v2/network/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::network::response::list::NetworkResponse; +use openstack_types::network::v2::network::response; /// Lists networks to which the project has access. /// @@ -292,7 +292,8 @@ impl NetworksCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/network/set.rs b/cli-cmd/network/src/v2/network/set.rs index 54dae1224..b7248c3d7 100644 --- a/cli-cmd/network/src/v2/network/set.rs +++ b/cli-cmd/network/src/v2/network/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::network::find; use openstack_sdk::api::network::v2::network::set; -use openstack_types::network::v2::network::response::set::NetworkResponse; +use openstack_types::network::v2::network::response; use serde_json::Value; /// Updates a network. @@ -255,8 +255,9 @@ impl NetworkCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network/show.rs b/cli-cmd/network/src/v2/network/show.rs index 32bfdeb8a..e3bae3a1a 100644 --- a/cli-cmd/network/src/v2/network/show.rs +++ b/cli-cmd/network/src/v2/network/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::network::find; -use openstack_types::network::v2::network::response::get::NetworkResponse; +use openstack_types::network::v2::network::response; /// Shows details for a network. /// @@ -89,7 +89,7 @@ impl NetworkCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/network/tag/list.rs b/cli-cmd/network/src/v2/network/tag/list.rs index 33795b9e8..6c4fe38c2 100644 --- a/cli-cmd/network/src/v2/network/tag/list.rs +++ b/cli-cmd/network/src/v2/network/tag/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::network::tag::response::list::TagResponse; +use openstack_types::network::v2::network::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -134,7 +134,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/network/tag/replace.rs b/cli-cmd/network/src/v2/network/tag/replace.rs index 902ac5c93..2c0c80164 100644 --- a/cli-cmd/network/src/v2/network/tag/replace.rs +++ b/cli-cmd/network/src/v2/network/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network::tag::replace; -use openstack_types::network::v2::network::tag::response::replace::TagResponse; +use openstack_types::network::v2::network::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -91,7 +91,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/network_ip_availability/create.rs b/cli-cmd/network/src/v2/network_ip_availability/create.rs index a98cf20bc..70db5a039 100644 --- a/cli-cmd/network/src/v2/network_ip_availability/create.rs +++ b/cli-cmd/network/src/v2/network_ip_availability/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network_ip_availability::create; -use openstack_types::network::v2::network_ip_availability::response::create::NetworkIpAvailabilityResponse; +use openstack_types::network::v2::network_ip_availability::response; use serde_json::Value; /// Command without description in OpenAPI @@ -84,8 +84,9 @@ impl NetworkIpAvailabilityCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network_ip_availability/list.rs b/cli-cmd/network/src/v2/network_ip_availability/list.rs index 8e9a63b93..54c65ca9f 100644 --- a/cli-cmd/network/src/v2/network_ip_availability/list.rs +++ b/cli-cmd/network/src/v2/network_ip_availability/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network_ip_availability::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::network_ip_availability::response::list::NetworkIpAvailabilityResponse; +use openstack_types::network::v2::network_ip_availability::response; /// Lists network IP availability of all networks. /// @@ -178,7 +178,8 @@ impl NetworkIpAvailabilitiesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/network_ip_availability/set.rs b/cli-cmd/network/src/v2/network_ip_availability/set.rs index b2bc40fe0..900111f8f 100644 --- a/cli-cmd/network/src/v2/network_ip_availability/set.rs +++ b/cli-cmd/network/src/v2/network_ip_availability/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network_ip_availability::set; -use openstack_types::network::v2::network_ip_availability::response::set::NetworkIpAvailabilityResponse; +use openstack_types::network::v2::network_ip_availability::response; use serde_json::Value; /// Command without description in OpenAPI @@ -94,8 +94,9 @@ impl NetworkIpAvailabilityCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network_ip_availability/show.rs b/cli-cmd/network/src/v2/network_ip_availability/show.rs index 8c768547a..63abb834c 100644 --- a/cli-cmd/network/src/v2/network_ip_availability/show.rs +++ b/cli-cmd/network/src/v2/network_ip_availability/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network_ip_availability::get; -use openstack_types::network::v2::network_ip_availability::response::get::NetworkIpAvailabilityResponse; +use openstack_types::network::v2::network_ip_availability::response; /// Shows network IP availability details for a network. /// @@ -94,8 +94,9 @@ impl NetworkIpAvailabilityCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network_segment_range/create.rs b/cli-cmd/network/src/v2/network_segment_range/create.rs index e1762af73..5a1d56b3a 100644 --- a/cli-cmd/network/src/v2/network_segment_range/create.rs +++ b/cli-cmd/network/src/v2/network_segment_range/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network_segment_range::create; -use openstack_types::network::v2::network_segment_range::response::create::NetworkSegmentRangeResponse; +use openstack_types::network::v2::network_segment_range::response; /// Command without description in OpenAPI #[derive(Args)] @@ -162,8 +162,9 @@ impl NetworkSegmentRangeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network_segment_range/list.rs b/cli-cmd/network/src/v2/network_segment_range/list.rs index aec4464ee..0748e028d 100644 --- a/cli-cmd/network/src/v2/network_segment_range/list.rs +++ b/cli-cmd/network/src/v2/network_segment_range/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network_segment_range::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::network_segment_range::response::list::NetworkSegmentRangeResponse; +use openstack_types::network::v2::network_segment_range::response; /// Command without description in OpenAPI #[derive(Args)] @@ -206,7 +206,8 @@ impl NetworkSegmentRangesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/network_segment_range/set.rs b/cli-cmd/network/src/v2/network_segment_range/set.rs index a26836b74..bbc766297 100644 --- a/cli-cmd/network/src/v2/network_segment_range/set.rs +++ b/cli-cmd/network/src/v2/network_segment_range/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::network_segment_range::find; use openstack_sdk::api::network::v2::network_segment_range::set; -use openstack_types::network::v2::network_segment_range::response::set::NetworkSegmentRangeResponse; +use openstack_types::network::v2::network_segment_range::response; /// Command without description in OpenAPI #[derive(Args)] @@ -143,8 +143,9 @@ impl NetworkSegmentRangeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/network_segment_range/show.rs b/cli-cmd/network/src/v2/network_segment_range/show.rs index ef30d7f8c..ac13d1c38 100644 --- a/cli-cmd/network/src/v2/network_segment_range/show.rs +++ b/cli-cmd/network/src/v2/network_segment_range/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::network_segment_range::find; -use openstack_types::network::v2::network_segment_range::response::get::NetworkSegmentRangeResponse; +use openstack_types::network::v2::network_segment_range::response; /// Command without description in OpenAPI #[derive(Args)] @@ -85,7 +85,7 @@ impl NetworkSegmentRangeCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/network_segment_range/tag/list.rs b/cli-cmd/network/src/v2/network_segment_range/tag/list.rs index 897e61a9e..47dd0c0fa 100644 --- a/cli-cmd/network/src/v2/network_segment_range/tag/list.rs +++ b/cli-cmd/network/src/v2/network_segment_range/tag/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network_segment_range::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::network_segment_range::tag::response::list::TagResponse; +use openstack_types::network::v2::network_segment_range::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -139,7 +139,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/network_segment_range/tag/replace.rs b/cli-cmd/network/src/v2/network_segment_range/tag/replace.rs index 578fad82e..afca35c88 100644 --- a/cli-cmd/network/src/v2/network_segment_range/tag/replace.rs +++ b/cli-cmd/network/src/v2/network_segment_range/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::network_segment_range::tag::replace; -use openstack_types::network::v2::network_segment_range::tag::response::replace::TagResponse; +use openstack_types::network::v2::network_segment_range::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -95,7 +95,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/create.rs b/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/create.rs index 4f7697034..35fa001b3 100644 --- a/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/create.rs +++ b/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::policy::packet_rate_limit_rule::create; -use openstack_types::network::v2::policy::packet_rate_limit_rule::response::create::PacketRateLimitRuleResponse; +use openstack_types::network::v2::policy::packet_rate_limit_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -134,8 +134,9 @@ impl PacketRateLimitRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/policy/packet_rate_limit_rule/list.rs b/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/list.rs index c6eef9081..9deabad28 100644 --- a/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/list.rs +++ b/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::policy::packet_rate_limit_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::policy::packet_rate_limit_rule::response::list::PacketRateLimitRuleResponse; +use openstack_types::network::v2::policy::packet_rate_limit_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -172,7 +172,8 @@ impl PacketRateLimitRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/set.rs b/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/set.rs index e537382a4..97690d048 100644 --- a/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/set.rs +++ b/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::policy::packet_rate_limit_rule::set; -use openstack_types::network::v2::policy::packet_rate_limit_rule::response::set::PacketRateLimitRuleResponse; +use openstack_types::network::v2::policy::packet_rate_limit_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -144,8 +144,9 @@ impl PacketRateLimitRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/policy/packet_rate_limit_rule/show.rs b/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/show.rs index e1c0b1367..b15490bf1 100644 --- a/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/show.rs +++ b/cli-cmd/network/src/v2/policy/packet_rate_limit_rule/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::policy::packet_rate_limit_rule::get; -use openstack_types::network::v2::policy::packet_rate_limit_rule::response::get::PacketRateLimitRuleResponse; +use openstack_types::network::v2::policy::packet_rate_limit_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -95,8 +95,9 @@ impl PacketRateLimitRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/policy/tag/list.rs b/cli-cmd/network/src/v2/policy/tag/list.rs index 5e6f4d4dd..2362e1037 100644 --- a/cli-cmd/network/src/v2/policy/tag/list.rs +++ b/cli-cmd/network/src/v2/policy/tag/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::policy::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::policy::tag::response::list::TagResponse; +use openstack_types::network::v2::policy::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -135,7 +135,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/policy/tag/replace.rs b/cli-cmd/network/src/v2/policy/tag/replace.rs index 9019223a3..b8c95e263 100644 --- a/cli-cmd/network/src/v2/policy/tag/replace.rs +++ b/cli-cmd/network/src/v2/policy/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::policy::tag::replace; -use openstack_types::network::v2::policy::tag::response::replace::TagResponse; +use openstack_types::network::v2::policy::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -91,7 +91,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/port/add_allowed_address_pairs.rs b/cli-cmd/network/src/v2/port/add_allowed_address_pairs.rs index ce559d694..88432bbd5 100644 --- a/cli-cmd/network/src/v2/port/add_allowed_address_pairs.rs +++ b/cli-cmd/network/src/v2/port/add_allowed_address_pairs.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::add_allowed_address_pairs; -use openstack_types::network::v2::port::response::add_allowed_address_pairs::PortResponse; +use openstack_types::network::v2::port::response; use serde_json::Value; /// Request of the ports/port_id/add_allowed_address_pairs:put operation @@ -97,8 +97,9 @@ impl PortCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/port/binding/activate.rs b/cli-cmd/network/src/v2/port/binding/activate.rs index 73c9425c0..46f06f9d2 100644 --- a/cli-cmd/network/src/v2/port/binding/activate.rs +++ b/cli-cmd/network/src/v2/port/binding/activate.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::binding::activate; -use openstack_types::network::v2::port::binding::response::activate::BindingResponse; +use openstack_types::network::v2::port::binding::response; /// Normal response codes: 200 /// @@ -100,8 +100,9 @@ impl BindingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/port/binding/create.rs b/cli-cmd/network/src/v2/port/binding/create.rs index 519e98688..131571b02 100644 --- a/cli-cmd/network/src/v2/port/binding/create.rs +++ b/cli-cmd/network/src/v2/port/binding/create.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::binding::create; -use openstack_types::network::v2::port::binding::response::create::BindingResponse; +use openstack_types::network::v2::port::binding::response; use serde_json::Value; /// Command without description in OpenAPI @@ -157,8 +157,9 @@ impl BindingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/port/binding/list.rs b/cli-cmd/network/src/v2/port/binding/list.rs index bfaa0f632..4b9397adf 100644 --- a/cli-cmd/network/src/v2/port/binding/list.rs +++ b/cli-cmd/network/src/v2/port/binding/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::binding::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::port::binding::response::list::BindingResponse; +use openstack_types::network::v2::port::binding::response; /// Use the `fields` query parameter to control which fields are returned in /// the response body. For more information, see [Fields](#fields). @@ -169,7 +169,8 @@ impl BindingsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/port/binding/set.rs b/cli-cmd/network/src/v2/port/binding/set.rs index ea87145b2..24820de07 100644 --- a/cli-cmd/network/src/v2/port/binding/set.rs +++ b/cli-cmd/network/src/v2/port/binding/set.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::binding::set; -use openstack_types::network::v2::port::binding::response::set::BindingResponse; +use openstack_types::network::v2::port::binding::response; use serde_json::Value; /// Command without description in OpenAPI @@ -158,8 +158,9 @@ impl BindingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/port/binding/show.rs b/cli-cmd/network/src/v2/port/binding/show.rs index 81bdb3885..25ea66283 100644 --- a/cli-cmd/network/src/v2/port/binding/show.rs +++ b/cli-cmd/network/src/v2/port/binding/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::binding::get; -use openstack_types::network::v2::port::binding::response::get::BindingResponse; +use openstack_types::network::v2::port::binding::response; /// Command without description in OpenAPI #[derive(Args)] @@ -90,8 +90,9 @@ impl BindingCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/port/create.rs b/cli-cmd/network/src/v2/port/create.rs index 8a62b0875..206ca8916 100644 --- a/cli-cmd/network/src/v2/port/create.rs +++ b/cli-cmd/network/src/v2/port/create.rs @@ -32,7 +32,7 @@ use clap::ValueEnum; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::create; -use openstack_types::network::v2::port::response::create::PortResponse; +use openstack_types::network::v2::port::response; use serde_json::Value; /// Creates a port on a network. @@ -436,8 +436,9 @@ impl PortCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/port/list.rs b/cli-cmd/network/src/v2/port/list.rs index ab385170f..ebaa0329b 100644 --- a/cli-cmd/network/src/v2/port/list.rs +++ b/cli-cmd/network/src/v2/port/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::port::response::list::PortResponse; +use openstack_types::network::v2::port::response; /// Lists ports to which the user has access. /// @@ -286,7 +286,8 @@ impl PortsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/port/set.rs b/cli-cmd/network/src/v2/port/set.rs index dd301598d..e976fb7f0 100644 --- a/cli-cmd/network/src/v2/port/set.rs +++ b/cli-cmd/network/src/v2/port/set.rs @@ -34,7 +34,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::port::find; use openstack_sdk::api::network::v2::port::set; -use openstack_types::network::v2::port::response::set::PortResponse; +use openstack_types::network::v2::port::response; use serde_json::Value; /// Updates a port. @@ -454,8 +454,9 @@ impl PortCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/port/show.rs b/cli-cmd/network/src/v2/port/show.rs index ed896247f..86516c476 100644 --- a/cli-cmd/network/src/v2/port/show.rs +++ b/cli-cmd/network/src/v2/port/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::port::find; -use openstack_types::network::v2::port::response::get::PortResponse; +use openstack_types::network::v2::port::response; /// Shows details for a port. /// @@ -90,7 +90,7 @@ impl PortCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/port/tag/list.rs b/cli-cmd/network/src/v2/port/tag/list.rs index d5cb50929..61510c8bc 100644 --- a/cli-cmd/network/src/v2/port/tag/list.rs +++ b/cli-cmd/network/src/v2/port/tag/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::port::tag::response::list::TagResponse; +use openstack_types::network::v2::port::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -134,7 +134,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/port/tag/replace.rs b/cli-cmd/network/src/v2/port/tag/replace.rs index 4ce6c19d2..d5e59cd08 100644 --- a/cli-cmd/network/src/v2/port/tag/replace.rs +++ b/cli-cmd/network/src/v2/port/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::port::tag::replace; -use openstack_types::network::v2::port::tag::response::replace::TagResponse; +use openstack_types::network::v2::port::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -90,7 +90,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/create.rs b/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/create.rs index 92db2cf2a..65ab32c4a 100644 --- a/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/create.rs +++ b/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_bandwidth_limit_rule::create; -use openstack_types::network::v2::qos::alias_bandwidth_limit_rule::response::create::AliasBandwidthLimitRuleResponse; +use openstack_types::network::v2::qos::alias_bandwidth_limit_rule::response; use serde_json::Value; /// Command without description in OpenAPI @@ -83,8 +83,9 @@ impl AliasBandwidthLimitRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_bandwidth_limit_rule/list.rs b/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/list.rs index 26deda4cc..a827fbce4 100644 --- a/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/list.rs +++ b/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_bandwidth_limit_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::alias_bandwidth_limit_rule::response::list::AliasBandwidthLimitRuleResponse; +use openstack_types::network::v2::qos::alias_bandwidth_limit_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -158,7 +158,8 @@ impl AliasBandwidthLimitRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/set.rs b/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/set.rs index 48ffffeaa..c1fc91379 100644 --- a/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/set.rs +++ b/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_bandwidth_limit_rule::set; -use openstack_types::network::v2::qos::alias_bandwidth_limit_rule::response::set::AliasBandwidthLimitRuleResponse; +use openstack_types::network::v2::qos::alias_bandwidth_limit_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -133,8 +133,9 @@ impl AliasBandwidthLimitRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_bandwidth_limit_rule/show.rs b/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/show.rs index 1b53a7add..8d83032e8 100644 --- a/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/show.rs +++ b/cli-cmd/network/src/v2/qos/alias_bandwidth_limit_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_bandwidth_limit_rule::get; -use openstack_types::network::v2::qos::alias_bandwidth_limit_rule::response::get::AliasBandwidthLimitRuleResponse; +use openstack_types::network::v2::qos::alias_bandwidth_limit_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -83,8 +83,9 @@ impl AliasBandwidthLimitRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_dscp_marking_rule/create.rs b/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/create.rs index 55c814c6a..e9597085f 100644 --- a/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/create.rs +++ b/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_dscp_marking_rule::create; -use openstack_types::network::v2::qos::alias_dscp_marking_rule::response::create::AliasDscpMarkingRuleResponse; +use openstack_types::network::v2::qos::alias_dscp_marking_rule::response; use serde_json::Value; /// Command without description in OpenAPI @@ -83,8 +83,9 @@ impl AliasDscpMarkingRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_dscp_marking_rule/list.rs b/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/list.rs index 7819d8246..2e1c99084 100644 --- a/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/list.rs +++ b/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_dscp_marking_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::alias_dscp_marking_rule::response::list::AliasDscpMarkingRuleResponse; +use openstack_types::network::v2::qos::alias_dscp_marking_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -143,7 +143,8 @@ impl AliasDscpMarkingRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/set.rs b/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/set.rs index 81103e398..fa0463c03 100644 --- a/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/set.rs +++ b/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_dscp_marking_rule::set; -use openstack_types::network::v2::qos::alias_dscp_marking_rule::response::set::AliasDscpMarkingRuleResponse; +use openstack_types::network::v2::qos::alias_dscp_marking_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -107,8 +107,9 @@ impl AliasDscpMarkingRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_dscp_marking_rule/show.rs b/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/show.rs index 59ebf7999..fd6e61eb0 100644 --- a/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/show.rs +++ b/cli-cmd/network/src/v2/qos/alias_dscp_marking_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_dscp_marking_rule::get; -use openstack_types::network::v2::qos::alias_dscp_marking_rule::response::get::AliasDscpMarkingRuleResponse; +use openstack_types::network::v2::qos::alias_dscp_marking_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -83,8 +83,9 @@ impl AliasDscpMarkingRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_minimum_bandwidth_rule/create.rs b/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/create.rs index 9a3f64f46..95c56dbf5 100644 --- a/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/create.rs +++ b/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_minimum_bandwidth_rule::create; -use openstack_types::network::v2::qos::alias_minimum_bandwidth_rule::response::create::AliasMinimumBandwidthRuleResponse; +use openstack_types::network::v2::qos::alias_minimum_bandwidth_rule::response; use serde_json::Value; /// Command without description in OpenAPI @@ -83,8 +83,9 @@ impl AliasMinimumBandwidthRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_minimum_bandwidth_rule/list.rs b/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/list.rs index 380c95c20..48044846a 100644 --- a/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/list.rs +++ b/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_minimum_bandwidth_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::alias_minimum_bandwidth_rule::response::list::AliasMinimumBandwidthRuleResponse; +use openstack_types::network::v2::qos::alias_minimum_bandwidth_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -152,7 +152,8 @@ impl AliasMinimumBandwidthRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/set.rs b/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/set.rs index 1b7dc8ba1..09f834c08 100644 --- a/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/set.rs +++ b/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_minimum_bandwidth_rule::set; -use openstack_types::network::v2::qos::alias_minimum_bandwidth_rule::response::set::AliasMinimumBandwidthRuleResponse; +use openstack_types::network::v2::qos::alias_minimum_bandwidth_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -127,8 +127,9 @@ impl AliasMinimumBandwidthRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_minimum_bandwidth_rule/show.rs b/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/show.rs index 98590b812..77f656a44 100644 --- a/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/show.rs +++ b/cli-cmd/network/src/v2/qos/alias_minimum_bandwidth_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_minimum_bandwidth_rule::get; -use openstack_types::network::v2::qos::alias_minimum_bandwidth_rule::response::get::AliasMinimumBandwidthRuleResponse; +use openstack_types::network::v2::qos::alias_minimum_bandwidth_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -83,8 +83,9 @@ impl AliasMinimumBandwidthRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_minimum_packet_rate_rule/create.rs b/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/create.rs index a57e2e928..433f53300 100644 --- a/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/create.rs +++ b/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_minimum_packet_rate_rule::create; -use openstack_types::network::v2::qos::alias_minimum_packet_rate_rule::response::create::AliasMinimumPacketRateRuleResponse; +use openstack_types::network::v2::qos::alias_minimum_packet_rate_rule::response; use serde_json::Value; /// Command without description in OpenAPI @@ -84,8 +84,9 @@ impl AliasMinimumPacketRateRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_minimum_packet_rate_rule/list.rs b/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/list.rs index 0de5577f6..3e169d090 100644 --- a/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/list.rs +++ b/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_minimum_packet_rate_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::alias_minimum_packet_rate_rule::response::list::AliasMinimumPacketRateRuleResponse; +use openstack_types::network::v2::qos::alias_minimum_packet_rate_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -152,7 +152,8 @@ impl AliasMinimumPacketRateRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/set.rs b/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/set.rs index 957ec43cf..f1337439a 100644 --- a/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/set.rs +++ b/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_minimum_packet_rate_rule::set; -use openstack_types::network::v2::qos::alias_minimum_packet_rate_rule::response::set::AliasMinimumPacketRateRuleResponse; +use openstack_types::network::v2::qos::alias_minimum_packet_rate_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -129,8 +129,9 @@ impl AliasMinimumPacketRateRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/alias_minimum_packet_rate_rule/show.rs b/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/show.rs index 021e2dff5..0a57237fa 100644 --- a/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/show.rs +++ b/cli-cmd/network/src/v2/qos/alias_minimum_packet_rate_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::alias_minimum_packet_rate_rule::get; -use openstack_types::network::v2::qos::alias_minimum_packet_rate_rule::response::get::AliasMinimumPacketRateRuleResponse; +use openstack_types::network::v2::qos::alias_minimum_packet_rate_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -83,8 +83,9 @@ impl AliasMinimumPacketRateRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/bandwidth_limit_rule/create.rs b/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/create.rs index 8ea91955e..a0ea98aa0 100644 --- a/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/create.rs +++ b/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::bandwidth_limit_rule::create; -use openstack_types::network::v2::qos::policy::bandwidth_limit_rule::response::create::BandwidthLimitRuleResponse; +use openstack_types::network::v2::qos::policy::bandwidth_limit_rule::response; /// Creates a bandwidth limit rule for a QoS policy. /// @@ -146,8 +146,9 @@ impl BandwidthLimitRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/bandwidth_limit_rule/list.rs b/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/list.rs index c397b78b5..8d20f90be 100644 --- a/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/list.rs +++ b/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::bandwidth_limit_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::policy::bandwidth_limit_rule::response::list::BandwidthLimitRuleResponse; +use openstack_types::network::v2::qos::policy::bandwidth_limit_rule::response; /// Lists all bandwidth limit rules for a QoS policy. /// @@ -183,7 +183,8 @@ impl BandwidthLimitRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/set.rs b/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/set.rs index 28b333092..5ba3f6ac9 100644 --- a/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/set.rs +++ b/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::bandwidth_limit_rule::set; -use openstack_types::network::v2::qos::policy::bandwidth_limit_rule::response::set::BandwidthLimitRuleResponse; +use openstack_types::network::v2::qos::policy::bandwidth_limit_rule::response; /// Updates a bandwidth limit rule for a QoS policy. /// @@ -156,8 +156,9 @@ impl BandwidthLimitRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/bandwidth_limit_rule/show.rs b/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/show.rs index 6790293a8..e75b72de6 100644 --- a/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/show.rs +++ b/cli-cmd/network/src/v2/qos/policy/bandwidth_limit_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::bandwidth_limit_rule::get; -use openstack_types::network::v2::qos::policy::bandwidth_limit_rule::response::get::BandwidthLimitRuleResponse; +use openstack_types::network::v2::qos::policy::bandwidth_limit_rule::response; /// Shows details for a bandwidth limit rule for a QoS policy. /// @@ -99,8 +99,9 @@ impl BandwidthLimitRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/create.rs b/cli-cmd/network/src/v2/qos/policy/create.rs index 8c76ed3cd..1df7b664c 100644 --- a/cli-cmd/network/src/v2/qos/policy/create.rs +++ b/cli-cmd/network/src/v2/qos/policy/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::create; -use openstack_types::network::v2::qos::policy::response::create::PolicyResponse; +use openstack_types::network::v2::qos::policy::response; /// Creates a QoS policy. /// @@ -147,8 +147,9 @@ impl PolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/dscp_marking_rule/create.rs b/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/create.rs index 1be6fb065..cda052975 100644 --- a/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/create.rs +++ b/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::dscp_marking_rule::create; -use openstack_types::network::v2::qos::policy::dscp_marking_rule::response::create::DscpMarkingRuleResponse; +use openstack_types::network::v2::qos::policy::dscp_marking_rule::response; /// Creates a DSCP marking rule for a QoS policy. /// @@ -115,8 +115,9 @@ impl DscpMarkingRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/dscp_marking_rule/list.rs b/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/list.rs index b1c5feeb5..fb7460626 100644 --- a/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/list.rs +++ b/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::dscp_marking_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::policy::dscp_marking_rule::response::list::DscpMarkingRuleResponse; +use openstack_types::network::v2::qos::policy::dscp_marking_rule::response; /// Lists all DSCP marking rules for a QoS policy. /// @@ -175,7 +175,8 @@ impl DscpMarkingRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/set.rs b/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/set.rs index a287ec591..bb68ca471 100644 --- a/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/set.rs +++ b/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::dscp_marking_rule::set; -use openstack_types::network::v2::qos::policy::dscp_marking_rule::response::set::DscpMarkingRuleResponse; +use openstack_types::network::v2::qos::policy::dscp_marking_rule::response; /// Updates a DSCP marking rule for a QoS policy. /// @@ -125,8 +125,9 @@ impl DscpMarkingRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/dscp_marking_rule/show.rs b/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/show.rs index efc995352..5cb6df150 100644 --- a/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/show.rs +++ b/cli-cmd/network/src/v2/qos/policy/dscp_marking_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::dscp_marking_rule::get; -use openstack_types::network::v2::qos::policy::dscp_marking_rule::response::get::DscpMarkingRuleResponse; +use openstack_types::network::v2::qos::policy::dscp_marking_rule::response; /// Shows details for a DSCP marking rule for a QoS policy. /// @@ -99,8 +99,9 @@ impl DscpMarkingRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/list.rs b/cli-cmd/network/src/v2/qos/policy/list.rs index 4f6356d83..e6197265e 100644 --- a/cli-cmd/network/src/v2/qos/policy/list.rs +++ b/cli-cmd/network/src/v2/qos/policy/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::policy::response::list::PolicyResponse; +use openstack_types::network::v2::qos::policy::response; /// Lists all QoS policies associated with your project. One policy can contain /// more than one rule type. @@ -223,7 +223,8 @@ impl PoliciesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/create.rs b/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/create.rs index 4ae6e35f4..cf7027c14 100644 --- a/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/create.rs +++ b/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::minimum_bandwidth_rule::create; -use openstack_types::network::v2::qos::policy::minimum_bandwidth_rule::response::create::MinimumBandwidthRuleResponse; +use openstack_types::network::v2::qos::policy::minimum_bandwidth_rule::response; /// Creates a minimum bandwidth rule for a QoS policy. /// @@ -138,8 +138,9 @@ impl MinimumBandwidthRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/minimum_bandwidth_rule/list.rs b/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/list.rs index 707837dab..1863b91d9 100644 --- a/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/list.rs +++ b/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::minimum_bandwidth_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::policy::minimum_bandwidth_rule::response::list::MinimumBandwidthRuleResponse; +use openstack_types::network::v2::qos::policy::minimum_bandwidth_rule::response; /// Lists all minimum bandwidth rules for a QoS policy. /// @@ -183,7 +183,8 @@ impl MinimumBandwidthRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/set.rs b/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/set.rs index 74c8e2bbf..8060dabd8 100644 --- a/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/set.rs +++ b/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::minimum_bandwidth_rule::set; -use openstack_types::network::v2::qos::policy::minimum_bandwidth_rule::response::set::MinimumBandwidthRuleResponse; +use openstack_types::network::v2::qos::policy::minimum_bandwidth_rule::response; /// Updates a minimum bandwidth rule for a QoS policy. /// @@ -152,8 +152,9 @@ impl MinimumBandwidthRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/minimum_bandwidth_rule/show.rs b/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/show.rs index 2aa8d5819..9fd65d3a4 100644 --- a/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/show.rs +++ b/cli-cmd/network/src/v2/qos/policy/minimum_bandwidth_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::minimum_bandwidth_rule::get; -use openstack_types::network::v2::qos::policy::minimum_bandwidth_rule::response::get::MinimumBandwidthRuleResponse; +use openstack_types::network::v2::qos::policy::minimum_bandwidth_rule::response; /// Shows details for a minimum bandwidth rule for a QoS policy. /// @@ -99,8 +99,9 @@ impl MinimumBandwidthRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/minimum_packet_rate_rule/create.rs b/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/create.rs index 4f0ae441b..e4089fe43 100644 --- a/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/create.rs +++ b/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::minimum_packet_rate_rule::create; -use openstack_types::network::v2::qos::policy::minimum_packet_rate_rule::response::create::MinimumPacketRateRuleResponse; +use openstack_types::network::v2::qos::policy::minimum_packet_rate_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -129,8 +129,9 @@ impl MinimumPacketRateRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/minimum_packet_rate_rule/list.rs b/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/list.rs index 3df510e01..c2020d91f 100644 --- a/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/list.rs +++ b/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::minimum_packet_rate_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::policy::minimum_packet_rate_rule::response::list::MinimumPacketRateRuleResponse; +use openstack_types::network::v2::qos::policy::minimum_packet_rate_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -163,7 +163,8 @@ impl MinimumPacketRateRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/set.rs b/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/set.rs index 27a123e03..027f46b39 100644 --- a/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/set.rs +++ b/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::minimum_packet_rate_rule::set; -use openstack_types::network::v2::qos::policy::minimum_packet_rate_rule::response::set::MinimumPacketRateRuleResponse; +use openstack_types::network::v2::qos::policy::minimum_packet_rate_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -139,8 +139,9 @@ impl MinimumPacketRateRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/minimum_packet_rate_rule/show.rs b/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/show.rs index 63da39391..821c8e20d 100644 --- a/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/show.rs +++ b/cli-cmd/network/src/v2/qos/policy/minimum_packet_rate_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::policy::minimum_packet_rate_rule::get; -use openstack_types::network::v2::qos::policy::minimum_packet_rate_rule::response::get::MinimumPacketRateRuleResponse; +use openstack_types::network::v2::qos::policy::minimum_packet_rate_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -94,8 +94,9 @@ impl MinimumPacketRateRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/set.rs b/cli-cmd/network/src/v2/qos/policy/set.rs index 3bdae7058..b12b79d17 100644 --- a/cli-cmd/network/src/v2/qos/policy/set.rs +++ b/cli-cmd/network/src/v2/qos/policy/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::qos::policy::find; use openstack_sdk::api::network::v2::qos::policy::set; -use openstack_types::network::v2::qos::policy::response::set::PolicyResponse; +use openstack_types::network::v2::qos::policy::response; /// Updates a QoS policy. /// @@ -151,8 +151,9 @@ impl PolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/policy/show.rs b/cli-cmd/network/src/v2/qos/policy/show.rs index d51670694..788e9eb20 100644 --- a/cli-cmd/network/src/v2/qos/policy/show.rs +++ b/cli-cmd/network/src/v2/qos/policy/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::qos::policy::find; -use openstack_types::network::v2::qos::policy::response::get::PolicyResponse; +use openstack_types::network::v2::qos::policy::response; /// Shows details for a QoS policy. One policy can contain more than one rule /// type. @@ -87,7 +87,7 @@ impl PolicyCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/rule_type/create.rs b/cli-cmd/network/src/v2/qos/rule_type/create.rs index 4e632023a..ac476a444 100644 --- a/cli-cmd/network/src/v2/qos/rule_type/create.rs +++ b/cli-cmd/network/src/v2/qos/rule_type/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::rule_type::create; -use openstack_types::network::v2::qos::rule_type::response::create::RuleTypeResponse; +use openstack_types::network::v2::qos::rule_type::response; /// Command without description in OpenAPI #[derive(Args)] @@ -101,8 +101,9 @@ impl RuleTypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/rule_type/list.rs b/cli-cmd/network/src/v2/qos/rule_type/list.rs index 0c8e98b33..1521e5421 100644 --- a/cli-cmd/network/src/v2/qos/rule_type/list.rs +++ b/cli-cmd/network/src/v2/qos/rule_type/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::rule_type::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::qos::rule_type::response::list::RuleTypeResponse; +use openstack_types::network::v2::qos::rule_type::response; /// Lists available qos rule types. /// @@ -158,7 +158,8 @@ impl RuleTypesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/qos/rule_type/set.rs b/cli-cmd/network/src/v2/qos/rule_type/set.rs index 5c7602a10..49613ef07 100644 --- a/cli-cmd/network/src/v2/qos/rule_type/set.rs +++ b/cli-cmd/network/src/v2/qos/rule_type/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::rule_type::set; -use openstack_types::network::v2::qos::rule_type::response::set::RuleTypeResponse; +use openstack_types::network::v2::qos::rule_type::response; /// Command without description in OpenAPI #[derive(Args)] @@ -111,8 +111,9 @@ impl RuleTypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/qos/rule_type/show.rs b/cli-cmd/network/src/v2/qos/rule_type/show.rs index 1f3805064..4ab8d93e6 100644 --- a/cli-cmd/network/src/v2/qos/rule_type/show.rs +++ b/cli-cmd/network/src/v2/qos/rule_type/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::qos::rule_type::get; -use openstack_types::network::v2::qos::rule_type::response::get::RuleTypeResponse; +use openstack_types::network::v2::qos::rule_type::response; /// Shows details for an available QoS rule type. /// @@ -88,8 +88,9 @@ impl RuleTypeCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/quota/defaults.rs b/cli-cmd/network/src/v2/quota/defaults.rs index 1c6dc55a6..f4d21dc9a 100644 --- a/cli-cmd/network/src/v2/quota/defaults.rs +++ b/cli-cmd/network/src/v2/quota/defaults.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::quota::defaults; -use openstack_types::network::v2::quota::response::defaults::QuotaResponse; +use openstack_types::network::v2::quota::response; /// Lists default quotas for a project. /// @@ -97,8 +97,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/quota/details.rs b/cli-cmd/network/src/v2/quota/details.rs index c08eb582f..bfaf430cb 100644 --- a/cli-cmd/network/src/v2/quota/details.rs +++ b/cli-cmd/network/src/v2/quota/details.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::quota::details; -use openstack_types::network::v2::quota::response::details::QuotaResponse; +use openstack_types::network::v2::quota::response; /// Command without description in OpenAPI #[derive(Args)] @@ -79,8 +79,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/quota/list.rs b/cli-cmd/network/src/v2/quota/list.rs index 539fc5d5d..5356dc201 100644 --- a/cli-cmd/network/src/v2/quota/list.rs +++ b/cli-cmd/network/src/v2/quota/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::quota::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::quota::response::list::QuotaResponse; +use openstack_types::network::v2::quota::response; /// Lists quotas for projects with non-default quota values. /// @@ -143,7 +143,8 @@ impl QuotasCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/quota/set.rs b/cli-cmd/network/src/v2/quota/set.rs index 51d9ce087..3ac0a745a 100644 --- a/cli-cmd/network/src/v2/quota/set.rs +++ b/cli-cmd/network/src/v2/quota/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::quota::set; -use openstack_types::network::v2::quota::response::set::QuotaResponse; +use openstack_types::network::v2::quota::response; /// Updates quotas for a project. Use when non-default quotas are desired. /// @@ -191,8 +191,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/quota/show.rs b/cli-cmd/network/src/v2/quota/show.rs index 487481844..c3382d08d 100644 --- a/cli-cmd/network/src/v2/quota/show.rs +++ b/cli-cmd/network/src/v2/quota/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::quota::get; -use openstack_types::network::v2::quota::response::get::QuotaResponse; +use openstack_types::network::v2::quota::response; /// Lists quotas for a project. /// @@ -97,8 +97,9 @@ impl QuotaCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/rbac_policy/create.rs b/cli-cmd/network/src/v2/rbac_policy/create.rs index 593e8f949..4c129fb8b 100644 --- a/cli-cmd/network/src/v2/rbac_policy/create.rs +++ b/cli-cmd/network/src/v2/rbac_policy/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::rbac_policy::create; -use openstack_types::network::v2::rbac_policy::response::create::RbacPolicyResponse; +use openstack_types::network::v2::rbac_policy::response; /// Create RBAC policy for given tenant. /// @@ -144,8 +144,9 @@ impl RbacPolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/rbac_policy/list.rs b/cli-cmd/network/src/v2/rbac_policy/list.rs index 973f8564a..857dd6c5e 100644 --- a/cli-cmd/network/src/v2/rbac_policy/list.rs +++ b/cli-cmd/network/src/v2/rbac_policy/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::rbac_policy::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::rbac_policy::response::list::RbacPolicyResponse; +use openstack_types::network::v2::rbac_policy::response; /// List RBAC policies that belong to a given tenant. /// @@ -185,7 +185,8 @@ impl RbacPoliciesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/rbac_policy/set.rs b/cli-cmd/network/src/v2/rbac_policy/set.rs index 367986285..89faed9bb 100644 --- a/cli-cmd/network/src/v2/rbac_policy/set.rs +++ b/cli-cmd/network/src/v2/rbac_policy/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::rbac_policy::set; -use openstack_types::network::v2::rbac_policy::response::set::RbacPolicyResponse; +use openstack_types::network::v2::rbac_policy::response; /// Update RBAC policy for given tenant. /// @@ -114,8 +114,9 @@ impl RbacPolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/rbac_policy/show.rs b/cli-cmd/network/src/v2/rbac_policy/show.rs index 6b8a01765..fa1697a63 100644 --- a/cli-cmd/network/src/v2/rbac_policy/show.rs +++ b/cli-cmd/network/src/v2/rbac_policy/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::rbac_policy::get; -use openstack_types::network::v2::rbac_policy::response::get::RbacPolicyResponse; +use openstack_types::network::v2::rbac_policy::response; /// Show details for a given RBAC policy. /// @@ -87,8 +87,9 @@ impl RbacPolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/add_external_gateways.rs b/cli-cmd/network/src/v2/router/add_external_gateways.rs index 87ac748ca..5fa851212 100644 --- a/cli-cmd/network/src/v2/router/add_external_gateways.rs +++ b/cli-cmd/network/src/v2/router/add_external_gateways.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::add_external_gateways; -use openstack_types::network::v2::router::response::add_external_gateways::RouterResponse; +use openstack_types::network::v2::router::response; use serde_json::Value; /// Request body @@ -118,8 +118,9 @@ impl RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/add_extraroutes.rs b/cli-cmd/network/src/v2/router/add_extraroutes.rs index 214730112..7c7002042 100644 --- a/cli-cmd/network/src/v2/router/add_extraroutes.rs +++ b/cli-cmd/network/src/v2/router/add_extraroutes.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::add_extraroutes; -use openstack_types::network::v2::router::response::add_extraroutes::RouterResponse; +use openstack_types::network::v2::router::response; use serde_json::Value; /// Request body @@ -118,8 +118,9 @@ impl RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/add_router_interface.rs b/cli-cmd/network/src/v2/router/add_router_interface.rs index e7afb6f73..b97064f1b 100644 --- a/cli-cmd/network/src/v2/router/add_router_interface.rs +++ b/cli-cmd/network/src/v2/router/add_router_interface.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::add_router_interface; -use openstack_types::network::v2::router::response::add_router_interface::RouterResponse; +use openstack_types::network::v2::router::response; /// Request body #[derive(Args)] @@ -103,8 +103,9 @@ impl RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/conntrack_helper/create.rs b/cli-cmd/network/src/v2/router/conntrack_helper/create.rs index c0e6d490d..3e7111ee3 100644 --- a/cli-cmd/network/src/v2/router/conntrack_helper/create.rs +++ b/cli-cmd/network/src/v2/router/conntrack_helper/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::conntrack_helper::create; -use openstack_types::network::v2::router::conntrack_helper::response::create::ConntrackHelperResponse; +use openstack_types::network::v2::router::conntrack_helper::response; /// Creates a router conntrack helper. /// @@ -158,8 +158,9 @@ impl ConntrackHelperCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/conntrack_helper/list.rs b/cli-cmd/network/src/v2/router/conntrack_helper/list.rs index f0ef4cc6c..9a260b755 100644 --- a/cli-cmd/network/src/v2/router/conntrack_helper/list.rs +++ b/cli-cmd/network/src/v2/router/conntrack_helper/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::conntrack_helper::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::router::conntrack_helper::response::list::ConntrackHelperResponse; +use openstack_types::network::v2::router::conntrack_helper::response; /// Lists router conntrack helpers associated with a router. /// @@ -188,7 +188,8 @@ impl ConntrackHelpersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/router/conntrack_helper/set.rs b/cli-cmd/network/src/v2/router/conntrack_helper/set.rs index 519eae080..0264d7270 100644 --- a/cli-cmd/network/src/v2/router/conntrack_helper/set.rs +++ b/cli-cmd/network/src/v2/router/conntrack_helper/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::conntrack_helper::set; -use openstack_types::network::v2::router::conntrack_helper::response::set::ConntrackHelperResponse; +use openstack_types::network::v2::router::conntrack_helper::response; /// Updates a router conntrack helper. /// @@ -159,8 +159,9 @@ impl ConntrackHelperCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/conntrack_helper/show.rs b/cli-cmd/network/src/v2/router/conntrack_helper/show.rs index 0946b95f9..bb5bc6da4 100644 --- a/cli-cmd/network/src/v2/router/conntrack_helper/show.rs +++ b/cli-cmd/network/src/v2/router/conntrack_helper/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::conntrack_helper::get; -use openstack_types::network::v2::router::conntrack_helper::response::get::ConntrackHelperResponse; +use openstack_types::network::v2::router::conntrack_helper::response; /// Shows information for a router conntrack helper. /// @@ -101,8 +101,9 @@ impl ConntrackHelperCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/create.rs b/cli-cmd/network/src/v2/router/create.rs index c0ff64d48..c3c556cde 100644 --- a/cli-cmd/network/src/v2/router/create.rs +++ b/cli-cmd/network/src/v2/router/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::create; -use openstack_types::network::v2::router::response::create::RouterResponse; +use openstack_types::network::v2::router::response; use serde_json::Value; /// Creates a logical router. @@ -235,8 +235,9 @@ impl RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/l3_agent/list.rs b/cli-cmd/network/src/v2/router/l3_agent/list.rs index 1a0a5684e..a23a5f691 100644 --- a/cli-cmd/network/src/v2/router/l3_agent/list.rs +++ b/cli-cmd/network/src/v2/router/l3_agent/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::l3_agent::list; -use openstack_types::network::v2::router::l3_agent::response::list::L3AgentResponse; +use openstack_types::network::v2::router::l3_agent::response; /// Lists l3 agents hosting a specific router. /// @@ -149,8 +149,9 @@ impl L3AgentsCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/l3_agent/set.rs b/cli-cmd/network/src/v2/router/l3_agent/set.rs index e556b9f87..5b26ef3ea 100644 --- a/cli-cmd/network/src/v2/router/l3_agent/set.rs +++ b/cli-cmd/network/src/v2/router/l3_agent/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::l3_agent::set; -use openstack_types::network::v2::router::l3_agent::response::set::L3AgentResponse; +use openstack_types::network::v2::router::l3_agent::response; /// Command without description in OpenAPI #[derive(Args)] @@ -90,8 +90,9 @@ impl L3AgentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/list.rs b/cli-cmd/network/src/v2/router/list.rs index 921100ac0..f11d4f026 100644 --- a/cli-cmd/network/src/v2/router/list.rs +++ b/cli-cmd/network/src/v2/router/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::router::response::list::RouterResponse; +use openstack_types::network::v2::router::response; /// Lists logical routers that the project who submits the request can access. /// @@ -224,7 +224,8 @@ impl RoutersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/router/remove_external_gateways.rs b/cli-cmd/network/src/v2/router/remove_external_gateways.rs index b4cebf019..9f7aa2318 100644 --- a/cli-cmd/network/src/v2/router/remove_external_gateways.rs +++ b/cli-cmd/network/src/v2/router/remove_external_gateways.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::remove_external_gateways; -use openstack_types::network::v2::router::response::remove_external_gateways::RouterResponse; +use openstack_types::network::v2::router::response; use serde_json::Value; /// Request body @@ -120,8 +120,9 @@ impl RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/remove_extraroutes.rs b/cli-cmd/network/src/v2/router/remove_extraroutes.rs index be9a24afb..8aa6ecb5d 100644 --- a/cli-cmd/network/src/v2/router/remove_extraroutes.rs +++ b/cli-cmd/network/src/v2/router/remove_extraroutes.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::remove_extraroutes; -use openstack_types::network::v2::router::response::remove_extraroutes::RouterResponse; +use openstack_types::network::v2::router::response; use serde_json::Value; /// Request body @@ -118,8 +118,9 @@ impl RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/remove_router_interface.rs b/cli-cmd/network/src/v2/router/remove_router_interface.rs index 0580b5309..009a79814 100644 --- a/cli-cmd/network/src/v2/router/remove_router_interface.rs +++ b/cli-cmd/network/src/v2/router/remove_router_interface.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::remove_router_interface; -use openstack_types::network::v2::router::response::remove_router_interface::RouterResponse; +use openstack_types::network::v2::router::response; /// Request body #[derive(Args)] @@ -103,8 +103,9 @@ impl RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/set.rs b/cli-cmd/network/src/v2/router/set.rs index da81c7322..39565a4d7 100644 --- a/cli-cmd/network/src/v2/router/set.rs +++ b/cli-cmd/network/src/v2/router/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::router::find; use openstack_sdk::api::network::v2::router::set; -use openstack_types::network::v2::router::response::set::RouterResponse; +use openstack_types::network::v2::router::response; use serde_json::Value; /// Updates a logical router. @@ -242,8 +242,9 @@ impl RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/router/show.rs b/cli-cmd/network/src/v2/router/show.rs index 915159f79..9e91c581e 100644 --- a/cli-cmd/network/src/v2/router/show.rs +++ b/cli-cmd/network/src/v2/router/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::router::find; -use openstack_types::network::v2::router::response::get::RouterResponse; +use openstack_types::network::v2::router::response; /// Shows details for a router. /// @@ -89,7 +89,7 @@ impl RouterCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/router/tag/list.rs b/cli-cmd/network/src/v2/router/tag/list.rs index 5683df1c5..f2b256bb9 100644 --- a/cli-cmd/network/src/v2/router/tag/list.rs +++ b/cli-cmd/network/src/v2/router/tag/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::router::tag::response::list::TagResponse; +use openstack_types::network::v2::router::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -134,7 +134,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/router/tag/replace.rs b/cli-cmd/network/src/v2/router/tag/replace.rs index 4ac67d45e..7d96510d1 100644 --- a/cli-cmd/network/src/v2/router/tag/replace.rs +++ b/cli-cmd/network/src/v2/router/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::tag::replace; -use openstack_types::network::v2::router::tag::response::replace::TagResponse; +use openstack_types::network::v2::router::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -91,7 +91,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/router/update_external_gateways.rs b/cli-cmd/network/src/v2/router/update_external_gateways.rs index 6bf148b01..bfaf78ad2 100644 --- a/cli-cmd/network/src/v2/router/update_external_gateways.rs +++ b/cli-cmd/network/src/v2/router/update_external_gateways.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::router::update_external_gateways; -use openstack_types::network::v2::router::response::update_external_gateways::RouterResponse; +use openstack_types::network::v2::router::response; use serde_json::Value; /// Request body @@ -120,8 +120,9 @@ impl RouterCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/security_group/create.rs b/cli-cmd/network/src/v2/security_group/create.rs index a7939c4db..c33c57ae0 100644 --- a/cli-cmd/network/src/v2/security_group/create.rs +++ b/cli-cmd/network/src/v2/security_group/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::security_group::create; -use openstack_types::network::v2::security_group::response::create::SecurityGroupResponse; +use openstack_types::network::v2::security_group::response; /// Creates an OpenStack Networking security group. /// @@ -129,8 +129,9 @@ impl SecurityGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/security_group/list.rs b/cli-cmd/network/src/v2/security_group/list.rs index 0a38b8bb7..4a6dbe7c5 100644 --- a/cli-cmd/network/src/v2/security_group/list.rs +++ b/cli-cmd/network/src/v2/security_group/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::security_group::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::security_group::response::list::SecurityGroupResponse; +use openstack_types::network::v2::security_group::response; /// Lists OpenStack Networking security groups to which the project has access. /// @@ -217,7 +217,8 @@ impl SecurityGroupsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/security_group/set.rs b/cli-cmd/network/src/v2/security_group/set.rs index aa64038d7..7c28219e7 100644 --- a/cli-cmd/network/src/v2/security_group/set.rs +++ b/cli-cmd/network/src/v2/security_group/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::security_group::find; use openstack_sdk::api::network::v2::security_group::set; -use openstack_types::network::v2::security_group::response::set::SecurityGroupResponse; +use openstack_types::network::v2::security_group::response; /// Updates a security group. /// @@ -142,8 +142,9 @@ impl SecurityGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/security_group/show.rs b/cli-cmd/network/src/v2/security_group/show.rs index ac36ef469..917fa715f 100644 --- a/cli-cmd/network/src/v2/security_group/show.rs +++ b/cli-cmd/network/src/v2/security_group/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::security_group::find; -use openstack_types::network::v2::security_group::response::get::SecurityGroupResponse; +use openstack_types::network::v2::security_group::response; /// Shows details for a security group. /// @@ -92,7 +92,7 @@ impl SecurityGroupCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/security_group/tag/list.rs b/cli-cmd/network/src/v2/security_group/tag/list.rs index c4b7d4326..5b6eb7562 100644 --- a/cli-cmd/network/src/v2/security_group/tag/list.rs +++ b/cli-cmd/network/src/v2/security_group/tag/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::security_group::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::security_group::tag::response::list::TagResponse; +use openstack_types::network::v2::security_group::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -139,7 +139,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/security_group/tag/replace.rs b/cli-cmd/network/src/v2/security_group/tag/replace.rs index 34295e54d..386226856 100644 --- a/cli-cmd/network/src/v2/security_group/tag/replace.rs +++ b/cli-cmd/network/src/v2/security_group/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::security_group::tag::replace; -use openstack_types::network::v2::security_group::tag::response::replace::TagResponse; +use openstack_types::network::v2::security_group::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -95,7 +95,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/security_group_rule/create.rs b/cli-cmd/network/src/v2/security_group_rule/create.rs index 8130429f9..1bdef9f83 100644 --- a/cli-cmd/network/src/v2/security_group_rule/create.rs +++ b/cli-cmd/network/src/v2/security_group_rule/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::security_group_rule::create; -use openstack_types::network::v2::security_group_rule::response::create::SecurityGroupRuleResponse; +use openstack_types::network::v2::security_group_rule::response; /// Creates an OpenStack Networking security group rule. /// @@ -225,8 +225,9 @@ impl SecurityGroupRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/security_group_rule/list.rs b/cli-cmd/network/src/v2/security_group_rule/list.rs index b2a6d1d9e..17e0222c2 100644 --- a/cli-cmd/network/src/v2/security_group_rule/list.rs +++ b/cli-cmd/network/src/v2/security_group_rule/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::security_group_rule::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::security_group_rule::response::list::SecurityGroupRuleResponse; +use openstack_types::network::v2::security_group_rule::response; /// Lists a summary of all OpenStack Networking security group rules that the /// project can access. @@ -257,7 +257,8 @@ impl SecurityGroupRulesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/security_group_rule/set.rs b/cli-cmd/network/src/v2/security_group_rule/set.rs index e15e48b8a..4225a0e9f 100644 --- a/cli-cmd/network/src/v2/security_group_rule/set.rs +++ b/cli-cmd/network/src/v2/security_group_rule/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::security_group_rule::set; -use openstack_types::network::v2::security_group_rule::response::set::SecurityGroupRuleResponse; +use openstack_types::network::v2::security_group_rule::response; /// Command without description in OpenAPI #[derive(Args)] @@ -107,8 +107,9 @@ impl SecurityGroupRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/security_group_rule/show.rs b/cli-cmd/network/src/v2/security_group_rule/show.rs index ecc5b77bf..2d073f381 100644 --- a/cli-cmd/network/src/v2/security_group_rule/show.rs +++ b/cli-cmd/network/src/v2/security_group_rule/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::security_group_rule::get; -use openstack_types::network::v2::security_group_rule::response::get::SecurityGroupRuleResponse; +use openstack_types::network::v2::security_group_rule::response; /// Shows detailed information for a security group rule. /// @@ -94,8 +94,9 @@ impl SecurityGroupRuleCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/segment/create.rs b/cli-cmd/network/src/v2/segment/create.rs index 01473a9cc..578caf8f1 100644 --- a/cli-cmd/network/src/v2/segment/create.rs +++ b/cli-cmd/network/src/v2/segment/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::segment::create; -use openstack_types::network::v2::segment::response::create::SegmentResponse; +use openstack_types::network::v2::segment::response; /// Creates a segment. /// @@ -158,8 +158,9 @@ impl SegmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/segment/list.rs b/cli-cmd/network/src/v2/segment/list.rs index 122c1f92a..9ebb631d4 100644 --- a/cli-cmd/network/src/v2/segment/list.rs +++ b/cli-cmd/network/src/v2/segment/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::segment::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::segment::response::list::SegmentResponse; +use openstack_types::network::v2::segment::response; /// Lists segments to which the project has access. /// @@ -192,7 +192,8 @@ impl SegmentsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/segment/set.rs b/cli-cmd/network/src/v2/segment/set.rs index 4d4968b46..2fd1cf89d 100644 --- a/cli-cmd/network/src/v2/segment/set.rs +++ b/cli-cmd/network/src/v2/segment/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::segment::find; use openstack_sdk::api::network::v2::segment::set; -use openstack_types::network::v2::segment::response::set::SegmentResponse; +use openstack_types::network::v2::segment::response; /// Updates a segment. /// @@ -139,8 +139,9 @@ impl SegmentCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/segment/show.rs b/cli-cmd/network/src/v2/segment/show.rs index c4cd98669..74f69264e 100644 --- a/cli-cmd/network/src/v2/segment/show.rs +++ b/cli-cmd/network/src/v2/segment/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::segment::find; -use openstack_types::network::v2::segment::response::get::SegmentResponse; +use openstack_types::network::v2::segment::response; /// Shows details for a segment. /// @@ -89,7 +89,7 @@ impl SegmentCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/service_profile/create.rs b/cli-cmd/network/src/v2/service_profile/create.rs index f15dd7107..418dd2ea2 100644 --- a/cli-cmd/network/src/v2/service_profile/create.rs +++ b/cli-cmd/network/src/v2/service_profile/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::service_profile::create; -use openstack_types::network::v2::service_profile::response::create::ServiceProfileResponse; +use openstack_types::network::v2::service_profile::response; /// Creates a service profile. /// @@ -153,8 +153,9 @@ impl ServiceProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/service_profile/list.rs b/cli-cmd/network/src/v2/service_profile/list.rs index 62dd8b604..820316073 100644 --- a/cli-cmd/network/src/v2/service_profile/list.rs +++ b/cli-cmd/network/src/v2/service_profile/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::service_profile::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::service_profile::response::list::ServiceProfileResponse; +use openstack_types::network::v2::service_profile::response; /// Lists all service profiles visible for the tenant account. /// @@ -175,7 +175,8 @@ impl ServiceProfilesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/service_profile/set.rs b/cli-cmd/network/src/v2/service_profile/set.rs index 157c227c8..d97f5e5c7 100644 --- a/cli-cmd/network/src/v2/service_profile/set.rs +++ b/cli-cmd/network/src/v2/service_profile/set.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::service_profile::set; -use openstack_types::network::v2::service_profile::response::set::ServiceProfileResponse; +use openstack_types::network::v2::service_profile::response; /// Updates a service profile. /// @@ -142,8 +142,9 @@ impl ServiceProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/service_profile/show.rs b/cli-cmd/network/src/v2/service_profile/show.rs index 896801c88..6988bb4d6 100644 --- a/cli-cmd/network/src/v2/service_profile/show.rs +++ b/cli-cmd/network/src/v2/service_profile/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::service_profile::get; -use openstack_types::network::v2::service_profile::response::get::ServiceProfileResponse; +use openstack_types::network::v2::service_profile::response; /// Shows details for a service profile. /// @@ -93,8 +93,9 @@ impl ServiceProfileCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/service_provider/create.rs b/cli-cmd/network/src/v2/service_provider/create.rs index 9354b01d1..4bb05ce5d 100644 --- a/cli-cmd/network/src/v2/service_provider/create.rs +++ b/cli-cmd/network/src/v2/service_provider/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::service_provider::create; -use openstack_types::network::v2::service_provider::response::create::ServiceProviderResponse; +use openstack_types::network::v2::service_provider::response; use serde_json::Value; /// Command without description in OpenAPI @@ -84,8 +84,9 @@ impl ServiceProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/service_provider/list.rs b/cli-cmd/network/src/v2/service_provider/list.rs index b974fcea2..fea4386d1 100644 --- a/cli-cmd/network/src/v2/service_provider/list.rs +++ b/cli-cmd/network/src/v2/service_provider/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::service_provider::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::service_provider::response::list::ServiceProviderResponse; +use openstack_types::network::v2::service_provider::response; /// Lists service providers and their associated service types. /// @@ -145,7 +145,8 @@ impl ServiceProvidersCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/service_provider/set.rs b/cli-cmd/network/src/v2/service_provider/set.rs index 6b94cedd3..16881f52f 100644 --- a/cli-cmd/network/src/v2/service_provider/set.rs +++ b/cli-cmd/network/src/v2/service_provider/set.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::service_provider::set; -use openstack_types::network::v2::service_provider::response::set::ServiceProviderResponse; +use openstack_types::network::v2::service_provider::response; use serde_json::Value; /// Command without description in OpenAPI @@ -91,8 +91,9 @@ impl ServiceProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/service_provider/show.rs b/cli-cmd/network/src/v2/service_provider/show.rs index 204c3563c..3ce042f87 100644 --- a/cli-cmd/network/src/v2/service_provider/show.rs +++ b/cli-cmd/network/src/v2/service_provider/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::service_provider::get; -use openstack_types::network::v2::service_provider::response::get::ServiceProviderResponse; +use openstack_types::network::v2::service_provider::response; /// Command without description in OpenAPI #[derive(Args)] @@ -81,8 +81,9 @@ impl ServiceProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/subnet/create.rs b/cli-cmd/network/src/v2/subnet/create.rs index a88d59e89..e0975f721 100644 --- a/cli-cmd/network/src/v2/subnet/create.rs +++ b/cli-cmd/network/src/v2/subnet/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnet::create; -use openstack_types::network::v2::subnet::response::create::SubnetResponse; +use openstack_types::network::v2::subnet::response; use serde_json::Value; /// Creates a subnet on a network. @@ -358,8 +358,9 @@ impl SubnetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/subnet/list.rs b/cli-cmd/network/src/v2/subnet/list.rs index 8a842ce79..6c4ebb3c7 100644 --- a/cli-cmd/network/src/v2/subnet/list.rs +++ b/cli-cmd/network/src/v2/subnet/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnet::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::subnet::response::list::SubnetResponse; +use openstack_types::network::v2::subnet::response; /// Lists subnets that the project has access to. /// @@ -288,7 +288,8 @@ impl SubnetsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/subnet/set.rs b/cli-cmd/network/src/v2/subnet/set.rs index db722743e..fd6cdcda1 100644 --- a/cli-cmd/network/src/v2/subnet/set.rs +++ b/cli-cmd/network/src/v2/subnet/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::subnet::find; use openstack_sdk::api::network::v2::subnet::set; -use openstack_types::network::v2::subnet::response::set::SubnetResponse; +use openstack_types::network::v2::subnet::response; use serde_json::Value; /// Updates a subnet. @@ -239,8 +239,9 @@ impl SubnetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/subnet/show.rs b/cli-cmd/network/src/v2/subnet/show.rs index 578961e50..27f625157 100644 --- a/cli-cmd/network/src/v2/subnet/show.rs +++ b/cli-cmd/network/src/v2/subnet/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::subnet::find; -use openstack_types::network::v2::subnet::response::get::SubnetResponse; +use openstack_types::network::v2::subnet::response; /// Shows details for a subnet. /// @@ -91,7 +91,7 @@ impl SubnetCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/subnet/tag/list.rs b/cli-cmd/network/src/v2/subnet/tag/list.rs index feaca0b9e..1e94a455b 100644 --- a/cli-cmd/network/src/v2/subnet/tag/list.rs +++ b/cli-cmd/network/src/v2/subnet/tag/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnet::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::subnet::tag::response::list::TagResponse; +use openstack_types::network::v2::subnet::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -134,7 +134,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/subnet/tag/replace.rs b/cli-cmd/network/src/v2/subnet/tag/replace.rs index b550a194e..aab1e72f7 100644 --- a/cli-cmd/network/src/v2/subnet/tag/replace.rs +++ b/cli-cmd/network/src/v2/subnet/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnet::tag::replace; -use openstack_types::network::v2::subnet::tag::response::replace::TagResponse; +use openstack_types::network::v2::subnet::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -91,7 +91,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/subnetpool/add_prefixes.rs b/cli-cmd/network/src/v2/subnetpool/add_prefixes.rs index b0bc0aaa0..9316ac56b 100644 --- a/cli-cmd/network/src/v2/subnetpool/add_prefixes.rs +++ b/cli-cmd/network/src/v2/subnetpool/add_prefixes.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnetpool::add_prefixes; -use openstack_types::network::v2::subnetpool::response::add_prefixes::SubnetpoolResponse; +use openstack_types::network::v2::subnetpool::response; use serde_json::Value; /// Request of the subnetpools/id/add_prefixes:put operation @@ -95,8 +95,9 @@ impl SubnetpoolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/subnetpool/create.rs b/cli-cmd/network/src/v2/subnetpool/create.rs index 66a3a04cb..884df600e 100644 --- a/cli-cmd/network/src/v2/subnetpool/create.rs +++ b/cli-cmd/network/src/v2/subnetpool/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnetpool::create; -use openstack_types::network::v2::subnetpool::response::create::SubnetpoolResponse; +use openstack_types::network::v2::subnetpool::response; /// Creates a subnet pool. /// @@ -204,8 +204,9 @@ impl SubnetpoolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/subnetpool/list.rs b/cli-cmd/network/src/v2/subnetpool/list.rs index e78b23535..ff91eb58b 100644 --- a/cli-cmd/network/src/v2/subnetpool/list.rs +++ b/cli-cmd/network/src/v2/subnetpool/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnetpool::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::subnetpool::response::list::SubnetpoolResponse; +use openstack_types::network::v2::subnetpool::response; /// Lists subnet pools that the project has access to. /// @@ -266,7 +266,8 @@ impl SubnetpoolsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/subnetpool/onboard_network_subnet/onboard_network_subnets.rs b/cli-cmd/network/src/v2/subnetpool/onboard_network_subnet/onboard_network_subnets.rs index b68d9a186..9161db240 100644 --- a/cli-cmd/network/src/v2/subnetpool/onboard_network_subnet/onboard_network_subnets.rs +++ b/cli-cmd/network/src/v2/subnetpool/onboard_network_subnet/onboard_network_subnets.rs @@ -29,9 +29,9 @@ use openstack_cli_core::output::OutputProcessor; use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; -use openstack_sdk::api::network::v2::subnetpool::onboard_network_subnet::onboard_network_subnets; use openstack_sdk::api::QueryAsync; -use openstack_types::network::v2::subnetpool::onboard_network_subnet::response::onboard_network_subnets::OnboardNetworkSubnetResponse; +use openstack_sdk::api::network::v2::subnetpool::onboard_network_subnet::onboard_network_subnets; +use openstack_types::network::v2::subnetpool::onboard_network_subnet::response; use serde_json::Value; /// Request of the subnetpools/id/onboard_network_subnets:put operation @@ -96,8 +96,11 @@ impl OnboardNetworkSubnetCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/subnetpool/remove_prefixes.rs b/cli-cmd/network/src/v2/subnetpool/remove_prefixes.rs index b0e92e1dc..b24390f28 100644 --- a/cli-cmd/network/src/v2/subnetpool/remove_prefixes.rs +++ b/cli-cmd/network/src/v2/subnetpool/remove_prefixes.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnetpool::remove_prefixes; -use openstack_types::network::v2::subnetpool::response::remove_prefixes::SubnetpoolResponse; +use openstack_types::network::v2::subnetpool::response; use serde_json::Value; /// Request of the subnetpools/id/remove_prefixes:put operation @@ -95,8 +95,9 @@ impl SubnetpoolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/subnetpool/set.rs b/cli-cmd/network/src/v2/subnetpool/set.rs index 248d006b1..ee4981150 100644 --- a/cli-cmd/network/src/v2/subnetpool/set.rs +++ b/cli-cmd/network/src/v2/subnetpool/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::subnetpool::find; use openstack_sdk::api::network::v2::subnetpool::set; -use openstack_types::network::v2::subnetpool::response::set::SubnetpoolResponse; +use openstack_types::network::v2::subnetpool::response; /// Updates a subnet pool. /// @@ -211,8 +211,9 @@ impl SubnetpoolCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/subnetpool/show.rs b/cli-cmd/network/src/v2/subnetpool/show.rs index 5fb0d10e5..10642847b 100644 --- a/cli-cmd/network/src/v2/subnetpool/show.rs +++ b/cli-cmd/network/src/v2/subnetpool/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::subnetpool::find; -use openstack_types::network::v2::subnetpool::response::get::SubnetpoolResponse; +use openstack_types::network::v2::subnetpool::response; /// Shows information for a subnet pool. /// @@ -89,7 +89,7 @@ impl SubnetpoolCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/subnetpool/tag/list.rs b/cli-cmd/network/src/v2/subnetpool/tag/list.rs index 37219b814..09762e158 100644 --- a/cli-cmd/network/src/v2/subnetpool/tag/list.rs +++ b/cli-cmd/network/src/v2/subnetpool/tag/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnetpool::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::subnetpool::tag::response::list::TagResponse; +use openstack_types::network::v2::subnetpool::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -136,7 +136,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/subnetpool/tag/replace.rs b/cli-cmd/network/src/v2/subnetpool/tag/replace.rs index 2e2487b6a..a80484ca8 100644 --- a/cli-cmd/network/src/v2/subnetpool/tag/replace.rs +++ b/cli-cmd/network/src/v2/subnetpool/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::subnetpool::tag::replace; -use openstack_types::network::v2::subnetpool::tag::response::replace::TagResponse; +use openstack_types::network::v2::subnetpool::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -95,7 +95,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/trunk/tag/list.rs b/cli-cmd/network/src/v2/trunk/tag/list.rs index 11d511b04..a79541c79 100644 --- a/cli-cmd/network/src/v2/trunk/tag/list.rs +++ b/cli-cmd/network/src/v2/trunk/tag/list.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::trunk::tag::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::trunk::tag::response::list::TagResponse; +use openstack_types::network::v2::trunk::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -135,7 +135,8 @@ impl TagsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/trunk/tag/replace.rs b/cli-cmd/network/src/v2/trunk/tag/replace.rs index d54a1193b..85f4ad714 100644 --- a/cli-cmd/network/src/v2/trunk/tag/replace.rs +++ b/cli-cmd/network/src/v2/trunk/tag/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::trunk::tag::replace; -use openstack_types::network::v2::trunk::tag::response::replace::TagResponse; +use openstack_types::network::v2::trunk::tag::response; /// Command without description in OpenAPI #[derive(Args)] @@ -91,7 +91,7 @@ impl TagCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/endpoint_group/create.rs b/cli-cmd/network/src/v2/vpn/endpoint_group/create.rs index a12116009..dae02462f 100644 --- a/cli-cmd/network/src/v2/vpn/endpoint_group/create.rs +++ b/cli-cmd/network/src/v2/vpn/endpoint_group/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::endpoint_group::create; -use openstack_types::network::v2::vpn::endpoint_group::response::create::EndpointGroupResponse; +use openstack_types::network::v2::vpn::endpoint_group::response; /// Creates a VPN endpoint group. /// @@ -162,8 +162,9 @@ impl EndpointGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/endpoint_group/list.rs b/cli-cmd/network/src/v2/vpn/endpoint_group/list.rs index 5dad9ed9f..6b889015f 100644 --- a/cli-cmd/network/src/v2/vpn/endpoint_group/list.rs +++ b/cli-cmd/network/src/v2/vpn/endpoint_group/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::endpoint_group::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::vpn::endpoint_group::response::list::EndpointGroupResponse; +use openstack_types::network::v2::vpn::endpoint_group::response; /// Lists VPN endpoint groups. /// @@ -147,7 +147,8 @@ impl EndpointGroupsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/endpoint_group/set.rs b/cli-cmd/network/src/v2/vpn/endpoint_group/set.rs index b7dc22362..e0c554e7d 100644 --- a/cli-cmd/network/src/v2/vpn/endpoint_group/set.rs +++ b/cli-cmd/network/src/v2/vpn/endpoint_group/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::endpoint_group::find; use openstack_sdk::api::network::v2::vpn::endpoint_group::set; -use openstack_types::network::v2::vpn::endpoint_group::response::set::EndpointGroupResponse; +use openstack_types::network::v2::vpn::endpoint_group::response; /// Updates settings for a VPN endpoint group. /// @@ -137,8 +137,9 @@ impl EndpointGroupCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/endpoint_group/show.rs b/cli-cmd/network/src/v2/vpn/endpoint_group/show.rs index cdca2ddff..78204459e 100644 --- a/cli-cmd/network/src/v2/vpn/endpoint_group/show.rs +++ b/cli-cmd/network/src/v2/vpn/endpoint_group/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::endpoint_group::find; -use openstack_types::network::v2::vpn::endpoint_group::response::get::EndpointGroupResponse; +use openstack_types::network::v2::vpn::endpoint_group::response; /// Shows details for a VPN endpoint group. /// @@ -93,7 +93,7 @@ impl EndpointGroupCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/ikepolicy/create.rs b/cli-cmd/network/src/v2/vpn/ikepolicy/create.rs index 70a0a1b1b..465812851 100644 --- a/cli-cmd/network/src/v2/vpn/ikepolicy/create.rs +++ b/cli-cmd/network/src/v2/vpn/ikepolicy/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::ikepolicy::create; -use openstack_types::network::v2::vpn::ikepolicy::response::create::IkepolicyResponse; +use openstack_types::network::v2::vpn::ikepolicy::response; /// Creates an IKE policy. /// @@ -321,8 +321,9 @@ impl IkepolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/ikepolicy/list.rs b/cli-cmd/network/src/v2/vpn/ikepolicy/list.rs index 153bcde68..a69628c0e 100644 --- a/cli-cmd/network/src/v2/vpn/ikepolicy/list.rs +++ b/cli-cmd/network/src/v2/vpn/ikepolicy/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::ikepolicy::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::vpn::ikepolicy::response::list::IkepolicyResponse; +use openstack_types::network::v2::vpn::ikepolicy::response; /// Lists IKE policies. /// @@ -144,7 +144,8 @@ impl IkepoliciesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/ikepolicy/set.rs b/cli-cmd/network/src/v2/vpn/ikepolicy/set.rs index 0a2b63b15..0105eb0cb 100644 --- a/cli-cmd/network/src/v2/vpn/ikepolicy/set.rs +++ b/cli-cmd/network/src/v2/vpn/ikepolicy/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::ikepolicy::find; use openstack_sdk::api::network::v2::vpn::ikepolicy::set; -use openstack_types::network::v2::vpn::ikepolicy::response::set::IkepolicyResponse; +use openstack_types::network::v2::vpn::ikepolicy::response; /// Updates policy settings in an IKE policy. /// @@ -334,8 +334,9 @@ impl IkepolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/ikepolicy/show.rs b/cli-cmd/network/src/v2/vpn/ikepolicy/show.rs index 2e543b44e..725341c9b 100644 --- a/cli-cmd/network/src/v2/vpn/ikepolicy/show.rs +++ b/cli-cmd/network/src/v2/vpn/ikepolicy/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::ikepolicy::find; -use openstack_types::network::v2::vpn::ikepolicy::response::get::IkepolicyResponse; +use openstack_types::network::v2::vpn::ikepolicy::response; /// Shows details for an IKE policy. /// @@ -90,7 +90,7 @@ impl IkepolicyCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/ipsec_site_connection/create.rs b/cli-cmd/network/src/v2/vpn/ipsec_site_connection/create.rs index 547fff73f..37667b836 100644 --- a/cli-cmd/network/src/v2/vpn/ipsec_site_connection/create.rs +++ b/cli-cmd/network/src/v2/vpn/ipsec_site_connection/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::ipsec_site_connection::create; -use openstack_types::network::v2::vpn::ipsec_site_connection::response::create::IpsecSiteConnectionResponse; +use openstack_types::network::v2::vpn::ipsec_site_connection::response; /// Creates a site-to-site IPsec connection for a service. /// @@ -278,8 +278,9 @@ impl IpsecSiteConnectionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/ipsec_site_connection/list.rs b/cli-cmd/network/src/v2/vpn/ipsec_site_connection/list.rs index c314f65c7..5b5c58471 100644 --- a/cli-cmd/network/src/v2/vpn/ipsec_site_connection/list.rs +++ b/cli-cmd/network/src/v2/vpn/ipsec_site_connection/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::ipsec_site_connection::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::vpn::ipsec_site_connection::response::list::IpsecSiteConnectionResponse; +use openstack_types::network::v2::vpn::ipsec_site_connection::response; /// Lists all IPsec connections. /// @@ -147,7 +147,8 @@ impl IpsecSiteConnectionsCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/ipsec_site_connection/set.rs b/cli-cmd/network/src/v2/vpn/ipsec_site_connection/set.rs index 1e595a901..1f430383a 100644 --- a/cli-cmd/network/src/v2/vpn/ipsec_site_connection/set.rs +++ b/cli-cmd/network/src/v2/vpn/ipsec_site_connection/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::ipsec_site_connection::find; use openstack_sdk::api::network::v2::vpn::ipsec_site_connection::set; -use openstack_types::network::v2::vpn::ipsec_site_connection::response::set::IpsecSiteConnectionResponse; +use openstack_types::network::v2::vpn::ipsec_site_connection::response; /// Updates connection settings for an IPsec connection. /// @@ -271,8 +271,9 @@ impl IpsecSiteConnectionCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/ipsec_site_connection/show.rs b/cli-cmd/network/src/v2/vpn/ipsec_site_connection/show.rs index 3364ce56b..b07668f67 100644 --- a/cli-cmd/network/src/v2/vpn/ipsec_site_connection/show.rs +++ b/cli-cmd/network/src/v2/vpn/ipsec_site_connection/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::ipsec_site_connection::find; -use openstack_types::network::v2::vpn::ipsec_site_connection::response::get::IpsecSiteConnectionResponse; +use openstack_types::network::v2::vpn::ipsec_site_connection::response; /// Shows details for an IPsec connection. /// @@ -93,7 +93,7 @@ impl IpsecSiteConnectionCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/ipsecpolicy/create.rs b/cli-cmd/network/src/v2/vpn/ipsecpolicy/create.rs index ef691e045..6aed89288 100644 --- a/cli-cmd/network/src/v2/vpn/ipsecpolicy/create.rs +++ b/cli-cmd/network/src/v2/vpn/ipsecpolicy/create.rs @@ -31,7 +31,7 @@ use openstack_sdk::AsyncOpenStack; use clap::ValueEnum; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::ipsecpolicy::create; -use openstack_types::network::v2::vpn::ipsecpolicy::response::create::IpsecpolicyResponse; +use openstack_types::network::v2::vpn::ipsecpolicy::response; /// Creates an IP security (IPsec) policy. /// @@ -327,8 +327,9 @@ impl IpsecpolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/ipsecpolicy/list.rs b/cli-cmd/network/src/v2/vpn/ipsecpolicy/list.rs index 639b52df4..ad6111c1e 100644 --- a/cli-cmd/network/src/v2/vpn/ipsecpolicy/list.rs +++ b/cli-cmd/network/src/v2/vpn/ipsecpolicy/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::ipsecpolicy::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::vpn::ipsecpolicy::response::list::IpsecpolicyResponse; +use openstack_types::network::v2::vpn::ipsecpolicy::response; /// Lists all IPsec policies. /// @@ -144,7 +144,8 @@ impl IpsecpoliciesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/ipsecpolicy/set.rs b/cli-cmd/network/src/v2/vpn/ipsecpolicy/set.rs index 13a197f29..d9942b9f2 100644 --- a/cli-cmd/network/src/v2/vpn/ipsecpolicy/set.rs +++ b/cli-cmd/network/src/v2/vpn/ipsecpolicy/set.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::ipsecpolicy::find; use openstack_sdk::api::network::v2::vpn::ipsecpolicy::set; -use openstack_types::network::v2::vpn::ipsecpolicy::response::set::IpsecpolicyResponse; +use openstack_types::network::v2::vpn::ipsecpolicy::response; /// Updates policy settings in an IPsec policy. /// @@ -338,8 +338,9 @@ impl IpsecpolicyCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/ipsecpolicy/show.rs b/cli-cmd/network/src/v2/vpn/ipsecpolicy/show.rs index 6b9aed02b..41957ef9b 100644 --- a/cli-cmd/network/src/v2/vpn/ipsecpolicy/show.rs +++ b/cli-cmd/network/src/v2/vpn/ipsecpolicy/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::ipsecpolicy::find; -use openstack_types::network::v2::vpn::ipsecpolicy::response::get::IpsecpolicyResponse; +use openstack_types::network::v2::vpn::ipsecpolicy::response; /// Shows details for an IPsec policy. /// @@ -90,7 +90,7 @@ impl IpsecpolicyCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/vpnservice/create.rs b/cli-cmd/network/src/v2/vpn/vpnservice/create.rs index 26664bd04..4f676e89e 100644 --- a/cli-cmd/network/src/v2/vpn/vpnservice/create.rs +++ b/cli-cmd/network/src/v2/vpn/vpnservice/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::vpnservice::create; -use openstack_types::network::v2::vpn::vpnservice::response::create::VpnserviceResponse; +use openstack_types::network::v2::vpn::vpnservice::response; /// Creates a VPN service. /// @@ -174,8 +174,9 @@ impl VpnserviceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/vpnservice/list.rs b/cli-cmd/network/src/v2/vpn/vpnservice/list.rs index c914fa8ac..3d7d0dcab 100644 --- a/cli-cmd/network/src/v2/vpn/vpnservice/list.rs +++ b/cli-cmd/network/src/v2/vpn/vpnservice/list.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::network::v2::vpn::vpnservice::list; use openstack_sdk::api::{Pagination, paged}; -use openstack_types::network::v2::vpn::vpnservice::response::list::VpnserviceResponse; +use openstack_types::network::v2::vpn::vpnservice::response; /// Lists all VPN services. /// @@ -146,7 +146,8 @@ impl VpnservicesCommand { let data: Vec = paged(ep, Pagination::Limit(self.max_items)) .query_async(client) .await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/network/src/v2/vpn/vpnservice/set.rs b/cli-cmd/network/src/v2/vpn/vpnservice/set.rs index 299156920..31c3acd22 100644 --- a/cli-cmd/network/src/v2/vpn/vpnservice/set.rs +++ b/cli-cmd/network/src/v2/vpn/vpnservice/set.rs @@ -32,7 +32,7 @@ use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::vpnservice::find; use openstack_sdk::api::network::v2::vpn::vpnservice::set; -use openstack_types::network::v2::vpn::vpnservice::response::set::VpnserviceResponse; +use openstack_types::network::v2::vpn::vpnservice::response; /// Updates a VPN service. /// @@ -147,8 +147,9 @@ impl VpnserviceCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/network/src/v2/vpn/vpnservice/show.rs b/cli-cmd/network/src/v2/vpn/vpnservice/show.rs index 8cdae7a42..4335bb7e3 100644 --- a/cli-cmd/network/src/v2/vpn/vpnservice/show.rs +++ b/cli-cmd/network/src/v2/vpn/vpnservice/show.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::find; use openstack_sdk::api::network::v2::vpn::vpnservice::find; -use openstack_types::network::v2::vpn::vpnservice::response::get::VpnserviceResponse; +use openstack_types::network::v2::vpn::vpnservice::response; /// Shows details for a VPN service. /// @@ -94,7 +94,7 @@ impl VpnserviceCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let find_data: serde_json::Value = find(find_ep).query_async(client).await?; - op.output_single::(find_data)?; + op.output_single::(find_data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/allocation/show.rs b/cli-cmd/placement/src/v1/allocation/show.rs index 898b3aa5e..b77396465 100644 --- a/cli-cmd/placement/src/v1/allocation/show.rs +++ b/cli-cmd/placement/src/v1/allocation/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::allocation::get; -use openstack_types::placement::v1::allocation::response::get::AllocationResponse; +use openstack_types::placement::v1::allocation::response; /// List all allocation records for the consumer identified by {consumer_uuid} /// on all the resource providers it is consuming. @@ -84,8 +84,9 @@ impl AllocationCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/allocation_candidate/list.rs b/cli-cmd/placement/src/v1/allocation_candidate/list.rs index 75bfcc12c..4cce193b6 100644 --- a/cli-cmd/placement/src/v1/allocation_candidate/list.rs +++ b/cli-cmd/placement/src/v1/allocation_candidate/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::allocation_candidate::list; -use openstack_types::placement::v1::allocation_candidate::response::list::AllocationCandidateResponse; +use openstack_types::placement::v1::allocation_candidate::response; /// Returns a dictionary representing a collection of allocation requests and /// resource provider summaries. Each allocation request has information to @@ -228,8 +228,9 @@ impl AllocationCandidateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_class/create.rs b/cli-cmd/placement/src/v1/resource_class/create.rs index 0fa5e09c2..555ea30ad 100644 --- a/cli-cmd/placement/src/v1/resource_class/create.rs +++ b/cli-cmd/placement/src/v1/resource_class/create.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_class::create; -use openstack_types::placement::v1::resource_class::response::create::ResourceClassResponse; +use openstack_types::placement::v1::resource_class::response; /// Create a new resource class. The new class must be a *custom* resource /// class, prefixed with CUSTOM\_ and distinct from the standard resource @@ -94,8 +94,9 @@ impl ResourceClassCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_class/list.rs b/cli-cmd/placement/src/v1/resource_class/list.rs index 9d6efeb68..c73df5908 100644 --- a/cli-cmd/placement/src/v1/resource_class/list.rs +++ b/cli-cmd/placement/src/v1/resource_class/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_class::list; -use openstack_types::placement::v1::resource_class::response::list::ResourceClassResponse; +use openstack_types::placement::v1::resource_class::response; /// Return a list of all resource classes. /// @@ -74,7 +74,8 @@ impl ResourceClassesCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_class/set_17.rs b/cli-cmd/placement/src/v1/resource_class/set_17.rs index 10476a33b..94c867556 100644 --- a/cli-cmd/placement/src/v1/resource_class/set_17.rs +++ b/cli-cmd/placement/src/v1/resource_class/set_17.rs @@ -29,7 +29,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_class::set_17; -use openstack_types::placement::v1::resource_class::response::set::ResourceClassResponse; /// Create or validate the existence of single resource class identified by /// {name}. @@ -93,9 +92,7 @@ impl ResourceClassCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_class/show.rs b/cli-cmd/placement/src/v1/resource_class/show.rs index 90ed9aeb7..2a8b0dead 100644 --- a/cli-cmd/placement/src/v1/resource_class/show.rs +++ b/cli-cmd/placement/src/v1/resource_class/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_class::get; -use openstack_types::placement::v1::resource_class::response::get::ResourceClassResponse; +use openstack_types::placement::v1::resource_class::response; /// Return a representation of the resource class identified by {name}. /// @@ -85,8 +85,9 @@ impl ResourceClassCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/aggregate/list.rs b/cli-cmd/placement/src/v1/resource_provider/aggregate/list.rs index 98db4d59b..9f72f91e0 100644 --- a/cli-cmd/placement/src/v1/resource_provider/aggregate/list.rs +++ b/cli-cmd/placement/src/v1/resource_provider/aggregate/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::aggregate::list; -use openstack_types::placement::v1::resource_provider::aggregate::response::list::AggregateResponse; +use openstack_types::placement::v1::resource_provider::aggregate::response; /// Return a list of aggregates associated with the resource provider /// identified by {uuid}. @@ -91,8 +91,9 @@ impl AggregateCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/aggregate/set_11.rs b/cli-cmd/placement/src/v1/resource_provider/aggregate/set_11.rs index d590f1274..eda0c8116 100644 --- a/cli-cmd/placement/src/v1/resource_provider/aggregate/set_11.rs +++ b/cli-cmd/placement/src/v1/resource_provider/aggregate/set_11.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::aggregate::set_11; -use openstack_types::placement::v1::resource_provider::aggregate::response::set::AggregateResponse; +use openstack_types::placement::v1::resource_provider::aggregate::response; /// Associate a list of aggregates with the resource provider identified by /// {uuid}. @@ -94,7 +94,7 @@ impl AggregateCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + 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/set_119.rs b/cli-cmd/placement/src/v1/resource_provider/aggregate/set_119.rs index a7866259f..c88660f93 100644 --- a/cli-cmd/placement/src/v1/resource_provider/aggregate/set_119.rs +++ b/cli-cmd/placement/src/v1/resource_provider/aggregate/set_119.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::aggregate::set_119; -use openstack_types::placement::v1::resource_provider::aggregate::response::set::AggregateResponse; +use openstack_types::placement::v1::resource_provider::aggregate::response; /// Associate a list of aggregates with the resource provider identified by /// {uuid}. @@ -109,7 +109,7 @@ impl AggregateCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/allocation/list.rs b/cli-cmd/placement/src/v1/resource_provider/allocation/list.rs index a748e9259..6be6620bd 100644 --- a/cli-cmd/placement/src/v1/resource_provider/allocation/list.rs +++ b/cli-cmd/placement/src/v1/resource_provider/allocation/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::allocation::list; -use openstack_types::placement::v1::resource_provider::allocation::response::list::AllocationResponse; +use openstack_types::placement::v1::resource_provider::allocation::response; /// Return a representation of all allocations made against this resource /// provider, keyed by consumer uuid. Each allocation includes one or more @@ -90,8 +90,9 @@ impl AllocationCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/create_10.rs b/cli-cmd/placement/src/v1/resource_provider/create_10.rs index b5aa9c0ad..b6b851a9d 100644 --- a/cli-cmd/placement/src/v1/resource_provider/create_10.rs +++ b/cli-cmd/placement/src/v1/resource_provider/create_10.rs @@ -29,7 +29,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::create_10; -use openstack_types::placement::v1::resource_provider::response::create::ResourceProviderResponse; /// Create a new resource provider. /// @@ -102,9 +101,7 @@ impl ResourceProviderCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/create_114.rs b/cli-cmd/placement/src/v1/resource_provider/create_114.rs index 633a1c27c..27a284c91 100644 --- a/cli-cmd/placement/src/v1/resource_provider/create_114.rs +++ b/cli-cmd/placement/src/v1/resource_provider/create_114.rs @@ -29,7 +29,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::create_114; -use openstack_types::placement::v1::resource_provider::response::create::ResourceProviderResponse; /// Create a new resource provider. /// @@ -122,9 +121,7 @@ impl ResourceProviderCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/inventory/create.rs b/cli-cmd/placement/src/v1/resource_provider/inventory/create.rs index d2c0fb2ea..22d28b040 100644 --- a/cli-cmd/placement/src/v1/resource_provider/inventory/create.rs +++ b/cli-cmd/placement/src/v1/resource_provider/inventory/create.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::inventory::create; -use openstack_types::placement::v1::resource_provider::inventory::response::create::InventoryResponse; +use openstack_types::placement::v1::resource_provider::inventory::response; use serde_json::Value; /// POST to create one inventory. @@ -114,8 +114,9 @@ impl InventoryCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/inventory/list.rs b/cli-cmd/placement/src/v1/resource_provider/inventory/list.rs index 2e1d153ac..160f02ef5 100644 --- a/cli-cmd/placement/src/v1/resource_provider/inventory/list.rs +++ b/cli-cmd/placement/src/v1/resource_provider/inventory/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::inventory::list; -use openstack_types::placement::v1::resource_provider::inventory::response::list::InventoryResponse; +use openstack_types::placement::v1::resource_provider::inventory::response; /// Normal Response Codes: 200 /// @@ -87,8 +87,9 @@ impl InventoriesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/inventory/replace.rs b/cli-cmd/placement/src/v1/resource_provider/inventory/replace.rs index 3bbfaf62e..02bedb966 100644 --- a/cli-cmd/placement/src/v1/resource_provider/inventory/replace.rs +++ b/cli-cmd/placement/src/v1/resource_provider/inventory/replace.rs @@ -30,7 +30,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_cli_core::common::parse_key_val; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::inventory::replace; -use openstack_types::placement::v1::resource_provider::inventory::response::replace::InventoryResponse; +use openstack_types::placement::v1::resource_provider::inventory::response; use serde_json::Value; /// Replaces the set of inventory records for the resource provider identified @@ -117,8 +117,9 @@ impl InventoryCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/inventory/set.rs b/cli-cmd/placement/src/v1/resource_provider/inventory/set.rs index ab128ce28..8e0783c7d 100644 --- a/cli-cmd/placement/src/v1/resource_provider/inventory/set.rs +++ b/cli-cmd/placement/src/v1/resource_provider/inventory/set.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::inventory::set; -use openstack_types::placement::v1::resource_provider::inventory::response::set::InventoryResponse; +use openstack_types::placement::v1::resource_provider::inventory::response; /// Replace the inventory record of the {resource_class} for the resource /// provider identified by {uuid}. @@ -173,8 +173,9 @@ impl InventoryCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/inventory/show.rs b/cli-cmd/placement/src/v1/resource_provider/inventory/show.rs index 9ca259d5b..fd1697c2a 100644 --- a/cli-cmd/placement/src/v1/resource_provider/inventory/show.rs +++ b/cli-cmd/placement/src/v1/resource_provider/inventory/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::inventory::get; -use openstack_types::placement::v1::resource_provider::inventory::response::get::InventoryResponse; +use openstack_types::placement::v1::resource_provider::inventory::response; /// Normal Response Codes: 200 /// @@ -97,8 +97,9 @@ impl InventoryCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/list.rs b/cli-cmd/placement/src/v1/resource_provider/list.rs index 1c374ee25..3bc6a7f53 100644 --- a/cli-cmd/placement/src/v1/resource_provider/list.rs +++ b/cli-cmd/placement/src/v1/resource_provider/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::list; -use openstack_types::placement::v1::resource_provider::response::list::ResourceProviderResponse; +use openstack_types::placement::v1::resource_provider::response; /// List an optionally filtered collection of resource providers. /// @@ -182,7 +182,8 @@ impl ResourceProvidersCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/set_10.rs b/cli-cmd/placement/src/v1/resource_provider/set_10.rs index 278b0b053..4d8279c6c 100644 --- a/cli-cmd/placement/src/v1/resource_provider/set_10.rs +++ b/cli-cmd/placement/src/v1/resource_provider/set_10.rs @@ -29,7 +29,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::set_10; -use openstack_types::placement::v1::resource_provider::response::set::ResourceProviderResponse; /// Update the name of the resource provider identified by {uuid}. /// @@ -102,9 +101,7 @@ impl ResourceProviderCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/set_114.rs b/cli-cmd/placement/src/v1/resource_provider/set_114.rs index 2661f96d2..2d866bc8a 100644 --- a/cli-cmd/placement/src/v1/resource_provider/set_114.rs +++ b/cli-cmd/placement/src/v1/resource_provider/set_114.rs @@ -29,7 +29,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::set_114; -use openstack_types::placement::v1::resource_provider::response::set::ResourceProviderResponse; /// Update the name of the resource provider identified by {uuid}. /// @@ -122,9 +121,7 @@ impl ResourceProviderCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/show.rs b/cli-cmd/placement/src/v1/resource_provider/show.rs index 239c3fb1b..92b842f6e 100644 --- a/cli-cmd/placement/src/v1/resource_provider/show.rs +++ b/cli-cmd/placement/src/v1/resource_provider/show.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::get; -use openstack_types::placement::v1::resource_provider::response::get::ResourceProviderResponse; +use openstack_types::placement::v1::resource_provider::response; /// Return a representation of the resource provider identified by {uuid}. /// @@ -88,8 +88,9 @@ impl ResourceProviderCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/trait/list.rs b/cli-cmd/placement/src/v1/resource_provider/trait/list.rs index d2680698c..00029780d 100644 --- a/cli-cmd/placement/src/v1/resource_provider/trait/list.rs +++ b/cli-cmd/placement/src/v1/resource_provider/trait/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::r#trait::list; -use openstack_types::placement::v1::resource_provider::r#trait::response::list::TraitResponse; +use openstack_types::placement::v1::resource_provider::r#trait::response; /// Return a list of traits for the resource provider identified by {uuid}. /// @@ -88,8 +88,9 @@ impl TraitCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/resource_provider/trait/set.rs b/cli-cmd/placement/src/v1/resource_provider/trait/set.rs index 938959ae3..523f1cee2 100644 --- a/cli-cmd/placement/src/v1/resource_provider/trait/set.rs +++ b/cli-cmd/placement/src/v1/resource_provider/trait/set.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::r#trait::set; -use openstack_types::placement::v1::resource_provider::r#trait::response::set::TraitResponse; +use openstack_types::placement::v1::resource_provider::r#trait::response; /// Associate traits with the resource provider identified by {uuid}. All the /// associated traits will be replaced by the traits specified in the request @@ -102,7 +102,7 @@ impl TraitCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + op.output_list::(data.clone())?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/resource_provider/usage/get.rs b/cli-cmd/placement/src/v1/resource_provider/usage/get.rs index b5d8e9653..3dfbd9681 100644 --- a/cli-cmd/placement/src/v1/resource_provider/usage/get.rs +++ b/cli-cmd/placement/src/v1/resource_provider/usage/get.rs @@ -29,7 +29,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::resource_provider::usage::get; -use openstack_types::placement::v1::resource_provider::usage::response::get::UsageResponse; /// Return a report of usage information for resources associated with the /// resource provider identified by {uuid}. The value is a dictionary of @@ -90,9 +89,7 @@ impl UsageCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/cli-cmd/placement/src/v1/trait/list.rs b/cli-cmd/placement/src/v1/trait/list.rs index beb847b8b..faecef54e 100644 --- a/cli-cmd/placement/src/v1/trait/list.rs +++ b/cli-cmd/placement/src/v1/trait/list.rs @@ -29,7 +29,7 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::r#trait::list; -use openstack_types::placement::v1::r#trait::response::list::TraitResponse; +use openstack_types::placement::v1::r#trait::response; /// Return a list of valid trait strings according to parameters specified. /// @@ -91,7 +91,8 @@ impl TraitsCommand { .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; let data: Vec = ep.query_async(client).await?; - op.output_list::(data)?; + + 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 951615e1d..c2c5f3b03 100644 --- a/cli-cmd/placement/src/v1/usage/list.rs +++ b/cli-cmd/placement/src/v1/usage/list.rs @@ -33,7 +33,7 @@ use openstack_sdk::api::find_by_name; use openstack_sdk::api::identity::v3::project::find as find_project; use openstack_sdk::api::identity::v3::user::find as find_user; use openstack_sdk::api::placement::v1::usage::list; -use openstack_types::placement::v1::usage::response::list::UsageResponse; +use openstack_types::placement::v1::usage::response; use tracing::warn; /// Return a report of usage information for resources associated with the @@ -220,8 +220,9 @@ impl UsagesCommand { .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - let data = ep.query_async(client).await?; - op.output_single::(data)?; + 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/placement/src/v1/version/get.rs b/cli-cmd/placement/src/v1/version/get.rs index b95af8855..bd08af92b 100644 --- a/cli-cmd/placement/src/v1/version/get.rs +++ b/cli-cmd/placement/src/v1/version/get.rs @@ -30,7 +30,6 @@ use openstack_sdk::AsyncOpenStack; use openstack_sdk::api::QueryAsync; use openstack_sdk::api::placement::v1::version::get; -use openstack_types::placement::v1::version::response::get::VersionResponse; /// Fetch information about all known major versions of the placement API, /// including information about the minimum and maximum microversions. @@ -73,9 +72,7 @@ impl VersionCommand { let ep = ep_builder .build() .map_err(|x| OpenStackCliError::EndpointBuild(x.to_string()))?; - - let data = ep.query_async(client).await?; - op.output_single::(data)?; + openstack_sdk::api::ignore(ep).query_async(client).await?; // Show command specific hints op.show_command_hint()?; Ok(()) diff --git a/openstack_cli/tests/compute/v2/server/add_fixed_ip_autogen.rs b/openstack_cli/tests/compute/v2/server/add_fixed_ip_autogen.rs new file mode 100644 index 000000000..aa88886ce --- /dev/null +++ b/openstack_cli/tests/compute/v2/server/add_fixed_ip_autogen.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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.arg("compute") + .arg("server") + .arg("add-fixed-ip") + .arg("--help"); + cmd.assert().success(); + + Ok(()) +} diff --git a/openstack_cli/tests/compute/v2/server/add_floating_ip_autogen.rs b/openstack_cli/tests/compute/v2/server/add_floating_ip_autogen.rs new file mode 100644 index 000000000..2aff923bc --- /dev/null +++ b/openstack_cli/tests/compute/v2/server/add_floating_ip_autogen.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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.arg("compute") + .arg("server") + .arg("add-floating-ip") + .arg("--help"); + cmd.assert().success(); + + Ok(()) +} diff --git a/openstack_cli/tests/compute/v2/server/migration/force_complete_autogen.rs b/openstack_cli/tests/compute/v2/server/migration/force_complete_autogen.rs new file mode 100644 index 000000000..7495fcd98 --- /dev/null +++ b/openstack_cli/tests/compute/v2/server/migration/force_complete_autogen.rs @@ -0,0 +1,33 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.arg("compute") + .arg("server") + .arg("migration") + .arg("force-complete") + .arg("--help"); + cmd.assert().success(); + + Ok(()) +} diff --git a/openstack_cli/tests/compute/v2/server/os_get_serial_console_autogen.rs b/openstack_cli/tests/compute/v2/server/os_get_serial_console_autogen.rs new file mode 100644 index 000000000..d460830d7 --- /dev/null +++ b/openstack_cli/tests/compute/v2/server/os_get_serial_console_autogen.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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.arg("compute") + .arg("server") + .arg("get-serial-console") + .arg("--help"); + cmd.assert().success(); + + Ok(()) +} diff --git a/openstack_cli/tests/compute/v2/server/os_get_spiceconsole_autogen.rs b/openstack_cli/tests/compute/v2/server/os_get_spiceconsole_autogen.rs new file mode 100644 index 000000000..7285faacf --- /dev/null +++ b/openstack_cli/tests/compute/v2/server/os_get_spiceconsole_autogen.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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.arg("compute") + .arg("server") + .arg("get-spiceconsole") + .arg("--help"); + cmd.assert().success(); + + Ok(()) +} diff --git a/openstack_cli/tests/compute/v2/server/os_get_vncconsole_autogen.rs b/openstack_cli/tests/compute/v2/server/os_get_vncconsole_autogen.rs new file mode 100644 index 000000000..a796e023c --- /dev/null +++ b/openstack_cli/tests/compute/v2/server/os_get_vncconsole_autogen.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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.arg("compute") + .arg("server") + .arg("get-vncconsole") + .arg("--help"); + cmd.assert().success(); + + Ok(()) +} diff --git a/openstack_cli/tests/compute/v2/server/remove_fixed_ip_autogen.rs b/openstack_cli/tests/compute/v2/server/remove_fixed_ip_autogen.rs new file mode 100644 index 000000000..b2f44f284 --- /dev/null +++ b/openstack_cli/tests/compute/v2/server/remove_fixed_ip_autogen.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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.arg("compute") + .arg("server") + .arg("remove-fixed-ip") + .arg("--help"); + cmd.assert().success(); + + Ok(()) +} diff --git a/openstack_cli/tests/compute/v2/server/remove_floating_ip_autogen.rs b/openstack_cli/tests/compute/v2/server/remove_floating_ip_autogen.rs new file mode 100644 index 000000000..4a19b0d76 --- /dev/null +++ b/openstack_cli/tests/compute/v2/server/remove_floating_ip_autogen.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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.arg("compute") + .arg("server") + .arg("remove-floating-ip") + .arg("--help"); + cmd.assert().success(); + + Ok(()) +} diff --git a/openstack_cli/tests/compute/v2/server/trigger_crash_dump_autogen.rs b/openstack_cli/tests/compute/v2/server/trigger_crash_dump_autogen.rs new file mode 100644 index 000000000..2dcf99ae4 --- /dev/null +++ b/openstack_cli/tests/compute/v2/server/trigger_crash_dump_autogen.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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.arg("compute") + .arg("server") + .arg("trigger-crash-dump") + .arg("--help"); + cmd.assert().success(); + + Ok(()) +} diff --git a/openstack_tui/src/app.rs b/openstack_tui/src/app.rs index 6a38f5fa1..17fca746d 100644 --- a/openstack_tui/src/app.rs +++ b/openstack_tui/src/app.rs @@ -399,12 +399,11 @@ impl App { Action::ClearScreen => tui.terminal.clear()?, Action::Resize(w, h) => self.handle_resize(tui, w, h)?, Action::Render => self.render(tui)?, - Action::Clouds(_) => { + Action::Clouds(_) // Started without any cloud selected - switch to CloudSelect mode - if self.cloud_name.is_none() { + if self.cloud_name.is_none() => { self.action_tx.send(Action::CloudSelect)?; } - } Action::ConnectedToCloud(_) => { if let Some(popup) = &self.active_popup @@ -462,8 +461,8 @@ impl App { self.active_popup = None; self.render(tui)?; } - Action::Mode { mode, stack } => { - if self.mode != mode { + Action::Mode { mode, stack } + if self.mode != mode => { debug!("Switching from {:?} to {:?}", self.mode, mode); // Hide popup self.active_popup = None; @@ -474,7 +473,6 @@ impl App { self.mode = mode; self.render(tui)?; } - } Action::PerformApiRequest(ref request) => { self.cloud_worker_tx .send(Action::PerformApiRequest(request.clone()))?; diff --git a/openstack_tui/src/components/block_storage/volumes.rs b/openstack_tui/src/components/block_storage/volumes.rs index b85cc5bc6..cac951ff7 100644 --- a/openstack_tui/src/components/block_storage/volumes.rs +++ b/openstack_tui/src/components/block_storage/volumes.rs @@ -108,9 +108,9 @@ impl Component for BlockStorageVolumes<'_> { self.set_data(data)?; } } - Action::DeleteBlockStorageVolume => { + Action::DeleteBlockStorageVolume // only if we are currently in the Volumes mode - if current_mode == Mode::BlockStorageVolumes { + if current_mode == Mode::BlockStorageVolumes => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -125,7 +125,6 @@ impl Component for BlockStorageVolumes<'_> { } } } - } _ => {} }; Ok(None) diff --git a/openstack_tui/src/components/compute/aggregates.rs b/openstack_tui/src/components/compute/aggregates.rs index 3ca1bf5cc..87069fdd9 100644 --- a/openstack_tui/src/components/compute/aggregates.rs +++ b/openstack_tui/src/components/compute/aggregates.rs @@ -17,7 +17,7 @@ use eyre::Result; use ratatui::prelude::*; use tokio::sync::mpsc::UnboundedSender; -use openstack_types::compute::v2::aggregate::response::list::AggregateResponse; +use openstack_types::compute::v2::aggregate::response::list_241::AggregateResponse; use crate::{ action::Action, diff --git a/openstack_tui/src/components/compute/flavors.rs b/openstack_tui/src/components/compute/flavors.rs index bf3692060..d4e27f96a 100644 --- a/openstack_tui/src/components/compute/flavors.rs +++ b/openstack_tui/src/components/compute/flavors.rs @@ -17,7 +17,7 @@ use eyre::{Result, WrapErr}; use ratatui::prelude::*; use tokio::sync::mpsc::UnboundedSender; -use openstack_types::compute::v2::flavor::response::list_detailed::FlavorResponse; +use openstack_types::compute::v2::flavor::response::list_detailed_255::FlavorResponse; use crate::{ action::Action, @@ -104,9 +104,9 @@ impl Component for ComputeFlavors<'_> { self.set_data(data)?; } } - Action::ShowComputeServersWithFlavor => { + Action::ShowComputeServersWithFlavor // only if we are currently in the flavors mode - if current_mode == Mode::ComputeFlavors { + if current_mode == Mode::ComputeFlavors => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -126,7 +126,6 @@ impl Component for ComputeFlavors<'_> { } } } - } _ => {} }; Ok(None) diff --git a/openstack_tui/src/components/compute/hypervisors.rs b/openstack_tui/src/components/compute/hypervisors.rs index f5e952943..da6ba5b24 100644 --- a/openstack_tui/src/components/compute/hypervisors.rs +++ b/openstack_tui/src/components/compute/hypervisors.rs @@ -17,7 +17,7 @@ use eyre::Result; use ratatui::prelude::*; use tokio::sync::mpsc::UnboundedSender; -use openstack_types::compute::v2::hypervisor::response::list_detailed::HypervisorResponse; +use openstack_types::compute::v2::hypervisor::response::list_detailed_253::HypervisorResponse; use crate::{ action::Action, diff --git a/openstack_tui/src/components/compute/server_instance_actions.rs b/openstack_tui/src/components/compute/server_instance_actions.rs index 6eb1a2b04..faa9c485d 100644 --- a/openstack_tui/src/components/compute/server_instance_actions.rs +++ b/openstack_tui/src/components/compute/server_instance_actions.rs @@ -17,7 +17,7 @@ use eyre::{Result, WrapErr}; use ratatui::prelude::*; use tokio::sync::mpsc::UnboundedSender; -use openstack_types::compute::v2::server::instance_action::response::list::InstanceActionResponse; +use openstack_types::compute::v2::server::instance_action::response::list_21::InstanceActionResponse; use crate::{ action::Action, @@ -104,9 +104,9 @@ impl Component for ComputeServerInstanceActions<'_> { )), )))); } - Action::ShowComputeServerInstanceActionEvents => { + Action::ShowComputeServerInstanceActionEvents // only if we are currently in the IdentityGroup mode - if current_mode == Mode::ComputeServerInstanceActions { + if current_mode == Mode::ComputeServerInstanceActions => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -114,9 +114,7 @@ impl Component for ComputeServerInstanceActions<'_> { // send action to set server instance action filters let mut req = ComputeServerInstanceActionShowBuilder::default(); req.id(selected_entry.request_id.clone()); - if let Some(sid) = &selected_entry.instance_uuid { - req.server_id(sid.clone()); - } + req.server_id(selected_entry.instance_uuid.clone()); if let Some(name) = &self.get_filters().server_name { req.server_name(name.clone()); } @@ -131,7 +129,6 @@ impl Component for ComputeServerInstanceActions<'_> { } } } - } _ => {} }; diff --git a/openstack_tui/src/components/compute/servers.rs b/openstack_tui/src/components/compute/servers.rs index f07ca8f86..96ee87a3f 100644 --- a/openstack_tui/src/components/compute/servers.rs +++ b/openstack_tui/src/components/compute/servers.rs @@ -19,7 +19,7 @@ use serde_json::json; use tokio::sync::mpsc::UnboundedSender; use tracing::debug; -use openstack_types::compute::v2::server::response::list_detailed::ServerResponse; +use openstack_types::compute::v2::server::response::list_detailed_21::ServerResponse; use crate::{ action::Action, @@ -73,7 +73,9 @@ impl TryFrom<&ServerResponse> for ComputeServerDelete { fn try_from(value: &ServerResponse) -> Result { let mut builder = ComputeServerDeleteBuilder::default(); builder.id(value.id.clone()); - builder.name(value.name.clone()); + if let Some(name) = &value.name { + builder.name(name.clone()); + } builder.build() } } @@ -83,7 +85,9 @@ impl TryFrom<&ServerResponse> for ComputeServerInstanceActionList { fn try_from(value: &ServerResponse) -> Result { let mut builder = ComputeServerInstanceActionListBuilder::default(); builder.server_id(value.id.clone()); - builder.server_name(value.name.clone()); + if let Some(name) = &value.name { + builder.server_name(name.clone()); + } builder.build() } } @@ -182,9 +186,9 @@ impl Component for ComputeServers<'_> { )))); } } - Action::ShowComputeServerInstanceActions => { + Action::ShowComputeServerInstanceActions // only if we are currently in the servers mode - if current_mode == Mode::ComputeServers { + if current_mode == Mode::ComputeServers => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -204,10 +208,9 @@ impl Component for ComputeServers<'_> { } } } - } - Action::DeleteComputeServer => { + Action::DeleteComputeServer // only if we are currently in the IdentityGroup mode - if current_mode == Mode::ComputeServers { + if current_mode == Mode::ComputeServers => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -222,7 +225,6 @@ impl Component for ComputeServers<'_> { } } } - } _ => {} }; Ok(None) diff --git a/openstack_tui/src/components/dns/zones.rs b/openstack_tui/src/components/dns/zones.rs index fa69fc741..8492d1632 100644 --- a/openstack_tui/src/components/dns/zones.rs +++ b/openstack_tui/src/components/dns/zones.rs @@ -124,9 +124,9 @@ impl Component for DnsZones<'_> { DnsZoneApiRequest::List(Box::new(self.get_filters().clone())), )))); } - Action::ShowDnsZoneRecordsets => { + Action::ShowDnsZoneRecordsets // only if we are currently in the servers mode - if current_mode == Mode::DnsZones { + if current_mode == Mode::DnsZones => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -143,10 +143,9 @@ impl Component for DnsZones<'_> { } } } - } - Action::DeleteDnsZone => { + Action::DeleteDnsZone // only if we are currently in the right mode - if current_mode == Mode::DnsZones { + if current_mode == Mode::DnsZones => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -161,7 +160,6 @@ impl Component for DnsZones<'_> { } } } - } _ => {} }; Ok(None) diff --git a/openstack_tui/src/components/home.rs b/openstack_tui/src/components/home.rs index eaffc5e0c..8db81cee5 100644 --- a/openstack_tui/src/components/home.rs +++ b/openstack_tui/src/components/home.rs @@ -164,11 +164,9 @@ impl Component for Home { } Action::Mode { mode: Mode::Home, .. - } => { - if !self.is_loading { - self.set_loading(true); - return self.refresh_data(); - } + } if !self.is_loading => { + self.set_loading(true); + return self.refresh_data(); } Action::Tick => { self.tick(); diff --git a/openstack_tui/src/components/identity/groups.rs b/openstack_tui/src/components/identity/groups.rs index a3bf70530..7b97abad5 100644 --- a/openstack_tui/src/components/identity/groups.rs +++ b/openstack_tui/src/components/identity/groups.rs @@ -91,9 +91,9 @@ impl Component for IdentityGroups<'_> { IdentityGroupApiRequest::List(Box::new(self.get_filters().clone())), )))); } - Action::ShowIdentityGroupUsers => { + Action::ShowIdentityGroupUsers // only if we are currently in the IdentityGroup mode - if current_mode == Mode::IdentityGroups { + if current_mode == Mode::IdentityGroups => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -111,7 +111,6 @@ impl Component for IdentityGroups<'_> { } } } - } Action::DescribeApiResponse => self.describe_selected_entry()?, Action::Tick => self.app_tick()?, Action::Render => self.render_tick()?, diff --git a/openstack_tui/src/components/identity/users.rs b/openstack_tui/src/components/identity/users.rs index b3670f73f..09fb79ad6 100644 --- a/openstack_tui/src/components/identity/users.rs +++ b/openstack_tui/src/components/identity/users.rs @@ -100,9 +100,9 @@ impl Component for IdentityUsers<'_> { IdentityUserApiRequest::List(Box::new(self.get_filters().clone())), )))); } - Action::IdentityUserFlipEnable => { + Action::IdentityUserFlipEnable // only if we are currently in the proper mode - if current_mode == Mode::IdentityUsers { + if current_mode == Mode::IdentityUsers => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -119,10 +119,9 @@ impl Component for IdentityUsers<'_> { } } } - } - Action::IdentityUserDelete => { + Action::IdentityUserDelete // only if we are currently in the proper mode - if current_mode == Mode::IdentityUsers { + if current_mode == Mode::IdentityUsers => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -137,10 +136,9 @@ impl Component for IdentityUsers<'_> { } } } - } - Action::ShowIdentityUserApplicationCredentials => { + Action::ShowIdentityUserApplicationCredentials // only if we are currently in the proper mode - if current_mode == Mode::IdentityUsers { + if current_mode == Mode::IdentityUsers => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -159,7 +157,6 @@ impl Component for IdentityUsers<'_> { } } } - } Action::DescribeApiResponse => self.describe_selected_entry()?, Action::Tick => self.app_tick()?, Action::Render => self.render_tick()?, diff --git a/openstack_tui/src/components/image/images.rs b/openstack_tui/src/components/image/images.rs index 8970a0e51..df6e8da81 100644 --- a/openstack_tui/src/components/image/images.rs +++ b/openstack_tui/src/components/image/images.rs @@ -122,9 +122,9 @@ impl Component for Images<'_> { ImageImageApiRequest::List(Box::new(self.get_filters().clone())), )))); } - Action::DeleteImage => { + Action::DeleteImage // only if we are currently in the right mode - if current_mode == Mode::ImageImages { + if current_mode == Mode::ImageImages => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -139,7 +139,6 @@ impl Component for Images<'_> { } } } - } _ => {} }; Ok(None) diff --git a/openstack_tui/src/components/load_balancer/loadbalancers.rs b/openstack_tui/src/components/load_balancer/loadbalancers.rs index fab276182..5b334eea8 100644 --- a/openstack_tui/src/components/load_balancer/loadbalancers.rs +++ b/openstack_tui/src/components/load_balancer/loadbalancers.rs @@ -128,9 +128,9 @@ impl Component for LoadBalancers<'_> { LoadBalancerLoadbalancerApiRequest::List(Box::new(self.get_filters().clone())), )))); } - Action::ShowLoadBalancerListeners => { + Action::ShowLoadBalancerListeners // only if we are currently in the right mode - if current_mode == Mode::LoadBalancers { + if current_mode == Mode::LoadBalancers => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -147,10 +147,9 @@ impl Component for LoadBalancers<'_> { } } } - } - Action::ShowLoadBalancerPools => { + Action::ShowLoadBalancerPools // only if we are currently in the right mode - if current_mode == Mode::LoadBalancers { + if current_mode == Mode::LoadBalancers => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -167,7 +166,6 @@ impl Component for LoadBalancers<'_> { } } } - } // Action::DeleteLoadBalancer => { // // only if we are currently in the right mode // if current_mode == Mode::LoadBalancerLoadBalancers { diff --git a/openstack_tui/src/components/load_balancer/pools.rs b/openstack_tui/src/components/load_balancer/pools.rs index f319fb057..f2a82eabd 100644 --- a/openstack_tui/src/components/load_balancer/pools.rs +++ b/openstack_tui/src/components/load_balancer/pools.rs @@ -125,9 +125,9 @@ impl Component for LoadBalancerPools<'_> { LoadBalancerPoolApiRequest::List(Box::new(self.get_filters().clone())), )))); } - Action::ShowLoadBalancerPoolMembers => { + Action::ShowLoadBalancerPoolMembers // only if we are currently in the expected mode - if current_mode == Mode::LoadBalancerPools { + if current_mode == Mode::LoadBalancerPools => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -143,10 +143,9 @@ impl Component for LoadBalancerPools<'_> { } } } - } - Action::ShowLoadBalancerPoolHealthMonitors => { + Action::ShowLoadBalancerPoolHealthMonitors // only if we are currently in the expected mode - if current_mode == Mode::LoadBalancerPools { + if current_mode == Mode::LoadBalancerPools => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -162,7 +161,6 @@ impl Component for LoadBalancerPools<'_> { } } } - } // Action::DeleteLoadBalancer => { // // only if we are currently in the right mode // if current_mode == Mode::LoadBalancerLoadBalancers { diff --git a/openstack_tui/src/components/network/networks.rs b/openstack_tui/src/components/network/networks.rs index 1d8c55b2a..3c957e5f4 100644 --- a/openstack_tui/src/components/network/networks.rs +++ b/openstack_tui/src/components/network/networks.rs @@ -110,9 +110,9 @@ impl Component for NetworkNetworks<'_> { NetworkNetworkApiRequest::List(Box::new(self.normalized_filters())), )))); } - Action::ShowNetworkSubnets => { + Action::ShowNetworkSubnets // only if we are currently in the expected mode - if current_mode == Mode::NetworkNetworks { + if current_mode == Mode::NetworkNetworks => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -128,7 +128,6 @@ impl Component for NetworkNetworks<'_> { } } } - } Action::DescribeApiResponse => self.describe_selected_entry()?, Action::Tick => self.app_tick()?, Action::Render => self.render_tick()?, diff --git a/openstack_tui/src/components/network/security_group_rules.rs b/openstack_tui/src/components/network/security_group_rules.rs index ab3d89285..c61e9fd39 100644 --- a/openstack_tui/src/components/network/security_group_rules.rs +++ b/openstack_tui/src/components/network/security_group_rules.rs @@ -156,9 +156,9 @@ impl Component for NetworkSecurityGroupRules<'_> { self.set_loading(false); } } - Action::DeleteNetworkSecurityGroupRule => { + Action::DeleteNetworkSecurityGroupRule // only if we are currently in the right mode - if current_mode == Mode::NetworkSecurityGroupRules { + if current_mode == Mode::NetworkSecurityGroupRules => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -173,7 +173,6 @@ impl Component for NetworkSecurityGroupRules<'_> { } } } - } Action::CreateNetworkSecurityGroupRule => { if let Some(command_tx) = self.get_command_tx() { command_tx.send(Action::Edit { diff --git a/openstack_tui/src/components/network/security_groups.rs b/openstack_tui/src/components/network/security_groups.rs index 22583e9d3..3f13b1424 100644 --- a/openstack_tui/src/components/network/security_groups.rs +++ b/openstack_tui/src/components/network/security_groups.rs @@ -112,9 +112,9 @@ impl Component for NetworkSecurityGroups<'_> { NetworkSecurityGroupApiRequest::List(Box::new(self.normalized_filters())), )))); } - Action::ShowNetworkSecurityGroupRules => { + Action::ShowNetworkSecurityGroupRules // only if we are currently in the IdentityGroup mode - if current_mode == Mode::NetworkSecurityGroups { + if current_mode == Mode::NetworkSecurityGroups => { // and have command_tx if let Some(command_tx) = self.get_command_tx() { // and have a selected entry @@ -132,7 +132,6 @@ impl Component for NetworkSecurityGroups<'_> { } } } - } Action::DescribeApiResponse => self.describe_selected_entry()?, Action::Tick => self.app_tick()?, Action::Render => self.render_tick()?, diff --git a/openstack_types/tests/mocked/compute/v2/server/response/list.rs b/openstack_types/tests/mocked/compute/v2/server/response/list.rs index 151aeb76c..671a296fe 100644 --- a/openstack_types/tests/mocked/compute/v2/server/response/list.rs +++ b/openstack_types/tests/mocked/compute/v2/server/response/list.rs @@ -14,7 +14,7 @@ use openstack_sdk::api::compute::v2::server::list::Request; use openstack_sdk::api::{Pagination, QueryAsync, paged}; -use openstack_types::compute::v2::server::response::list::ServerResponse; +use openstack_types::compute::v2::server::response::list_21::ServerResponse; use crate::get_client; diff --git a/openstack_types/tests/mocked/compute/v2/server/response/list_detailed.rs b/openstack_types/tests/mocked/compute/v2/server/response/list_detailed.rs index 47571e9ff..51ec4f86a 100644 --- a/openstack_types/tests/mocked/compute/v2/server/response/list_detailed.rs +++ b/openstack_types/tests/mocked/compute/v2/server/response/list_detailed.rs @@ -14,7 +14,7 @@ use openstack_sdk::api::compute::v2::server::list_detailed::Request; use openstack_sdk::api::{Pagination, QueryAsync, paged}; -use openstack_types::compute::v2::server::response::list_detailed::ServerResponse; +use openstack_types::compute::v2::server::response; use crate::get_client; @@ -22,9 +22,93 @@ use crate::get_client; async fn deserialize() -> Result<(), Box> { let client = get_client("compute"); - let _res: Vec = paged(Request::builder().build()?, Pagination::Limit(10)) + let res: Vec = paged(Request::builder().build()?, Pagination::Limit(10)) .query_async(&client) .await?; + // Need to iterate over all possible candidate schemas + if let Some(val) = res.first() { + assert!( + serde_json::from_value::(val.clone()) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + || serde_json::from_value::( + val.clone(), + ) + .is_ok() + ); + } + Ok(()) } diff --git a/sdk/compute/src/v2/instance_usage_audit_log/get.rs b/sdk/compute/src/v2/instance_usage_audit_log/get.rs index 3d2b3e064..16e53ceed 100644 --- a/sdk/compute/src/v2/instance_usage_audit_log/get.rs +++ b/sdk/compute/src/v2/instance_usage_audit_log/get.rs @@ -92,7 +92,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("instance_usage_audit_log".into()) } /// Returns headers to be set into the request @@ -127,7 +127,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(), + "instance_usage_audit_log" + ); } #[cfg(feature = "sync")] @@ -141,7 +144,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "instance_usage_audit_log": {} })); }); let endpoint = Request::builder().id("id").build().unwrap(); @@ -161,7 +164,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "instance_usage_audit_log": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/instance_usage_audit_log/list.rs b/sdk/compute/src/v2/instance_usage_audit_log/list.rs index 8fdad035e..6563fc243 100644 --- a/sdk/compute/src/v2/instance_usage_audit_log/list.rs +++ b/sdk/compute/src/v2/instance_usage_audit_log/list.rs @@ -86,7 +86,7 @@ impl RestEndpoint for Request { } fn response_key(&self) -> Option> { - None + Some("instance_usage_audit_logs".into()) } /// Returns headers to be set into the request @@ -121,7 +121,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(), + "instance_usage_audit_logs" + ); } #[cfg(feature = "sync")] @@ -135,7 +138,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "instance_usage_audit_logs": {} })); }); let endpoint = Request::builder().build().unwrap(); @@ -155,7 +158,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "instance_usage_audit_logs": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/add_fixed_ip.rs b/sdk/compute/src/v2/server/add_fixed_ip.rs new file mode 100644 index 000000000..3fbae2c23 --- /dev/null +++ b/sdk/compute/src/v2/server/add_fixed_ip.rs @@ -0,0 +1,238 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use derive_builder::Builder; +use http::{HeaderMap, HeaderName, HeaderValue}; + +use openstack_sdk_core::api::rest_endpoint_prelude::*; + +use serde::Deserialize; +use serde::Serialize; +use std::borrow::Cow; + +/// The action to add a fixed ip address to a server. +#[derive(Builder, Debug, Deserialize, Clone, Serialize)] +#[builder(setter(strip_option))] +pub struct AddFixedIp<'a> { + /// The network ID. + #[serde(rename = "networkId")] + #[builder(setter(into))] + pub(crate) network_id: Cow<'a, str>, +} + +#[derive(Builder, Debug, Clone)] +#[builder(setter(strip_option))] +pub struct Request<'a> { + /// The action to add a fixed ip address to a server. + #[builder(setter(into))] + pub(crate) add_fixed_ip: AddFixedIp<'a>, + + /// id parameter for /v2.1/servers/{id}/action API + #[builder(default, setter(into))] + id: Cow<'a, str>, + + #[builder(setter(name = "_headers"), default, private)] + _headers: Option, +} +impl<'a> Request<'a> { + /// Create a builder for the endpoint. + pub fn builder() -> RequestBuilder<'a> { + RequestBuilder::default() + } +} + +impl<'a> RequestBuilder<'a> { + /// Add a single header to the Server. + pub fn header(&mut self, header_name: K, header_value: V) -> &mut Self + where + K: Into, + V: Into, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .insert(header_name.into(), header_value.into()); + self + } + + /// Add multiple headers. + pub fn headers(&mut self, iter: I) -> &mut Self + where + I: Iterator, + T: Into<(Option, HeaderValue)>, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .extend(iter.map(Into::into)); + self + } +} + +impl RestEndpoint for Request<'_> { + fn method(&self) -> http::Method { + http::Method::POST + } + + fn endpoint(&self) -> Cow<'static, str> { + format!("servers/{id}/action", id = self.id.as_ref(),).into() + } + + fn parameters(&self) -> QueryParams<'_> { + QueryParams::default() + } + + fn body(&self) -> Result)>, BodyError> { + let mut params = JsonBodyParams::default(); + + params.push("addFixedIp", serde_json::to_value(&self.add_fixed_ip)?); + + params.into_body() + } + + fn service_type(&self) -> ServiceType { + ServiceType::Compute + } + + fn response_key(&self) -> Option> { + None + } + + /// Returns headers to be set into the request + fn request_headers(&self) -> Option<&HeaderMap> { + self._headers.as_ref() + } + + /// Returns required API version + fn api_version(&self) -> Option { + Some(ApiVersion::new(2, 1)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use http::{HeaderName, HeaderValue}; + use httpmock::MockServer; + #[cfg(feature = "sync")] + use openstack_sdk_core::api::Query; + use openstack_sdk_core::test::client::FakeOpenStackClient; + use openstack_sdk_core::types::ServiceType; + use serde_json::json; + + #[test] + fn test_service_type() { + assert_eq!( + Request::builder() + .add_fixed_ip( + AddFixedIpBuilder::default() + .network_id("foo") + .build() + .unwrap() + ) + .build() + .unwrap() + .service_type(), + ServiceType::Compute + ); + } + + #[test] + fn test_response_key() { + assert!( + Request::builder() + .add_fixed_ip( + AddFixedIpBuilder::default() + .network_id("foo") + .build() + .unwrap() + ) + .build() + .unwrap() + .response_key() + .is_none() + ) + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)); + + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .add_fixed_ip( + AddFixedIpBuilder::default() + .network_id("foo") + .build() + .unwrap(), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint_headers() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)) + .header("foo", "bar") + .header("not_foo", "not_bar"); + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .add_fixed_ip( + AddFixedIpBuilder::default() + .network_id("foo") + .build() + .unwrap(), + ) + .headers( + [( + Some(HeaderName::from_static("foo")), + HeaderValue::from_static("bar"), + )] + .into_iter(), + ) + .header( + HeaderName::from_static("not_foo"), + HeaderValue::from_static("not_bar"), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } +} diff --git a/sdk/compute/src/v2/server/add_floating_ip.rs b/sdk/compute/src/v2/server/add_floating_ip.rs new file mode 100644 index 000000000..e4e8f0302 --- /dev/null +++ b/sdk/compute/src/v2/server/add_floating_ip.rs @@ -0,0 +1,250 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use derive_builder::Builder; +use http::{HeaderMap, HeaderName, HeaderValue}; + +use openstack_sdk_core::api::rest_endpoint_prelude::*; + +use serde::Deserialize; +use serde::Serialize; +use std::borrow::Cow; + +/// The action. Contains required floating IP `address` and optional +/// `fixed_address`. +#[derive(Builder, Debug, Deserialize, Clone, Serialize)] +#[builder(setter(strip_option))] +pub struct AddFloatingIp<'a> { + /// The fixed IP address with which you want to associate the floating IP + /// address. + #[serde()] + #[builder(setter(into))] + pub(crate) address: Cow<'a, str>, + + /// The fixed IP address with which you want to associate the floating IP + /// address. + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(default, setter(into))] + pub(crate) fixed_address: Option>, +} + +#[derive(Builder, Debug, Clone)] +#[builder(setter(strip_option))] +pub struct Request<'a> { + /// The action. Contains required floating IP `address` and optional + /// `fixed_address`. + #[builder(setter(into))] + pub(crate) add_floating_ip: AddFloatingIp<'a>, + + /// id parameter for /v2.1/servers/{id}/action API + #[builder(default, setter(into))] + id: Cow<'a, str>, + + #[builder(setter(name = "_headers"), default, private)] + _headers: Option, +} +impl<'a> Request<'a> { + /// Create a builder for the endpoint. + pub fn builder() -> RequestBuilder<'a> { + RequestBuilder::default() + } +} + +impl<'a> RequestBuilder<'a> { + /// Add a single header to the Server. + pub fn header(&mut self, header_name: K, header_value: V) -> &mut Self + where + K: Into, + V: Into, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .insert(header_name.into(), header_value.into()); + self + } + + /// Add multiple headers. + pub fn headers(&mut self, iter: I) -> &mut Self + where + I: Iterator, + T: Into<(Option, HeaderValue)>, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .extend(iter.map(Into::into)); + self + } +} + +impl RestEndpoint for Request<'_> { + fn method(&self) -> http::Method { + http::Method::POST + } + + fn endpoint(&self) -> Cow<'static, str> { + format!("servers/{id}/action", id = self.id.as_ref(),).into() + } + + fn parameters(&self) -> QueryParams<'_> { + QueryParams::default() + } + + fn body(&self) -> Result)>, BodyError> { + let mut params = JsonBodyParams::default(); + + params.push( + "addFloatingIp", + serde_json::to_value(&self.add_floating_ip)?, + ); + + params.into_body() + } + + fn service_type(&self) -> ServiceType { + ServiceType::Compute + } + + fn response_key(&self) -> Option> { + None + } + + /// Returns headers to be set into the request + fn request_headers(&self) -> Option<&HeaderMap> { + self._headers.as_ref() + } + + /// Returns required API version + fn api_version(&self) -> Option { + Some(ApiVersion::new(2, 1)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use http::{HeaderName, HeaderValue}; + use httpmock::MockServer; + #[cfg(feature = "sync")] + use openstack_sdk_core::api::Query; + use openstack_sdk_core::test::client::FakeOpenStackClient; + use openstack_sdk_core::types::ServiceType; + use serde_json::json; + + #[test] + fn test_service_type() { + assert_eq!( + Request::builder() + .add_floating_ip( + AddFloatingIpBuilder::default() + .address("foo") + .build() + .unwrap() + ) + .build() + .unwrap() + .service_type(), + ServiceType::Compute + ); + } + + #[test] + fn test_response_key() { + assert!( + Request::builder() + .add_floating_ip( + AddFloatingIpBuilder::default() + .address("foo") + .build() + .unwrap() + ) + .build() + .unwrap() + .response_key() + .is_none() + ) + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)); + + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .add_floating_ip( + AddFloatingIpBuilder::default() + .address("foo") + .build() + .unwrap(), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint_headers() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)) + .header("foo", "bar") + .header("not_foo", "not_bar"); + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .add_floating_ip( + AddFloatingIpBuilder::default() + .address("foo") + .build() + .unwrap(), + ) + .headers( + [( + Some(HeaderName::from_static("foo")), + HeaderValue::from_static("bar"), + )] + .into_iter(), + ) + .header( + HeaderName::from_static("not_foo"), + HeaderValue::from_static("not_bar"), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } +} diff --git a/sdk/compute/src/v2/server/migration/force_complete.rs b/sdk/compute/src/v2/server/migration/force_complete.rs new file mode 100644 index 000000000..0650b2e03 --- /dev/null +++ b/sdk/compute/src/v2/server/migration/force_complete.rs @@ -0,0 +1,209 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use derive_builder::Builder; +use http::{HeaderMap, HeaderName, HeaderValue}; + +use openstack_sdk_core::api::rest_endpoint_prelude::*; + +use serde_json::Value; +use std::borrow::Cow; + +#[derive(Builder, Debug, Clone)] +#[builder(setter(strip_option))] +pub struct Request<'a> { + /// id parameter for /v2.1/servers/{server_id}/migrations/{id}/action API + #[builder(default, setter(into))] + id: Cow<'a, str>, + + /// server_id parameter for + /// /v2.1/servers/{server_id}/migrations/{id}/action API + #[builder(default, setter(into))] + server_id: Cow<'a, str>, + + #[builder(setter(name = "_headers"), default, private)] + _headers: Option, +} +impl<'a> Request<'a> { + /// Create a builder for the endpoint. + pub fn builder() -> RequestBuilder<'a> { + RequestBuilder::default() + } +} + +impl<'a> RequestBuilder<'a> { + /// Add a single header to the Migration. + pub fn header(&mut self, header_name: K, header_value: V) -> &mut Self + where + K: Into, + V: Into, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .insert(header_name.into(), header_value.into()); + self + } + + /// Add multiple headers. + pub fn headers(&mut self, iter: I) -> &mut Self + where + I: Iterator, + T: Into<(Option, HeaderValue)>, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .extend(iter.map(Into::into)); + self + } +} + +impl RestEndpoint for Request<'_> { + fn method(&self) -> http::Method { + http::Method::POST + } + + fn endpoint(&self) -> Cow<'static, str> { + format!( + "servers/{server_id}/migrations/{id}/action", + id = self.id.as_ref(), + server_id = self.server_id.as_ref(), + ) + .into() + } + + fn parameters(&self) -> QueryParams<'_> { + QueryParams::default() + } + + fn body(&self) -> Result)>, BodyError> { + let mut params = JsonBodyParams::default(); + + params.push("force_complete", Value::Null); + + params.into_body() + } + + fn service_type(&self) -> ServiceType { + ServiceType::Compute + } + + fn response_key(&self) -> Option> { + None + } + + /// Returns headers to be set into the request + fn request_headers(&self) -> Option<&HeaderMap> { + self._headers.as_ref() + } + + /// Returns required API version + fn api_version(&self) -> Option { + Some(ApiVersion::new(2, 1)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use http::{HeaderName, HeaderValue}; + use httpmock::MockServer; + #[cfg(feature = "sync")] + use openstack_sdk_core::api::Query; + use openstack_sdk_core::test::client::FakeOpenStackClient; + use openstack_sdk_core::types::ServiceType; + use serde_json::json; + + #[test] + fn test_service_type() { + assert_eq!( + Request::builder().build().unwrap().service_type(), + ServiceType::Compute + ); + } + + #[test] + fn test_response_key() { + assert!(Request::builder().build().unwrap().response_key().is_none()) + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST).path(format!( + "/servers/{server_id}/migrations/{id}/action", + id = "id", + server_id = "server_id", + )); + + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .server_id("server_id") + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint_headers() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!( + "/servers/{server_id}/migrations/{id}/action", + id = "id", + server_id = "server_id", + )) + .header("foo", "bar") + .header("not_foo", "not_bar"); + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .server_id("server_id") + .headers( + [( + Some(HeaderName::from_static("foo")), + HeaderValue::from_static("bar"), + )] + .into_iter(), + ) + .header( + HeaderName::from_static("not_foo"), + HeaderValue::from_static("not_bar"), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } +} diff --git a/sdk/compute/src/v2/server/os_get_rdpconsole.rs b/sdk/compute/src/v2/server/os_get_rdpconsole.rs index df5eb33d7..111d7813e 100644 --- a/sdk/compute/src/v2/server/os_get_rdpconsole.rs +++ b/sdk/compute/src/v2/server/os_get_rdpconsole.rs @@ -94,7 +94,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("console".into()) } /// Returns headers to be set into the request @@ -129,7 +129,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(), + "console" + ); } #[cfg(feature = "sync")] @@ -143,7 +146,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder().id("id").build().unwrap(); @@ -163,7 +166,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/os_get_serial_console.rs b/sdk/compute/src/v2/server/os_get_serial_console.rs index dd32fe2d1..8caf75f8a 100644 --- a/sdk/compute/src/v2/server/os_get_serial_console.rs +++ b/sdk/compute/src/v2/server/os_get_serial_console.rs @@ -1,4 +1,3 @@ -// // 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 @@ -12,20 +11,42 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. use derive_builder::Builder; use http::{HeaderMap, HeaderName, HeaderValue}; -use crate::api::rest_endpoint_prelude::*; -use serde::Serialize; +use openstack_sdk_core::api::rest_endpoint_prelude::*; use serde::Deserialize; -use serde_json::Value; +use serde::Serialize; use std::borrow::Cow; +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Type { + #[serde(rename = "serial")] + Serial, +} + +/// The action. +#[derive(Builder, Debug, Deserialize, Clone, Serialize)] +#[builder(setter(strip_option))] +pub struct OsGetSerialConsole { + /// The type of serial console. The only valid value is `serial`. + #[serde(rename = "type")] + #[builder()] + pub(crate) _type: Type, +} + #[derive(Builder, Debug, Clone)] #[builder(setter(strip_option))] pub struct Request<'a> { + /// The action. + #[builder(setter(into))] + pub(crate) os_get_serial_console: OsGetSerialConsole, + /// id parameter for /v2.1/servers/{id}/action API #[builder(default, setter(into))] id: Cow<'a, str>, @@ -42,12 +63,15 @@ impl<'a> Request<'a> { impl<'a> RequestBuilder<'a> { /// Add a single header to the Server. - pub fn header(&mut self, header_name: &'static str, header_value: &'static str) -> &mut Self -where { + pub fn header(&mut self, header_name: K, header_value: V) -> &mut Self + where + K: Into, + V: Into, + { self._headers .get_or_insert(None) .get_or_insert_with(HeaderMap::new) - .insert(header_name, HeaderValue::from_static(header_value)); + .insert(header_name.into(), header_value.into()); self } @@ -65,23 +89,26 @@ where { } } -impl<'a> RestEndpoint for Request<'a> { +impl RestEndpoint for Request<'_> { fn method(&self) -> http::Method { http::Method::POST } fn endpoint(&self) -> Cow<'static, str> { - format!("v2.1/servers/{id}/action", id = self.id.as_ref(),).into() + format!("servers/{id}/action", id = self.id.as_ref(),).into() } - fn parameters(&self) -> QueryParams { + fn parameters(&self) -> QueryParams<'_> { QueryParams::default() } fn body(&self) -> Result)>, BodyError> { let mut params = JsonBodyParams::default(); - params.push("os-getSerialConsole", Value::Null); + params.push( + "os-getSerialConsole", + serde_json::to_value(&self.os_get_serial_console)?, + ); params.into_body() } @@ -91,80 +118,128 @@ impl<'a> RestEndpoint for Request<'a> { } fn response_key(&self) -> Option> { - None + Some("console".into()) } /// Returns headers to be set into the request fn request_headers(&self) -> Option<&HeaderMap> { self._headers.as_ref() } + + /// Returns required API version + fn api_version(&self) -> Option { + Some(ApiVersion::new(2, 1)) + } } #[cfg(test)] mod tests { use super::*; - use crate::api::{self, Query, RawQuery}; - use openstack_sdk_core::test::client::MockServerClient; - use crate::types::ServiceType; use http::{HeaderName, HeaderValue}; - use serde::Deserialize; - use serde::Serialize; + use httpmock::MockServer; + #[cfg(feature = "sync")] + use openstack_sdk_core::api::Query; + use openstack_sdk_core::test::client::FakeOpenStackClient; + use openstack_sdk_core::types::ServiceType; use serde_json::json; #[test] fn test_service_type() { assert_eq!( - Request::builder().build().unwrap().service_type(), + Request::builder() + .os_get_serial_console( + OsGetSerialConsoleBuilder::default() + ._type(Type::Serial) + .build() + .unwrap() + ) + .build() + .unwrap() + .service_type(), ServiceType::Compute ); } #[test] fn test_response_key() { - assert!(Request::builder().build().unwrap().response_key().is_none()) + assert_eq!( + Request::builder() + .os_get_serial_console( + OsGetSerialConsoleBuilder::default() + ._type(Type::Serial) + .build() + .unwrap() + ) + .build() + .unwrap() + .response_key() + .unwrap(), + "console" + ); } + #[cfg(feature = "sync")] #[test] fn endpoint() { - let client = MockServerClient::new(); - let mock = client.server.mock(|when, then| { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { when.method(httpmock::Method::POST) - .path(format!("/v2.1/servers/{id}/action", id = "id",)); + .path(format!("/servers/{id}/action", id = "id",)); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); - let endpoint = Request::builder().id("id").build().unwrap(); + let endpoint = Request::builder() + .id("id") + .os_get_serial_console( + OsGetSerialConsoleBuilder::default() + ._type(Type::Serial) + .build() + .unwrap(), + ) + .build() + .unwrap(); let _: serde_json::Value = endpoint.query(&client).unwrap(); mock.assert(); } + #[cfg(feature = "sync")] #[test] fn endpoint_headers() { - let client = MockServerClient::new(); - let mock = client.server.mock(|when, then| { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { when.method(httpmock::Method::POST) - .path(format!("/v2.1/servers/{id}/action", id = "id",)) + .path(format!("/servers/{id}/action", id = "id",)) .header("foo", "bar") .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() .id("id") + .os_get_serial_console( + OsGetSerialConsoleBuilder::default() + ._type(Type::Serial) + .build() + .unwrap(), + ) .headers( [( Some(HeaderName::from_static("foo")), HeaderValue::from_static("bar"), )] - .iter() - .cloned(), + .into_iter(), + ) + .header( + HeaderName::from_static("not_foo"), + HeaderValue::from_static("not_bar"), ) - .header("not_foo", "not_bar") .build() .unwrap(); let _: serde_json::Value = endpoint.query(&client).unwrap(); diff --git a/sdk/compute/src/v2/server/os_get_serial_console_21.rs b/sdk/compute/src/v2/server/os_get_serial_console_21.rs index 740dde309..8caf75f8a 100644 --- a/sdk/compute/src/v2/server/os_get_serial_console_21.rs +++ b/sdk/compute/src/v2/server/os_get_serial_console_21.rs @@ -118,7 +118,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("console".into()) } /// Returns headers to be set into the request @@ -162,7 +162,7 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .os_get_serial_console( OsGetSerialConsoleBuilder::default() @@ -173,8 +173,9 @@ mod tests { .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "console" + ); } #[cfg(feature = "sync")] @@ -188,7 +189,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() @@ -217,7 +218,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/os_get_spiceconsole.rs b/sdk/compute/src/v2/server/os_get_spiceconsole.rs index 33e195fc7..0a5a0809d 100644 --- a/sdk/compute/src/v2/server/os_get_spiceconsole.rs +++ b/sdk/compute/src/v2/server/os_get_spiceconsole.rs @@ -1,4 +1,3 @@ -// // 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 @@ -12,20 +11,42 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. use derive_builder::Builder; use http::{HeaderMap, HeaderName, HeaderValue}; -use crate::api::rest_endpoint_prelude::*; -use serde::Serialize; +use openstack_sdk_core::api::rest_endpoint_prelude::*; use serde::Deserialize; -use serde_json::Value; +use serde::Serialize; use std::borrow::Cow; +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Type { + #[serde(rename = "spice-html5")] + SpiceHtml5, +} + +/// The action. +#[derive(Builder, Debug, Deserialize, Clone, Serialize)] +#[builder(setter(strip_option))] +pub struct OsGetSpiceconsole { + /// The type of SPICE console. The only valid value is `spice-html5`. + #[serde(rename = "type")] + #[builder()] + pub(crate) _type: Type, +} + #[derive(Builder, Debug, Clone)] #[builder(setter(strip_option))] pub struct Request<'a> { + /// The action. + #[builder(setter(into))] + pub(crate) os_get_spiceconsole: OsGetSpiceconsole, + /// id parameter for /v2.1/servers/{id}/action API #[builder(default, setter(into))] id: Cow<'a, str>, @@ -42,12 +63,15 @@ impl<'a> Request<'a> { impl<'a> RequestBuilder<'a> { /// Add a single header to the Server. - pub fn header(&mut self, header_name: &'static str, header_value: &'static str) -> &mut Self -where { + pub fn header(&mut self, header_name: K, header_value: V) -> &mut Self + where + K: Into, + V: Into, + { self._headers .get_or_insert(None) .get_or_insert_with(HeaderMap::new) - .insert(header_name, HeaderValue::from_static(header_value)); + .insert(header_name.into(), header_value.into()); self } @@ -65,23 +89,26 @@ where { } } -impl<'a> RestEndpoint for Request<'a> { +impl RestEndpoint for Request<'_> { fn method(&self) -> http::Method { http::Method::POST } fn endpoint(&self) -> Cow<'static, str> { - format!("v2.1/servers/{id}/action", id = self.id.as_ref(),).into() + format!("servers/{id}/action", id = self.id.as_ref(),).into() } - fn parameters(&self) -> QueryParams { + fn parameters(&self) -> QueryParams<'_> { QueryParams::default() } fn body(&self) -> Result)>, BodyError> { let mut params = JsonBodyParams::default(); - params.push("os-getSPICEConsole", Value::Null); + params.push( + "os-getSPICEConsole", + serde_json::to_value(&self.os_get_spiceconsole)?, + ); params.into_body() } @@ -91,80 +118,128 @@ impl<'a> RestEndpoint for Request<'a> { } fn response_key(&self) -> Option> { - None + Some("console".into()) } /// Returns headers to be set into the request fn request_headers(&self) -> Option<&HeaderMap> { self._headers.as_ref() } + + /// Returns required API version + fn api_version(&self) -> Option { + Some(ApiVersion::new(2, 1)) + } } #[cfg(test)] mod tests { use super::*; - use crate::api::{self, Query, RawQuery}; - use openstack_sdk_core::test::client::MockServerClient; - use crate::types::ServiceType; use http::{HeaderName, HeaderValue}; - use serde::Deserialize; - use serde::Serialize; + use httpmock::MockServer; + #[cfg(feature = "sync")] + use openstack_sdk_core::api::Query; + use openstack_sdk_core::test::client::FakeOpenStackClient; + use openstack_sdk_core::types::ServiceType; use serde_json::json; #[test] fn test_service_type() { assert_eq!( - Request::builder().build().unwrap().service_type(), + Request::builder() + .os_get_spiceconsole( + OsGetSpiceconsoleBuilder::default() + ._type(Type::SpiceHtml5) + .build() + .unwrap() + ) + .build() + .unwrap() + .service_type(), ServiceType::Compute ); } #[test] fn test_response_key() { - assert!(Request::builder().build().unwrap().response_key().is_none()) + assert_eq!( + Request::builder() + .os_get_spiceconsole( + OsGetSpiceconsoleBuilder::default() + ._type(Type::SpiceHtml5) + .build() + .unwrap() + ) + .build() + .unwrap() + .response_key() + .unwrap(), + "console" + ); } + #[cfg(feature = "sync")] #[test] fn endpoint() { - let client = MockServerClient::new(); - let mock = client.server.mock(|when, then| { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { when.method(httpmock::Method::POST) - .path(format!("/v2.1/servers/{id}/action", id = "id",)); + .path(format!("/servers/{id}/action", id = "id",)); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); - let endpoint = Request::builder().id("id").build().unwrap(); + let endpoint = Request::builder() + .id("id") + .os_get_spiceconsole( + OsGetSpiceconsoleBuilder::default() + ._type(Type::SpiceHtml5) + .build() + .unwrap(), + ) + .build() + .unwrap(); let _: serde_json::Value = endpoint.query(&client).unwrap(); mock.assert(); } + #[cfg(feature = "sync")] #[test] fn endpoint_headers() { - let client = MockServerClient::new(); - let mock = client.server.mock(|when, then| { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { when.method(httpmock::Method::POST) - .path(format!("/v2.1/servers/{id}/action", id = "id",)) + .path(format!("/servers/{id}/action", id = "id",)) .header("foo", "bar") .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() .id("id") + .os_get_spiceconsole( + OsGetSpiceconsoleBuilder::default() + ._type(Type::SpiceHtml5) + .build() + .unwrap(), + ) .headers( [( Some(HeaderName::from_static("foo")), HeaderValue::from_static("bar"), )] - .iter() - .cloned(), + .into_iter(), + ) + .header( + HeaderName::from_static("not_foo"), + HeaderValue::from_static("not_bar"), ) - .header("not_foo", "not_bar") .build() .unwrap(); let _: serde_json::Value = endpoint.query(&client).unwrap(); diff --git a/sdk/compute/src/v2/server/os_get_spiceconsole_21.rs b/sdk/compute/src/v2/server/os_get_spiceconsole_21.rs index bb6d32163..0a5a0809d 100644 --- a/sdk/compute/src/v2/server/os_get_spiceconsole_21.rs +++ b/sdk/compute/src/v2/server/os_get_spiceconsole_21.rs @@ -118,7 +118,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("console".into()) } /// Returns headers to be set into the request @@ -162,7 +162,7 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .os_get_spiceconsole( OsGetSpiceconsoleBuilder::default() @@ -173,8 +173,9 @@ mod tests { .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "console" + ); } #[cfg(feature = "sync")] @@ -188,7 +189,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() @@ -217,7 +218,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/os_get_vncconsole.rs b/sdk/compute/src/v2/server/os_get_vncconsole.rs index 71c659f67..86c130ed6 100644 --- a/sdk/compute/src/v2/server/os_get_vncconsole.rs +++ b/sdk/compute/src/v2/server/os_get_vncconsole.rs @@ -1,4 +1,3 @@ -// // 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 @@ -12,20 +11,44 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. use derive_builder::Builder; use http::{HeaderMap, HeaderName, HeaderValue}; -use crate::api::rest_endpoint_prelude::*; -use serde::Serialize; +use openstack_sdk_core::api::rest_endpoint_prelude::*; use serde::Deserialize; -use serde_json::Value; +use serde::Serialize; use std::borrow::Cow; +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Type { + #[serde(rename = "novnc")] + Novnc, + #[serde(rename = "xvpvnc")] + Xvpvnc, +} + +/// The action. +#[derive(Builder, Debug, Deserialize, Clone, Serialize)] +#[builder(setter(strip_option))] +pub struct OsGetVncconsole { + /// The type of VNC console. The only valid value is `novnc`. + #[serde(rename = "type")] + #[builder()] + pub(crate) _type: Type, +} + #[derive(Builder, Debug, Clone)] #[builder(setter(strip_option))] pub struct Request<'a> { + /// The action. + #[builder(setter(into))] + pub(crate) os_get_vncconsole: OsGetVncconsole, + /// id parameter for /v2.1/servers/{id}/action API #[builder(default, setter(into))] id: Cow<'a, str>, @@ -42,12 +65,15 @@ impl<'a> Request<'a> { impl<'a> RequestBuilder<'a> { /// Add a single header to the Server. - pub fn header(&mut self, header_name: &'static str, header_value: &'static str) -> &mut Self -where { + pub fn header(&mut self, header_name: K, header_value: V) -> &mut Self + where + K: Into, + V: Into, + { self._headers .get_or_insert(None) .get_or_insert_with(HeaderMap::new) - .insert(header_name, HeaderValue::from_static(header_value)); + .insert(header_name.into(), header_value.into()); self } @@ -65,23 +91,26 @@ where { } } -impl<'a> RestEndpoint for Request<'a> { +impl RestEndpoint for Request<'_> { fn method(&self) -> http::Method { http::Method::POST } fn endpoint(&self) -> Cow<'static, str> { - format!("v2.1/servers/{id}/action", id = self.id.as_ref(),).into() + format!("servers/{id}/action", id = self.id.as_ref(),).into() } - fn parameters(&self) -> QueryParams { + fn parameters(&self) -> QueryParams<'_> { QueryParams::default() } fn body(&self) -> Result)>, BodyError> { let mut params = JsonBodyParams::default(); - params.push("os-getVNCConsole", Value::Null); + params.push( + "os-getVNCConsole", + serde_json::to_value(&self.os_get_vncconsole)?, + ); params.into_body() } @@ -91,80 +120,128 @@ impl<'a> RestEndpoint for Request<'a> { } fn response_key(&self) -> Option> { - None + Some("console".into()) } /// Returns headers to be set into the request fn request_headers(&self) -> Option<&HeaderMap> { self._headers.as_ref() } + + /// Returns required API version + fn api_version(&self) -> Option { + Some(ApiVersion::new(2, 1)) + } } #[cfg(test)] mod tests { use super::*; - use crate::api::{self, Query, RawQuery}; - use openstack_sdk_core::test::client::MockServerClient; - use crate::types::ServiceType; use http::{HeaderName, HeaderValue}; - use serde::Deserialize; - use serde::Serialize; + use httpmock::MockServer; + #[cfg(feature = "sync")] + use openstack_sdk_core::api::Query; + use openstack_sdk_core::test::client::FakeOpenStackClient; + use openstack_sdk_core::types::ServiceType; use serde_json::json; #[test] fn test_service_type() { assert_eq!( - Request::builder().build().unwrap().service_type(), + Request::builder() + .os_get_vncconsole( + OsGetVncconsoleBuilder::default() + ._type(Type::Novnc) + .build() + .unwrap() + ) + .build() + .unwrap() + .service_type(), ServiceType::Compute ); } #[test] fn test_response_key() { - assert!(Request::builder().build().unwrap().response_key().is_none()) + assert_eq!( + Request::builder() + .os_get_vncconsole( + OsGetVncconsoleBuilder::default() + ._type(Type::Novnc) + .build() + .unwrap() + ) + .build() + .unwrap() + .response_key() + .unwrap(), + "console" + ); } + #[cfg(feature = "sync")] #[test] fn endpoint() { - let client = MockServerClient::new(); - let mock = client.server.mock(|when, then| { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { when.method(httpmock::Method::POST) - .path(format!("/v2.1/servers/{id}/action", id = "id",)); + .path(format!("/servers/{id}/action", id = "id",)); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); - let endpoint = Request::builder().id("id").build().unwrap(); + let endpoint = Request::builder() + .id("id") + .os_get_vncconsole( + OsGetVncconsoleBuilder::default() + ._type(Type::Novnc) + .build() + .unwrap(), + ) + .build() + .unwrap(); let _: serde_json::Value = endpoint.query(&client).unwrap(); mock.assert(); } + #[cfg(feature = "sync")] #[test] fn endpoint_headers() { - let client = MockServerClient::new(); - let mock = client.server.mock(|when, then| { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { when.method(httpmock::Method::POST) - .path(format!("/v2.1/servers/{id}/action", id = "id",)) + .path(format!("/servers/{id}/action", id = "id",)) .header("foo", "bar") .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() .id("id") + .os_get_vncconsole( + OsGetVncconsoleBuilder::default() + ._type(Type::Novnc) + .build() + .unwrap(), + ) .headers( [( Some(HeaderName::from_static("foo")), HeaderValue::from_static("bar"), )] - .iter() - .cloned(), + .into_iter(), + ) + .header( + HeaderName::from_static("not_foo"), + HeaderValue::from_static("not_bar"), ) - .header("not_foo", "not_bar") .build() .unwrap(); let _: serde_json::Value = endpoint.query(&client).unwrap(); diff --git a/sdk/compute/src/v2/server/os_get_vncconsole_21.rs b/sdk/compute/src/v2/server/os_get_vncconsole_21.rs index 362a25dce..86c130ed6 100644 --- a/sdk/compute/src/v2/server/os_get_vncconsole_21.rs +++ b/sdk/compute/src/v2/server/os_get_vncconsole_21.rs @@ -120,7 +120,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("console".into()) } /// Returns headers to be set into the request @@ -164,7 +164,7 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .os_get_vncconsole( OsGetVncconsoleBuilder::default() @@ -175,8 +175,9 @@ mod tests { .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "console" + ); } #[cfg(feature = "sync")] @@ -190,7 +191,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() @@ -219,7 +220,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "console": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/rebuild_20.rs b/sdk/compute/src/v2/server/rebuild_20.rs index 48a8d0446..f72c465ac 100644 --- a/sdk/compute/src/v2/server/rebuild_20.rs +++ b/sdk/compute/src/v2/server/rebuild_20.rs @@ -224,7 +224,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("server".into()) } /// Returns headers to be set into the request @@ -263,14 +263,15 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .rebuild(RebuildBuilder::default().image_ref("foo").build().unwrap()) .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "server" + ); } #[cfg(feature = "sync")] @@ -284,7 +285,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() @@ -308,7 +309,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/rebuild_21.rs b/sdk/compute/src/v2/server/rebuild_21.rs index 8014f67c6..e86516e83 100644 --- a/sdk/compute/src/v2/server/rebuild_21.rs +++ b/sdk/compute/src/v2/server/rebuild_21.rs @@ -224,7 +224,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("server".into()) } /// Returns headers to be set into the request @@ -263,14 +263,15 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .rebuild(RebuildBuilder::default().image_ref("foo").build().unwrap()) .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "server" + ); } #[cfg(feature = "sync")] @@ -284,7 +285,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() @@ -308,7 +309,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/rebuild_219.rs b/sdk/compute/src/v2/server/rebuild_219.rs index 2a8976009..78795562e 100644 --- a/sdk/compute/src/v2/server/rebuild_219.rs +++ b/sdk/compute/src/v2/server/rebuild_219.rs @@ -232,7 +232,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("server".into()) } /// Returns headers to be set into the request @@ -271,14 +271,15 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .rebuild(RebuildBuilder::default().image_ref("foo").build().unwrap()) .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "server" + ); } #[cfg(feature = "sync")] @@ -292,7 +293,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() @@ -316,7 +317,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/rebuild_254.rs b/sdk/compute/src/v2/server/rebuild_254.rs index 798a4f5c5..e0a92bd18 100644 --- a/sdk/compute/src/v2/server/rebuild_254.rs +++ b/sdk/compute/src/v2/server/rebuild_254.rs @@ -248,7 +248,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("server".into()) } /// Returns headers to be set into the request @@ -287,14 +287,15 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .rebuild(RebuildBuilder::default().image_ref("foo").build().unwrap()) .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "server" + ); } #[cfg(feature = "sync")] @@ -308,7 +309,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() @@ -332,7 +333,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/rebuild_257.rs b/sdk/compute/src/v2/server/rebuild_257.rs index d3ce591dc..724f97437 100644 --- a/sdk/compute/src/v2/server/rebuild_257.rs +++ b/sdk/compute/src/v2/server/rebuild_257.rs @@ -235,7 +235,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("server".into()) } /// Returns headers to be set into the request @@ -274,14 +274,15 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .rebuild(RebuildBuilder::default().image_ref("foo").build().unwrap()) .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "server" + ); } #[cfg(feature = "sync")] @@ -295,7 +296,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() @@ -319,7 +320,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/rebuild_263.rs b/sdk/compute/src/v2/server/rebuild_263.rs index 5e403f96c..27643cfba 100644 --- a/sdk/compute/src/v2/server/rebuild_263.rs +++ b/sdk/compute/src/v2/server/rebuild_263.rs @@ -249,7 +249,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("server".into()) } /// Returns headers to be set into the request @@ -288,14 +288,15 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .rebuild(RebuildBuilder::default().image_ref("foo").build().unwrap()) .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "server" + ); } #[cfg(feature = "sync")] @@ -309,7 +310,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() @@ -333,7 +334,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/rebuild_290.rs b/sdk/compute/src/v2/server/rebuild_290.rs index 5fc45d98a..2675ec9ee 100644 --- a/sdk/compute/src/v2/server/rebuild_290.rs +++ b/sdk/compute/src/v2/server/rebuild_290.rs @@ -265,7 +265,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("server".into()) } /// Returns headers to be set into the request @@ -304,14 +304,15 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .rebuild(RebuildBuilder::default().image_ref("foo").build().unwrap()) .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "server" + ); } #[cfg(feature = "sync")] @@ -325,7 +326,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() @@ -349,7 +350,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/rebuild_294.rs b/sdk/compute/src/v2/server/rebuild_294.rs index 6780777fd..aeeda77b7 100644 --- a/sdk/compute/src/v2/server/rebuild_294.rs +++ b/sdk/compute/src/v2/server/rebuild_294.rs @@ -265,7 +265,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("server".into()) } /// Returns headers to be set into the request @@ -304,14 +304,15 @@ mod tests { #[test] fn test_response_key() { - assert!( + assert_eq!( Request::builder() .rebuild(RebuildBuilder::default().image_ref("foo").build().unwrap()) .build() .unwrap() .response_key() - .is_none() - ) + .unwrap(), + "server" + ); } #[cfg(feature = "sync")] @@ -325,7 +326,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() @@ -349,7 +350,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "server": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/server/remove_fixed_ip.rs b/sdk/compute/src/v2/server/remove_fixed_ip.rs new file mode 100644 index 000000000..95920345b --- /dev/null +++ b/sdk/compute/src/v2/server/remove_fixed_ip.rs @@ -0,0 +1,241 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use derive_builder::Builder; +use http::{HeaderMap, HeaderName, HeaderValue}; + +use openstack_sdk_core::api::rest_endpoint_prelude::*; + +use serde::Deserialize; +use serde::Serialize; +use std::borrow::Cow; + +/// The action to remove a fixed ip address from a server. +#[derive(Builder, Debug, Deserialize, Clone, Serialize)] +#[builder(setter(strip_option))] +pub struct RemoveFixedIp<'a> { + /// The IP address. + #[serde()] + #[builder(setter(into))] + pub(crate) address: Cow<'a, str>, +} + +#[derive(Builder, Debug, Clone)] +#[builder(setter(strip_option))] +pub struct Request<'a> { + /// The action to remove a fixed ip address from a server. + #[builder(setter(into))] + pub(crate) remove_fixed_ip: RemoveFixedIp<'a>, + + /// id parameter for /v2.1/servers/{id}/action API + #[builder(default, setter(into))] + id: Cow<'a, str>, + + #[builder(setter(name = "_headers"), default, private)] + _headers: Option, +} +impl<'a> Request<'a> { + /// Create a builder for the endpoint. + pub fn builder() -> RequestBuilder<'a> { + RequestBuilder::default() + } +} + +impl<'a> RequestBuilder<'a> { + /// Add a single header to the Server. + pub fn header(&mut self, header_name: K, header_value: V) -> &mut Self + where + K: Into, + V: Into, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .insert(header_name.into(), header_value.into()); + self + } + + /// Add multiple headers. + pub fn headers(&mut self, iter: I) -> &mut Self + where + I: Iterator, + T: Into<(Option, HeaderValue)>, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .extend(iter.map(Into::into)); + self + } +} + +impl RestEndpoint for Request<'_> { + fn method(&self) -> http::Method { + http::Method::POST + } + + fn endpoint(&self) -> Cow<'static, str> { + format!("servers/{id}/action", id = self.id.as_ref(),).into() + } + + fn parameters(&self) -> QueryParams<'_> { + QueryParams::default() + } + + fn body(&self) -> Result)>, BodyError> { + let mut params = JsonBodyParams::default(); + + params.push( + "removeFixedIp", + serde_json::to_value(&self.remove_fixed_ip)?, + ); + + params.into_body() + } + + fn service_type(&self) -> ServiceType { + ServiceType::Compute + } + + fn response_key(&self) -> Option> { + None + } + + /// Returns headers to be set into the request + fn request_headers(&self) -> Option<&HeaderMap> { + self._headers.as_ref() + } + + /// Returns required API version + fn api_version(&self) -> Option { + Some(ApiVersion::new(2, 1)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use http::{HeaderName, HeaderValue}; + use httpmock::MockServer; + #[cfg(feature = "sync")] + use openstack_sdk_core::api::Query; + use openstack_sdk_core::test::client::FakeOpenStackClient; + use openstack_sdk_core::types::ServiceType; + use serde_json::json; + + #[test] + fn test_service_type() { + assert_eq!( + Request::builder() + .remove_fixed_ip( + RemoveFixedIpBuilder::default() + .address("foo") + .build() + .unwrap() + ) + .build() + .unwrap() + .service_type(), + ServiceType::Compute + ); + } + + #[test] + fn test_response_key() { + assert!( + Request::builder() + .remove_fixed_ip( + RemoveFixedIpBuilder::default() + .address("foo") + .build() + .unwrap() + ) + .build() + .unwrap() + .response_key() + .is_none() + ) + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)); + + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .remove_fixed_ip( + RemoveFixedIpBuilder::default() + .address("foo") + .build() + .unwrap(), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint_headers() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)) + .header("foo", "bar") + .header("not_foo", "not_bar"); + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .remove_fixed_ip( + RemoveFixedIpBuilder::default() + .address("foo") + .build() + .unwrap(), + ) + .headers( + [( + Some(HeaderName::from_static("foo")), + HeaderValue::from_static("bar"), + )] + .into_iter(), + ) + .header( + HeaderName::from_static("not_foo"), + HeaderValue::from_static("not_bar"), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } +} diff --git a/sdk/compute/src/v2/server/remove_floating_ip.rs b/sdk/compute/src/v2/server/remove_floating_ip.rs new file mode 100644 index 000000000..fd1c2bf27 --- /dev/null +++ b/sdk/compute/src/v2/server/remove_floating_ip.rs @@ -0,0 +1,242 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use derive_builder::Builder; +use http::{HeaderMap, HeaderName, HeaderValue}; + +use openstack_sdk_core::api::rest_endpoint_prelude::*; + +use serde::Deserialize; +use serde::Serialize; +use std::borrow::Cow; + +/// The action to remove or disassociate a floating IP address from the server. +#[derive(Builder, Debug, Deserialize, Clone, Serialize)] +#[builder(setter(strip_option))] +pub struct RemoveFloatingIp<'a> { + /// The floating IP address. + #[serde()] + #[builder(setter(into))] + pub(crate) address: Cow<'a, str>, +} + +#[derive(Builder, Debug, Clone)] +#[builder(setter(strip_option))] +pub struct Request<'a> { + /// The action to remove or disassociate a floating IP address from the + /// server. + #[builder(setter(into))] + pub(crate) remove_floating_ip: RemoveFloatingIp<'a>, + + /// id parameter for /v2.1/servers/{id}/action API + #[builder(default, setter(into))] + id: Cow<'a, str>, + + #[builder(setter(name = "_headers"), default, private)] + _headers: Option, +} +impl<'a> Request<'a> { + /// Create a builder for the endpoint. + pub fn builder() -> RequestBuilder<'a> { + RequestBuilder::default() + } +} + +impl<'a> RequestBuilder<'a> { + /// Add a single header to the Server. + pub fn header(&mut self, header_name: K, header_value: V) -> &mut Self + where + K: Into, + V: Into, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .insert(header_name.into(), header_value.into()); + self + } + + /// Add multiple headers. + pub fn headers(&mut self, iter: I) -> &mut Self + where + I: Iterator, + T: Into<(Option, HeaderValue)>, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .extend(iter.map(Into::into)); + self + } +} + +impl RestEndpoint for Request<'_> { + fn method(&self) -> http::Method { + http::Method::POST + } + + fn endpoint(&self) -> Cow<'static, str> { + format!("servers/{id}/action", id = self.id.as_ref(),).into() + } + + fn parameters(&self) -> QueryParams<'_> { + QueryParams::default() + } + + fn body(&self) -> Result)>, BodyError> { + let mut params = JsonBodyParams::default(); + + params.push( + "removeFloatingIp", + serde_json::to_value(&self.remove_floating_ip)?, + ); + + params.into_body() + } + + fn service_type(&self) -> ServiceType { + ServiceType::Compute + } + + fn response_key(&self) -> Option> { + None + } + + /// Returns headers to be set into the request + fn request_headers(&self) -> Option<&HeaderMap> { + self._headers.as_ref() + } + + /// Returns required API version + fn api_version(&self) -> Option { + Some(ApiVersion::new(2, 1)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use http::{HeaderName, HeaderValue}; + use httpmock::MockServer; + #[cfg(feature = "sync")] + use openstack_sdk_core::api::Query; + use openstack_sdk_core::test::client::FakeOpenStackClient; + use openstack_sdk_core::types::ServiceType; + use serde_json::json; + + #[test] + fn test_service_type() { + assert_eq!( + Request::builder() + .remove_floating_ip( + RemoveFloatingIpBuilder::default() + .address("foo") + .build() + .unwrap() + ) + .build() + .unwrap() + .service_type(), + ServiceType::Compute + ); + } + + #[test] + fn test_response_key() { + assert!( + Request::builder() + .remove_floating_ip( + RemoveFloatingIpBuilder::default() + .address("foo") + .build() + .unwrap() + ) + .build() + .unwrap() + .response_key() + .is_none() + ) + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)); + + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .remove_floating_ip( + RemoveFloatingIpBuilder::default() + .address("foo") + .build() + .unwrap(), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint_headers() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)) + .header("foo", "bar") + .header("not_foo", "not_bar"); + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .remove_floating_ip( + RemoveFloatingIpBuilder::default() + .address("foo") + .build() + .unwrap(), + ) + .headers( + [( + Some(HeaderName::from_static("foo")), + HeaderValue::from_static("bar"), + )] + .into_iter(), + ) + .header( + HeaderName::from_static("not_foo"), + HeaderValue::from_static("not_bar"), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } +} diff --git a/sdk/compute/src/v2/server/trigger_crash_dump.rs b/sdk/compute/src/v2/server/trigger_crash_dump.rs new file mode 100644 index 000000000..e57a07655 --- /dev/null +++ b/sdk/compute/src/v2/server/trigger_crash_dump.rs @@ -0,0 +1,187 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. + +use derive_builder::Builder; +use http::{HeaderMap, HeaderName, HeaderValue}; + +use openstack_sdk_core::api::rest_endpoint_prelude::*; + +use serde_json::Value; +use std::borrow::Cow; + +#[derive(Builder, Debug, Clone)] +#[builder(setter(strip_option))] +pub struct Request<'a> { + /// id parameter for /v2.1/servers/{id}/action API + #[builder(default, setter(into))] + id: Cow<'a, str>, + + #[builder(setter(name = "_headers"), default, private)] + _headers: Option, +} +impl<'a> Request<'a> { + /// Create a builder for the endpoint. + pub fn builder() -> RequestBuilder<'a> { + RequestBuilder::default() + } +} + +impl<'a> RequestBuilder<'a> { + /// Add a single header to the Server. + pub fn header(&mut self, header_name: K, header_value: V) -> &mut Self + where + K: Into, + V: Into, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .insert(header_name.into(), header_value.into()); + self + } + + /// Add multiple headers. + pub fn headers(&mut self, iter: I) -> &mut Self + where + I: Iterator, + T: Into<(Option, HeaderValue)>, + { + self._headers + .get_or_insert(None) + .get_or_insert_with(HeaderMap::new) + .extend(iter.map(Into::into)); + self + } +} + +impl RestEndpoint for Request<'_> { + fn method(&self) -> http::Method { + http::Method::POST + } + + fn endpoint(&self) -> Cow<'static, str> { + format!("servers/{id}/action", id = self.id.as_ref(),).into() + } + + fn parameters(&self) -> QueryParams<'_> { + QueryParams::default() + } + + fn body(&self) -> Result)>, BodyError> { + let mut params = JsonBodyParams::default(); + + params.push("trigger_crash_dump", Value::Null); + + params.into_body() + } + + fn service_type(&self) -> ServiceType { + ServiceType::Compute + } + + fn response_key(&self) -> Option> { + None + } + + /// Returns headers to be set into the request + fn request_headers(&self) -> Option<&HeaderMap> { + self._headers.as_ref() + } + + /// Returns required API version + fn api_version(&self) -> Option { + Some(ApiVersion::new(2, 1)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use http::{HeaderName, HeaderValue}; + use httpmock::MockServer; + #[cfg(feature = "sync")] + use openstack_sdk_core::api::Query; + use openstack_sdk_core::test::client::FakeOpenStackClient; + use openstack_sdk_core::types::ServiceType; + use serde_json::json; + + #[test] + fn test_service_type() { + assert_eq!( + Request::builder().build().unwrap().service_type(), + ServiceType::Compute + ); + } + + #[test] + fn test_response_key() { + assert!(Request::builder().build().unwrap().response_key().is_none()) + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)); + + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder().id("id").build().unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } + + #[cfg(feature = "sync")] + #[test] + fn endpoint_headers() { + let server = MockServer::start(); + let client = FakeOpenStackClient::new(server.base_url()); + let mock = server.mock(|when, then| { + when.method(httpmock::Method::POST) + .path(format!("/servers/{id}/action", id = "id",)) + .header("foo", "bar") + .header("not_foo", "not_bar"); + then.status(200) + .header("content-type", "application/json") + .json_body(json!({ "dummy": {} })); + }); + + let endpoint = Request::builder() + .id("id") + .headers( + [( + Some(HeaderName::from_static("foo")), + HeaderValue::from_static("bar"), + )] + .into_iter(), + ) + .header( + HeaderName::from_static("not_foo"), + HeaderValue::from_static("not_bar"), + ) + .build() + .unwrap(); + let _: serde_json::Value = endpoint.query(&client).unwrap(); + mock.assert(); + } +} diff --git a/sdk/compute/src/v2/simple_tenant_usage/get.rs b/sdk/compute/src/v2/simple_tenant_usage/get.rs index 09575ee1b..8e88ff9f6 100644 --- a/sdk/compute/src/v2/simple_tenant_usage/get.rs +++ b/sdk/compute/src/v2/simple_tenant_usage/get.rs @@ -110,7 +110,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("tenant_usage".into()) } /// Returns headers to be set into the request @@ -146,7 +146,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(), + "tenant_usage" + ); } #[cfg(feature = "sync")] @@ -160,7 +163,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "tenant_usage": {} })); }); let endpoint = Request::builder().id("id").build().unwrap(); @@ -180,7 +183,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "tenant_usage": {} })); }); let endpoint = Request::builder() diff --git a/sdk/compute/src/v2/simple_tenant_usage/list.rs b/sdk/compute/src/v2/simple_tenant_usage/list.rs index 672a087bd..c06e986a9 100644 --- a/sdk/compute/src/v2/simple_tenant_usage/list.rs +++ b/sdk/compute/src/v2/simple_tenant_usage/list.rs @@ -110,7 +110,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - None + Some("tenant_usages".into()) } /// Returns headers to be set into the request @@ -146,7 +146,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(), + "tenant_usages" + ); } #[cfg(feature = "sync")] @@ -160,7 +163,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "tenant_usages": {} })); }); let endpoint = Request::builder().build().unwrap(); @@ -180,7 +183,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "dummy": {} })); + .json_body(json!({ "tenant_usages": {} })); }); let endpoint = Request::builder() diff --git a/sdk/core/src/catalog/service_endpoint.rs b/sdk/core/src/catalog/service_endpoint.rs index d9c4d33ef..06acbf57a 100644 --- a/sdk/core/src/catalog/service_endpoint.rs +++ b/sdk/core/src/catalog/service_endpoint.rs @@ -338,13 +338,12 @@ impl ServiceEndpoints { continue; } match (®ion_name, candidate.region()) { - (Some(requested_region), Some(candidate_region)) => { + (Some(requested_region), Some(candidate_region)) if candidate_region.as_str() == requested_region.as_ref() && candidate.interface.as_ref().map(|x| x.as_ref()) - == interface.as_ref().map(|x| x.as_ref()) - { - return Some(candidate); - } + == interface.as_ref().map(|x| x.as_ref()) => + { + return Some(candidate); } (None, _) => { return Some(candidate); @@ -381,10 +380,10 @@ impl ServiceEndpoints { continue; } match (®ion_name, candidate.region()) { - (Some(requested_region), Some(candidate_region)) => { - if candidate_region.as_str() == requested_region.as_ref() { - return Some(candidate); - } + (Some(requested_region), Some(candidate_region)) + if candidate_region.as_str() == requested_region.as_ref() => + { + return Some(candidate); } (None, _) => { return Some(candidate); diff --git a/sdk/identity/src/v3/limit/create.rs b/sdk/identity/src/v3/limit/create.rs index ea03e09e2..01b8aaaf6 100644 --- a/sdk/identity/src/v3/limit/create.rs +++ b/sdk/identity/src/v3/limit/create.rs @@ -37,12 +37,12 @@ pub struct Limits<'a> { #[builder(default, setter(into))] pub(crate) description: Option>>, - /// The name of the domain. + /// The ID of the domain. Either this or the project ID must be supplied. #[serde(skip_serializing_if = "Option::is_none")] #[builder(default, setter(into))] pub(crate) domain_id: Option>>, - /// The ID for the project. + /// The ID of the project. Either this or the domain ID must be supplied. #[serde(skip_serializing_if = "Option::is_none")] #[builder(default, setter(into))] pub(crate) project_id: Option>>, diff --git a/sdk/identity/src/v3/os_federation/identity_provider/get.rs b/sdk/identity/src/v3/os_federation/identity_provider/get.rs index c8a09691c..371c8b4c6 100644 --- a/sdk/identity/src/v3/os_federation/identity_provider/get.rs +++ b/sdk/identity/src/v3/os_federation/identity_provider/get.rs @@ -93,7 +93,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - Some("identity_provider".into()) + Some("identity_providers".into()) } /// Returns headers to be set into the request @@ -130,7 +130,7 @@ mod tests { fn test_response_key() { assert_eq!( Request::builder().build().unwrap().response_key().unwrap(), - "identity_provider" + "identity_providers" ); } @@ -147,7 +147,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "identity_provider": {} })); + .json_body(json!({ "identity_providers": {} })); }); let endpoint = Request::builder().idp_id("idp_id").build().unwrap(); @@ -170,7 +170,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "identity_provider": {} })); + .json_body(json!({ "identity_providers": {} })); }); let endpoint = Request::builder() diff --git a/sdk/identity/src/v3/role/imply/get.rs b/sdk/identity/src/v3/role/imply/get.rs index f769b2c86..0218a341d 100644 --- a/sdk/identity/src/v3/role/imply/get.rs +++ b/sdk/identity/src/v3/role/imply/get.rs @@ -101,7 +101,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - Some("role_inference".into()) + None } /// Returns headers to be set into the request @@ -136,10 +136,7 @@ mod tests { #[test] fn test_response_key() { - assert_eq!( - Request::builder().build().unwrap().response_key().unwrap(), - "role_inference" - ); + assert!(Request::builder().build().unwrap().response_key().is_none()) } #[cfg(feature = "sync")] @@ -156,7 +153,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "role_inference": {} })); + .json_body(json!({ "dummy": {} })); }); let endpoint = Request::builder() @@ -184,7 +181,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "role_inference": {} })); + .json_body(json!({ "dummy": {} })); }); let endpoint = Request::builder() diff --git a/sdk/identity/src/v3/role/imply/set.rs b/sdk/identity/src/v3/role/imply/set.rs index f09563e8a..29f2ae130 100644 --- a/sdk/identity/src/v3/role/imply/set.rs +++ b/sdk/identity/src/v3/role/imply/set.rs @@ -101,7 +101,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - Some("role_inference".into()) + None } /// Returns headers to be set into the request @@ -136,10 +136,7 @@ mod tests { #[test] fn test_response_key() { - assert_eq!( - Request::builder().build().unwrap().response_key().unwrap(), - "role_inference" - ); + assert!(Request::builder().build().unwrap().response_key().is_none()) } #[cfg(feature = "sync")] @@ -156,7 +153,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "role_inference": {} })); + .json_body(json!({ "dummy": {} })); }); let endpoint = Request::builder() @@ -184,7 +181,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "role_inference": {} })); + .json_body(json!({ "dummy": {} })); }); let endpoint = Request::builder() diff --git a/sdk/load-balancer/src/v2/pool/member/replace.rs b/sdk/load-balancer/src/v2/pool/member/replace.rs index 4b1d97f35..d7ebef47b 100644 --- a/sdk/load-balancer/src/v2/pool/member/replace.rs +++ b/sdk/load-balancer/src/v2/pool/member/replace.rs @@ -215,7 +215,7 @@ impl RestEndpoint for Request<'_> { } fn response_key(&self) -> Option> { - Some("member".into()) + None } /// Returns headers to be set into the request @@ -258,7 +258,7 @@ mod tests { #[test] fn test_response_key() { - assert_eq!( + assert!( Request::builder() .members(Vec::from([MembersBuilder::default() .address("foo") @@ -268,9 +268,8 @@ mod tests { .build() .unwrap() .response_key() - .unwrap(), - "member" - ); + .is_none() + ) } #[cfg(feature = "sync")] @@ -286,7 +285,7 @@ mod tests { then.status(200) .header("content-type", "application/json") - .json_body(json!({ "member": {} })); + .json_body(json!({ "dummy": {} })); }); let endpoint = Request::builder() @@ -317,7 +316,7 @@ mod tests { .header("not_foo", "not_bar"); then.status(200) .header("content-type", "application/json") - .json_body(json!({ "member": {} })); + .json_body(json!({ "dummy": {} })); }); let endpoint = Request::builder() diff --git a/sdk/load-balancer/src/v2/quota/set.rs b/sdk/load-balancer/src/v2/quota/set.rs index dccaebe7d..0f1fae6a2 100644 --- a/sdk/load-balancer/src/v2/quota/set.rs +++ b/sdk/load-balancer/src/v2/quota/set.rs @@ -39,7 +39,7 @@ use serde::Deserialize; use serde::Serialize; use std::borrow::Cow; -/// Individual quota definitions. +/// Base type for complex types #[derive(Builder, Debug, Deserialize, Clone, Serialize)] #[builder(setter(strip_option))] pub struct Quota { @@ -99,7 +99,7 @@ pub struct Quota { #[derive(Builder, Debug, Clone)] #[builder(setter(strip_option))] pub struct Request<'a> { - /// Individual quota definitions. + /// Base type for complex types #[builder(setter(into))] pub(crate) quota: Quota, diff --git a/types/compute/src/v2/aggregate/response.rs b/types/compute/src/v2/aggregate/response.rs index ba96f7678..877a7bf9b 100644 --- a/types/compute/src/v2/aggregate/response.rs +++ b/types/compute/src/v2/aggregate/response.rs @@ -16,10 +16,17 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod add_host; -pub mod create; -pub mod get; -pub mod list; -pub mod remove_host; -pub mod set; -pub mod set_metadata; +pub mod add_host_21; +pub mod add_host_241; +pub mod create_21; +pub mod create_241; +pub mod get_21; +pub mod get_241; +pub mod list_21; +pub mod list_241; +pub mod remove_host_21; +pub mod remove_host_241; +pub mod set_21; +pub mod set_241; +pub mod set_metadata_21; +pub mod set_metadata_241; diff --git a/types/compute/src/v2/aggregate/response/add_host_21.rs b/types/compute/src/v2/aggregate/response/add_host_21.rs new file mode 100644 index 000000000..133b17e0d --- /dev/null +++ b/types/compute/src/v2/aggregate/response/add_host_21.rs @@ -0,0 +1,53 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-aggregates/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Aggregate response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct AggregateResponse { + #[structable(optional)] + pub availability_zone: Option, + + #[structable()] + pub created_at: String, + + #[structable()] + pub deleted: bool, + + #[structable(optional)] + pub deleted_at: Option, + + #[structable(serialize)] + pub hosts: Vec, + + #[structable()] + pub id: i32, + + #[structable(optional, serialize)] + pub metadata: Option>, + + #[structable()] + pub name: String, + + #[structable(optional)] + pub updated_at: Option, +} diff --git a/types/compute/src/v2/aggregate/response/add_host.rs b/types/compute/src/v2/aggregate/response/add_host_241.rs similarity index 100% rename from types/compute/src/v2/aggregate/response/add_host.rs rename to types/compute/src/v2/aggregate/response/add_host_241.rs diff --git a/types/compute/src/v2/aggregate/response/create_21.rs b/types/compute/src/v2/aggregate/response/create_21.rs new file mode 100644 index 000000000..5b53e2724 --- /dev/null +++ b/types/compute/src/v2/aggregate/response/create_21.rs @@ -0,0 +1,82 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-aggregates` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Aggregate response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct AggregateResponse { + /// The availability zone of the host aggregate. + #[structable(optional)] + pub availability_zone: Option, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// A boolean indicates whether this aggregate is deleted or not, if it has + /// not been deleted, `false` will appear. + #[structable()] + pub deleted: bool, + + /// The date and time when the resource was deleted. If the resource has + /// not been deleted yet, this field will be `null`, 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`. + #[structable(optional)] + pub deleted_at: Option, + + /// The ID of the host aggregate. + #[structable()] + pub id: i32, + + /// The name of the host aggregate. + #[structable()] + pub name: String, + + /// The date and time when the resource was updated, if the resource has + /// not been updated, this field will show as `null`. 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`. + #[structable(optional)] + pub updated_at: Option, +} diff --git a/types/compute/src/v2/aggregate/response/create.rs b/types/compute/src/v2/aggregate/response/create_241.rs similarity index 100% rename from types/compute/src/v2/aggregate/response/create.rs rename to types/compute/src/v2/aggregate/response/create_241.rs diff --git a/types/compute/src/v2/aggregate/response/get_21.rs b/types/compute/src/v2/aggregate/response/get_21.rs new file mode 100644 index 000000000..5f0a930c6 --- /dev/null +++ b/types/compute/src/v2/aggregate/response/get_21.rs @@ -0,0 +1,92 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-aggregates/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Aggregate response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct AggregateResponse { + /// The availability zone of the host aggregate. + #[structable(optional)] + pub availability_zone: Option, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// A boolean indicates whether this aggregate is deleted or not, if it has + /// not been deleted, `false` will appear. + #[structable()] + pub deleted: bool, + + /// The date and time when the resource was deleted. If the resource has + /// not been deleted yet, this field will be `null`, 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`. + #[structable(optional)] + pub deleted_at: Option, + + /// An array of host information. + #[structable(serialize)] + pub hosts: Vec, + + /// The ID of the host aggregate. + #[structable()] + pub id: i32, + + /// Metadata key and value pairs associated with the aggregate. + #[structable(optional, serialize)] + pub metadata: Option>, + + /// The name of the host aggregate. + #[structable()] + pub name: String, + + /// The date and time when the resource was updated, if the resource has + /// not been updated, this field will show as `null`. 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`. + #[structable(optional)] + pub updated_at: Option, +} diff --git a/types/compute/src/v2/aggregate/response/get.rs b/types/compute/src/v2/aggregate/response/get_241.rs similarity index 100% rename from types/compute/src/v2/aggregate/response/get.rs rename to types/compute/src/v2/aggregate/response/get_241.rs diff --git a/types/compute/src/v2/aggregate/response/list_21.rs b/types/compute/src/v2/aggregate/response/list_21.rs new file mode 100644 index 000000000..4fe4004ec --- /dev/null +++ b/types/compute/src/v2/aggregate/response/list_21.rs @@ -0,0 +1,92 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-aggregates` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Aggregate response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct AggregateResponse { + /// The availability zone of the host aggregate. + #[structable(optional, wide)] + pub availability_zone: Option, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// A boolean indicates whether this aggregate is deleted or not, if it has + /// not been deleted, `false` will appear. + #[structable(wide)] + pub deleted: bool, + + /// The date and time when the resource was deleted. If the resource has + /// not been deleted yet, this field will be `null`, 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`. + #[structable(optional, wide)] + pub deleted_at: Option, + + /// A list of host ids in this aggregate. + #[structable(serialize, wide)] + pub hosts: Vec, + + /// The ID of the host aggregate. + #[structable()] + pub id: i32, + + /// Metadata key and value pairs associated with the aggregate. + #[structable(optional, serialize, wide)] + pub metadata: Option>, + + /// The name of the host aggregate. + #[structable()] + pub name: String, + + /// The date and time when the resource was updated, if the resource has + /// not been updated, this field will show as `null`. 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`. + #[structable(optional)] + pub updated_at: Option, +} diff --git a/types/compute/src/v2/aggregate/response/list.rs b/types/compute/src/v2/aggregate/response/list_241.rs similarity index 100% rename from types/compute/src/v2/aggregate/response/list.rs rename to types/compute/src/v2/aggregate/response/list_241.rs diff --git a/types/compute/src/v2/aggregate/response/remove_host_21.rs b/types/compute/src/v2/aggregate/response/remove_host_21.rs new file mode 100644 index 000000000..133b17e0d --- /dev/null +++ b/types/compute/src/v2/aggregate/response/remove_host_21.rs @@ -0,0 +1,53 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-aggregates/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Aggregate response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct AggregateResponse { + #[structable(optional)] + pub availability_zone: Option, + + #[structable()] + pub created_at: String, + + #[structable()] + pub deleted: bool, + + #[structable(optional)] + pub deleted_at: Option, + + #[structable(serialize)] + pub hosts: Vec, + + #[structable()] + pub id: i32, + + #[structable(optional, serialize)] + pub metadata: Option>, + + #[structable()] + pub name: String, + + #[structable(optional)] + pub updated_at: Option, +} diff --git a/types/compute/src/v2/aggregate/response/remove_host.rs b/types/compute/src/v2/aggregate/response/remove_host_241.rs similarity index 100% rename from types/compute/src/v2/aggregate/response/remove_host.rs rename to types/compute/src/v2/aggregate/response/remove_host_241.rs diff --git a/types/compute/src/v2/aggregate/response/set_21.rs b/types/compute/src/v2/aggregate/response/set_21.rs new file mode 100644 index 000000000..fc504b266 --- /dev/null +++ b/types/compute/src/v2/aggregate/response/set_21.rs @@ -0,0 +1,92 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `os-aggregates/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Aggregate response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct AggregateResponse { + /// The availability zone of the host aggregate. + #[structable(optional)] + pub availability_zone: Option, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// A boolean indicates whether this aggregate is deleted or not, if it has + /// not been deleted, `false` will appear. + #[structable()] + pub deleted: bool, + + /// The date and time when the resource was deleted. If the resource has + /// not been deleted yet, this field will be `null`, 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`. + #[structable(optional)] + pub deleted_at: Option, + + /// An array of host information. + #[structable(serialize)] + pub hosts: Vec, + + /// The ID of the host aggregate. + #[structable()] + pub id: i32, + + /// Metadata key and value pairs associated with the aggregate. + #[structable(optional, serialize)] + pub metadata: Option>, + + /// The name of the host aggregate. + #[structable()] + pub name: String, + + /// The date and time when the resource was updated, if the resource has + /// not been updated, this field will show as `null`. 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`. + #[structable(optional)] + pub updated_at: Option, +} diff --git a/types/compute/src/v2/aggregate/response/set.rs b/types/compute/src/v2/aggregate/response/set_241.rs similarity index 100% rename from types/compute/src/v2/aggregate/response/set.rs rename to types/compute/src/v2/aggregate/response/set_241.rs diff --git a/types/compute/src/v2/aggregate/response/set_metadata_21.rs b/types/compute/src/v2/aggregate/response/set_metadata_21.rs new file mode 100644 index 000000000..133b17e0d --- /dev/null +++ b/types/compute/src/v2/aggregate/response/set_metadata_21.rs @@ -0,0 +1,53 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-aggregates/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Aggregate response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct AggregateResponse { + #[structable(optional)] + pub availability_zone: Option, + + #[structable()] + pub created_at: String, + + #[structable()] + pub deleted: bool, + + #[structable(optional)] + pub deleted_at: Option, + + #[structable(serialize)] + pub hosts: Vec, + + #[structable()] + pub id: i32, + + #[structable(optional, serialize)] + pub metadata: Option>, + + #[structable()] + pub name: String, + + #[structable(optional)] + pub updated_at: Option, +} diff --git a/types/compute/src/v2/aggregate/response/set_metadata.rs b/types/compute/src/v2/aggregate/response/set_metadata_241.rs similarity index 100% rename from types/compute/src/v2/aggregate/response/set_metadata.rs rename to types/compute/src/v2/aggregate/response/set_metadata_241.rs diff --git a/types/compute/src/v2/availability_zone/response/list.rs b/types/compute/src/v2/availability_zone/response/list.rs index 2dd9862a2..c993c990c 100644 --- a/types/compute/src/v2/availability_zone/response/list.rs +++ b/types/compute/src/v2/availability_zone/response/list.rs @@ -24,9 +24,8 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct AvailabilityZoneResponse { /// It is always `null`. - #[serde(default)] - #[structable(optional)] - pub hosts: Option, + #[structable()] + pub hosts: Value, /// The availability zone name. #[serde(rename = "zoneName")] diff --git a/types/compute/src/v2/availability_zone/response/list_detail.rs b/types/compute/src/v2/availability_zone/response/list_detail.rs index f1c631289..394f54b5d 100644 --- a/types/compute/src/v2/availability_zone/response/list_detail.rs +++ b/types/compute/src/v2/availability_zone/response/list_detail.rs @@ -17,7 +17,6 @@ //! Response type for the GET `os-availability-zone/detail` operation use serde::{Deserialize, Serialize}; -use serde_json::Value; use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; @@ -28,9 +27,8 @@ pub struct AvailabilityZoneResponse { /// is comprised of host and service objects. The service object returns /// three parameters representing the states of the service: `active`, /// `available`, and `updated_at`. - #[serde(default)] #[structable(optional, serialize)] - pub hosts: Option>, + pub hosts: Option>>, /// The availability zone name. #[serde(rename = "zoneName")] @@ -43,6 +41,14 @@ pub struct AvailabilityZoneResponse { pub zone_state: ZoneState, } +/// `HostsItemItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct HostsItemItem { + pub active: bool, + pub available: bool, + pub updated_at: Option, +} + /// The current state of the availability zone. /// `ZoneState` type #[derive(Clone, Debug, Deserialize, Serialize)] diff --git a/types/compute/src/v2/console_auth_token/response.rs b/types/compute/src/v2/console_auth_token/response.rs index cb428ee5e..95981a44b 100644 --- a/types/compute/src/v2/console_auth_token/response.rs +++ b/types/compute/src/v2/console_auth_token/response.rs @@ -16,4 +16,5 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; +pub mod get_21; +pub mod get_299; diff --git a/types/compute/src/v2/console_auth_token/response/get.rs b/types/compute/src/v2/console_auth_token/response/get_21.rs similarity index 96% rename from types/compute/src/v2/console_auth_token/response/get.rs rename to types/compute/src/v2/console_auth_token/response/get_21.rs index 49de033cb..0659f105a 100644 --- a/types/compute/src/v2/console_auth_token/response/get.rs +++ b/types/compute/src/v2/console_auth_token/response/get_21.rs @@ -23,7 +23,6 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ConsoleAuthTokenResponse { /// The name or ID of the host. - #[serde(default)] #[structable(optional)] pub host: Option, @@ -32,7 +31,6 @@ pub struct ConsoleAuthTokenResponse { pub instance_uuid: String, /// The id representing the internal access path. - #[serde(default)] #[structable(optional)] pub internal_access_path: Option, diff --git a/types/compute/src/v2/console_auth_token/response/get_299.rs b/types/compute/src/v2/console_auth_token/response/get_299.rs new file mode 100644 index 000000000..9f0c7e47b --- /dev/null +++ b/types/compute/src/v2/console_auth_token/response/get_299.rs @@ -0,0 +1,45 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-console-auth-tokens/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// ConsoleAuthToken response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ConsoleAuthTokenResponse { + /// The name or ID of the host. + #[structable(optional)] + pub host: Option, + + /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// The id representing the internal access path. + #[structable(optional)] + pub internal_access_path: Option, + + /// The port number. + #[structable()] + pub port: i32, + + /// The port number of a port requiring a TLS connection. + #[serde(default)] + #[structable(optional)] + pub tls_port: Option, +} diff --git a/types/compute/src/v2/extension/response/get.rs b/types/compute/src/v2/extension/response/get.rs index bc7481860..45ce7ced3 100644 --- a/types/compute/src/v2/extension/response/get.rs +++ b/types/compute/src/v2/extension/response/get.rs @@ -27,24 +27,21 @@ pub struct ExtensionResponse { pub alias: String, /// Text describing this extension’s purpose. - #[serde(default)] - #[structable(optional)] - pub description: Option, + #[structable()] + pub description: String, /// Links pertaining to this extension. This is a list of dictionaries, /// each including keys `href` and `rel`. - #[serde(default)] - #[structable(optional, serialize)] - pub links: Option>, + #[structable(serialize)] + pub links: Vec, /// Name of the extension. #[structable()] pub name: String, /// A URL pointing to the namespace for this extension. - #[serde(default)] - #[structable(optional)] - pub namespace: Option, + #[structable()] + pub namespace: 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) @@ -56,14 +53,10 @@ pub struct ExtensionResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub updated: Option, + #[structable()] + pub updated: String, } -/// Links to the resources in question. See -/// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) -/// for more info. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/compute/src/v2/extension/response/list.rs b/types/compute/src/v2/extension/response/list.rs index f1bed1062..5f51ebeec 100644 --- a/types/compute/src/v2/extension/response/list.rs +++ b/types/compute/src/v2/extension/response/list.rs @@ -27,18 +27,16 @@ pub struct ExtensionResponse { pub alias: String, /// Text describing this extension’s purpose. - #[serde(default)] - #[structable(optional)] - pub description: Option, + #[structable()] + pub description: String, /// Name of the extension. #[structable()] pub name: String, /// A URL pointing to the namespace for this extension. - #[serde(default)] - #[structable(optional)] - pub namespace: Option, + #[structable()] + pub namespace: 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) @@ -50,14 +48,10 @@ pub struct ExtensionResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub updated: Option, + #[structable()] + pub updated: String, } -/// Links to the resources in question. See -/// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) -/// for more info. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/compute/src/v2/flavor/response.rs b/types/compute/src/v2/flavor/response.rs index 8cf6d4dd5..9310ac5a9 100644 --- a/types/compute/src/v2/flavor/response.rs +++ b/types/compute/src/v2/flavor/response.rs @@ -17,9 +17,24 @@ //! `response` REST operations of compute pub mod add_tenant_access; -pub mod create; -pub mod get; -pub mod list; -pub mod list_detailed; +pub mod create_20; +pub mod create_2102; +pub mod create_255; +pub mod create_261; +pub mod create_275; +pub mod get_20; +pub mod get_2102; +pub mod get_255; +pub mod get_261; +pub mod get_275; +pub mod list_20; +pub mod list_255; +pub mod list_detailed_20; +pub mod list_detailed_2102; +pub mod list_detailed_255; +pub mod list_detailed_261; pub mod remove_tenant_access; -pub mod set; +pub mod set_2102; +pub mod set_255; +pub mod set_261; +pub mod set_275; diff --git a/types/compute/src/v2/flavor/response/create_20.rs b/types/compute/src/v2/flavor/response/create_20.rs new file mode 100644 index 000000000..b0952d557 --- /dev/null +++ b/types/compute/src/v2/flavor/response/create_20.rs @@ -0,0 +1,99 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `flavors` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/create.rs b/types/compute/src/v2/flavor/response/create_2102.rs similarity index 100% rename from types/compute/src/v2/flavor/response/create.rs rename to types/compute/src/v2/flavor/response/create_2102.rs diff --git a/types/compute/src/v2/flavor/response/create_255.rs b/types/compute/src/v2/flavor/response/create_255.rs new file mode 100644 index 000000000..b7d57c203 --- /dev/null +++ b/types/compute/src/v2/flavor/response/create_255.rs @@ -0,0 +1,105 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `flavors` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/create_261.rs b/types/compute/src/v2/flavor/response/create_261.rs new file mode 100644 index 000000000..cee5617b8 --- /dev/null +++ b/types/compute/src/v2/flavor/response/create_261.rs @@ -0,0 +1,115 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `flavors` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// A dictionary of the flavor’s extra-specs key-and-value pairs. This will + /// only be included if the user is allowed by policy to index flavor + /// extra_specs. + /// + /// **New in version 2.61** + #[serde(default)] + #[structable(optional, serialize)] + pub extra_specs: Option>, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/create_275.rs b/types/compute/src/v2/flavor/response/create_275.rs new file mode 100644 index 000000000..3f5997a9d --- /dev/null +++ b/types/compute/src/v2/flavor/response/create_275.rs @@ -0,0 +1,114 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `flavors` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// A dictionary of the flavor’s extra-specs key-and-value pairs. This will + /// only be included if the user is allowed by policy to index flavor + /// extra_specs. + /// + /// **New in version 2.61** + #[serde(default)] + #[structable(optional, serialize)] + pub extra_specs: Option>, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[structable()] + pub swap: i32, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/get_20.rs b/types/compute/src/v2/flavor/response/get_20.rs new file mode 100644 index 000000000..d6b97e6a5 --- /dev/null +++ b/types/compute/src/v2/flavor/response/get_20.rs @@ -0,0 +1,99 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/get.rs b/types/compute/src/v2/flavor/response/get_2102.rs similarity index 100% rename from types/compute/src/v2/flavor/response/get.rs rename to types/compute/src/v2/flavor/response/get_2102.rs diff --git a/types/compute/src/v2/flavor/response/get_255.rs b/types/compute/src/v2/flavor/response/get_255.rs new file mode 100644 index 000000000..14c006034 --- /dev/null +++ b/types/compute/src/v2/flavor/response/get_255.rs @@ -0,0 +1,105 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/get_261.rs b/types/compute/src/v2/flavor/response/get_261.rs new file mode 100644 index 000000000..368efe892 --- /dev/null +++ b/types/compute/src/v2/flavor/response/get_261.rs @@ -0,0 +1,115 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// A dictionary of the flavor’s extra-specs key-and-value pairs. This will + /// only be included if the user is allowed by policy to index flavor + /// extra_specs. + /// + /// **New in version 2.61** + #[serde(default)] + #[structable(optional, serialize)] + pub extra_specs: Option>, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/get_275.rs b/types/compute/src/v2/flavor/response/get_275.rs new file mode 100644 index 000000000..ef458d977 --- /dev/null +++ b/types/compute/src/v2/flavor/response/get_275.rs @@ -0,0 +1,114 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// A dictionary of the flavor’s extra-specs key-and-value pairs. This will + /// only be included if the user is allowed by policy to index flavor + /// extra_specs. + /// + /// **New in version 2.61** + #[serde(default)] + #[structable(optional, serialize)] + pub extra_specs: Option>, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[structable()] + pub swap: i32, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/list_20.rs b/types/compute/src/v2/flavor/response/list_20.rs new file mode 100644 index 000000000..481c3ece9 --- /dev/null +++ b/types/compute/src/v2/flavor/response/list_20.rs @@ -0,0 +1,40 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// The display name of a flavor. + #[structable()] + pub name: String, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/list_255.rs b/types/compute/src/v2/flavor/response/list_255.rs new file mode 100644 index 000000000..b132aef76 --- /dev/null +++ b/types/compute/src/v2/flavor/response/list_255.rs @@ -0,0 +1,46 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional, wide)] + pub description: Option, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// The display name of a flavor. + #[structable()] + pub name: String, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/list_detailed_20.rs b/types/compute/src/v2/flavor/response/list_detailed_20.rs new file mode 100644 index 000000000..c87f91b32 --- /dev/null +++ b/types/compute/src/v2/flavor/response/list_detailed_20.rs @@ -0,0 +1,93 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors/detail` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable(wide)] + pub disk: i32, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public", wide)] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled", wide)] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral", wide)] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable(wide)] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize, wide)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable(wide)] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable(wide)] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/list_detailed_2102.rs b/types/compute/src/v2/flavor/response/list_detailed_2102.rs new file mode 100644 index 000000000..1d83f0b44 --- /dev/null +++ b/types/compute/src/v2/flavor/response/list_detailed_2102.rs @@ -0,0 +1,95 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors/detail` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional, wide)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable(wide)] + pub disk: i32, + + /// A dictionary of the flavor’s extra-specs key-and-value pairs. This will + /// only be included if the user is allowed by policy to index flavor + /// extra_specs. + /// + /// **New in version 2.61** + #[serde(default)] + #[structable(optional, serialize, wide)] + pub extra_specs: Option>, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public", wide)] + pub os_flavor_access_is_public: Value, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral", wide)] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable(wide)] + pub ram: i32, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[structable(wide)] + pub swap: i32, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable(wide)] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/list_detailed_255.rs b/types/compute/src/v2/flavor/response/list_detailed_255.rs new file mode 100644 index 000000000..016dcdcfe --- /dev/null +++ b/types/compute/src/v2/flavor/response/list_detailed_255.rs @@ -0,0 +1,99 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors/detail` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional, wide)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable(wide)] + pub disk: i32, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public", wide)] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled", wide)] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral", wide)] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable(wide)] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize, wide)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable(wide)] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable(wide)] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/list_detailed_261.rs b/types/compute/src/v2/flavor/response/list_detailed_261.rs new file mode 100644 index 000000000..4786d9e0e --- /dev/null +++ b/types/compute/src/v2/flavor/response/list_detailed_261.rs @@ -0,0 +1,109 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `flavors/detail` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + /// + /// **New in version 2.55** + #[structable(optional, wide)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable(wide)] + pub disk: i32, + + /// A dictionary of the flavor’s extra-specs key-and-value pairs. This will + /// only be included if the user is allowed by policy to index flavor + /// extra_specs. + /// + /// **New in version 2.61** + #[serde(default)] + #[structable(optional, serialize, wide)] + pub extra_specs: Option>, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public", wide)] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled", wide)] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral", wide)] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable(wide)] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize, wide)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable(wide)] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable(wide)] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/set.rs b/types/compute/src/v2/flavor/response/set_2102.rs similarity index 100% rename from types/compute/src/v2/flavor/response/set.rs rename to types/compute/src/v2/flavor/response/set_2102.rs diff --git a/types/compute/src/v2/flavor/response/set_255.rs b/types/compute/src/v2/flavor/response/set_255.rs new file mode 100644 index 000000000..7ae557aff --- /dev/null +++ b/types/compute/src/v2/flavor/response/set_255.rs @@ -0,0 +1,103 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `flavors/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + #[structable(optional)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/set_261.rs b/types/compute/src/v2/flavor/response/set_261.rs new file mode 100644 index 000000000..7cdd012cf --- /dev/null +++ b/types/compute/src/v2/flavor/response/set_261.rs @@ -0,0 +1,113 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `flavors/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + #[structable(optional)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// A dictionary of the flavor’s extra-specs key-and-value pairs. This will + /// only be included if the user is allowed by policy to index flavor + /// extra_specs. + /// + /// **New in version 2.61** + #[serde(default)] + #[structable(optional, serialize)] + pub extra_specs: Option>, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub swap: i64, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/flavor/response/set_275.rs b/types/compute/src/v2/flavor/response/set_275.rs new file mode 100644 index 000000000..255eb3052 --- /dev/null +++ b/types/compute/src/v2/flavor/response/set_275.rs @@ -0,0 +1,112 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `flavors/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Flavor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct FlavorResponse { + /// The description of the flavor. + #[structable(optional)] + pub description: Option, + + /// The size of the root disk that will be created in GiB. If 0 the root + /// disk will be set to exactly the size of the image used to deploy the + /// instance. However, in this case the scheduler cannot select the compute + /// host based on the virtual image size. Therefore, 0 should only be used + /// for volume booted instances or for testing purposes. Volume-backed + /// instances can be enforced for flavors with zero root disk via the + /// `os_compute_api:servers:create:zero_disk_flavor` policy rule. + #[structable()] + pub disk: i32, + + /// A dictionary of the flavor’s extra-specs key-and-value pairs. This will + /// only be included if the user is allowed by policy to index flavor + /// extra_specs. + /// + /// **New in version 2.61** + #[serde(default)] + #[structable(optional, serialize)] + pub extra_specs: Option>, + + /// The ID of the flavor. While people often make this look like an int, + /// this is really a string. + #[structable()] + pub id: String, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// The display name of a flavor. + #[structable()] + pub name: String, + + /// OpenAPI specifies the field as '{}'. + #[serde(rename = "os-flavor-access:is_public")] + #[structable(serialize, title = "os-flavor-access:is_public")] + pub os_flavor_access_is_public: Value, + + /// Whether or not the flavor has been administratively disabled. This is + /// an artifact of the legacy v2 API and will always be set to `false`. + /// There is currently no way to disable a flavor and set this to `true`. + /// + /// **Available until version 2.101** + #[serde(rename = "OS-FLV-DISABLED:disabled")] + #[structable(title = "OS-FLV-DISABLED:disabled")] + pub os_flv_disabled_disabled: bool, + + /// The size of the ephemeral disk that will be created, in GiB. Ephemeral + /// disks may be written over on server state changes. So should only be + /// used as a scratch space for applications that are aware of its + /// limitations. Defaults to 0. + #[serde(rename = "OS-FLV-EXT-DATA:ephemeral")] + #[structable(title = "OS-FLV-EXT-DATA:ephemeral")] + pub os_flv_ext_data_ephemeral: i32, + + /// The amount of RAM a flavor has, in MiB. + #[structable()] + pub ram: i32, + + /// OpenAPI specifies the field as '{}'. + #[structable(serialize)] + pub rxtx_factor: Value, + + /// The size of a dedicated swap disk that will be allocated, in MiB. If 0 + /// (the default), no dedicated swap disk will be created. Currently, the + /// empty string (‘’) is used to represent 0. As of microversion 2.75 + /// default return value of swap is 0 instead of empty string. + #[structable()] + pub swap: i32, + + /// The number of virtual CPUs that will be allocated to the server. + #[structable()] + pub vcpus: i32, +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: String, +} diff --git a/types/compute/src/v2/floating_ip/response.rs b/types/compute/src/v2/floating_ip/response.rs index 57479c591..120024e5c 100644 --- a/types/compute/src/v2/floating_ip/response.rs +++ b/types/compute/src/v2/floating_ip/response.rs @@ -16,6 +16,6 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod create; -pub mod get; -pub mod list; +pub mod create_21; +pub mod get_21; +pub mod list_21; diff --git a/types/compute/src/v2/floating_ip/response/create.rs b/types/compute/src/v2/floating_ip/response/create_21.rs similarity index 100% rename from types/compute/src/v2/floating_ip/response/create.rs rename to types/compute/src/v2/floating_ip/response/create_21.rs diff --git a/types/compute/src/v2/floating_ip/response/get.rs b/types/compute/src/v2/floating_ip/response/get_21.rs similarity index 100% rename from types/compute/src/v2/floating_ip/response/get.rs rename to types/compute/src/v2/floating_ip/response/get_21.rs diff --git a/types/compute/src/v2/floating_ip/response/list.rs b/types/compute/src/v2/floating_ip/response/list_21.rs similarity index 100% rename from types/compute/src/v2/floating_ip/response/list.rs rename to types/compute/src/v2/floating_ip/response/list_21.rs diff --git a/types/compute/src/v2/hypervisor/response.rs b/types/compute/src/v2/hypervisor/response.rs index 3a77e778b..a1361f24d 100644 --- a/types/compute/src/v2/hypervisor/response.rs +++ b/types/compute/src/v2/hypervisor/response.rs @@ -16,6 +16,15 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; -pub mod list; -pub mod list_detailed; +pub mod get_21; +pub mod get_228; +pub mod get_253; +pub mod get_288; +pub mod list_21; +pub mod list_233; +pub mod list_253; +pub mod list_detailed_21; +pub mod list_detailed_228; +pub mod list_detailed_233; +pub mod list_detailed_253; +pub mod list_detailed_288; diff --git a/types/compute/src/v2/hypervisor/response/get_21.rs b/types/compute/src/v2/hypervisor/response/get_21.rs new file mode 100644 index 000000000..d03edda67 --- /dev/null +++ b/types/compute/src/v2/hypervisor/response/get_21.rs @@ -0,0 +1,208 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Hypervisor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct HypervisorResponse { + /// A dictionary that contains cpu information like `arch`, `model`, + /// `vendor`, `features` and `topology`. The content of this field is + /// hypervisor specific. + /// + /// Note + /// + /// Since version 2.28 `cpu_info` field is returned as a dictionary instead + /// of string. + /// + /// **Available until version 2.87** + #[structable()] + pub cpu_info: String, + + /// The current_workload is the number of tasks the hypervisor is + /// responsible for. This will be equal or greater than the number of + /// active VMs on the system (it can be greater when VMs are being deleted + /// and the hypervisor is still cleaning up). + /// + /// **Available until version 2.87** + #[structable(optional)] + pub current_workload: Option, + + /// The actual free disk on this hypervisor(in GiB). If allocation ratios + /// used for overcommit are configured, this may be negative. This is + /// intentional as it provides insight into the amount by which the disk is + /// overcommitted. + /// + /// **Available until version 2.87** + #[serde(default)] + #[structable(optional)] + pub disk_available_least: Option, + + /// The free disk remaining on this hypervisor(in GiB). This does not take + /// allocation ratios used for overcommit into account so this value may be + /// negative. + /// + /// **Available until version 2.87** + #[structable(optional)] + pub free_disk_gb: Option, + + /// The free RAM in this hypervisor(in MiB). This does not take allocation + /// ratios used for overcommit into account so this value may be negative. + /// + /// **Available until version 2.87** + #[structable(optional)] + pub free_ram_mb: Option, + + /// The IP address of the hypervisor’s host. + #[structable(optional)] + pub host_ip: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable()] + pub hypervisor_hostname: String, + + /// The hypervisor type. + #[structable()] + pub hypervisor_type: String, + + /// The hypervisor version. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub hypervisor_version: i64, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: i32, + + /// The disk in this hypervisor (in GiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable()] + pub local_gb: i32, + + /// The disk used in this hypervisor (in GiB). + /// + /// **Available until version 2.87** + #[structable()] + pub local_gb_used: i32, + + /// The memory of this hypervisor (in MiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable()] + pub memory_mb: i32, + + /// The memory used in this hypervisor (in MiB). + /// + /// **Available until version 2.87** + #[structable()] + pub memory_mb_used: i32, + + /// The number of running VMs on this hypervisor. + /// + /// **Available until version 2.87** + #[structable(optional)] + pub running_vms: Option, + + /// The hypervisor service object. + #[structable(serialize)] + pub service: Service, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// The number of vCPU in this hypervisor. This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable()] + pub vcpus: i32, + + /// The number of vCPU used in this hypervisor. + /// + /// **Available until version 2.87** + #[structable()] + pub vcpus_used: i32, +} + +/// The hypervisor service object. +/// `Service` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Service { + pub disabled_reason: Option, + pub host: String, + pub id: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/response/get_228.rs b/types/compute/src/v2/hypervisor/response/get_228.rs new file mode 100644 index 000000000..f8f169152 --- /dev/null +++ b/types/compute/src/v2/hypervisor/response/get_228.rs @@ -0,0 +1,210 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Hypervisor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct HypervisorResponse { + /// A dictionary that contains cpu information like `arch`, `model`, + /// `vendor`, `features` and `topology`. The content of this field is + /// hypervisor specific. + /// + /// Note + /// + /// Since version 2.28 `cpu_info` field is returned as a dictionary instead + /// of string. + /// + /// **Available until version 2.87** + #[structable(serialize)] + pub cpu_info: BTreeMap, + + /// The current_workload is the number of tasks the hypervisor is + /// responsible for. This will be equal or greater than the number of + /// active VMs on the system (it can be greater when VMs are being deleted + /// and the hypervisor is still cleaning up). + /// + /// **Available until version 2.87** + #[structable(optional)] + pub current_workload: Option, + + /// The actual free disk on this hypervisor(in GiB). If allocation ratios + /// used for overcommit are configured, this may be negative. This is + /// intentional as it provides insight into the amount by which the disk is + /// overcommitted. + /// + /// **Available until version 2.87** + #[serde(default)] + #[structable(optional)] + pub disk_available_least: Option, + + /// The free disk remaining on this hypervisor(in GiB). This does not take + /// allocation ratios used for overcommit into account so this value may be + /// negative. + /// + /// **Available until version 2.87** + #[structable(optional)] + pub free_disk_gb: Option, + + /// The free RAM in this hypervisor(in MiB). This does not take allocation + /// ratios used for overcommit into account so this value may be negative. + /// + /// **Available until version 2.87** + #[structable(optional)] + pub free_ram_mb: Option, + + /// The IP address of the hypervisor’s host. + #[structable(optional)] + pub host_ip: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable()] + pub hypervisor_hostname: String, + + /// The hypervisor type. + #[structable()] + pub hypervisor_type: String, + + /// The hypervisor version. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub hypervisor_version: i64, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: i32, + + /// The disk in this hypervisor (in GiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable()] + pub local_gb: i32, + + /// The disk used in this hypervisor (in GiB). + /// + /// **Available until version 2.87** + #[structable()] + pub local_gb_used: i32, + + /// The memory of this hypervisor (in MiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable()] + pub memory_mb: i32, + + /// The memory used in this hypervisor (in MiB). + /// + /// **Available until version 2.87** + #[structable()] + pub memory_mb_used: i32, + + /// The number of running VMs on this hypervisor. + /// + /// **Available until version 2.87** + #[structable(optional)] + pub running_vms: Option, + + /// The hypervisor service object. + #[structable(serialize)] + pub service: Service, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// The number of vCPU in this hypervisor. This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable()] + pub vcpus: i32, + + /// The number of vCPU used in this hypervisor. + /// + /// **Available until version 2.87** + #[structable()] + pub vcpus_used: i32, +} + +/// The hypervisor service object. +/// `Service` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Service { + pub disabled_reason: Option, + pub host: String, + pub id: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/response/get.rs b/types/compute/src/v2/hypervisor/response/get_253.rs similarity index 74% rename from types/compute/src/v2/hypervisor/response/get.rs rename to types/compute/src/v2/hypervisor/response/get_253.rs index e6b22648b..112143ab0 100644 --- a/types/compute/src/v2/hypervisor/response/get.rs +++ b/types/compute/src/v2/hypervisor/response/get_253.rs @@ -34,9 +34,8 @@ pub struct HypervisorResponse { /// of string. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional, serialize)] - pub cpu_info: Option>, + #[structable(serialize)] + pub cpu_info: BTreeMap, /// The current_workload is the number of tasks the hypervisor is /// responsible for. This will be equal or greater than the number of @@ -44,7 +43,6 @@ pub struct HypervisorResponse { /// and the hypervisor is still cleaning up). /// /// **Available until version 2.87** - #[serde(default)] #[structable(optional)] pub current_workload: Option, @@ -63,7 +61,6 @@ pub struct HypervisorResponse { /// negative. /// /// **Available until version 2.87** - #[serde(default)] #[structable(optional)] pub free_disk_gb: Option, @@ -71,72 +68,64 @@ pub struct HypervisorResponse { /// ratios used for overcommit into account so this value may be negative. /// /// **Available until version 2.87** - #[serde(default)] #[structable(optional)] pub free_ram_mb: Option, /// The IP address of the hypervisor’s host. - #[serde(default)] #[structable(optional)] pub host_ip: Option, /// The hypervisor host name provided by the Nova virt driver. For the /// Ironic driver, it is the Ironic node uuid. - #[serde(default)] - #[structable(optional)] - pub hypervisor_hostname: Option, + #[structable()] + pub hypervisor_hostname: String, /// The hypervisor type. - #[serde(default)] - #[structable(optional)] - pub hypervisor_type: Option, + #[structable()] + pub hypervisor_type: String, /// The hypervisor version. - #[serde(default)] - #[structable(optional)] - pub hypervisor_version: Option, + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub hypervisor_version: i64, - /// The id of the hypervisor. From version 2.53 it is a string as UUID - #[serde(default)] - #[structable(optional)] - pub id: Option, + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: String, /// The disk in this hypervisor (in GiB). This does not take allocation /// ratios used for overcommit into account so there may be disparity /// between this and the used count. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional)] - pub local_gb: Option, + #[structable()] + pub local_gb: i32, /// The disk used in this hypervisor (in GiB). /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional)] - pub local_gb_used: Option, + #[structable()] + pub local_gb_used: i32, /// The memory of this hypervisor (in MiB). This does not take allocation /// ratios used for overcommit into account so there may be disparity /// between this and the used count. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional)] - pub memory_mb: Option, + #[structable()] + pub memory_mb: i32, /// The memory used in this hypervisor (in MiB). /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional)] - pub memory_mb_used: Option, + #[structable()] + pub memory_mb_used: i32, /// The number of running VMs on this hypervisor. /// /// **Available until version 2.87** - #[serde(default)] #[structable(optional)] pub running_vms: Option, @@ -151,45 +140,30 @@ pub struct HypervisorResponse { pub servers: Option>, /// The hypervisor service object. - #[serde(default)] - #[structable(optional, serialize)] - pub service: Option, + #[structable(serialize)] + pub service: Service, /// The state of the hypervisor. One of `up` or `down`. - #[serde(default)] - #[structable(optional, serialize)] - pub state: Option, + #[structable(serialize)] + pub state: State, /// The status of the hypervisor. One of `enabled` or `disabled`. - #[serde(default)] - #[structable(optional, serialize)] - pub status: Option, - - /// The response format of this api depends on the virt driver in use on a - /// given host. The libvirt driver returns the output of the uptime command - /// directly, the z/VM driver returns the ILP time. All other drivers - /// always return null. Note this value is cached and updated periodically. - /// - /// **New in version 2.88** - #[serde(default)] - #[structable(optional)] - pub uptime: Option, + #[structable(serialize)] + pub status: Status, /// The number of vCPU in this hypervisor. This does not take allocation /// ratios used for overcommit into account so there may be disparity /// between this and the used count. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional)] - pub vcpus: Option, + #[structable()] + pub vcpus: i32, /// The number of vCPU used in this hypervisor. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional)] - pub vcpus_used: Option, + #[structable()] + pub vcpus_used: i32, } /// `Servers` type @@ -203,15 +177,9 @@ pub struct Servers { /// `Service` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Service { - #[serde(default)] pub disabled_reason: Option, - #[serde(default)] - pub host: Option, - #[serde( - default, - deserialize_with = "openstack_types_core::common::deser_num_str_opt" - )] - pub id: Option, + pub host: String, + pub id: String, } #[derive(Debug, Deserialize, Clone, Serialize)] diff --git a/types/compute/src/v2/hypervisor/response/get_288.rs b/types/compute/src/v2/hypervisor/response/get_288.rs new file mode 100644 index 000000000..e34530dc4 --- /dev/null +++ b/types/compute/src/v2/hypervisor/response/get_288.rs @@ -0,0 +1,149 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Hypervisor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct HypervisorResponse { + /// The actual free disk on this hypervisor(in GiB). If allocation ratios + /// used for overcommit are configured, this may be negative. This is + /// intentional as it provides insight into the amount by which the disk is + /// overcommitted. + /// + /// **Available until version 2.87** + #[serde(default)] + #[structable(optional)] + pub disk_available_least: Option, + + /// The IP address of the hypervisor’s host. + #[structable(optional)] + pub host_ip: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable()] + pub hypervisor_hostname: String, + + /// The hypervisor type. + #[structable()] + pub hypervisor_type: String, + + /// The hypervisor version. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable()] + pub hypervisor_version: i64, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: String, + + /// A list of `server` objects. Before microversion 2.75, this field is + /// only returned if non-empty. From microversion 2.75, this field will + /// always be returned unless the `with_servers` query parameter is + /// provided and is set to `false`. + /// + /// **New in version 2.53** + #[serde(default)] + #[structable(optional, serialize)] + pub servers: Option>, + + /// The hypervisor service object. + #[structable(serialize)] + pub service: Service, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// The response format of this api depends on the virt driver in use on a + /// given host. The libvirt driver returns the output of the uptime command + /// directly, the z/VM driver returns the ILP time. All other drivers + /// always return null. Note this value is cached and updated periodically. + /// + /// **New in version 2.88** + #[structable(optional)] + pub uptime: Option, +} + +/// `Servers` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Servers { + pub name: String, + pub uuid: String, +} + +/// The hypervisor service object. +/// `Service` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Service { + pub disabled_reason: Option, + pub host: String, + pub id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/response/list_21.rs b/types/compute/src/v2/hypervisor/response/list_21.rs new file mode 100644 index 000000000..5e555b727 --- /dev/null +++ b/types/compute/src/v2/hypervisor/response/list_21.rs @@ -0,0 +1,87 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Hypervisor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct HypervisorResponse { + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable(wide)] + pub hypervisor_hostname: String, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: i32, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/response/list_233.rs b/types/compute/src/v2/hypervisor/response/list_233.rs new file mode 100644 index 000000000..5e555b727 --- /dev/null +++ b/types/compute/src/v2/hypervisor/response/list_233.rs @@ -0,0 +1,87 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Hypervisor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct HypervisorResponse { + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable(wide)] + pub hypervisor_hostname: String, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: i32, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/response/list.rs b/types/compute/src/v2/hypervisor/response/list_253.rs similarity index 95% rename from types/compute/src/v2/hypervisor/response/list.rs rename to types/compute/src/v2/hypervisor/response/list_253.rs index 1035c11c4..f8486a9f3 100644 --- a/types/compute/src/v2/hypervisor/response/list.rs +++ b/types/compute/src/v2/hypervisor/response/list_253.rs @@ -39,17 +39,17 @@ pub struct HypervisorResponse { /// provided and is set to `false`. /// /// **New in version 2.53** - #[structable(serialize, wide)] - pub servers: Vec, + #[serde(default)] + #[structable(optional, serialize, wide)] + pub servers: Option>, /// The state of the hypervisor. One of `up` or `down`. #[structable(serialize)] pub state: State, /// The status of the hypervisor. One of `enabled` or `disabled`. - #[serde(default)] - #[structable(optional, serialize)] - pub status: Option, + #[structable(serialize)] + pub status: Status, } /// `Servers` type diff --git a/types/compute/src/v2/hypervisor/response/list_detailed_21.rs b/types/compute/src/v2/hypervisor/response/list_detailed_21.rs new file mode 100644 index 000000000..b12d08ece --- /dev/null +++ b/types/compute/src/v2/hypervisor/response/list_detailed_21.rs @@ -0,0 +1,208 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors/detail` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Hypervisor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct HypervisorResponse { + /// A dictionary that contains cpu information like `arch`, `model`, + /// `vendor`, `features` and `topology`. The content of this field is + /// hypervisor specific. + /// + /// Note + /// + /// Since version 2.28 `cpu_info` field is returned as a dictionary instead + /// of string. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub cpu_info: String, + + /// The current_workload is the number of tasks the hypervisor is + /// responsible for. This will be equal or greater than the number of + /// active VMs on the system (it can be greater when VMs are being deleted + /// and the hypervisor is still cleaning up). + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub current_workload: Option, + + /// The actual free disk on this hypervisor(in GiB). If allocation ratios + /// used for overcommit are configured, this may be negative. This is + /// intentional as it provides insight into the amount by which the disk is + /// overcommitted. + /// + /// **Available until version 2.87** + #[serde(default)] + #[structable(optional, wide)] + pub disk_available_least: Option, + + /// The free disk remaining on this hypervisor(in GiB). This does not take + /// allocation ratios used for overcommit into account so this value may be + /// negative. + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub free_disk_gb: Option, + + /// The free RAM in this hypervisor(in MiB). This does not take allocation + /// ratios used for overcommit into account so this value may be negative. + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub free_ram_mb: Option, + + /// The IP address of the hypervisor’s host. + #[structable(optional, wide)] + pub host_ip: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable(wide)] + pub hypervisor_hostname: String, + + /// The hypervisor type. + #[structable(wide)] + pub hypervisor_type: String, + + /// The hypervisor version. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable(wide)] + pub hypervisor_version: i64, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: i32, + + /// The disk in this hypervisor (in GiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub local_gb: i32, + + /// The disk used in this hypervisor (in GiB). + /// + /// **Available until version 2.87** + #[structable(wide)] + pub local_gb_used: i32, + + /// The memory of this hypervisor (in MiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub memory_mb: i32, + + /// The memory used in this hypervisor (in MiB). + /// + /// **Available until version 2.87** + #[structable(wide)] + pub memory_mb_used: i32, + + /// The number of running VMs on this hypervisor. + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub running_vms: Option, + + /// The hypervisor service object. + #[structable(serialize, wide)] + pub service: Service, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// The number of vCPU in this hypervisor. This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub vcpus: i32, + + /// The number of vCPU used in this hypervisor. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub vcpus_used: i32, +} + +/// The hypervisor service object. +/// `Service` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Service { + pub disabled_reason: Option, + pub host: String, + pub id: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/response/list_detailed_228.rs b/types/compute/src/v2/hypervisor/response/list_detailed_228.rs new file mode 100644 index 000000000..b15e14af0 --- /dev/null +++ b/types/compute/src/v2/hypervisor/response/list_detailed_228.rs @@ -0,0 +1,210 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors/detail` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Hypervisor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct HypervisorResponse { + /// A dictionary that contains cpu information like `arch`, `model`, + /// `vendor`, `features` and `topology`. The content of this field is + /// hypervisor specific. + /// + /// Note + /// + /// Since version 2.28 `cpu_info` field is returned as a dictionary instead + /// of string. + /// + /// **Available until version 2.87** + #[structable(serialize, wide)] + pub cpu_info: BTreeMap, + + /// The current_workload is the number of tasks the hypervisor is + /// responsible for. This will be equal or greater than the number of + /// active VMs on the system (it can be greater when VMs are being deleted + /// and the hypervisor is still cleaning up). + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub current_workload: Option, + + /// The actual free disk on this hypervisor(in GiB). If allocation ratios + /// used for overcommit are configured, this may be negative. This is + /// intentional as it provides insight into the amount by which the disk is + /// overcommitted. + /// + /// **Available until version 2.87** + #[serde(default)] + #[structable(optional, wide)] + pub disk_available_least: Option, + + /// The free disk remaining on this hypervisor(in GiB). This does not take + /// allocation ratios used for overcommit into account so this value may be + /// negative. + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub free_disk_gb: Option, + + /// The free RAM in this hypervisor(in MiB). This does not take allocation + /// ratios used for overcommit into account so this value may be negative. + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub free_ram_mb: Option, + + /// The IP address of the hypervisor’s host. + #[structable(optional, wide)] + pub host_ip: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable(wide)] + pub hypervisor_hostname: String, + + /// The hypervisor type. + #[structable(wide)] + pub hypervisor_type: String, + + /// The hypervisor version. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable(wide)] + pub hypervisor_version: i64, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: i32, + + /// The disk in this hypervisor (in GiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub local_gb: i32, + + /// The disk used in this hypervisor (in GiB). + /// + /// **Available until version 2.87** + #[structable(wide)] + pub local_gb_used: i32, + + /// The memory of this hypervisor (in MiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub memory_mb: i32, + + /// The memory used in this hypervisor (in MiB). + /// + /// **Available until version 2.87** + #[structable(wide)] + pub memory_mb_used: i32, + + /// The number of running VMs on this hypervisor. + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub running_vms: Option, + + /// The hypervisor service object. + #[structable(serialize, wide)] + pub service: Service, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// The number of vCPU in this hypervisor. This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub vcpus: i32, + + /// The number of vCPU used in this hypervisor. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub vcpus_used: i32, +} + +/// The hypervisor service object. +/// `Service` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Service { + pub disabled_reason: Option, + pub host: String, + pub id: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/response/list_detailed_233.rs b/types/compute/src/v2/hypervisor/response/list_detailed_233.rs new file mode 100644 index 000000000..b15e14af0 --- /dev/null +++ b/types/compute/src/v2/hypervisor/response/list_detailed_233.rs @@ -0,0 +1,210 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors/detail` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Hypervisor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct HypervisorResponse { + /// A dictionary that contains cpu information like `arch`, `model`, + /// `vendor`, `features` and `topology`. The content of this field is + /// hypervisor specific. + /// + /// Note + /// + /// Since version 2.28 `cpu_info` field is returned as a dictionary instead + /// of string. + /// + /// **Available until version 2.87** + #[structable(serialize, wide)] + pub cpu_info: BTreeMap, + + /// The current_workload is the number of tasks the hypervisor is + /// responsible for. This will be equal or greater than the number of + /// active VMs on the system (it can be greater when VMs are being deleted + /// and the hypervisor is still cleaning up). + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub current_workload: Option, + + /// The actual free disk on this hypervisor(in GiB). If allocation ratios + /// used for overcommit are configured, this may be negative. This is + /// intentional as it provides insight into the amount by which the disk is + /// overcommitted. + /// + /// **Available until version 2.87** + #[serde(default)] + #[structable(optional, wide)] + pub disk_available_least: Option, + + /// The free disk remaining on this hypervisor(in GiB). This does not take + /// allocation ratios used for overcommit into account so this value may be + /// negative. + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub free_disk_gb: Option, + + /// The free RAM in this hypervisor(in MiB). This does not take allocation + /// ratios used for overcommit into account so this value may be negative. + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub free_ram_mb: Option, + + /// The IP address of the hypervisor’s host. + #[structable(optional, wide)] + pub host_ip: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable(wide)] + pub hypervisor_hostname: String, + + /// The hypervisor type. + #[structable(wide)] + pub hypervisor_type: String, + + /// The hypervisor version. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable(wide)] + pub hypervisor_version: i64, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: i32, + + /// The disk in this hypervisor (in GiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub local_gb: i32, + + /// The disk used in this hypervisor (in GiB). + /// + /// **Available until version 2.87** + #[structable(wide)] + pub local_gb_used: i32, + + /// The memory of this hypervisor (in MiB). This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub memory_mb: i32, + + /// The memory used in this hypervisor (in MiB). + /// + /// **Available until version 2.87** + #[structable(wide)] + pub memory_mb_used: i32, + + /// The number of running VMs on this hypervisor. + /// + /// **Available until version 2.87** + #[structable(optional, wide)] + pub running_vms: Option, + + /// The hypervisor service object. + #[structable(serialize, wide)] + pub service: Service, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// The number of vCPU in this hypervisor. This does not take allocation + /// ratios used for overcommit into account so there may be disparity + /// between this and the used count. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub vcpus: i32, + + /// The number of vCPU used in this hypervisor. + /// + /// **Available until version 2.87** + #[structable(wide)] + pub vcpus_used: i32, +} + +/// The hypervisor service object. +/// `Service` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Service { + pub disabled_reason: Option, + pub host: String, + pub id: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/response/list_detailed.rs b/types/compute/src/v2/hypervisor/response/list_detailed_253.rs similarity index 73% rename from types/compute/src/v2/hypervisor/response/list_detailed.rs rename to types/compute/src/v2/hypervisor/response/list_detailed_253.rs index 6dd2d42a0..a90784088 100644 --- a/types/compute/src/v2/hypervisor/response/list_detailed.rs +++ b/types/compute/src/v2/hypervisor/response/list_detailed_253.rs @@ -34,9 +34,8 @@ pub struct HypervisorResponse { /// of string. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional, serialize, wide)] - pub cpu_info: Option>, + #[structable(serialize, wide)] + pub cpu_info: BTreeMap, /// The current_workload is the number of tasks the hypervisor is /// responsible for. This will be equal or greater than the number of @@ -44,7 +43,6 @@ pub struct HypervisorResponse { /// and the hypervisor is still cleaning up). /// /// **Available until version 2.87** - #[serde(default)] #[structable(optional, wide)] pub current_workload: Option, @@ -63,7 +61,6 @@ pub struct HypervisorResponse { /// negative. /// /// **Available until version 2.87** - #[serde(default)] #[structable(optional, wide)] pub free_disk_gb: Option, @@ -71,72 +68,64 @@ pub struct HypervisorResponse { /// ratios used for overcommit into account so this value may be negative. /// /// **Available until version 2.87** - #[serde(default)] #[structable(optional, wide)] pub free_ram_mb: Option, /// The IP address of the hypervisor’s host. - #[serde(default)] #[structable(optional, wide)] pub host_ip: Option, /// The hypervisor host name provided by the Nova virt driver. For the /// Ironic driver, it is the Ironic node uuid. - #[serde(default)] - #[structable(optional, wide)] - pub hypervisor_hostname: Option, + #[structable(wide)] + pub hypervisor_hostname: String, /// The hypervisor type. - #[serde(default)] - #[structable(optional, wide)] - pub hypervisor_type: Option, + #[structable(wide)] + pub hypervisor_type: String, /// The hypervisor version. - #[serde(default)] - #[structable(optional, wide)] - pub hypervisor_version: Option, + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable(wide)] + pub hypervisor_version: i64, - /// The id of the hypervisor. From version 2.53 it is a string as UUID - #[serde(default)] - #[structable(optional)] - pub id: Option, + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: String, /// The disk in this hypervisor (in GiB). This does not take allocation /// ratios used for overcommit into account so there may be disparity /// between this and the used count. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional, wide)] - pub local_gb: Option, + #[structable(wide)] + pub local_gb: i32, /// The disk used in this hypervisor (in GiB). /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional, wide)] - pub local_gb_used: Option, + #[structable(wide)] + pub local_gb_used: i32, /// The memory of this hypervisor (in MiB). This does not take allocation /// ratios used for overcommit into account so there may be disparity /// between this and the used count. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional, wide)] - pub memory_mb: Option, + #[structable(wide)] + pub memory_mb: i32, /// The memory used in this hypervisor (in MiB). /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional, wide)] - pub memory_mb_used: Option, + #[structable(wide)] + pub memory_mb_used: i32, /// The number of running VMs on this hypervisor. /// /// **Available until version 2.87** - #[serde(default)] #[structable(optional, wide)] pub running_vms: Option, @@ -151,45 +140,30 @@ pub struct HypervisorResponse { pub servers: Option>, /// The hypervisor service object. - #[serde(default)] - #[structable(optional, serialize, wide)] - pub service: Option, + #[structable(serialize, wide)] + pub service: Service, /// The state of the hypervisor. One of `up` or `down`. - #[serde(default)] - #[structable(optional, serialize)] - pub state: Option, + #[structable(serialize)] + pub state: State, /// The status of the hypervisor. One of `enabled` or `disabled`. - #[serde(default)] - #[structable(optional, serialize)] - pub status: Option, - - /// The response format of this api depends on the virt driver in use on a - /// given host. The libvirt driver returns the output of the uptime command - /// directly, the z/VM driver returns the ILP time. All other drivers - /// always return null. Note this value is cached and updated periodically. - /// - /// **New in version 2.88** - #[serde(default)] - #[structable(optional, wide)] - pub uptime: Option, + #[structable(serialize)] + pub status: Status, /// The number of vCPU in this hypervisor. This does not take allocation /// ratios used for overcommit into account so there may be disparity /// between this and the used count. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional, wide)] - pub vcpus: Option, + #[structable(wide)] + pub vcpus: i32, /// The number of vCPU used in this hypervisor. /// /// **Available until version 2.87** - #[serde(default)] - #[structable(optional, wide)] - pub vcpus_used: Option, + #[structable(wide)] + pub vcpus_used: i32, } /// `Servers` type @@ -203,15 +177,9 @@ pub struct Servers { /// `Service` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Service { - #[serde(default)] pub disabled_reason: Option, - #[serde(default)] - pub host: Option, - #[serde( - default, - deserialize_with = "openstack_types_core::common::deser_num_str_opt" - )] - pub id: Option, + pub host: String, + pub id: String, } #[derive(Debug, Deserialize, Clone, Serialize)] diff --git a/types/compute/src/v2/hypervisor/response/list_detailed_288.rs b/types/compute/src/v2/hypervisor/response/list_detailed_288.rs new file mode 100644 index 000000000..e8ad0e49b --- /dev/null +++ b/types/compute/src/v2/hypervisor/response/list_detailed_288.rs @@ -0,0 +1,149 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors/detail` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Hypervisor response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct HypervisorResponse { + /// The actual free disk on this hypervisor(in GiB). If allocation ratios + /// used for overcommit are configured, this may be negative. This is + /// intentional as it provides insight into the amount by which the disk is + /// overcommitted. + /// + /// **Available until version 2.87** + #[serde(default)] + #[structable(optional, wide)] + pub disk_available_least: Option, + + /// The IP address of the hypervisor’s host. + #[structable(optional, wide)] + pub host_ip: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable(wide)] + pub hypervisor_hostname: String, + + /// The hypervisor type. + #[structable(wide)] + pub hypervisor_type: String, + + /// The hypervisor version. + #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + #[structable(wide)] + pub hypervisor_version: i64, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: String, + + /// A list of `server` objects. Before microversion 2.75, this field is + /// only returned if non-empty. From microversion 2.75, this field will + /// always be returned unless the `with_servers` query parameter is + /// provided and is set to `false`. + /// + /// **New in version 2.53** + #[serde(default)] + #[structable(optional, serialize, wide)] + pub servers: Option>, + + /// The hypervisor service object. + #[structable(serialize, wide)] + pub service: Service, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// The response format of this api depends on the virt driver in use on a + /// given host. The libvirt driver returns the output of the uptime command + /// directly, the z/VM driver returns the ILP time. All other drivers + /// always return null. Note this value is cached and updated periodically. + /// + /// **New in version 2.88** + #[structable(optional, wide)] + pub uptime: Option, +} + +/// `Servers` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Servers { + pub name: String, + pub uuid: String, +} + +/// The hypervisor service object. +/// `Service` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Service { + pub disabled_reason: Option, + pub host: String, + pub id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/search/response.rs b/types/compute/src/v2/hypervisor/search/response.rs index cb428ee5e..b14bdc049 100644 --- a/types/compute/src/v2/hypervisor/search/response.rs +++ b/types/compute/src/v2/hypervisor/search/response.rs @@ -16,4 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; +pub mod get_21; diff --git a/types/compute/src/v2/hypervisor/search/response/get.rs b/types/compute/src/v2/hypervisor/search/response/get_21.rs similarity index 100% rename from types/compute/src/v2/hypervisor/search/response/get.rs rename to types/compute/src/v2/hypervisor/search/response/get_21.rs diff --git a/types/compute/src/v2/hypervisor/server/response.rs b/types/compute/src/v2/hypervisor/server/response.rs index cb428ee5e..b14bdc049 100644 --- a/types/compute/src/v2/hypervisor/server/response.rs +++ b/types/compute/src/v2/hypervisor/server/response.rs @@ -16,4 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; +pub mod get_21; diff --git a/types/compute/src/v2/hypervisor/server/response/get.rs b/types/compute/src/v2/hypervisor/server/response/get_21.rs similarity index 100% rename from types/compute/src/v2/hypervisor/server/response/get.rs rename to types/compute/src/v2/hypervisor/server/response/get_21.rs diff --git a/types/compute/src/v2/hypervisor/statistic/response.rs b/types/compute/src/v2/hypervisor/statistic/response.rs index cb428ee5e..b14bdc049 100644 --- a/types/compute/src/v2/hypervisor/statistic/response.rs +++ b/types/compute/src/v2/hypervisor/statistic/response.rs @@ -16,4 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; +pub mod get_21; diff --git a/types/compute/src/v2/hypervisor/statistic/response/get.rs b/types/compute/src/v2/hypervisor/statistic/response/get_21.rs similarity index 100% rename from types/compute/src/v2/hypervisor/statistic/response/get.rs rename to types/compute/src/v2/hypervisor/statistic/response/get_21.rs diff --git a/types/compute/src/v2/hypervisor/uptime/response.rs b/types/compute/src/v2/hypervisor/uptime/response.rs index cb428ee5e..d70209036 100644 --- a/types/compute/src/v2/hypervisor/uptime/response.rs +++ b/types/compute/src/v2/hypervisor/uptime/response.rs @@ -16,4 +16,5 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; +pub mod get_21; +pub mod get_253; diff --git a/types/compute/src/v2/hypervisor/uptime/response/get_21.rs b/types/compute/src/v2/hypervisor/uptime/response/get_21.rs new file mode 100644 index 000000000..a70a543c0 --- /dev/null +++ b/types/compute/src/v2/hypervisor/uptime/response/get_21.rs @@ -0,0 +1,91 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-hypervisors/{id}/uptime` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Uptime response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct UptimeResponse { + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. + #[structable()] + pub hypervisor_hostname: String, + + /// The id of the hypervisor as a UUID. + /// + /// **New in version 2.53** + #[structable()] + pub id: i32, + + /// The state of the hypervisor. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the hypervisor. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// The total uptime of the hypervisor and information about average load. + #[structable(optional)] + pub uptime: Option, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/hypervisor/uptime/response/get.rs b/types/compute/src/v2/hypervisor/uptime/response/get_253.rs similarity index 100% rename from types/compute/src/v2/hypervisor/uptime/response/get.rs rename to types/compute/src/v2/hypervisor/uptime/response/get_253.rs diff --git a/types/compute/src/v2/instance_usage_audit_log/response/get.rs b/types/compute/src/v2/instance_usage_audit_log/response/get.rs index 331ff2591..dc96402af 100644 --- a/types/compute/src/v2/instance_usage_audit_log/response/get.rs +++ b/types/compute/src/v2/instance_usage_audit_log/response/get.rs @@ -17,57 +17,35 @@ //! Response type for the GET `os-instance_usage_audit_log/{id}` operation use serde::{Deserialize, Serialize}; -use serde_json::Value; use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; /// InstanceUsageAuditLog response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct InstanceUsageAuditLogResponse { - /// The number of errors. - #[serde(default)] - #[structable(optional)] - pub errors: Option, - /// A list of the hosts whose instance audit tasks have not run. - #[serde(default)] - #[structable(optional, serialize)] - pub hosts_not_run: Option>, - - /// The number of instances. - #[serde(default)] - #[structable(optional)] - pub instances: Option, + #[structable(serialize)] + pub hosts_not_run: Vec, /// The object of instance usage audit logs. - #[serde(default)] - #[structable(optional, serialize)] - pub log: Option>, - - /// The log message of the instance usage audit task. - #[serde(default)] - #[structable(optional)] - pub message: Option, + #[structable(serialize)] + pub log: BTreeMap, /// The number of the hosts. - #[serde(default)] - #[structable(optional)] - pub num_hosts: Option, + #[structable()] + pub num_hosts: u32, /// The number of the hosts whose instance audit tasks have been done. - #[serde(default)] - #[structable(optional)] - pub num_hosts_done: Option, + #[structable()] + pub num_hosts_done: u32, /// The number of the hosts whose instance audit tasks have not run. - #[serde(default)] - #[structable(optional)] - pub num_hosts_not_run: Option, + #[structable()] + pub num_hosts_not_run: u32, /// The number of the hosts whose instance audit tasks are running. - #[serde(default)] - #[structable(optional)] - pub num_hosts_running: Option, + #[structable()] + pub num_hosts_running: u32, /// The overall status of instance audit tasks. /// @@ -84,36 +62,26 @@ pub struct InstanceUsageAuditLogResponse { /// ```text /// ALL hosts done. K errors. /// ``` - #[serde(default)] - #[structable(optional)] - pub overall_status: Option, + #[structable()] + pub overall_status: String, /// The beginning time of the instance usage audit period. For example, /// `2016-05-01 00:00:00`. - #[serde(default)] - #[structable(optional)] - pub period_beginning: Option, + #[structable()] + pub period_beginning: String, /// The ending time of the instance usage audit period. For example, /// `2016-06-01 00:00:00`. - #[serde(default)] - #[structable(optional)] - pub period_ending: Option, - - /// The state of the instance usage audit task. `DONE` or `RUNNING`. - #[serde(default)] - #[structable(optional, serialize)] - pub state: Option, + #[structable()] + pub period_ending: String, /// The total number of instance audit task errors. - #[serde(default)] - #[structable(optional)] - pub total_errors: Option, + #[structable()] + pub total_errors: u32, /// The total number of VM instances in the period. - #[serde(default)] - #[structable(optional)] - pub total_instances: Option, + #[structable()] + pub total_instances: u32, } #[derive(Debug, Deserialize, Clone, Serialize)] @@ -137,3 +105,16 @@ impl std::str::FromStr for State { } } } + +/// `Log` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Log { + #[serde(default)] + pub errors: Option, + #[serde(default)] + pub instances: Option, + #[serde(default)] + pub message: Option, + #[serde(default)] + pub state: Option, +} diff --git a/types/compute/src/v2/instance_usage_audit_log/response/list.rs b/types/compute/src/v2/instance_usage_audit_log/response/list.rs index bd172d047..cbada7020 100644 --- a/types/compute/src/v2/instance_usage_audit_log/response/list.rs +++ b/types/compute/src/v2/instance_usage_audit_log/response/list.rs @@ -17,57 +17,35 @@ //! Response type for the GET `os-instance_usage_audit_log` operation use serde::{Deserialize, Serialize}; -use serde_json::Value; use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; /// InstanceUsageAuditLog response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct InstanceUsageAuditLogResponse { - /// The number of errors. - #[serde(default)] - #[structable(optional, wide)] - pub errors: Option, - /// A list of the hosts whose instance audit tasks have not run. - #[serde(default)] - #[structable(optional, serialize, wide)] - pub hosts_not_run: Option>, - - /// The number of instances. - #[serde(default)] - #[structable(optional, wide)] - pub instances: Option, + #[structable(serialize, wide)] + pub hosts_not_run: Vec, /// The object of instance usage audit logs. - #[serde(default)] - #[structable(optional, serialize, wide)] - pub log: Option>, - - /// The log message of the instance usage audit task. - #[serde(default)] - #[structable(optional, wide)] - pub message: Option, + #[structable(serialize)] + pub log: BTreeMap, /// The number of the hosts. - #[serde(default)] - #[structable(optional)] - pub num_hosts: Option, + #[structable()] + pub num_hosts: u32, /// The number of the hosts whose instance audit tasks have been done. - #[serde(default)] - #[structable(optional)] - pub num_hosts_done: Option, + #[structable()] + pub num_hosts_done: u32, /// The number of the hosts whose instance audit tasks have not run. - #[serde(default)] - #[structable(optional)] - pub num_hosts_not_run: Option, + #[structable()] + pub num_hosts_not_run: u32, /// The number of the hosts whose instance audit tasks are running. - #[serde(default)] - #[structable(optional)] - pub num_hosts_running: Option, + #[structable()] + pub num_hosts_running: u32, /// The overall status of instance audit tasks. /// @@ -84,36 +62,26 @@ pub struct InstanceUsageAuditLogResponse { /// ```text /// ALL hosts done. K errors. /// ``` - #[serde(default)] - #[structable(optional)] - pub overall_status: Option, + #[structable()] + pub overall_status: String, /// The beginning time of the instance usage audit period. For example, /// `2016-05-01 00:00:00`. - #[serde(default)] - #[structable(optional)] - pub period_beginning: Option, + #[structable()] + pub period_beginning: String, /// The ending time of the instance usage audit period. For example, /// `2016-06-01 00:00:00`. - #[serde(default)] - #[structable(optional)] - pub period_ending: Option, - - /// The state of the instance usage audit task. `DONE` or `RUNNING`. - #[serde(default)] - #[structable(optional, serialize, status)] - pub state: Option, + #[structable()] + pub period_ending: String, /// The total number of instance audit task errors. - #[serde(default)] - #[structable(optional)] - pub total_errors: Option, + #[structable()] + pub total_errors: u32, /// The total number of VM instances in the period. - #[serde(default)] - #[structable(optional)] - pub total_instances: Option, + #[structable()] + pub total_instances: u32, } #[derive(Debug, Deserialize, Clone, Serialize)] @@ -137,3 +105,16 @@ impl std::str::FromStr for State { } } } + +/// `Log` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Log { + #[serde(default)] + pub errors: Option, + #[serde(default)] + pub instances: Option, + #[serde(default)] + pub message: Option, + #[serde(default)] + pub state: Option, +} diff --git a/types/compute/src/v2/keypair/response.rs b/types/compute/src/v2/keypair/response.rs index 57479c591..04c6a3eb0 100644 --- a/types/compute/src/v2/keypair/response.rs +++ b/types/compute/src/v2/keypair/response.rs @@ -16,6 +16,11 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod create; -pub mod get; -pub mod list; +pub mod create_20; +pub mod create_22; +pub mod create_292; +pub mod get_20; +pub mod get_22; +pub mod list_20; +pub mod list_22; +pub mod list_235; diff --git a/types/compute/src/v2/keypair/response/create.rs b/types/compute/src/v2/keypair/response/create_20.rs similarity index 89% rename from types/compute/src/v2/keypair/response/create.rs rename to types/compute/src/v2/keypair/response/create_20.rs index a15f99869..346e06228 100644 --- a/types/compute/src/v2/keypair/response/create.rs +++ b/types/compute/src/v2/keypair/response/create_20.rs @@ -44,10 +44,7 @@ pub struct KeypairResponse { #[structable()] pub public_key: String, - /// The type of the keypair. Allowed values are `ssh` or `x509`. - /// - /// **New in version 2.2** - #[serde(rename = "type")] - #[structable(title = "type")] - pub _type: String, + /// The user_id for a keypair. + #[structable()] + pub user_id: String, } diff --git a/types/compute/src/v2/keypair/response/create_22.rs b/types/compute/src/v2/keypair/response/create_22.rs new file mode 100644 index 000000000..e8b8501b6 --- /dev/null +++ b/types/compute/src/v2/keypair/response/create_22.rs @@ -0,0 +1,79 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-keypairs` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Keypair response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct KeypairResponse { + /// The fingerprint for the keypair. + #[structable()] + pub fingerprint: String, + + /// The name for the keypair. + #[structable()] + pub name: String, + + /// If you do not provide a public key on create, a new keypair will be + /// built for you, and the private key will be returned during the initial + /// create call. Make sure to save this, as there is no way to get this + /// private key again in the future. + /// + /// **Available until version 2.91** + #[serde(default)] + #[structable(optional)] + pub private_key: Option, + + /// The keypair public key. + #[structable()] + pub public_key: String, + + /// The type of the keypair. Allowed values are `ssh` or `x509`. + /// + /// **New in version 2.2** + #[serde(rename = "type")] + #[structable(serialize, title = "type")] + pub _type: Type, + + /// The user_id for a keypair. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Type { + // Ssh + #[serde(rename = "ssh")] + Ssh, + + // X509 + #[serde(rename = "x509")] + X509, +} + +impl std::str::FromStr for Type { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ssh" => Ok(Self::Ssh), + "x509" => Ok(Self::X509), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/os_get_rdpconsole.rs b/types/compute/src/v2/keypair/response/create_292.rs similarity index 63% rename from types/compute/src/v2/server/response/os_get_rdpconsole.rs rename to types/compute/src/v2/keypair/response/create_292.rs index a0232f16b..0d262a2df 100644 --- a/types/compute/src/v2/server/response/os_get_rdpconsole.rs +++ b/types/compute/src/v2/keypair/response/create_292.rs @@ -14,51 +14,55 @@ // // WARNING: This file is automatically generated from OpenAPI schema using // `openstack-codegenerator`. -//! Response type for the POST `servers/{id}/action` operation +//! Response type for the POST `os-keypairs` operation use serde::{Deserialize, Serialize}; use structable::{StructTable, StructTableOptions}; -/// Server response representation +/// Keypair response representation #[derive(Clone, Deserialize, Serialize, StructTable)] -pub struct ServerResponse { - /// The type of the remote console +pub struct KeypairResponse { + /// The fingerprint for the keypair. + #[structable()] + pub fingerprint: String, + + /// The name for the keypair. + #[structable()] + pub name: String, + + /// The keypair public key. + #[structable()] + pub public_key: String, + + /// The type of the keypair. Allowed values are `ssh` or `x509`. + /// + /// **New in version 2.2** #[serde(rename = "type")] #[structable(serialize, title = "type")] pub _type: Type, - /// The URL used to connect to the console. + /// The user_id for a keypair. #[structable()] - pub url: String, + pub user_id: String, } #[derive(Debug, Deserialize, Clone, Serialize)] pub enum Type { - // Novnc - #[serde(rename = "novnc")] - Novnc, - - // RdpHtml5 - #[serde(rename = "rdp-html5")] - RdpHtml5, - - // Serial - #[serde(rename = "serial")] - Serial, + // Ssh + #[serde(rename = "ssh")] + Ssh, - // SpiceHtml5 - #[serde(rename = "spice-html5")] - SpiceHtml5, + // X509 + #[serde(rename = "x509")] + X509, } impl std::str::FromStr for Type { type Err = (); fn from_str(input: &str) -> Result { match input { - "novnc" => Ok(Self::Novnc), - "rdp-html5" => Ok(Self::RdpHtml5), - "serial" => Ok(Self::Serial), - "spice-html5" => Ok(Self::SpiceHtml5), + "ssh" => Ok(Self::Ssh), + "x509" => Ok(Self::X509), _ => Err(()), } } diff --git a/types/compute/src/v2/keypair/response/get_20.rs b/types/compute/src/v2/keypair/response/get_20.rs new file mode 100644 index 000000000..eee3fe1bf --- /dev/null +++ b/types/compute/src/v2/keypair/response/get_20.rs @@ -0,0 +1,71 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-keypairs/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use structable::{StructTable, StructTableOptions}; + +/// Keypair response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct KeypairResponse { + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// A boolean indicates whether this keypair is deleted or not. The value + /// is always `false` (not deleted). + #[structable()] + pub deleted: bool, + + /// It is always `null`. + #[structable()] + pub deleted_at: Value, + + /// The fingerprint for the keypair. + #[structable()] + pub fingerprint: String, + + /// The keypair ID. + #[structable()] + pub id: i32, + + /// The name for the keypair. + #[structable()] + pub name: String, + + /// The keypair public key. + #[structable()] + pub public_key: String, + + /// It is always `null`. + #[structable()] + pub updated_at: Value, + + /// The user_id for a keypair. + #[structable()] + pub user_id: String, +} diff --git a/types/compute/src/v2/keypair/response/get_22.rs b/types/compute/src/v2/keypair/response/get_22.rs new file mode 100644 index 000000000..ee6ae897f --- /dev/null +++ b/types/compute/src/v2/keypair/response/get_22.rs @@ -0,0 +1,100 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-keypairs/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use structable::{StructTable, StructTableOptions}; + +/// Keypair response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct KeypairResponse { + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// A boolean indicates whether this keypair is deleted or not. The value + /// is always `false` (not deleted). + #[structable()] + pub deleted: bool, + + /// It is always `null`. + #[structable()] + pub deleted_at: Value, + + /// The fingerprint for the keypair. + #[structable()] + pub fingerprint: String, + + /// The keypair ID. + #[structable()] + pub id: i32, + + /// The name for the keypair. + #[structable()] + pub name: String, + + /// The keypair public key. + #[structable()] + pub public_key: String, + + /// The type of the keypair. Allowed values are `ssh` or `x509`. + /// + /// **New in version 2.2** + #[serde(rename = "type")] + #[structable(serialize, title = "type")] + pub _type: Type, + + /// It is always `null`. + #[structable()] + pub updated_at: Value, + + /// The user_id for a keypair. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Type { + // Ssh + #[serde(rename = "ssh")] + Ssh, + + // X509 + #[serde(rename = "x509")] + X509, +} + +impl std::str::FromStr for Type { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ssh" => Ok(Self::Ssh), + "x509" => Ok(Self::X509), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/keypair/response/list.rs b/types/compute/src/v2/keypair/response/list_20.rs similarity index 85% rename from types/compute/src/v2/keypair/response/list.rs rename to types/compute/src/v2/keypair/response/list_20.rs index ac08d8c1f..f25c34f72 100644 --- a/types/compute/src/v2/keypair/response/list.rs +++ b/types/compute/src/v2/keypair/response/list_20.rs @@ -33,11 +33,4 @@ pub struct KeypairResponse { /// The keypair public key. #[structable()] pub public_key: String, - - /// The type of the keypair. Allowed values are `ssh` or `x509`. - /// - /// **New in version 2.2** - #[serde(rename = "type")] - #[structable(title = "type", wide)] - pub _type: String, } diff --git a/types/compute/src/v2/keypair/response/get.rs b/types/compute/src/v2/keypair/response/list_22.rs similarity index 70% rename from types/compute/src/v2/keypair/response/get.rs rename to types/compute/src/v2/keypair/response/list_22.rs index 7ed2a2456..8c97882be 100644 --- a/types/compute/src/v2/keypair/response/get.rs +++ b/types/compute/src/v2/keypair/response/list_22.rs @@ -14,7 +14,7 @@ // // WARNING: This file is automatically generated from OpenAPI schema using // `openstack-codegenerator`. -//! Response type for the GET `os-keypairs/{id}` operation +//! Response type for the GET `os-keypairs` operation use serde::{Deserialize, Serialize}; use structable::{StructTable, StructTableOptions}; @@ -26,10 +26,6 @@ pub struct KeypairResponse { #[structable()] pub fingerprint: String, - /// The keypair ID. - #[structable()] - pub id: i32, - /// The name for the keypair. #[structable()] pub name: String, @@ -42,6 +38,28 @@ pub struct KeypairResponse { /// /// **New in version 2.2** #[serde(rename = "type")] - #[structable(title = "type")] - pub _type: String, + #[structable(serialize, title = "type", wide)] + pub _type: Type, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Type { + // Ssh + #[serde(rename = "ssh")] + Ssh, + + // X509 + #[serde(rename = "x509")] + X509, +} + +impl std::str::FromStr for Type { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ssh" => Ok(Self::Ssh), + "x509" => Ok(Self::X509), + _ => Err(()), + } + } } diff --git a/types/compute/src/v2/keypair/response/list_235.rs b/types/compute/src/v2/keypair/response/list_235.rs new file mode 100644 index 000000000..8c97882be --- /dev/null +++ b/types/compute/src/v2/keypair/response/list_235.rs @@ -0,0 +1,65 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-keypairs` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Keypair response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct KeypairResponse { + /// The fingerprint for the keypair. + #[structable()] + pub fingerprint: String, + + /// The name for the keypair. + #[structable()] + pub name: String, + + /// The keypair public key. + #[structable()] + pub public_key: String, + + /// The type of the keypair. Allowed values are `ssh` or `x509`. + /// + /// **New in version 2.2** + #[serde(rename = "type")] + #[structable(serialize, title = "type", wide)] + pub _type: Type, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Type { + // Ssh + #[serde(rename = "ssh")] + Ssh, + + // X509 + #[serde(rename = "x509")] + X509, +} + +impl std::str::FromStr for Type { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ssh" => Ok(Self::Ssh), + "x509" => Ok(Self::X509), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/limit/response.rs b/types/compute/src/v2/limit/response.rs index d3864d160..7780a2625 100644 --- a/types/compute/src/v2/limit/response.rs +++ b/types/compute/src/v2/limit/response.rs @@ -16,4 +16,7 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod list; +pub mod list_21; +pub mod list_236; +pub mod list_239; +pub mod list_257; diff --git a/types/compute/src/v2/limit/response/list_21.rs b/types/compute/src/v2/limit/response/list_21.rs new file mode 100644 index 000000000..6edc4971b --- /dev/null +++ b/types/compute/src/v2/limit/response/list_21.rs @@ -0,0 +1,78 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `limits` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Limit response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct LimitResponse { + /// Name/value pairs that set quota limits within a deployment and + /// Name/value pairs of resource usage. + #[structable(serialize)] + pub absolute: Absolute, + + /// An empty list for backwards compatibility purposes. + #[structable(serialize)] + pub rate: Vec, +} + +/// Name/value pairs that set quota limits within a deployment and Name/value +/// pairs of resource usage. +/// `Absolute` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Absolute { + #[serde(rename = "maxImageMeta")] + pub max_image_meta: i32, + #[serde(rename = "maxPersonality")] + pub max_personality: i32, + #[serde(rename = "maxPersonalitySize")] + pub max_personality_size: i32, + #[serde(rename = "maxSecurityGroupRules")] + pub max_security_group_rules: i32, + #[serde(rename = "maxSecurityGroups")] + pub max_security_groups: i32, + #[serde(rename = "maxServerGroupMembers")] + pub max_server_group_members: i32, + #[serde(rename = "maxServerGroups")] + pub max_server_groups: i32, + #[serde(rename = "maxServerMeta")] + pub max_server_meta: i32, + #[serde(rename = "maxTotalCores")] + pub max_total_cores: i32, + #[serde(rename = "maxTotalFloatingIps")] + pub max_total_floating_ips: i32, + #[serde(rename = "maxTotalInstances")] + pub max_total_instances: i32, + #[serde(rename = "maxTotalKeypairs")] + pub max_total_keypairs: i32, + #[serde(rename = "maxTotalRAMSize")] + pub max_total_ramsize: i32, + #[serde(rename = "totalCoresUsed")] + pub total_cores_used: i32, + #[serde(rename = "totalFloatingIpsUsed")] + pub total_floating_ips_used: i32, + #[serde(rename = "totalInstancesUsed")] + pub total_instances_used: i32, + #[serde(rename = "totalRAMUsed")] + pub total_ramused: i32, + #[serde(rename = "totalSecurityGroupsUsed")] + pub total_security_groups_used: i32, + #[serde(rename = "totalServerGroupsUsed")] + pub total_server_groups_used: i32, +} diff --git a/types/compute/src/v2/limit/response/list_236.rs b/types/compute/src/v2/limit/response/list_236.rs new file mode 100644 index 000000000..0506af4e7 --- /dev/null +++ b/types/compute/src/v2/limit/response/list_236.rs @@ -0,0 +1,68 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `limits` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Limit response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct LimitResponse { + /// Name/value pairs that set quota limits within a deployment and + /// Name/value pairs of resource usage. + #[structable(serialize)] + pub absolute: Absolute, + + /// An empty list for backwards compatibility purposes. + #[structable(serialize)] + pub rate: Vec, +} + +/// Name/value pairs that set quota limits within a deployment and Name/value +/// pairs of resource usage. +/// `Absolute` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Absolute { + #[serde(rename = "maxImageMeta")] + pub max_image_meta: i32, + #[serde(rename = "maxPersonality")] + pub max_personality: i32, + #[serde(rename = "maxPersonalitySize")] + pub max_personality_size: i32, + #[serde(rename = "maxServerGroupMembers")] + pub max_server_group_members: i32, + #[serde(rename = "maxServerGroups")] + pub max_server_groups: i32, + #[serde(rename = "maxServerMeta")] + pub max_server_meta: i32, + #[serde(rename = "maxTotalCores")] + pub max_total_cores: i32, + #[serde(rename = "maxTotalInstances")] + pub max_total_instances: i32, + #[serde(rename = "maxTotalKeypairs")] + pub max_total_keypairs: i32, + #[serde(rename = "maxTotalRAMSize")] + pub max_total_ramsize: i32, + #[serde(rename = "totalCoresUsed")] + pub total_cores_used: i32, + #[serde(rename = "totalInstancesUsed")] + pub total_instances_used: i32, + #[serde(rename = "totalRAMUsed")] + pub total_ramused: i32, + #[serde(rename = "totalServerGroupsUsed")] + pub total_server_groups_used: i32, +} diff --git a/types/compute/src/v2/limit/response/list_239.rs b/types/compute/src/v2/limit/response/list_239.rs new file mode 100644 index 000000000..a05fba308 --- /dev/null +++ b/types/compute/src/v2/limit/response/list_239.rs @@ -0,0 +1,66 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `limits` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Limit response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct LimitResponse { + /// Name/value pairs that set quota limits within a deployment and + /// Name/value pairs of resource usage. + #[structable(serialize)] + pub absolute: Absolute, + + /// An empty list for backwards compatibility purposes. + #[structable(serialize)] + pub rate: Vec, +} + +/// Name/value pairs that set quota limits within a deployment and Name/value +/// pairs of resource usage. +/// `Absolute` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Absolute { + #[serde(rename = "maxPersonality")] + pub max_personality: i32, + #[serde(rename = "maxPersonalitySize")] + pub max_personality_size: i32, + #[serde(rename = "maxServerGroupMembers")] + pub max_server_group_members: i32, + #[serde(rename = "maxServerGroups")] + pub max_server_groups: i32, + #[serde(rename = "maxServerMeta")] + pub max_server_meta: i32, + #[serde(rename = "maxTotalCores")] + pub max_total_cores: i32, + #[serde(rename = "maxTotalInstances")] + pub max_total_instances: i32, + #[serde(rename = "maxTotalKeypairs")] + pub max_total_keypairs: i32, + #[serde(rename = "maxTotalRAMSize")] + pub max_total_ramsize: i32, + #[serde(rename = "totalCoresUsed")] + pub total_cores_used: i32, + #[serde(rename = "totalInstancesUsed")] + pub total_instances_used: i32, + #[serde(rename = "totalRAMUsed")] + pub total_ramused: i32, + #[serde(rename = "totalServerGroupsUsed")] + pub total_server_groups_used: i32, +} diff --git a/types/compute/src/v2/limit/response/list.rs b/types/compute/src/v2/limit/response/list_257.rs similarity index 56% rename from types/compute/src/v2/limit/response/list.rs rename to types/compute/src/v2/limit/response/list_257.rs index 1ef29632b..fa0c6ffed 100644 --- a/types/compute/src/v2/limit/response/list.rs +++ b/types/compute/src/v2/limit/response/list_257.rs @@ -26,6 +26,10 @@ pub struct LimitResponse { /// Name/value pairs of resource usage. #[structable(serialize)] pub absolute: Absolute, + + /// An empty list for backwards compatibility purposes. + #[structable(serialize)] + pub rate: Vec, } /// Name/value pairs that set quota limits within a deployment and Name/value @@ -33,26 +37,26 @@ pub struct LimitResponse { /// `Absolute` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Absolute { - #[serde(default, rename = "maxServerGroupMembers")] - pub max_server_group_members: Option, - #[serde(default, rename = "maxServerGroups")] - pub max_server_groups: Option, - #[serde(default, rename = "maxServerMetamaxServerMeta")] - pub max_server_metamax_server_meta: Option, - #[serde(default, rename = "maxTotalCores")] - pub max_total_cores: Option, - #[serde(default, rename = "maxTotalInstances")] - pub max_total_instances: Option, - #[serde(default, rename = "maxTotalKeypairs")] - pub max_total_keypairs: Option, - #[serde(default, rename = "maxTotalRAMSize")] - pub max_total_ramsize: Option, - #[serde(default, rename = "totalCoresUsed")] - pub total_cores_used: Option, - #[serde(default, rename = "totalInstancesUsed")] - pub total_instances_used: Option, - #[serde(default, rename = "totalRAMUsed")] - pub total_ramused: Option, - #[serde(default, rename = "totalServerGroupsUsed")] - pub total_server_groups_used: Option, + #[serde(rename = "maxServerGroupMembers")] + pub max_server_group_members: i32, + #[serde(rename = "maxServerGroups")] + pub max_server_groups: i32, + #[serde(rename = "maxServerMeta")] + pub max_server_meta: i32, + #[serde(rename = "maxTotalCores")] + pub max_total_cores: i32, + #[serde(rename = "maxTotalInstances")] + pub max_total_instances: i32, + #[serde(rename = "maxTotalKeypairs")] + pub max_total_keypairs: i32, + #[serde(rename = "maxTotalRAMSize")] + pub max_total_ramsize: i32, + #[serde(rename = "totalCoresUsed")] + pub total_cores_used: i32, + #[serde(rename = "totalInstancesUsed")] + pub total_instances_used: i32, + #[serde(rename = "totalRAMUsed")] + pub total_ramused: i32, + #[serde(rename = "totalServerGroupsUsed")] + pub total_server_groups_used: i32, } diff --git a/types/compute/src/v2/migration/response.rs b/types/compute/src/v2/migration/response.rs index cb428ee5e..0daa42da9 100644 --- a/types/compute/src/v2/migration/response.rs +++ b/types/compute/src/v2/migration/response.rs @@ -16,4 +16,7 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; +pub mod get_20; +pub mod get_223; +pub mod get_259; +pub mod get_280; diff --git a/types/compute/src/v2/migration/response/get_20.rs b/types/compute/src/v2/migration/response/get_20.rs new file mode 100644 index 000000000..c504d588a --- /dev/null +++ b/types/compute/src/v2/migration/response/get_20.rs @@ -0,0 +1,106 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-migrations` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Migration response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct MigrationResponse { + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// The target compute for a migration. + #[structable(optional)] + pub dest_compute: Option, + + /// The target host for a migration. + #[structable(optional)] + pub dest_host: Option, + + /// The target node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub dest_node: Option, + + /// The ID of the server migration. + #[structable()] + pub id: i32, + + /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// In `resize` case, the flavor ID for resizing the server. In the other + /// cases, this parameter is same as the flavor ID of the server when the + /// migration was started. + /// + /// Note + /// + /// This is an internal ID and is not exposed in any other API. In + /// particular, this is not the ID specified or automatically generated + /// during flavor creation or returned via the `GET /flavors` API. + #[structable(optional)] + pub new_instance_type_id: Option, + + /// The flavor ID of the server when the migration was started. + /// + /// Note + /// + /// This is an internal ID and is not exposed in any other API. In + /// particular, this is not the ID specified or automatically generated + /// during flavor creation or returned via the `GET /flavors` API. + #[structable(optional)] + pub old_instance_type_id: Option, + + /// The source compute for a migration. + #[structable(optional)] + pub source_compute: Option, + + /// The source node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub source_node: Option, + + /// The current status of the migration. + #[structable()] + pub status: 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`. + #[structable(optional)] + pub updated_at: Option, +} diff --git a/types/compute/src/v2/migration/response/get.rs b/types/compute/src/v2/migration/response/get_223.rs similarity index 76% rename from types/compute/src/v2/migration/response/get.rs rename to types/compute/src/v2/migration/response/get_223.rs index 7d42dfcd0..d2896a0e9 100644 --- a/types/compute/src/v2/migration/response/get.rs +++ b/types/compute/src/v2/migration/response/get_223.rs @@ -32,43 +32,47 @@ pub struct MigrationResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub created_at: Option, + #[structable()] + pub created_at: String, /// The target compute for a migration. - #[serde(default)] #[structable(optional)] pub dest_compute: Option, /// The target host for a migration. - #[serde(default)] #[structable(optional)] pub dest_host: Option, /// The target node for a migration. This will be `null` if pre-migration /// checks fail due to e.g. insufficient resources. - #[serde(default)] #[structable(optional)] pub dest_node: Option, /// The ID of the server migration. - #[serde(default)] - #[structable(optional)] - pub id: Option, + #[structable()] + pub id: i32, /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// Links to the migration. This parameter is returned if the migration + /// type is `live-migration` and the migration status is one of `queued`, + /// `preparing`, `running` and `post-migrating`. See + /// [Paginated collections](https://docs.openstack.org/api-guide/compute/paginated_collections.html) + /// for more info. + /// + /// **New in version 2.23** #[serde(default)] - #[structable(optional)] - pub instance_uuid: Option, + #[structable(optional, serialize)] + pub links: Option>, /// The type of the server migration. This is one of `live-migration`, /// `migration`, `resize` and `evacuation`. /// /// **New in version 2.23** - #[serde(default)] - #[structable(optional, serialize)] - pub migration_type: Option, + #[structable(serialize)] + pub migration_type: MigrationType, /// In `resize` case, the flavor ID for resizing the server. In the other /// cases, this parameter is same as the flavor ID of the server when the @@ -79,7 +83,6 @@ pub struct MigrationResponse { /// This is an internal ID and is not exposed in any other API. In /// particular, this is not the ID specified or automatically generated /// during flavor creation or returned via the `GET /flavors` API. - #[serde(default)] #[structable(optional)] pub new_instance_type_id: Option, @@ -90,33 +93,21 @@ pub struct MigrationResponse { /// This is an internal ID and is not exposed in any other API. In /// particular, this is not the ID specified or automatically generated /// during flavor creation or returned via the `GET /flavors` API. - #[serde(default)] #[structable(optional)] pub old_instance_type_id: Option, - /// The ID of the project which initiated the server migration. The value - /// may be `null` for older migration records. - /// - /// **New in version 2.80** - #[serde(default)] - #[structable(optional)] - pub project_id: Option, - /// The source compute for a migration. - #[serde(default)] #[structable(optional)] pub source_compute: Option, /// The source node for a migration. This will be `null` if pre-migration /// checks fail due to e.g. insufficient resources. - #[serde(default)] #[structable(optional)] pub source_node: Option, /// The current status of the migration. - #[serde(default)] - #[structable(optional)] - pub status: Option, + #[structable()] + pub status: 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) @@ -128,28 +119,45 @@ pub struct MigrationResponse { /// 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`. - #[serde(default)] #[structable(optional)] pub updated_at: Option, +} - /// The ID of the user which initiated the server migration. The value may - /// be `null` for older migration records. - /// - /// **New in version 2.80** - #[serde(default)] - #[structable(optional)] - pub user_id: Option, +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} - /// The UUID of the migration. - /// - /// **New in version 2.59** - #[serde(default)] - #[structable(optional)] - pub uuid: Option, +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, } #[derive(Debug, Deserialize, Clone, Serialize)] pub enum MigrationType { + // Evacuation + #[serde(rename = "evacuation")] + Evacuation, + // LiveMigration #[serde(rename = "live-migration")] LiveMigration, @@ -167,6 +175,7 @@ impl std::str::FromStr for MigrationType { type Err = (); fn from_str(input: &str) -> Result { match input { + "evacuation" => Ok(Self::Evacuation), "live-migration" => Ok(Self::LiveMigration), "migration" => Ok(Self::Migration), "resize" => Ok(Self::Resize), diff --git a/types/compute/src/v2/migration/response/get_259.rs b/types/compute/src/v2/migration/response/get_259.rs new file mode 100644 index 000000000..50c5ac2be --- /dev/null +++ b/types/compute/src/v2/migration/response/get_259.rs @@ -0,0 +1,191 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-migrations` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Migration response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct MigrationResponse { + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// The target compute for a migration. + #[structable(optional)] + pub dest_compute: Option, + + /// The target host for a migration. + #[structable(optional)] + pub dest_host: Option, + + /// The target node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub dest_node: Option, + + /// The ID of the server migration. + #[structable()] + pub id: i32, + + /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// Links to the migration. This parameter is returned if the migration + /// type is `live-migration` and the migration status is one of `queued`, + /// `preparing`, `running` and `post-migrating`. See + /// [Paginated collections](https://docs.openstack.org/api-guide/compute/paginated_collections.html) + /// for more info. + /// + /// **New in version 2.23** + #[serde(default)] + #[structable(optional, serialize)] + pub links: Option>, + + /// The type of the server migration. This is one of `live-migration`, + /// `migration`, `resize` and `evacuation`. + /// + /// **New in version 2.23** + #[structable(serialize)] + pub migration_type: MigrationType, + + /// In `resize` case, the flavor ID for resizing the server. In the other + /// cases, this parameter is same as the flavor ID of the server when the + /// migration was started. + /// + /// Note + /// + /// This is an internal ID and is not exposed in any other API. In + /// particular, this is not the ID specified or automatically generated + /// during flavor creation or returned via the `GET /flavors` API. + #[structable(optional)] + pub new_instance_type_id: Option, + + /// The flavor ID of the server when the migration was started. + /// + /// Note + /// + /// This is an internal ID and is not exposed in any other API. In + /// particular, this is not the ID specified or automatically generated + /// during flavor creation or returned via the `GET /flavors` API. + #[structable(optional)] + pub old_instance_type_id: Option, + + /// The source compute for a migration. + #[structable(optional)] + pub source_compute: Option, + + /// The source node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub source_node: Option, + + /// The current status of the migration. + #[structable()] + pub status: 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`. + #[structable(optional)] + pub updated_at: Option, + + /// The UUID of the migration. + /// + /// **New in version 2.59** + #[structable()] + pub uuid: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum MigrationType { + // Evacuation + #[serde(rename = "evacuation")] + Evacuation, + + // LiveMigration + #[serde(rename = "live-migration")] + LiveMigration, + + // Migration + #[serde(rename = "migration")] + Migration, + + // Resize + #[serde(rename = "resize")] + Resize, +} + +impl std::str::FromStr for MigrationType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "evacuation" => Ok(Self::Evacuation), + "live-migration" => Ok(Self::LiveMigration), + "migration" => Ok(Self::Migration), + "resize" => Ok(Self::Resize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/migration/response/get_280.rs b/types/compute/src/v2/migration/response/get_280.rs new file mode 100644 index 000000000..84c9cbbf6 --- /dev/null +++ b/types/compute/src/v2/migration/response/get_280.rs @@ -0,0 +1,205 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-migrations` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Migration response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct MigrationResponse { + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// The target compute for a migration. + #[structable(optional)] + pub dest_compute: Option, + + /// The target host for a migration. + #[structable(optional)] + pub dest_host: Option, + + /// The target node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub dest_node: Option, + + /// The ID of the server migration. + #[structable()] + pub id: i32, + + /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// Links to the migration. This parameter is returned if the migration + /// type is `live-migration` and the migration status is one of `queued`, + /// `preparing`, `running` and `post-migrating`. See + /// [Paginated collections](https://docs.openstack.org/api-guide/compute/paginated_collections.html) + /// for more info. + /// + /// **New in version 2.23** + #[serde(default)] + #[structable(optional, serialize)] + pub links: Option>, + + /// The type of the server migration. This is one of `live-migration`, + /// `migration`, `resize` and `evacuation`. + /// + /// **New in version 2.23** + #[structable(serialize)] + pub migration_type: MigrationType, + + /// In `resize` case, the flavor ID for resizing the server. In the other + /// cases, this parameter is same as the flavor ID of the server when the + /// migration was started. + /// + /// Note + /// + /// This is an internal ID and is not exposed in any other API. In + /// particular, this is not the ID specified or automatically generated + /// during flavor creation or returned via the `GET /flavors` API. + #[structable(optional)] + pub new_instance_type_id: Option, + + /// The flavor ID of the server when the migration was started. + /// + /// Note + /// + /// This is an internal ID and is not exposed in any other API. In + /// particular, this is not the ID specified or automatically generated + /// during flavor creation or returned via the `GET /flavors` API. + #[structable(optional)] + pub old_instance_type_id: Option, + + /// The ID of the project which initiated the server migration. The value + /// may be `null` for older migration records. + /// + /// **New in version 2.80** + #[structable()] + pub project_id: String, + + /// The source compute for a migration. + #[structable(optional)] + pub source_compute: Option, + + /// The source node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub source_node: Option, + + /// The current status of the migration. + #[structable()] + pub status: 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`. + #[structable(optional)] + pub updated_at: Option, + + /// The ID of the user which initiated the server migration. The value may + /// be `null` for older migration records. + /// + /// **New in version 2.80** + #[structable()] + pub user_id: String, + + /// The UUID of the migration. + /// + /// **New in version 2.59** + #[structable()] + pub uuid: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum MigrationType { + // Evacuation + #[serde(rename = "evacuation")] + Evacuation, + + // LiveMigration + #[serde(rename = "live-migration")] + LiveMigration, + + // Migration + #[serde(rename = "migration")] + Migration, + + // Resize + #[serde(rename = "resize")] + Resize, +} + +impl std::str::FromStr for MigrationType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "evacuation" => Ok(Self::Evacuation), + "live-migration" => Ok(Self::LiveMigration), + "migration" => Ok(Self::Migration), + "resize" => Ok(Self::Resize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/quota_class_set/response.rs b/types/compute/src/v2/quota_class_set/response.rs index 59a27b1cf..e14f955c0 100644 --- a/types/compute/src/v2/quota_class_set/response.rs +++ b/types/compute/src/v2/quota_class_set/response.rs @@ -16,5 +16,9 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; -pub mod set; +pub mod get_21; +pub mod get_250; +pub mod get_257; +pub mod set_21; +pub mod set_250; +pub mod set_257; diff --git a/types/compute/src/v2/quota_class_set/response/get_21.rs b/types/compute/src/v2/quota_class_set/response/get_21.rs new file mode 100644 index 000000000..f9f8a7802 --- /dev/null +++ b/types/compute/src/v2/quota_class_set/response/get_21.rs @@ -0,0 +1,92 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-quota-class-sets/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaClassSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaClassSetResponse { + /// The number of allowed server cores for the quota class. + #[structable()] + pub cores: i32, + + /// The number of allowed fixed IP addresses for the quota class. Must be + /// equal to or greater than the number of allowed servers. + /// + /// **Available until version 2.49** + #[structable()] + pub fixed_ips: i32, + + /// The number of allowed floating IP addresses for the quota class. + /// + /// **Available until version 2.49** + #[structable()] + pub floating_ips: i32, + + /// The ID of the quota class. Nova supports the `default` Quota Class + /// only. + #[structable()] + pub id: String, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for the quota class. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for the quota class. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for the quota class. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed instance RAM, in MiB, for the quota class. + #[structable()] + pub ram: i32, + + /// The number of allowed rules for each security group. + /// + /// **Available until version 2.49** + #[structable()] + pub security_group_rules: i32, + + /// The number of allowed security groups for the quota class. + /// + /// **Available until version 2.49** + #[structable()] + pub security_groups: i32, +} diff --git a/types/compute/src/v2/quota_class_set/response/get_250.rs b/types/compute/src/v2/quota_class_set/response/get_250.rs new file mode 100644 index 000000000..4b9710b65 --- /dev/null +++ b/types/compute/src/v2/quota_class_set/response/get_250.rs @@ -0,0 +1,79 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-quota-class-sets/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaClassSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaClassSetResponse { + /// The number of allowed server cores for the quota class. + #[structable()] + pub cores: i32, + + /// The ID of the quota class. Nova supports the `default` Quota Class + /// only. + #[structable()] + pub id: String, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for the quota class. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for the quota class. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for the quota class. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed instance RAM, in MiB, for the quota class. + #[structable()] + pub ram: i32, + + /// The number of allowed members for each server group. + /// + /// **New in version 2.50** + #[structable()] + pub server_group_members: i32, + + /// The number of allowed server groups for the quota class. + /// + /// **New in version 2.50** + #[structable()] + pub server_groups: i32, +} diff --git a/types/compute/src/v2/quota_class_set/response/get.rs b/types/compute/src/v2/quota_class_set/response/get_257.rs similarity index 100% rename from types/compute/src/v2/quota_class_set/response/get.rs rename to types/compute/src/v2/quota_class_set/response/get_257.rs diff --git a/types/compute/src/v2/quota_class_set/response/set_21.rs b/types/compute/src/v2/quota_class_set/response/set_21.rs new file mode 100644 index 000000000..bd552042b --- /dev/null +++ b/types/compute/src/v2/quota_class_set/response/set_21.rs @@ -0,0 +1,87 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `os-quota-class-sets/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaClassSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaClassSetResponse { + /// The number of allowed server cores for the quota class. + #[structable()] + pub cores: i32, + + /// The number of allowed fixed IP addresses for the quota class. Must be + /// equal to or greater than the number of allowed servers. + /// + /// **Available until version 2.49** + #[structable()] + pub fixed_ips: i32, + + /// The number of allowed floating IP addresses for the quota class. + /// + /// **Available until version 2.49** + #[structable()] + pub floating_ips: i32, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for the quota class. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for the quota class. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for the quota class. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed instance RAM, in MiB, for the quota class. + #[structable()] + pub ram: i32, + + /// The number of allowed rules for each security group. + /// + /// **Available until version 2.49** + #[structable()] + pub security_group_rules: i32, + + /// The number of allowed security groups for the quota class. + /// + /// **Available until version 2.49** + #[structable()] + pub security_groups: i32, +} diff --git a/types/compute/src/v2/quota_class_set/response/set_250.rs b/types/compute/src/v2/quota_class_set/response/set_250.rs new file mode 100644 index 000000000..af09d8c26 --- /dev/null +++ b/types/compute/src/v2/quota_class_set/response/set_250.rs @@ -0,0 +1,74 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `os-quota-class-sets/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaClassSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaClassSetResponse { + /// The number of allowed server cores for the quota class. + #[structable()] + pub cores: i32, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for the quota class. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for the quota class. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for the quota class. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed instance RAM, in MiB, for the quota class. + #[structable()] + pub ram: i32, + + /// The number of allowed members for each server group. + /// + /// **New in version 2.50** + #[structable()] + pub server_group_members: i32, + + /// The number of allowed server groups for the quota class. + /// + /// **New in version 2.50** + #[structable()] + pub server_groups: i32, +} diff --git a/types/compute/src/v2/quota_class_set/response/set.rs b/types/compute/src/v2/quota_class_set/response/set_257.rs similarity index 100% rename from types/compute/src/v2/quota_class_set/response/set.rs rename to types/compute/src/v2/quota_class_set/response/set_257.rs diff --git a/types/compute/src/v2/quota_set/response.rs b/types/compute/src/v2/quota_set/response.rs index c57f231a4..426a71401 100644 --- a/types/compute/src/v2/quota_set/response.rs +++ b/types/compute/src/v2/quota_set/response.rs @@ -16,7 +16,15 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod defaults; -pub mod details; -pub mod get; -pub mod set; +pub mod defaults_20; +pub mod defaults_236; +pub mod defaults_257; +pub mod details_20; +pub mod details_236; +pub mod details_257; +pub mod get_20; +pub mod get_236; +pub mod get_257; +pub mod set_20; +pub mod set_236; +pub mod set_257; diff --git a/types/compute/src/v2/quota_set/response/defaults_20.rs b/types/compute/src/v2/quota_set/response/defaults_20.rs new file mode 100644 index 000000000..c9bcfb059 --- /dev/null +++ b/types/compute/src/v2/quota_set/response/defaults_20.rs @@ -0,0 +1,99 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-quota-sets/{id}/defaults` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaSetResponse { + /// The number of allowed server cores for each tenant. + #[structable()] + pub cores: i32, + + /// The number of allowed fixed IP addresses for each tenant. Must be equal + /// to or greater than the number of allowed servers. + /// + /// **Available until version 2.35** + #[structable()] + pub fixed_ips: i32, + + /// The number of allowed floating IP addresses for each tenant. + /// + /// **Available until version 2.35** + #[structable()] + pub floating_ips: i32, + + /// The UUID of the tenant/user the quotas listed for. + #[structable()] + pub id: String, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for each tenant. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for each tenant. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for each user. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed server RAM, in MiB, for each tenant. + #[structable()] + pub ram: i32, + + /// The number of allowed rules for each security group. + /// + /// **Available until version 2.35** + #[structable()] + pub security_group_rules: i32, + + /// The number of allowed security groups for each tenant. + /// + /// **Available until version 2.35** + #[structable()] + pub security_groups: i32, + + /// The number of allowed members for each server group. + #[structable()] + pub server_group_members: i32, + + /// The number of allowed server groups for each tenant. + #[structable()] + pub server_groups: i32, +} diff --git a/types/compute/src/v2/quota_set/response/defaults_236.rs b/types/compute/src/v2/quota_set/response/defaults_236.rs new file mode 100644 index 000000000..cbd3582c6 --- /dev/null +++ b/types/compute/src/v2/quota_set/response/defaults_236.rs @@ -0,0 +1,74 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-quota-sets/{id}/defaults` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaSetResponse { + /// The number of allowed server cores for each tenant. + #[structable()] + pub cores: i32, + + /// The UUID of the tenant/user the quotas listed for. + #[structable()] + pub id: String, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for each tenant. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for each tenant. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for each user. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed server RAM, in MiB, for each tenant. + #[structable()] + pub ram: i32, + + /// The number of allowed members for each server group. + #[structable()] + pub server_group_members: i32, + + /// The number of allowed server groups for each tenant. + #[structable()] + pub server_groups: i32, +} diff --git a/types/compute/src/v2/quota_set/response/defaults.rs b/types/compute/src/v2/quota_set/response/defaults_257.rs similarity index 100% rename from types/compute/src/v2/quota_set/response/defaults.rs rename to types/compute/src/v2/quota_set/response/defaults_257.rs diff --git a/types/compute/src/v2/quota_set/response/details_20.rs b/types/compute/src/v2/quota_set/response/details_20.rs new file mode 100644 index 000000000..bd90c456f --- /dev/null +++ b/types/compute/src/v2/quota_set/response/details_20.rs @@ -0,0 +1,278 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-quota-sets/{id}/detail` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaSetResponse { + /// The object of detailed cores quota, including in_use, limit and + /// reserved number of cores. + #[structable(serialize)] + pub cores: Cores, + + /// The object of detailed fixed ips quota, including in_use, limit and + /// reserved number of fixed ips. + /// + /// **Available until version 2.35** + #[structable(serialize)] + pub fixed_ips: FixedIps, + + /// The object of detailed floating ips quota, including in_use, limit and + /// reserved number of floating ips. + /// + /// **Available until version 2.35** + #[structable(serialize)] + pub floating_ips: FloatingIps, + + /// The UUID of the tenant/user the quotas listed for. + #[structable()] + pub id: String, + + /// The object of detailed injected file content bytes quota, including + /// in_use, limit and reserved number of injected file content bytes. + /// + /// **Available until version 2.56** + #[structable(serialize)] + pub injected_file_content_bytes: InjectedFileContentBytes, + + /// The object of detailed injected file path bytes quota, including + /// in_use, limit and reserved number of injected file path bytes. + /// + /// **Available until version 2.56** + #[structable(serialize)] + pub injected_file_path_bytes: InjectedFilePathBytes, + + /// The object of detailed injected files quota, including in_use, limit + /// and reserved number of injected files. + /// + /// **Available until version 2.56** + #[structable(serialize)] + pub injected_files: InjectedFiles, + + /// The object of detailed servers quota, including in_use, limit and + /// reserved number of instances. + #[structable(serialize)] + pub instances: Instances, + + /// The object of detailed key pairs quota, including in_use, limit and + /// reserved number of key pairs. + /// + /// Note + /// + /// `in_use` field value for keypair quota details is always zero. In Nova, + /// key_pairs are a user-level resource, not a project- level resource, so + /// for legacy reasons, the keypair in-use information is not counted. + #[structable(serialize)] + pub key_pairs: KeyPairs, + + /// The object of detailed key metadata items quota, including in_use, + /// limit and reserved number of metadata items. + #[structable(serialize)] + pub metadata_items: MetadataItems, + + /// The object of detailed key ram quota, including in_use, limit and + /// reserved number of ram. + #[structable(serialize)] + pub ram: Ram, + + /// The object of detailed security group rules quota, including in_use, + /// limit and reserved number of security group rules. + /// + /// **Available until version 2.35** + #[structable(serialize)] + pub security_group_rules: SecurityGroupRules, + + /// The object of detailed security groups, including in_use, limit and + /// reserved number of security groups. + /// + /// **Available until version 2.35** + #[structable(serialize)] + pub security_groups: SecurityGroups, + + /// The object of detailed server group members, including in_use, limit + /// and reserved number of server group members. + #[structable(serialize)] + pub server_group_members: ServerGroupMembers, + + /// The object of detailed server groups, including in_use, limit and + /// reserved number of server groups. + #[structable(serialize)] + pub server_groups: ServerGroups, +} + +/// The object of detailed cores quota, including in_use, limit and reserved +/// number of cores. +/// `Cores` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Cores { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed fixed ips quota, including in_use, limit and +/// reserved number of fixed ips. +/// +/// **Available until version 2.35** +/// `FixedIps` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct FixedIps { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed floating ips quota, including in_use, limit and +/// reserved number of floating ips. +/// +/// **Available until version 2.35** +/// `FloatingIps` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct FloatingIps { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed injected file content bytes quota, including in_use, +/// limit and reserved number of injected file content bytes. +/// +/// **Available until version 2.56** +/// `InjectedFileContentBytes` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct InjectedFileContentBytes { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed injected file path bytes quota, including in_use, +/// limit and reserved number of injected file path bytes. +/// +/// **Available until version 2.56** +/// `InjectedFilePathBytes` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct InjectedFilePathBytes { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed injected files quota, including in_use, limit and +/// reserved number of injected files. +/// +/// **Available until version 2.56** +/// `InjectedFiles` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct InjectedFiles { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed servers quota, including in_use, limit and reserved +/// number of instances. +/// `Instances` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Instances { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed key pairs quota, including in_use, limit and +/// reserved number of key pairs. +/// +/// Note +/// +/// `in_use` field value for keypair quota details is always zero. In Nova, +/// key_pairs are a user-level resource, not a project- level resource, so for +/// legacy reasons, the keypair in-use information is not counted. +/// `KeyPairs` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct KeyPairs { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed key metadata items quota, including in_use, limit +/// and reserved number of metadata items. +/// `MetadataItems` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct MetadataItems { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed key ram quota, including in_use, limit and reserved +/// number of ram. +/// `Ram` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Ram { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed security group rules quota, including in_use, limit +/// and reserved number of security group rules. +/// +/// **Available until version 2.35** +/// `SecurityGroupRules` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroupRules { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed security groups, including in_use, limit and +/// reserved number of security groups. +/// +/// **Available until version 2.35** +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed server group members, including in_use, limit and +/// reserved number of server group members. +/// `ServerGroupMembers` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ServerGroupMembers { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed server groups, including in_use, limit and reserved +/// number of server groups. +/// `ServerGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ServerGroups { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} diff --git a/types/compute/src/v2/quota_set/response/details_236.rs b/types/compute/src/v2/quota_set/response/details_236.rs new file mode 100644 index 000000000..185b10911 --- /dev/null +++ b/types/compute/src/v2/quota_set/response/details_236.rs @@ -0,0 +1,202 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-quota-sets/{id}/detail` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaSetResponse { + /// The object of detailed cores quota, including in_use, limit and + /// reserved number of cores. + #[structable(serialize)] + pub cores: Cores, + + /// The UUID of the tenant/user the quotas listed for. + #[structable()] + pub id: String, + + /// The object of detailed injected file content bytes quota, including + /// in_use, limit and reserved number of injected file content bytes. + /// + /// **Available until version 2.56** + #[structable(serialize)] + pub injected_file_content_bytes: InjectedFileContentBytes, + + /// The object of detailed injected file path bytes quota, including + /// in_use, limit and reserved number of injected file path bytes. + /// + /// **Available until version 2.56** + #[structable(serialize)] + pub injected_file_path_bytes: InjectedFilePathBytes, + + /// The object of detailed injected files quota, including in_use, limit + /// and reserved number of injected files. + /// + /// **Available until version 2.56** + #[structable(serialize)] + pub injected_files: InjectedFiles, + + /// The object of detailed servers quota, including in_use, limit and + /// reserved number of instances. + #[structable(serialize)] + pub instances: Instances, + + /// The object of detailed key pairs quota, including in_use, limit and + /// reserved number of key pairs. + /// + /// Note + /// + /// `in_use` field value for keypair quota details is always zero. In Nova, + /// key_pairs are a user-level resource, not a project- level resource, so + /// for legacy reasons, the keypair in-use information is not counted. + #[structable(serialize)] + pub key_pairs: KeyPairs, + + /// The object of detailed key metadata items quota, including in_use, + /// limit and reserved number of metadata items. + #[structable(serialize)] + pub metadata_items: MetadataItems, + + /// The object of detailed key ram quota, including in_use, limit and + /// reserved number of ram. + #[structable(serialize)] + pub ram: Ram, + + /// The object of detailed server group members, including in_use, limit + /// and reserved number of server group members. + #[structable(serialize)] + pub server_group_members: ServerGroupMembers, + + /// The object of detailed server groups, including in_use, limit and + /// reserved number of server groups. + #[structable(serialize)] + pub server_groups: ServerGroups, +} + +/// The object of detailed cores quota, including in_use, limit and reserved +/// number of cores. +/// `Cores` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Cores { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed injected file content bytes quota, including in_use, +/// limit and reserved number of injected file content bytes. +/// +/// **Available until version 2.56** +/// `InjectedFileContentBytes` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct InjectedFileContentBytes { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed injected file path bytes quota, including in_use, +/// limit and reserved number of injected file path bytes. +/// +/// **Available until version 2.56** +/// `InjectedFilePathBytes` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct InjectedFilePathBytes { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed injected files quota, including in_use, limit and +/// reserved number of injected files. +/// +/// **Available until version 2.56** +/// `InjectedFiles` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct InjectedFiles { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed servers quota, including in_use, limit and reserved +/// number of instances. +/// `Instances` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Instances { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed key pairs quota, including in_use, limit and +/// reserved number of key pairs. +/// +/// Note +/// +/// `in_use` field value for keypair quota details is always zero. In Nova, +/// key_pairs are a user-level resource, not a project- level resource, so for +/// legacy reasons, the keypair in-use information is not counted. +/// `KeyPairs` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct KeyPairs { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed key metadata items quota, including in_use, limit +/// and reserved number of metadata items. +/// `MetadataItems` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct MetadataItems { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed key ram quota, including in_use, limit and reserved +/// number of ram. +/// `Ram` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Ram { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed server group members, including in_use, limit and +/// reserved number of server group members. +/// `ServerGroupMembers` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ServerGroupMembers { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} + +/// The object of detailed server groups, including in_use, limit and reserved +/// number of server groups. +/// `ServerGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ServerGroups { + pub in_use: i32, + pub limit: i32, + pub reserved: i32, +} diff --git a/types/compute/src/v2/quota_set/response/details.rs b/types/compute/src/v2/quota_set/response/details_257.rs similarity index 61% rename from types/compute/src/v2/quota_set/response/details.rs rename to types/compute/src/v2/quota_set/response/details_257.rs index 3601c6f37..9f46be845 100644 --- a/types/compute/src/v2/quota_set/response/details.rs +++ b/types/compute/src/v2/quota_set/response/details_257.rs @@ -22,8 +22,8 @@ use structable::{StructTable, StructTableOptions}; /// QuotaSet response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct QuotaSetResponse { - /// The object of detailed server group members, including in_use, limit - /// and reserved number of server group members. + /// The object of detailed cores quota, including in_use, limit and + /// reserved number of cores. #[structable(serialize)] pub cores: Cores, @@ -31,23 +31,29 @@ pub struct QuotaSetResponse { #[structable()] pub id: String, - /// The object of detailed server group members, including in_use, limit - /// and reserved number of server group members. + /// The object of detailed servers quota, including in_use, limit and + /// reserved number of instances. #[structable(serialize)] pub instances: Instances, - /// The object of detailed server group members, including in_use, limit - /// and reserved number of server group members. + /// The object of detailed key pairs quota, including in_use, limit and + /// reserved number of key pairs. + /// + /// Note + /// + /// `in_use` field value for keypair quota details is always zero. In Nova, + /// key_pairs are a user-level resource, not a project- level resource, so + /// for legacy reasons, the keypair in-use information is not counted. #[structable(serialize)] pub key_pairs: KeyPairs, - /// The object of detailed server group members, including in_use, limit - /// and reserved number of server group members. + /// The object of detailed key metadata items quota, including in_use, + /// limit and reserved number of metadata items. #[structable(serialize)] pub metadata_items: MetadataItems, - /// The object of detailed server group members, including in_use, limit - /// and reserved number of server group members. + /// The object of detailed key ram quota, including in_use, limit and + /// reserved number of ram. #[structable(serialize)] pub ram: Ram, @@ -56,14 +62,14 @@ pub struct QuotaSetResponse { #[structable(serialize)] pub server_group_members: ServerGroupMembers, - /// The object of detailed server group members, including in_use, limit - /// and reserved number of server group members. + /// The object of detailed server groups, including in_use, limit and + /// reserved number of server groups. #[structable(serialize)] pub server_groups: ServerGroups, } -/// The object of detailed server group members, including in_use, limit and -/// reserved number of server group members. +/// The object of detailed cores quota, including in_use, limit and reserved +/// number of cores. /// `Cores` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Cores { @@ -72,8 +78,8 @@ pub struct Cores { pub reserved: i32, } -/// The object of detailed server group members, including in_use, limit and -/// reserved number of server group members. +/// The object of detailed servers quota, including in_use, limit and reserved +/// number of instances. /// `Instances` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Instances { @@ -82,8 +88,14 @@ pub struct Instances { pub reserved: i32, } -/// The object of detailed server group members, including in_use, limit and -/// reserved number of server group members. +/// The object of detailed key pairs quota, including in_use, limit and +/// reserved number of key pairs. +/// +/// Note +/// +/// `in_use` field value for keypair quota details is always zero. In Nova, +/// key_pairs are a user-level resource, not a project- level resource, so for +/// legacy reasons, the keypair in-use information is not counted. /// `KeyPairs` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct KeyPairs { @@ -92,8 +104,8 @@ pub struct KeyPairs { pub reserved: i32, } -/// The object of detailed server group members, including in_use, limit and -/// reserved number of server group members. +/// The object of detailed key metadata items quota, including in_use, limit +/// and reserved number of metadata items. /// `MetadataItems` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct MetadataItems { @@ -102,8 +114,8 @@ pub struct MetadataItems { pub reserved: i32, } -/// The object of detailed server group members, including in_use, limit and -/// reserved number of server group members. +/// The object of detailed key ram quota, including in_use, limit and reserved +/// number of ram. /// `Ram` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Ram { @@ -122,8 +134,8 @@ pub struct ServerGroupMembers { pub reserved: i32, } -/// The object of detailed server group members, including in_use, limit and -/// reserved number of server group members. +/// The object of detailed server groups, including in_use, limit and reserved +/// number of server groups. /// `ServerGroups` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ServerGroups { diff --git a/types/compute/src/v2/quota_set/response/get_20.rs b/types/compute/src/v2/quota_set/response/get_20.rs new file mode 100644 index 000000000..4ce952302 --- /dev/null +++ b/types/compute/src/v2/quota_set/response/get_20.rs @@ -0,0 +1,99 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-quota-sets/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaSetResponse { + /// The number of allowed server cores for each tenant. + #[structable()] + pub cores: i32, + + /// The number of allowed fixed IP addresses for each tenant. Must be equal + /// to or greater than the number of allowed servers. + /// + /// **Available until version 2.35** + #[structable()] + pub fixed_ips: i32, + + /// The number of allowed floating IP addresses for each tenant. + /// + /// **Available until version 2.35** + #[structable()] + pub floating_ips: i32, + + /// The UUID of the tenant/user the quotas listed for. + #[structable()] + pub id: String, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for each tenant. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for each tenant. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for each user. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed server RAM, in MiB, for each tenant. + #[structable()] + pub ram: i32, + + /// The number of allowed rules for each security group. + /// + /// **Available until version 2.35** + #[structable()] + pub security_group_rules: i32, + + /// The number of allowed security groups for each tenant. + /// + /// **Available until version 2.35** + #[structable()] + pub security_groups: i32, + + /// The number of allowed members for each server group. + #[structable()] + pub server_group_members: i32, + + /// The number of allowed server groups for each tenant. + #[structable()] + pub server_groups: i32, +} diff --git a/types/compute/src/v2/quota_set/response/get_236.rs b/types/compute/src/v2/quota_set/response/get_236.rs new file mode 100644 index 000000000..634814a3f --- /dev/null +++ b/types/compute/src/v2/quota_set/response/get_236.rs @@ -0,0 +1,74 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-quota-sets/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaSetResponse { + /// The number of allowed server cores for each tenant. + #[structable()] + pub cores: i32, + + /// The UUID of the tenant/user the quotas listed for. + #[structable()] + pub id: String, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for each tenant. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for each tenant. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for each user. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed server RAM, in MiB, for each tenant. + #[structable()] + pub ram: i32, + + /// The number of allowed members for each server group. + #[structable()] + pub server_group_members: i32, + + /// The number of allowed server groups for each tenant. + #[structable()] + pub server_groups: i32, +} diff --git a/types/compute/src/v2/quota_set/response/get.rs b/types/compute/src/v2/quota_set/response/get_257.rs similarity index 100% rename from types/compute/src/v2/quota_set/response/get.rs rename to types/compute/src/v2/quota_set/response/get_257.rs diff --git a/types/compute/src/v2/quota_set/response/set_20.rs b/types/compute/src/v2/quota_set/response/set_20.rs new file mode 100644 index 000000000..ce45b09fa --- /dev/null +++ b/types/compute/src/v2/quota_set/response/set_20.rs @@ -0,0 +1,95 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `os-quota-sets/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaSetResponse { + /// The number of allowed server cores for each tenant. + #[structable()] + pub cores: i32, + + /// The number of allowed fixed IP addresses for each tenant. Must be equal + /// to or greater than the number of allowed servers. + /// + /// **Available until version 2.35** + #[structable()] + pub fixed_ips: i32, + + /// The number of allowed floating IP addresses for each tenant. + /// + /// **Available until version 2.35** + #[structable()] + pub floating_ips: i32, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for each tenant. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for each tenant. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for each user. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed server RAM, in MiB, for each tenant. + #[structable()] + pub ram: i32, + + /// The number of allowed rules for each security group. + /// + /// **Available until version 2.35** + #[structable()] + pub security_group_rules: i32, + + /// The number of allowed security groups for each tenant. + /// + /// **Available until version 2.35** + #[structable()] + pub security_groups: i32, + + /// The number of allowed members for each server group. + #[structable()] + pub server_group_members: i32, + + /// The number of allowed server groups for each tenant. + #[structable()] + pub server_groups: i32, +} diff --git a/types/compute/src/v2/quota_set/response/set_236.rs b/types/compute/src/v2/quota_set/response/set_236.rs new file mode 100644 index 000000000..68e1c5d2b --- /dev/null +++ b/types/compute/src/v2/quota_set/response/set_236.rs @@ -0,0 +1,70 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `os-quota-sets/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// QuotaSet response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct QuotaSetResponse { + /// The number of allowed server cores for each tenant. + #[structable()] + pub cores: i32, + + /// The number of allowed bytes of content for each injected file. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_content_bytes: i32, + + /// The number of allowed bytes for each injected file path. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_file_path_bytes: i32, + + /// The number of allowed injected files for each tenant. + /// + /// **Available until version 2.56** + #[structable()] + pub injected_files: i32, + + /// The number of allowed servers for each tenant. + #[structable()] + pub instances: i32, + + /// The number of allowed key pairs for each user. + #[structable()] + pub key_pairs: i32, + + /// The number of allowed metadata items for each server. + #[structable()] + pub metadata_items: i32, + + /// The amount of allowed server RAM, in MiB, for each tenant. + #[structable()] + pub ram: i32, + + /// The number of allowed members for each server group. + #[structable()] + pub server_group_members: i32, + + /// The number of allowed server groups for each tenant. + #[structable()] + pub server_groups: i32, +} diff --git a/types/compute/src/v2/quota_set/response/set.rs b/types/compute/src/v2/quota_set/response/set_257.rs similarity index 100% rename from types/compute/src/v2/quota_set/response/set.rs rename to types/compute/src/v2/quota_set/response/set_257.rs diff --git a/types/compute/src/v2/server/diagnostic/response.rs b/types/compute/src/v2/server/diagnostic/response.rs index cb428ee5e..c2fad633a 100644 --- a/types/compute/src/v2/server/diagnostic/response.rs +++ b/types/compute/src/v2/server/diagnostic/response.rs @@ -16,4 +16,5 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; +pub mod get_21; +pub mod get_248; diff --git a/types/compute/src/v2/server/diagnostic/response/get_21.rs b/types/compute/src/v2/server/diagnostic/response/get_21.rs new file mode 100644 index 000000000..873432785 --- /dev/null +++ b/types/compute/src/v2/server/diagnostic/response/get_21.rs @@ -0,0 +1,46 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/diagnostics` 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 DiagnosticResponse(BTreeMap); + +impl StructTable for DiagnosticResponse { + 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())) + } +} + +impl StructTable for &DiagnosticResponse { + 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())) + } +} diff --git a/types/compute/src/v2/server/diagnostic/response/get.rs b/types/compute/src/v2/server/diagnostic/response/get_248.rs similarity index 100% rename from types/compute/src/v2/server/diagnostic/response/get.rs rename to types/compute/src/v2/server/diagnostic/response/get_248.rs diff --git a/types/compute/src/v2/server/instance_action/response.rs b/types/compute/src/v2/server/instance_action/response.rs index 0eccfe57e..450e293a7 100644 --- a/types/compute/src/v2/server/instance_action/response.rs +++ b/types/compute/src/v2/server/instance_action/response.rs @@ -16,5 +16,10 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; -pub mod list; +pub mod get_21; +pub mod get_251; +pub mod get_258; +pub mod get_262; +pub mod get_284; +pub mod list_21; +pub mod list_258; diff --git a/types/compute/src/v2/server/instance_action/response/get_21.rs b/types/compute/src/v2/server/instance_action/response/get_21.rs new file mode 100644 index 000000000..0377837e4 --- /dev/null +++ b/types/compute/src/v2/server/instance_action/response/get_21.rs @@ -0,0 +1,76 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-instance-actions/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// InstanceAction response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct InstanceActionResponse { + /// The name of the action. + #[structable()] + pub action: String, + + /// The events which occurred in this action in descending order of + /// creation. + /// + /// Policy defaults enable only users with the administrative role or the + /// owner of the server to see instance action event information. Cloud + /// providers can change these permissions through the `policy.yaml` file. + /// + /// **New in version 2.51** + #[serde(default)] + #[structable(optional, serialize)] + pub events: Option>, + + /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// The related error message for when an action fails. + #[structable(optional)] + pub message: Option, + + /// The ID of the project which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub project_id: Option, + + /// The request id generated when execute the API of this action. + #[structable()] + pub request_id: String, + + #[structable()] + pub start_time: String, + + /// The ID of the user which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub user_id: Option, +} + +/// `Events` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Events { + pub event: String, + pub finish_time: Option, + pub result: Option, + pub start_time: String, + #[serde(default)] + pub traceback: Option, +} diff --git a/types/compute/src/v2/server/instance_action/response/get_251.rs b/types/compute/src/v2/server/instance_action/response/get_251.rs new file mode 100644 index 000000000..0d5fc7ddc --- /dev/null +++ b/types/compute/src/v2/server/instance_action/response/get_251.rs @@ -0,0 +1,75 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-instance-actions/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// InstanceAction response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct InstanceActionResponse { + /// The name of the action. + #[structable()] + pub action: String, + + /// The events which occurred in this action in descending order of + /// creation. + /// + /// Policy defaults enable only users with the administrative role or the + /// owner of the server to see instance action event information. Cloud + /// providers can change these permissions through the `policy.yaml` file. + /// + /// **New in version 2.51** + #[structable(serialize)] + pub events: Vec, + + /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// The related error message for when an action fails. + #[structable(optional)] + pub message: Option, + + /// The ID of the project which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub project_id: Option, + + /// The request id generated when execute the API of this action. + #[structable()] + pub request_id: String, + + #[structable()] + pub start_time: String, + + /// The ID of the user which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub user_id: Option, +} + +/// `Events` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Events { + pub event: String, + pub finish_time: Option, + pub result: Option, + pub start_time: String, + #[serde(default)] + pub traceback: Option, +} diff --git a/types/compute/src/v2/server/instance_action/response/get_258.rs b/types/compute/src/v2/server/instance_action/response/get_258.rs new file mode 100644 index 000000000..b4f1f2954 --- /dev/null +++ b/types/compute/src/v2/server/instance_action/response/get_258.rs @@ -0,0 +1,91 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-instance-actions/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// InstanceAction response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct InstanceActionResponse { + /// The name of the action. + #[structable()] + pub action: String, + + /// The events which occurred in this action in descending order of + /// creation. + /// + /// Policy defaults enable only users with the administrative role or the + /// owner of the server to see instance action event information. Cloud + /// providers can change these permissions through the `policy.yaml` file. + /// + /// **New in version 2.51** + #[structable(serialize)] + pub events: Vec, + + /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// The related error message for when an action fails. + #[structable(optional)] + pub message: Option, + + /// The ID of the project which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub project_id: Option, + + /// The request id generated when execute the API of this action. + #[structable()] + pub request_id: String, + + #[structable()] + pub start_time: String, + + /// The date and time when the instance action or the action event of + /// instance action 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`. + /// + /// **New in version 2.58** + #[structable(optional)] + pub updated_at: Option, + + /// The ID of the user which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub user_id: Option, +} + +/// `Events` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Events { + pub event: String, + pub finish_time: Option, + pub result: Option, + pub start_time: String, + #[serde(default)] + pub traceback: Option, +} diff --git a/types/compute/src/v2/server/instance_action/response/get_262.rs b/types/compute/src/v2/server/instance_action/response/get_262.rs new file mode 100644 index 000000000..30f147861 --- /dev/null +++ b/types/compute/src/v2/server/instance_action/response/get_262.rs @@ -0,0 +1,95 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-instance-actions/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// InstanceAction response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct InstanceActionResponse { + /// The name of the action. + #[structable()] + pub action: String, + + /// The events which occurred in this action in descending order of + /// creation. + /// + /// Policy defaults enable only users with the administrative role or the + /// owner of the server to see instance action event information. Cloud + /// providers can change these permissions through the `policy.yaml` file. + /// + /// **New in version 2.51** + #[structable(serialize)] + pub events: Vec, + + /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// The related error message for when an action fails. + #[structable(optional)] + pub message: Option, + + /// The ID of the project which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub project_id: Option, + + /// The request id generated when execute the API of this action. + #[structable()] + pub request_id: String, + + #[structable()] + pub start_time: String, + + /// The date and time when the instance action or the action event of + /// instance action 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`. + /// + /// **New in version 2.58** + #[structable(optional)] + pub updated_at: Option, + + /// The ID of the user which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub user_id: Option, +} + +/// `Events` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Events { + pub event: String, + pub finish_time: Option, + #[serde(default)] + pub host: Option, + #[serde(rename = "hostId")] + pub host_id: String, + pub result: Option, + pub start_time: String, + #[serde(default)] + pub traceback: Option, +} diff --git a/types/compute/src/v2/server/instance_action/response/get.rs b/types/compute/src/v2/server/instance_action/response/get_284.rs similarity index 78% rename from types/compute/src/v2/server/instance_action/response/get.rs rename to types/compute/src/v2/server/instance_action/response/get_284.rs index e1c64e6d2..fc9c742c2 100644 --- a/types/compute/src/v2/server/instance_action/response/get.rs +++ b/types/compute/src/v2/server/instance_action/response/get_284.rs @@ -38,37 +38,24 @@ pub struct InstanceActionResponse { pub events: Vec, /// The UUID of the server. - #[serde(default)] - #[structable(optional)] - pub instance_uuid: Option, + #[structable()] + pub instance_uuid: String, /// The related error message for when an action fails. - #[serde(default)] #[structable(optional)] pub message: Option, /// The ID of the project which initiated the server action. This can be /// `null` for `nova-manage`-initiated actions. - #[structable()] - pub project_id: String, + #[structable(optional)] + pub project_id: Option, /// The request id generated when execute the API of this action. #[structable()] pub request_id: String, - /// The date and time when the action was started. 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`. - #[serde(default)] - #[structable(optional)] - pub start_time: Option, + #[structable()] + pub start_time: String, /// The date and time when the instance action or the action event of /// instance action was updated. The date and time stamp format is @@ -83,7 +70,6 @@ pub struct InstanceActionResponse { /// example, the offset value is `-05:00`. /// /// **New in version 2.58** - #[serde(default)] #[structable(optional)] pub updated_at: Option, @@ -93,23 +79,19 @@ pub struct InstanceActionResponse { pub user_id: Option, } -/// Event /// `Events` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Events { #[serde(default)] pub details: Option, pub event: String, - #[serde(default)] pub finish_time: Option, #[serde(default)] pub host: Option, - #[serde(default, rename = "hostId")] - pub host_id: Option, - #[serde(default)] + #[serde(rename = "hostId")] + pub host_id: String, pub result: Option, - #[serde(default)] - pub start_time: Option, + pub start_time: String, #[serde(default)] pub traceback: Option, } diff --git a/types/compute/src/v2/server/instance_action/response/list_21.rs b/types/compute/src/v2/server/instance_action/response/list_21.rs new file mode 100644 index 000000000..7eb166399 --- /dev/null +++ b/types/compute/src/v2/server/instance_action/response/list_21.rs @@ -0,0 +1,63 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-instance-actions` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// InstanceAction response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct InstanceActionResponse { + /// The name of the action. + #[structable()] + pub action: String, + + /// The UUID of the server. + #[structable()] + pub instance_uuid: String, + + /// The related error message for when an action fails. + #[structable(optional)] + pub message: Option, + + /// The ID of the project which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub project_id: Option, + + /// The request id generated when execute the API of this action. + #[structable()] + pub request_id: String, + + /// The date and time when the action was started. 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`. + #[structable()] + pub start_time: String, + + /// The ID of the user which initiated the server action. This can be + /// `null` for `nova-manage`-initiated actions. + #[structable(optional)] + pub user_id: Option, +} diff --git a/types/compute/src/v2/server/instance_action/response/list.rs b/types/compute/src/v2/server/instance_action/response/list_258.rs similarity index 92% rename from types/compute/src/v2/server/instance_action/response/list.rs rename to types/compute/src/v2/server/instance_action/response/list_258.rs index eeedc3d8c..4f3493e96 100644 --- a/types/compute/src/v2/server/instance_action/response/list.rs +++ b/types/compute/src/v2/server/instance_action/response/list_258.rs @@ -27,19 +27,17 @@ pub struct InstanceActionResponse { pub action: String, /// The UUID of the server. - #[serde(default)] - #[structable(optional)] - pub instance_uuid: Option, + #[structable()] + pub instance_uuid: String, /// The related error message for when an action fails. - #[serde(default)] #[structable(optional)] pub message: Option, /// The ID of the project which initiated the server action. This can be /// `null` for `nova-manage`-initiated actions. - #[structable()] - pub project_id: String, + #[structable(optional)] + pub project_id: Option, /// The request id generated when execute the API of this action. #[structable()] @@ -55,9 +53,8 @@ pub struct InstanceActionResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub start_time: Option, + #[structable()] + pub start_time: String, /// The date and time when the instance action or the action event of /// instance action was updated. The date and time stamp format is @@ -72,7 +69,6 @@ pub struct InstanceActionResponse { /// example, the offset value is `-05:00`. /// /// **New in version 2.58** - #[serde(default)] #[structable(optional)] pub updated_at: Option, diff --git a/types/compute/src/v2/server/interface/response.rs b/types/compute/src/v2/server/interface/response.rs index 57479c591..68fbe5ae0 100644 --- a/types/compute/src/v2/server/interface/response.rs +++ b/types/compute/src/v2/server/interface/response.rs @@ -16,6 +16,9 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod create; -pub mod get; -pub mod list; +pub mod create_21; +pub mod create_270; +pub mod get_21; +pub mod get_270; +pub mod list_21; +pub mod list_270; diff --git a/types/compute/src/v2/server/interface/response/create_21.rs b/types/compute/src/v2/server/interface/response/create_21.rs new file mode 100644 index 000000000..ff2fe3e3d --- /dev/null +++ b/types/compute/src/v2/server/interface/response/create_21.rs @@ -0,0 +1,51 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{server_id}/os-interface` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Interface response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct InterfaceResponse { + /// Fixed IP addresses with subnet IDs. + #[structable(serialize)] + pub fixed_ips: Vec, + + /// The MAC address. + #[structable()] + pub mac_addr: String, + + /// The network ID. + #[structable()] + pub net_id: String, + + /// The port ID. + #[structable()] + pub port_id: String, + + /// The port state. + #[structable()] + pub port_state: String, +} + +/// `FixedIps` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct FixedIps { + pub ip_address: String, + pub subnet_id: String, +} diff --git a/types/compute/src/v2/server/interface/response/create.rs b/types/compute/src/v2/server/interface/response/create_270.rs similarity index 75% rename from types/compute/src/v2/server/interface/response/create.rs rename to types/compute/src/v2/server/interface/response/create_270.rs index 338aa184f..e868c8e12 100644 --- a/types/compute/src/v2/server/interface/response/create.rs +++ b/types/compute/src/v2/server/interface/response/create_270.rs @@ -27,29 +27,24 @@ pub struct InterfaceResponse { pub fixed_ips: Vec, /// The MAC address. - #[serde(default)] - #[structable(optional)] - pub mac_addr: Option, + #[structable()] + pub mac_addr: String, /// The network ID. - #[serde(default)] - #[structable(optional)] - pub net_id: Option, + #[structable()] + pub net_id: String, /// The port ID. - #[serde(default)] - #[structable(optional)] - pub port_id: Option, + #[structable()] + pub port_id: String, /// The port state. - #[serde(default)] - #[structable(optional)] - pub port_state: Option, + #[structable()] + pub port_state: String, /// The device tag applied to the virtual network interface or `null`. /// /// **New in version 2.70** - #[serde(default)] #[structable(optional)] pub tag: Option, } @@ -57,8 +52,6 @@ pub struct InterfaceResponse { /// `FixedIps` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct FixedIps { - #[serde(default)] - pub ip_address: Option, - #[serde(default)] - pub subnet_id: Option, + pub ip_address: String, + pub subnet_id: String, } diff --git a/types/compute/src/v2/server/interface/response/get_21.rs b/types/compute/src/v2/server/interface/response/get_21.rs new file mode 100644 index 000000000..682e0b2a1 --- /dev/null +++ b/types/compute/src/v2/server/interface/response/get_21.rs @@ -0,0 +1,51 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-interface/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Interface response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct InterfaceResponse { + /// Fixed IP addresses with subnet IDs. + #[structable(serialize)] + pub fixed_ips: Vec, + + /// The MAC address. + #[structable()] + pub mac_addr: String, + + /// The network ID. + #[structable()] + pub net_id: String, + + /// The port ID. + #[structable()] + pub port_id: String, + + /// The port state. + #[structable()] + pub port_state: String, +} + +/// `FixedIps` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct FixedIps { + pub ip_address: String, + pub subnet_id: String, +} diff --git a/types/compute/src/v2/server/interface/response/get.rs b/types/compute/src/v2/server/interface/response/get_270.rs similarity index 75% rename from types/compute/src/v2/server/interface/response/get.rs rename to types/compute/src/v2/server/interface/response/get_270.rs index 37da19f04..f90457163 100644 --- a/types/compute/src/v2/server/interface/response/get.rs +++ b/types/compute/src/v2/server/interface/response/get_270.rs @@ -27,29 +27,24 @@ pub struct InterfaceResponse { pub fixed_ips: Vec, /// The MAC address. - #[serde(default)] - #[structable(optional)] - pub mac_addr: Option, + #[structable()] + pub mac_addr: String, /// The network ID. - #[serde(default)] - #[structable(optional)] - pub net_id: Option, + #[structable()] + pub net_id: String, /// The port ID. - #[serde(default)] - #[structable(optional)] - pub port_id: Option, + #[structable()] + pub port_id: String, /// The port state. - #[serde(default)] - #[structable(optional)] - pub port_state: Option, + #[structable()] + pub port_state: String, /// The device tag applied to the virtual network interface or `null`. /// /// **New in version 2.70** - #[serde(default)] #[structable(optional)] pub tag: Option, } @@ -57,8 +52,6 @@ pub struct InterfaceResponse { /// `FixedIps` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct FixedIps { - #[serde(default)] - pub ip_address: Option, - #[serde(default)] - pub subnet_id: Option, + pub ip_address: String, + pub subnet_id: String, } diff --git a/types/compute/src/v2/server/interface/response/list_21.rs b/types/compute/src/v2/server/interface/response/list_21.rs new file mode 100644 index 000000000..a5d37e34e --- /dev/null +++ b/types/compute/src/v2/server/interface/response/list_21.rs @@ -0,0 +1,46 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-interface` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Interface response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct InterfaceResponse { + /// List of the interface attachments. + #[serde(rename = "interfaceAttachments")] + #[structable(serialize, title = "interfaceAttachments", wide)] + pub interface_attachments: Vec, +} + +/// `FixedIps` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct FixedIps { + pub ip_address: String, + pub subnet_id: String, +} + +/// `InterfaceAttachments` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct InterfaceAttachments { + pub fixed_ips: Vec, + pub mac_addr: String, + pub net_id: String, + pub port_id: String, + pub port_state: String, +} diff --git a/types/compute/src/v2/server/interface/response/list.rs b/types/compute/src/v2/server/interface/response/list_270.rs similarity index 79% rename from types/compute/src/v2/server/interface/response/list.rs rename to types/compute/src/v2/server/interface/response/list_270.rs index 7015989fa..232292aad 100644 --- a/types/compute/src/v2/server/interface/response/list.rs +++ b/types/compute/src/v2/server/interface/response/list_270.rs @@ -31,25 +31,17 @@ pub struct InterfaceResponse { /// `FixedIps` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct FixedIps { - #[serde(default)] - pub ip_address: Option, - #[serde(default)] - pub subnet_id: Option, + pub ip_address: String, + pub subnet_id: String, } -/// The interface attachment. /// `InterfaceAttachments` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InterfaceAttachments { pub fixed_ips: Vec, - #[serde(default)] - pub mac_addr: Option, - #[serde(default)] - pub net_id: Option, - #[serde(default)] - pub port_id: Option, - #[serde(default)] - pub port_state: Option, - #[serde(default)] + pub mac_addr: String, + pub net_id: String, + pub port_id: String, + pub port_state: String, pub tag: Option, } diff --git a/types/compute/src/v2/server/metadata/response/create.rs b/types/compute/src/v2/server/metadata/response/create.rs index 3b2dfaf52..ddf1b1493 100644 --- a/types/compute/src/v2/server/metadata/response/create.rs +++ b/types/compute/src/v2/server/metadata/response/create.rs @@ -22,7 +22,7 @@ use structable::{StructTable, StructTableOptions}; /// Response data as HashMap type #[derive(Deserialize, Serialize)] -pub struct MetadataResponse(BTreeMap); +pub struct MetadataResponse(BTreeMap>); impl StructTable for MetadataResponse { fn instance_headers(&self, _options: &O) -> Option> { @@ -30,7 +30,7 @@ impl StructTable for MetadataResponse { } fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| Some(v.clone()))) + Vec::from_iter(self.0.values().map(|v| v.clone().map(|x| x.to_string()))) } } @@ -40,6 +40,6 @@ impl StructTable for &MetadataResponse { } fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| Some(v.clone()))) + Vec::from_iter(self.0.values().map(|v| v.clone().map(|x| x.to_string()))) } } diff --git a/types/compute/src/v2/server/metadata/response/get.rs b/types/compute/src/v2/server/metadata/response/get.rs index a50e73616..28b3d722d 100644 --- a/types/compute/src/v2/server/metadata/response/get.rs +++ b/types/compute/src/v2/server/metadata/response/get.rs @@ -22,7 +22,7 @@ use structable::{StructTable, StructTableOptions}; /// Response data as HashMap type #[derive(Deserialize, Serialize)] -pub struct MetadataResponse(BTreeMap); +pub struct MetadataResponse(BTreeMap>); impl StructTable for MetadataResponse { fn instance_headers(&self, _options: &O) -> Option> { @@ -30,7 +30,7 @@ impl StructTable for MetadataResponse { } fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| Some(v.clone()))) + Vec::from_iter(self.0.values().map(|v| v.clone().map(|x| x.to_string()))) } } @@ -40,6 +40,6 @@ impl StructTable for &MetadataResponse { } fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| Some(v.clone()))) + Vec::from_iter(self.0.values().map(|v| v.clone().map(|x| x.to_string()))) } } diff --git a/types/compute/src/v2/server/metadata/response/list.rs b/types/compute/src/v2/server/metadata/response/list.rs index 6166aef1f..ce0f569d4 100644 --- a/types/compute/src/v2/server/metadata/response/list.rs +++ b/types/compute/src/v2/server/metadata/response/list.rs @@ -22,7 +22,7 @@ use structable::{StructTable, StructTableOptions}; /// Response data as HashMap type #[derive(Deserialize, Serialize)] -pub struct MetadataResponse(BTreeMap); +pub struct MetadataResponse(BTreeMap>); impl StructTable for MetadataResponse { fn instance_headers(&self, _options: &O) -> Option> { @@ -30,7 +30,7 @@ impl StructTable for MetadataResponse { } fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| Some(v.clone()))) + Vec::from_iter(self.0.values().map(|v| v.clone().map(|x| x.to_string()))) } } @@ -40,6 +40,6 @@ impl StructTable for &MetadataResponse { } fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| Some(v.clone()))) + Vec::from_iter(self.0.values().map(|v| v.clone().map(|x| x.to_string()))) } } diff --git a/types/compute/src/v2/server/metadata/response/replace.rs b/types/compute/src/v2/server/metadata/response/replace.rs index 96ed0eca1..fdeb3c495 100644 --- a/types/compute/src/v2/server/metadata/response/replace.rs +++ b/types/compute/src/v2/server/metadata/response/replace.rs @@ -22,7 +22,7 @@ use structable::{StructTable, StructTableOptions}; /// Response data as HashMap type #[derive(Deserialize, Serialize)] -pub struct MetadataResponse(BTreeMap); +pub struct MetadataResponse(BTreeMap>); impl StructTable for MetadataResponse { fn instance_headers(&self, _options: &O) -> Option> { @@ -30,7 +30,7 @@ impl StructTable for MetadataResponse { } fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| Some(v.clone()))) + Vec::from_iter(self.0.values().map(|v| v.clone().map(|x| x.to_string()))) } } @@ -40,6 +40,6 @@ impl StructTable for &MetadataResponse { } fn data(&self, _options: &O) -> Vec> { - Vec::from_iter(self.0.values().map(|v| Some(v.clone()))) + Vec::from_iter(self.0.values().map(|v| v.clone().map(|x| x.to_string()))) } } diff --git a/types/compute/src/v2/server/migration/response.rs b/types/compute/src/v2/server/migration/response.rs index 0eccfe57e..99e068bfe 100644 --- a/types/compute/src/v2/server/migration/response.rs +++ b/types/compute/src/v2/server/migration/response.rs @@ -16,5 +16,9 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; -pub mod list; +pub mod get_223; +pub mod get_259; +pub mod get_280; +pub mod list_223; +pub mod list_259; +pub mod list_280; diff --git a/types/compute/src/v2/server/migration/response/get_223.rs b/types/compute/src/v2/server/migration/response/get_223.rs new file mode 100644 index 000000000..02fc58fd8 --- /dev/null +++ b/types/compute/src/v2/server/migration/response/get_223.rs @@ -0,0 +1,110 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/migrations/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Migration response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct MigrationResponse { + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// The target compute for a migration. + #[structable(optional)] + pub dest_compute: Option, + + /// The target host for a migration. + #[structable(optional)] + pub dest_host: Option, + + /// The target node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub dest_node: Option, + + /// The amount of disk, in bytes, that has been processed during the + /// migration. + #[structable(optional)] + pub disk_processed_bytes: Option, + + /// The amount of disk, in bytes, that still needs to be migrated. + #[structable(optional)] + pub disk_remaining_bytes: Option, + + /// The total amount of disk, in bytes, that needs to be migrated. + #[structable(optional)] + pub disk_total_bytes: Option, + + /// The ID of the server migration. + #[structable()] + pub id: i32, + + /// The amount of memory, in bytes, that has been processed during the + /// migration. + #[structable(optional)] + pub memory_processed_bytes: Option, + + /// The amount of memory, in bytes, that still needs to be migrated. + #[structable(optional)] + pub memory_remaining_bytes: Option, + + /// The total amount of memory, in bytes, that needs to be migrated. + #[structable(optional)] + pub memory_total_bytes: Option, + + /// The UUID of the server. + #[structable()] + pub server_uuid: String, + + /// The source compute for a migration. + #[structable(optional)] + pub source_compute: Option, + + /// The source node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub source_node: Option, + + /// The current status of the migration. + #[structable()] + pub status: 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`. + #[structable()] + pub updated_at: String, +} diff --git a/types/compute/src/v2/server/migration/response/get_259.rs b/types/compute/src/v2/server/migration/response/get_259.rs new file mode 100644 index 000000000..c79b4cbd4 --- /dev/null +++ b/types/compute/src/v2/server/migration/response/get_259.rs @@ -0,0 +1,116 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/migrations/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Migration response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct MigrationResponse { + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// The target compute for a migration. + #[structable(optional)] + pub dest_compute: Option, + + /// The target host for a migration. + #[structable(optional)] + pub dest_host: Option, + + /// The target node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub dest_node: Option, + + /// The amount of disk, in bytes, that has been processed during the + /// migration. + #[structable(optional)] + pub disk_processed_bytes: Option, + + /// The amount of disk, in bytes, that still needs to be migrated. + #[structable(optional)] + pub disk_remaining_bytes: Option, + + /// The total amount of disk, in bytes, that needs to be migrated. + #[structable(optional)] + pub disk_total_bytes: Option, + + /// The ID of the server migration. + #[structable()] + pub id: i32, + + /// The amount of memory, in bytes, that has been processed during the + /// migration. + #[structable(optional)] + pub memory_processed_bytes: Option, + + /// The amount of memory, in bytes, that still needs to be migrated. + #[structable(optional)] + pub memory_remaining_bytes: Option, + + /// The total amount of memory, in bytes, that needs to be migrated. + #[structable(optional)] + pub memory_total_bytes: Option, + + /// The UUID of the server. + #[structable()] + pub server_uuid: String, + + /// The source compute for a migration. + #[structable(optional)] + pub source_compute: Option, + + /// The source node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional)] + pub source_node: Option, + + /// The current status of the migration. + #[structable()] + pub status: 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`. + #[structable()] + pub updated_at: String, + + /// The UUID of the migration. + /// + /// **New in version 2.59** + #[structable()] + pub uuid: String, +} diff --git a/types/compute/src/v2/server/migration/response/get.rs b/types/compute/src/v2/server/migration/response/get_280.rs similarity index 81% rename from types/compute/src/v2/server/migration/response/get.rs rename to types/compute/src/v2/server/migration/response/get_280.rs index 0ca293b10..9568d23e9 100644 --- a/types/compute/src/v2/server/migration/response/get.rs +++ b/types/compute/src/v2/server/migration/response/get_280.rs @@ -32,60 +32,49 @@ pub struct MigrationResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub created_at: Option, + #[structable()] + pub created_at: String, /// The target compute for a migration. - #[serde(default)] #[structable(optional)] pub dest_compute: Option, /// The target host for a migration. - #[serde(default)] #[structable(optional)] pub dest_host: Option, /// The target node for a migration. This will be `null` if pre-migration /// checks fail due to e.g. insufficient resources. - #[serde(default)] #[structable(optional)] pub dest_node: Option, /// The amount of disk, in bytes, that has been processed during the /// migration. - #[serde(default)] #[structable(optional)] pub disk_processed_bytes: Option, /// The amount of disk, in bytes, that still needs to be migrated. - #[serde(default)] #[structable(optional)] pub disk_remaining_bytes: Option, /// The total amount of disk, in bytes, that needs to be migrated. - #[serde(default)] #[structable(optional)] pub disk_total_bytes: Option, /// The ID of the server migration. - #[serde(default)] - #[structable(optional)] - pub id: Option, + #[structable()] + pub id: i32, /// The amount of memory, in bytes, that has been processed during the /// migration. - #[serde(default)] #[structable(optional)] pub memory_processed_bytes: Option, /// The amount of memory, in bytes, that still needs to be migrated. - #[serde(default)] #[structable(optional)] pub memory_remaining_bytes: Option, /// The total amount of memory, in bytes, that needs to be migrated. - #[serde(default)] #[structable(optional)] pub memory_total_bytes: Option, @@ -93,30 +82,25 @@ pub struct MigrationResponse { /// may be `null` for older migration records. /// /// **New in version 2.80** - #[serde(default)] - #[structable(optional)] - pub project_id: Option, + #[structable()] + pub project_id: String, /// The UUID of the server. - #[serde(default)] - #[structable(optional)] - pub server_uuid: Option, + #[structable()] + pub server_uuid: String, /// The source compute for a migration. - #[serde(default)] #[structable(optional)] pub source_compute: Option, /// The source node for a migration. This will be `null` if pre-migration /// checks fail due to e.g. insufficient resources. - #[serde(default)] #[structable(optional)] pub source_node: Option, /// The current status of the migration. - #[serde(default)] - #[structable(optional)] - pub status: Option, + #[structable()] + pub status: 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) @@ -128,22 +112,19 @@ pub struct MigrationResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub updated_at: Option, + #[structable()] + pub updated_at: String, /// The ID of the user which initiated the server migration. The value may /// be `null` for older migration records. /// /// **New in version 2.80** - #[serde(default)] - #[structable(optional)] - pub user_id: Option, + #[structable()] + pub user_id: String, /// The UUID of the migration. /// /// **New in version 2.59** - #[serde(default)] - #[structable(optional)] - pub uuid: Option, + #[structable()] + pub uuid: String, } diff --git a/types/compute/src/v2/server/migration/response/list_223.rs b/types/compute/src/v2/server/migration/response/list_223.rs new file mode 100644 index 000000000..98092be97 --- /dev/null +++ b/types/compute/src/v2/server/migration/response/list_223.rs @@ -0,0 +1,110 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/migrations` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Migration response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct MigrationResponse { + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// The target compute for a migration. + #[structable(optional, wide)] + pub dest_compute: Option, + + /// The target host for a migration. + #[structable(optional, wide)] + pub dest_host: Option, + + /// The target node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional, wide)] + pub dest_node: Option, + + /// The amount of disk, in bytes, that has been processed during the + /// migration. + #[structable(optional, wide)] + pub disk_processed_bytes: Option, + + /// The amount of disk, in bytes, that still needs to be migrated. + #[structable(optional, wide)] + pub disk_remaining_bytes: Option, + + /// The total amount of disk, in bytes, that needs to be migrated. + #[structable(optional, wide)] + pub disk_total_bytes: Option, + + /// The ID of the server migration. + #[structable()] + pub id: i32, + + /// The amount of memory, in bytes, that has been processed during the + /// migration. + #[structable(optional, wide)] + pub memory_processed_bytes: Option, + + /// The amount of memory, in bytes, that still needs to be migrated. + #[structable(optional, wide)] + pub memory_remaining_bytes: Option, + + /// The total amount of memory, in bytes, that needs to be migrated. + #[structable(optional, wide)] + pub memory_total_bytes: Option, + + /// The UUID of the server. + #[structable(wide)] + pub server_uuid: String, + + /// The source compute for a migration. + #[structable(optional, wide)] + pub source_compute: Option, + + /// The source node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional, wide)] + pub source_node: Option, + + /// The current status of the migration. + #[structable()] + pub status: 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`. + #[structable()] + pub updated_at: String, +} diff --git a/types/compute/src/v2/server/migration/response/list_259.rs b/types/compute/src/v2/server/migration/response/list_259.rs new file mode 100644 index 000000000..1542a3e24 --- /dev/null +++ b/types/compute/src/v2/server/migration/response/list_259.rs @@ -0,0 +1,116 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/migrations` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Migration response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct MigrationResponse { + /// The date and time when the resource was created. 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`. + #[structable()] + pub created_at: String, + + /// The target compute for a migration. + #[structable(optional, wide)] + pub dest_compute: Option, + + /// The target host for a migration. + #[structable(optional, wide)] + pub dest_host: Option, + + /// The target node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional, wide)] + pub dest_node: Option, + + /// The amount of disk, in bytes, that has been processed during the + /// migration. + #[structable(optional, wide)] + pub disk_processed_bytes: Option, + + /// The amount of disk, in bytes, that still needs to be migrated. + #[structable(optional, wide)] + pub disk_remaining_bytes: Option, + + /// The total amount of disk, in bytes, that needs to be migrated. + #[structable(optional, wide)] + pub disk_total_bytes: Option, + + /// The ID of the server migration. + #[structable()] + pub id: i32, + + /// The amount of memory, in bytes, that has been processed during the + /// migration. + #[structable(optional, wide)] + pub memory_processed_bytes: Option, + + /// The amount of memory, in bytes, that still needs to be migrated. + #[structable(optional, wide)] + pub memory_remaining_bytes: Option, + + /// The total amount of memory, in bytes, that needs to be migrated. + #[structable(optional, wide)] + pub memory_total_bytes: Option, + + /// The UUID of the server. + #[structable(wide)] + pub server_uuid: String, + + /// The source compute for a migration. + #[structable(optional, wide)] + pub source_compute: Option, + + /// The source node for a migration. This will be `null` if pre-migration + /// checks fail due to e.g. insufficient resources. + #[structable(optional, wide)] + pub source_node: Option, + + /// The current status of the migration. + #[structable()] + pub status: 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`. + #[structable()] + pub updated_at: String, + + /// The UUID of the migration. + /// + /// **New in version 2.59** + #[structable()] + pub uuid: String, +} diff --git a/types/compute/src/v2/server/migration/response/list.rs b/types/compute/src/v2/server/migration/response/list_280.rs similarity index 81% rename from types/compute/src/v2/server/migration/response/list.rs rename to types/compute/src/v2/server/migration/response/list_280.rs index f65b6a7c9..188ca6bf7 100644 --- a/types/compute/src/v2/server/migration/response/list.rs +++ b/types/compute/src/v2/server/migration/response/list_280.rs @@ -32,60 +32,49 @@ pub struct MigrationResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub created_at: Option, + #[structable()] + pub created_at: String, /// The target compute for a migration. - #[serde(default)] #[structable(optional, wide)] pub dest_compute: Option, /// The target host for a migration. - #[serde(default)] #[structable(optional, wide)] pub dest_host: Option, /// The target node for a migration. This will be `null` if pre-migration /// checks fail due to e.g. insufficient resources. - #[serde(default)] #[structable(optional, wide)] pub dest_node: Option, /// The amount of disk, in bytes, that has been processed during the /// migration. - #[serde(default)] #[structable(optional, wide)] pub disk_processed_bytes: Option, /// The amount of disk, in bytes, that still needs to be migrated. - #[serde(default)] #[structable(optional, wide)] pub disk_remaining_bytes: Option, /// The total amount of disk, in bytes, that needs to be migrated. - #[serde(default)] #[structable(optional, wide)] pub disk_total_bytes: Option, /// The ID of the server migration. - #[serde(default)] - #[structable(optional)] - pub id: Option, + #[structable()] + pub id: i32, /// The amount of memory, in bytes, that has been processed during the /// migration. - #[serde(default)] #[structable(optional, wide)] pub memory_processed_bytes: Option, /// The amount of memory, in bytes, that still needs to be migrated. - #[serde(default)] #[structable(optional, wide)] pub memory_remaining_bytes: Option, /// The total amount of memory, in bytes, that needs to be migrated. - #[serde(default)] #[structable(optional, wide)] pub memory_total_bytes: Option, @@ -93,30 +82,25 @@ pub struct MigrationResponse { /// may be `null` for older migration records. /// /// **New in version 2.80** - #[serde(default)] - #[structable(optional, wide)] - pub project_id: Option, + #[structable(wide)] + pub project_id: String, /// The UUID of the server. - #[serde(default)] - #[structable(optional, wide)] - pub server_uuid: Option, + #[structable(wide)] + pub server_uuid: String, /// The source compute for a migration. - #[serde(default)] #[structable(optional, wide)] pub source_compute: Option, /// The source node for a migration. This will be `null` if pre-migration /// checks fail due to e.g. insufficient resources. - #[serde(default)] #[structable(optional, wide)] pub source_node: Option, /// The current status of the migration. - #[serde(default)] - #[structable(optional)] - pub status: Option, + #[structable()] + pub status: 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) @@ -128,22 +112,19 @@ pub struct MigrationResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub updated_at: Option, + #[structable()] + pub updated_at: String, /// The ID of the user which initiated the server migration. The value may /// be `null` for older migration records. /// /// **New in version 2.80** - #[serde(default)] - #[structable(optional, wide)] - pub user_id: Option, + #[structable(wide)] + pub user_id: String, /// The UUID of the migration. /// /// **New in version 2.59** - #[serde(default)] - #[structable(optional)] - pub uuid: Option, + #[structable()] + pub uuid: String, } diff --git a/types/compute/src/v2/server/remote_console/response.rs b/types/compute/src/v2/server/remote_console/response.rs index 9dde6d7c8..2d3d22c6a 100644 --- a/types/compute/src/v2/server/remote_console/response.rs +++ b/types/compute/src/v2/server/remote_console/response.rs @@ -16,4 +16,6 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod create; +pub mod create_26; +pub mod create_28; +pub mod create_299; diff --git a/types/compute/src/v2/server/remote_console/response/create_26.rs b/types/compute/src/v2/server/remote_console/response/create_26.rs new file mode 100644 index 000000000..3e94fc0e9 --- /dev/null +++ b/types/compute/src/v2/server/remote_console/response/create_26.rs @@ -0,0 +1,113 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{server_id}/remote-consoles` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// RemoteConsole response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct RemoteConsoleResponse { + /// The protocol of remote console. The valid values are `vnc`, `spice`, + /// `rdp`, `serial` and `mks`. The protocol `mks` is added since + /// Microversion `2.8`. The protocol `rdp` requires the Hyper-V driver + /// which was removed in the 29.0.0 (Caracal) release. + #[structable(serialize)] + pub protocol: Protocol, + + /// The type of remote console. The valid values are `novnc`, `rdp-html5`, + /// `spice-html5`, `spice-direct`, `serial`, and `webmks`. The type + /// `webmks` was added in Microversion `2.8` and the type `spice-direct` + /// was added in Microversion `2.99`. The type `rdp-html5` requires the + /// Hyper-V driver which was removed in the 29.0.0 (Caracal) release. + #[serde(rename = "type")] + #[structable(serialize, title = "type")] + pub _type: Type, + + /// The URL is used to connect the console. + #[structable()] + pub url: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Protocol { + // Rdp + #[serde(rename = "rdp")] + Rdp, + + // Serial + #[serde(rename = "serial")] + Serial, + + // Spice + #[serde(rename = "spice")] + Spice, + + // Vnc + #[serde(rename = "vnc")] + Vnc, +} + +impl std::str::FromStr for Protocol { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "rdp" => Ok(Self::Rdp), + "serial" => Ok(Self::Serial), + "spice" => Ok(Self::Spice), + "vnc" => Ok(Self::Vnc), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Type { + // Novnc + #[serde(rename = "novnc")] + Novnc, + + // RdpHtml5 + #[serde(rename = "rdp-html5")] + RdpHtml5, + + // Serial + #[serde(rename = "serial")] + Serial, + + // SpiceHtml5 + #[serde(rename = "spice-html5")] + SpiceHtml5, + + // Xvpvnc + #[serde(rename = "xvpvnc")] + Xvpvnc, +} + +impl std::str::FromStr for Type { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "novnc" => Ok(Self::Novnc), + "rdp-html5" => Ok(Self::RdpHtml5), + "serial" => Ok(Self::Serial), + "spice-html5" => Ok(Self::SpiceHtml5), + "xvpvnc" => Ok(Self::Xvpvnc), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/remote_console/response/create.rs b/types/compute/src/v2/server/remote_console/response/create_28.rs similarity index 100% rename from types/compute/src/v2/server/remote_console/response/create.rs rename to types/compute/src/v2/server/remote_console/response/create_28.rs diff --git a/types/compute/src/v2/server/remote_console/response/create_299.rs b/types/compute/src/v2/server/remote_console/response/create_299.rs new file mode 100644 index 000000000..eb5d8612c --- /dev/null +++ b/types/compute/src/v2/server/remote_console/response/create_299.rs @@ -0,0 +1,128 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{server_id}/remote-consoles` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// RemoteConsole response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct RemoteConsoleResponse { + /// The protocol of remote console. The valid values are `vnc`, `spice`, + /// `rdp`, `serial` and `mks`. The protocol `mks` is added since + /// Microversion `2.8`. The protocol `rdp` requires the Hyper-V driver + /// which was removed in the 29.0.0 (Caracal) release. + #[structable(serialize)] + pub protocol: Protocol, + + /// The type of remote console. The valid values are `novnc`, `rdp-html5`, + /// `spice-html5`, `spice-direct`, `serial`, and `webmks`. The type + /// `webmks` was added in Microversion `2.8` and the type `spice-direct` + /// was added in Microversion `2.99`. The type `rdp-html5` requires the + /// Hyper-V driver which was removed in the 29.0.0 (Caracal) release. + #[serde(rename = "type")] + #[structable(serialize, title = "type")] + pub _type: Type, + + /// The URL is used to connect the console. + #[structable()] + pub url: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Protocol { + // Mks + #[serde(rename = "mks")] + Mks, + + // Rdp + #[serde(rename = "rdp")] + Rdp, + + // Serial + #[serde(rename = "serial")] + Serial, + + // Spice + #[serde(rename = "spice")] + Spice, + + // Vnc + #[serde(rename = "vnc")] + Vnc, +} + +impl std::str::FromStr for Protocol { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "mks" => Ok(Self::Mks), + "rdp" => Ok(Self::Rdp), + "serial" => Ok(Self::Serial), + "spice" => Ok(Self::Spice), + "vnc" => Ok(Self::Vnc), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Type { + // Novnc + #[serde(rename = "novnc")] + Novnc, + + // RdpHtml5 + #[serde(rename = "rdp-html5")] + RdpHtml5, + + // Serial + #[serde(rename = "serial")] + Serial, + + // SpiceDirect + #[serde(rename = "spice-direct")] + SpiceDirect, + + // SpiceHtml5 + #[serde(rename = "spice-html5")] + SpiceHtml5, + + // Webmks + #[serde(rename = "webmks")] + Webmks, + + // Xvpvnc + #[serde(rename = "xvpvnc")] + Xvpvnc, +} + +impl std::str::FromStr for Type { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "novnc" => Ok(Self::Novnc), + "rdp-html5" => Ok(Self::RdpHtml5), + "serial" => Ok(Self::Serial), + "spice-direct" => Ok(Self::SpiceDirect), + "spice-html5" => Ok(Self::SpiceHtml5), + "webmks" => Ok(Self::Webmks), + "xvpvnc" => Ok(Self::Xvpvnc), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response.rs b/types/compute/src/v2/server/response.rs index 14c479fa8..52e24600c 100644 --- a/types/compute/src/v2/server/response.rs +++ b/types/compute/src/v2/server/response.rs @@ -16,18 +16,85 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod confirm_resize; -pub mod create; -pub mod create_backup; -pub mod create_image; +pub mod create_a; +pub mod create_b; +pub mod create_backup_245; +pub mod create_image_245; pub mod evacuate; -pub mod get; -pub mod list; -pub mod list_detailed; +pub mod get_20; +pub mod get_2100_a; +pub mod get_2100_b; +pub mod get_216; +pub mod get_219; +pub mod get_226; +pub mod get_23; +pub mod get_247; +pub mod get_263; +pub mod get_269_a; +pub mod get_269_b; +pub mod get_271_a; +pub mod get_271_b; +pub mod get_273_a; +pub mod get_273_b; +pub mod get_29; +pub mod get_290_a; +pub mod get_290_b; +pub mod get_296_a; +pub mod get_296_b; +pub mod get_298_a; +pub mod get_298_b; +pub mod list_21; +pub mod list_269_a; +pub mod list_269_b; +pub mod list_detailed_21; +pub mod list_detailed_2100_a; +pub mod list_detailed_2100_b; +pub mod list_detailed_216; +pub mod list_detailed_219; +pub mod list_detailed_226; +pub mod list_detailed_23; +pub mod list_detailed_247; +pub mod list_detailed_263; +pub mod list_detailed_269_a; +pub mod list_detailed_269_b; +pub mod list_detailed_273_a; +pub mod list_detailed_273_b; +pub mod list_detailed_29; +pub mod list_detailed_290_a; +pub mod list_detailed_290_b; +pub mod list_detailed_296_a; +pub mod list_detailed_296_b; +pub mod list_detailed_298_a; +pub mod list_detailed_298_b; pub mod os_get_console_output; -pub mod os_get_rdpconsole; -pub mod os_get_serial_console; -pub mod os_get_spiceconsole; -pub mod os_get_vncconsole; +pub mod os_get_rdpconsole_21; +pub mod os_get_serial_console_21; +pub mod os_get_spiceconsole_21; +pub mod os_get_vncconsole_21; +pub mod rebuild_20; +pub mod rebuild_2100; +pub mod rebuild_219; +pub mod rebuild_226; +pub mod rebuild_247; +pub mod rebuild_254; +pub mod rebuild_257; +pub mod rebuild_263; +pub mod rebuild_271; +pub mod rebuild_273; +pub mod rebuild_275; +pub mod rebuild_29; +pub mod rebuild_296; +pub mod rebuild_298; pub mod rescue; -pub mod set; +pub mod set_20; +pub mod set_2100; +pub mod set_219; +pub mod set_226; +pub mod set_247; +pub mod set_263; +pub mod set_271; +pub mod set_273; +pub mod set_275; +pub mod set_29; +pub mod set_296; +pub mod set_298; diff --git a/types/compute/src/v2/server/response/list.rs b/types/compute/src/v2/server/response/create_a.rs similarity index 84% rename from types/compute/src/v2/server/response/list.rs rename to types/compute/src/v2/server/response/create_a.rs index 61cbf5900..3f78fe06a 100644 --- a/types/compute/src/v2/server/response/list.rs +++ b/types/compute/src/v2/server/response/create_a.rs @@ -14,7 +14,7 @@ // // WARNING: This file is automatically generated from OpenAPI schema using // `openstack-codegenerator`. -//! Response type for the GET `servers` operation +//! Response type for the POST `servers` operation use serde::{Deserialize, Serialize}; use structable::{StructTable, StructTableOptions}; @@ -22,11 +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, - - /// The server name. - #[structable()] - pub name: String, + pub reservation_id: String, } diff --git a/types/compute/src/v2/server/response/create.rs b/types/compute/src/v2/server/response/create_b.rs similarity index 51% rename from types/compute/src/v2/server/response/create.rs rename to types/compute/src/v2/server/response/create_b.rs index 42fe16126..a2646a846 100644 --- a/types/compute/src/v2/server/response/create.rs +++ b/types/compute/src/v2/server/response/create_b.rs @@ -22,42 +22,22 @@ use structable::{StructTable, StructTableOptions}; /// Server response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServerResponse { - /// The administrative password for the server. If you set - /// `enable_instance_password` configuration option to `False`, the API - /// wouldn’t return the `adminPass` field in response. #[serde(default, rename = "adminPass")] #[structable(optional, title = "adminPass")] pub admin_pass: Option, - /// The UUID of the server. #[structable()] pub id: String, - /// Links pertaining to usage. See - /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) - /// for more info. - /// - /// **New in version 2.40** - #[serde(default)] - #[structable(optional, serialize)] - pub links: Option>, + #[structable(serialize)] + pub links: Vec, - /// Disk configuration. The value is either: - /// - /// - `AUTO`. The API builds the server with a single partition the size of - /// the target flavor disk. The API automatically adjusts the file system - /// to fit the entire partition. - /// - `MANUAL`. The API builds the server by using the partition scheme and - /// file system that is in the source image. If the target flavor disk is - /// larger, The API does not partition the remaining disk space. - #[serde(default, rename = "OS-DCF:diskConfig")] - #[structable(optional, serialize, title = "OS-DCF:diskConfig")] - pub os_dcf_disk_config: Option, + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(serialize, title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: OsDcfDiskConfig, - /// One or more security groups objects. - #[serde(default)] - #[structable(optional, serialize)] - pub security_groups: Option>, + #[structable(serialize)] + pub security_groups: Vec, } #[derive(Debug, Deserialize, Clone, Serialize)] @@ -82,21 +62,37 @@ impl std::str::FromStr for OsDcfDiskConfig { } } -/// Links to the resources in question. See -/// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) -/// for more info. +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { - #[serde(default)] - pub href: Option, - #[serde(default)] - pub rel: Option, + pub href: String, + pub rel: Rel, } /// `SecurityGroups` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SecurityGroups { - #[serde(default)] - pub name: Option, + pub name: String, } diff --git a/types/compute/src/v2/server/response/create_backup.rs b/types/compute/src/v2/server/response/create_backup_245.rs similarity index 95% rename from types/compute/src/v2/server/response/create_backup.rs rename to types/compute/src/v2/server/response/create_backup_245.rs index 666357545..7588b85b3 100644 --- a/types/compute/src/v2/server/response/create_backup.rs +++ b/types/compute/src/v2/server/response/create_backup_245.rs @@ -22,7 +22,6 @@ use structable::{StructTable, StructTableOptions}; /// Server response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServerResponse { - /// The UUID for the resulting image snapshot. #[structable()] pub image_id: String, } diff --git a/types/compute/src/v2/server/response/create_image.rs b/types/compute/src/v2/server/response/create_image_245.rs similarity index 90% rename from types/compute/src/v2/server/response/create_image.rs rename to types/compute/src/v2/server/response/create_image_245.rs index 666357545..1eed587e7 100644 --- a/types/compute/src/v2/server/response/create_image.rs +++ b/types/compute/src/v2/server/response/create_image_245.rs @@ -22,7 +22,6 @@ use structable::{StructTable, StructTableOptions}; /// Server response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServerResponse { - /// The UUID for the resulting image snapshot. - #[structable()] - pub image_id: String, + #[structable(optional)] + pub image_id: Option, } diff --git a/types/compute/src/v2/server/response/get_20.rs b/types/compute/src/v2/server/response/get_20.rs new file mode 100644 index 000000000..c869623df --- /dev/null +++ b/types/compute/src/v2/server/response/get_20.rs @@ -0,0 +1,514 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + #[structable(serialize)] + pub config_drive: ConfigDrive, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// One or more security groups objects. + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_2100_a.rs b/types/compute/src/v2/server/response/get_2100_a.rs new file mode 100644 index 000000000..34b1d91d5 --- /dev/null +++ b/types/compute/src/v2/server/response/get_2100_a.rs @@ -0,0 +1,507 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[structable(serialize)] + pub config_drive: ConfigDrive, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional)] + pub pinned_availability_zone: Option, + + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub scheduler_hints: SchedulerHints, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, + #[serde(default)] + pub properties: Option>>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SchedulerHints` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SchedulerHints { + #[serde(default)] + pub build_near_host_ip: Option, + #[serde(default)] + pub cidr: Option, + #[serde(default)] + pub different_cell: Option>, + #[serde(default)] + pub different_host: Option>, + #[serde(default)] + pub group: Option>, + #[serde(default)] + pub query: Option, + #[serde(default)] + pub same_host: Option>, + #[serde(default)] + pub target_cell: Option, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_2100_b.rs b/types/compute/src/v2/server/response/get_2100_b.rs new file mode 100644 index 000000000..19b82b4a3 --- /dev/null +++ b/types/compute/src/v2/server/response/get_2100_b.rs @@ -0,0 +1,120 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable()] + pub created: String, + + #[structable(serialize)] + pub flavor: Flavor, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable()] + pub status: String, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub user_id: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} diff --git a/types/compute/src/v2/server/response/get_216.rs b/types/compute/src/v2/server/response/get_216.rs new file mode 100644 index 000000000..c36deb689 --- /dev/null +++ b/types/compute/src/v2/server/response/get_216.rs @@ -0,0 +1,641 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + #[structable(serialize)] + pub config_drive: ConfigDrive, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// The host status. Values where next value in list can override the + /// previous: + /// + /// - `UP` if nova-compute up. + /// - `UNKNOWN` if nova-compute not reported by servicegroup driver. + /// - `DOWN` if nova-compute forced down. + /// - `MAINTENANCE` if nova-compute is disabled. + /// - Empty string indicates there is no host for server. + /// + /// This attribute appears in the response only if the policy permits. By + /// default, only administrators can get this parameter. + /// + /// **New in version 2.16** + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hostname of the instance reported in the metadata service. This + /// parameter only appears in responses for administrators until + /// microversion 2.90, after which it is shown for all users. + /// + /// Note + /// + /// This information is published via the metadata service and requires + /// application such as `cloud-init` to propagate it through to the + /// instance. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The UUID of the kernel image when using an AMI. Will be null if not. By + /// default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + /// When servers are launched via multiple create, this is the sequence in + /// which the servers were launched. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + /// The UUID of the ramdisk image when using an AMI. Will be null if not. + /// By default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + /// The reservation id for the server. This is an id that can be useful in + /// tracking groups of servers created with multiple create, that will all + /// have the same reservation_id. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + /// The root device name for the instance By default, it appears in the + /// response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + /// The user_data the instance was created with. By default, it appears in + /// the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// One or more security groups objects. + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed.rs b/types/compute/src/v2/server/response/get_219.rs similarity index 66% rename from types/compute/src/v2/server/response/list_detailed.rs rename to types/compute/src/v2/server/response/get_219.rs index f7ff25850..a37104284 100644 --- a/types/compute/src/v2/server/response/list_detailed.rs +++ b/types/compute/src/v2/server/response/get_219.rs @@ -14,10 +14,9 @@ // // WARNING: This file is automatically generated from OpenAPI schema using // `openstack-codegenerator`. -//! Response type for the GET `servers/detail` operation +//! Response type for the GET `servers/{id}` operation use serde::{Deserialize, Serialize}; -use serde_json::Value; use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; @@ -26,28 +25,26 @@ use structable::{StructTable, StructTableOptions}; pub struct ServerResponse { /// IPv4 address that should be used to access this server. May be /// automatically set by the provider. - #[serde(default, rename = "accessIPv4")] - #[structable(optional, title = "accessIPv4", wide)] - pub access_ipv4: Option, + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, /// IPv6 address that should be used to access this server. May be /// automatically set by the provider. - #[serde(default, rename = "accessIPv6")] - #[structable(optional, title = "accessIPv6", wide)] - pub access_ipv6: Option, + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, /// The addresses for the server. Servers with status `BUILD` hide their /// addresses information. This view is not updated immediately. Please /// consult with OpenStack Networking API for up-to-date information. - #[serde(default)] - #[structable(optional, serialize, wide)] - pub addresses: Option>>, + #[structable(serialize)] + pub addresses: BTreeMap>, /// Indicates whether or not a config drive was used for this server. The /// value is `True` or an empty string. An empty string stands for `False`. - #[serde(default)] - #[structable(optional, wide)] - pub config_drive: Option, + #[structable(serialize)] + pub config_drive: ConfigDrive, /// The date and time when the resource was created. The date and time /// stamp format is [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) @@ -59,22 +56,20 @@ pub struct ServerResponse { /// 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`. - #[serde(default)] - #[structable(optional, wide)] - pub created: Option, + #[structable()] + pub created: String, /// The description of the server. Before microversion 2.19 this was set to /// the server name. /// /// **New in version 2.19** - #[serde(default)] - #[structable(optional, wide)] + #[structable(optional)] pub description: Option, /// A fault object. Only displayed when the server status is `ERROR` or /// `DELETED` and a fault occurred. #[serde(default)] - #[structable(optional, serialize, wide)] + #[structable(optional, serialize)] pub fault: Option, /// Before microversion 2.47 this contains the ID and links for the flavor @@ -84,7 +79,7 @@ pub struct ServerResponse { /// As of microversion 2.47 this contains a subset of the actual flavor /// information used to create the server instance, represented as a nested /// dictionary. - #[structable(serialize, wide)] + #[structable(serialize)] pub flavor: Flavor, /// The host status. Values where next value in list can override the @@ -101,7 +96,7 @@ pub struct ServerResponse { /// /// **New in version 2.16** #[serde(default)] - #[structable(optional, serialize, wide)] + #[structable(optional, serialize)] pub host_status: Option, /// An ID string representing the host. This is a hashed value so will not @@ -111,40 +106,42 @@ pub struct ServerResponse { /// project you need to determine if two instances are on the same or /// different physical hosts for the purposes of availability or /// performance. - #[serde(default, rename = "hostId")] - #[structable(optional, title = "hostId", wide)] - pub host_id: Option, + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, - /// Id of the server #[structable()] pub id: String, /// The UUID and links for the image for your server instance. The `image` /// object will be an empty string when you boot the server from a volume. - #[structable(serialize, wide)] + #[structable(serialize)] pub image: ImageEnum, /// The name of associated key pair, if any. - #[serde(default)] - #[structable(optional, wide)] + #[structable(optional)] pub key_name: Option, + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + /// True if the instance is locked otherwise False. /// /// **New in version 2.9** - #[serde(default)] - #[structable(optional, wide)] - pub locked: Option, + #[structable()] + pub locked: bool, /// A dictionary of metadata key-and-value pairs, which is maintained for /// backward compatibility. - #[serde(default)] - #[structable(optional, serialize, wide)] - pub metadata: Option>, + #[structable(serialize)] + pub metadata: BTreeMap, /// The server name. - #[structable()] - pub name: String, + #[structable(optional)] + pub name: Option, /// Disk configuration. The value is either: /// @@ -154,19 +151,19 @@ pub struct ServerResponse { /// - `MANUAL`. The API builds the server by using the partition scheme and /// file system that is in the source image. If the target flavor disk is /// larger, The API does not partition the remaining disk space. - #[serde(default, rename = "OS-DCF:diskConfig")] - #[structable(optional, serialize, title = "OS-DCF:diskConfig", wide)] - pub os_dcf_disk_config: Option, + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, /// The availability zone name. - #[serde(default, rename = "OS-EXT-AZ:availability_zone")] - #[structable(optional, title = "OS-EXT-AZ:availability_zone", wide)] - pub os_ext_az_availability_zone: Option, + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, /// The name of the compute host on which this instance is running. Appears /// in the response for administrative users only. #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] pub os_ext_srv_attr_host: Option, /// The hostname of the instance reported in the metadata service. This @@ -181,21 +178,21 @@ pub struct ServerResponse { /// /// **New in version 2.3** #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] pub os_ext_srv_attr_hostname: Option, /// The hypervisor host name provided by the Nova virt driver. For the /// Ironic driver, it is the Ironic node uuid. Appears in the response for /// administrative users only. #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] pub os_ext_srv_attr_hypervisor_hostname: Option, /// The instance name. The Compute API generates the instance name from the /// instance name template. Appears in the response for administrative /// users only. #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] pub os_ext_srv_attr_instance_name: Option, /// The UUID of the kernel image when using an AMI. Will be null if not. By @@ -203,7 +200,7 @@ pub struct ServerResponse { /// /// **New in version 2.3** #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] pub os_ext_srv_attr_kernel_id: Option, /// When servers are launched via multiple create, this is the sequence in @@ -212,7 +209,7 @@ pub struct ServerResponse { /// /// **New in version 2.3** #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] pub os_ext_srv_attr_launch_index: Option, /// The UUID of the ramdisk image when using an AMI. Will be null if not. @@ -220,7 +217,7 @@ pub struct ServerResponse { /// /// **New in version 2.3** #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] pub os_ext_srv_attr_ramdisk_id: Option, /// The reservation id for the server. This is an id that can be useful in @@ -230,7 +227,7 @@ pub struct ServerResponse { /// /// **New in version 2.3** #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] pub os_ext_srv_attr_reservation_id: Option, /// The root device name for the instance By default, it appears in the @@ -238,7 +235,7 @@ pub struct ServerResponse { /// /// **New in version 2.3** #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] pub os_ext_srv_attr_root_device_name: Option, /// The user_data the instance was created with. By default, it appears in @@ -246,7 +243,7 @@ pub struct ServerResponse { /// /// **New in version 2.3** #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] - #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] pub os_ext_srv_attr_user_data: Option, /// The power state of the instance. This is an enum value that is mapped @@ -260,29 +257,24 @@ pub struct ServerResponse { /// 6: CRASHED /// 7: SUSPENDED /// ``` - #[serde(default, rename = "OS-EXT-STS:power_state")] - #[structable(optional, title = "OS-EXT-STS:power_state", wide)] - pub os_ext_sts_power_state: Option, + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, /// The task state of the instance. - #[serde(default, rename = "OS-EXT-STS:task_state")] - #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] pub os_ext_sts_task_state: Option, /// The VM state. - #[serde(default, rename = "OS-EXT-STS:vm_state")] - #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] pub os_ext_sts_vm_state: Option, /// The attached volumes, if any. - #[serde(default, rename = "os-extended-volumes:volumes_attached")] - #[structable( - optional, - serialize, - title = "os-extended-volumes:volumes_attached", - wide - )] - pub os_extended_volumes_volumes_attached: Option>>, + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, /// The date and time when the server was launched. /// @@ -298,8 +290,8 @@ pub struct ServerResponse { /// The `hh±:mm` value, if included, is the time zone as an offset from /// UTC. If the `deleted_at` date and time stamp is not set, its value is /// `null`. - #[serde(default, rename = "OS-SRV-USG:launched_at")] - #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] pub os_srv_usg_launched_at: Option, /// The date and time when the server was deleted. @@ -314,54 +306,29 @@ pub struct ServerResponse { /// For example, `2015-08-27T09:49:58-05:00`. The `±hh:mm` value, if /// included, is the time zone as an offset from UTC. If the `deleted_at` /// date and time stamp is not set, its value is `null`. - #[serde(default, rename = "OS-SRV-USG:terminated_at")] - #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] pub os_srv_usg_terminated_at: Option, /// A percentage value of the operation progress. This parameter only /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. #[serde(default)] - #[structable(optional, wide)] - pub progress: Option, + #[structable(optional)] + pub progress: Option, /// One or more security groups objects. #[serde(default)] - #[structable(optional, serialize, wide)] + #[structable(optional, serialize)] pub security_groups: Option>, - /// The UUIDs of the server groups to which the server belongs. Currently - /// this can contain at most one entry. - #[serde(default)] - #[structable(optional, serialize, wide)] - pub server_groups: Option>, - /// The server status. - #[serde(default)] - #[structable(optional)] - pub status: Option, - - /// A list of tags. The maximum count of tags in this list is 50. - /// - /// **New in version 2.26** - #[serde(default)] - #[structable(optional, serialize, wide)] - pub tags: Option>, + #[structable(serialize)] + pub status: Status, /// The UUID of the tenant in a multi-tenancy cloud. - #[serde(default)] - #[structable(optional, wide)] - pub tenant_id: Option, - - /// A list of trusted certificate IDs, that were used during image - /// signature verification to verify the signing certificate. The list is - /// restricted to a maximum of 50 IDs. The value is `null` if trusted - /// certificate IDs are not set. - /// - /// **New in version 2.63** - #[serde(default)] - #[structable(optional, serialize, wide)] - pub trusted_image_certificates: Option>, + #[structable()] + pub tenant_id: 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) @@ -373,45 +340,72 @@ pub struct ServerResponse { /// 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`. - #[serde(default)] - #[structable(optional, wide)] - pub updated: Option, + #[structable()] + pub updated: String, /// The user ID of the user who owns the server. - #[serde(default)] - #[structable(optional, wide)] - pub user_id: Option, + #[structable()] + pub user_id: String, } #[derive(Debug, Deserialize, Clone, Serialize)] -pub enum OsDcfDiskConfig { - // Auto - #[serde(rename = "AUTO")] - Auto, - - // Manual - #[serde(rename = "MANUAL")] - Manual, +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, } -impl std::str::FromStr for OsDcfDiskConfig { +impl std::str::FromStr for OsExtIpsType { type Err = (); fn from_str(input: &str) -> Result { match input { - "AUTO" => Ok(Self::Auto), - "MANUAL" => Ok(Self::Manual), + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), _ => Err(()), } } } -/// `Addresses` type +/// `AddressesItem` type #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Addresses { - #[serde(default)] - pub addr: Option, - #[serde(default)] - pub version: Option, +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } } /// A fault object. Only displayed when the server status is `ERROR` or @@ -419,26 +413,40 @@ pub struct Addresses { /// `Fault` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Fault { - #[serde(default)] - pub code: Option, - #[serde(default)] - pub created: Option, + pub code: i32, + pub created: String, #[serde(default)] pub details: Option, - #[serde(default)] - pub message: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } } -/// Links to the resources in question. See -/// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) -/// for more info. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { - #[serde(default)] - pub href: Option, - #[serde(default)] - pub rel: Option, + pub href: String, + pub rel: Rel, } /// Before microversion 2.47 this contains the ID and links for the flavor used @@ -451,24 +459,10 @@ pub struct Links { /// `Flavor` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Flavor { - #[serde(default)] - pub disk: Option, - #[serde(default)] - pub ephemeral: Option, - #[serde(default)] - pub extra_specs: Option>, #[serde(default)] pub id: Option, #[serde(default)] pub links: Option>, - #[serde(default)] - pub original_name: Option, - #[serde(default)] - pub ram: Option, - #[serde(default)] - pub swap: Option, - #[serde(default)] - pub vcpus: Option, } #[derive(Debug, Deserialize, Clone, Serialize)] @@ -485,10 +479,6 @@ pub enum HostStatus { #[serde(rename = "MAINTENANCE")] Maintenance, - // Null - #[serde(rename = "null")] - Null, - // Unknown #[serde(rename = "UNKNOWN")] Unknown, @@ -505,7 +495,6 @@ impl std::str::FromStr for HostStatus { "" => Ok(Self::Empty), "DOWN" => Ok(Self::Down), "MAINTENANCE" => Ok(Self::Maintenance), - "null" => Ok(Self::Null), "UNKNOWN" => Ok(Self::Unknown), "UP" => Ok(Self::Up), _ => Err(()), @@ -513,32 +502,15 @@ impl std::str::FromStr for HostStatus { } } -/// The image property as returned from server. +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. /// `Image` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Image { - pub id: String, #[serde(default)] - pub links: Option>, + pub id: Option, #[serde(default)] - pub properties: Option>, -} - -#[derive(Debug, Deserialize, Clone, Serialize)] -pub enum ImageStringEnum { - // Empty - #[serde(rename = "")] - Empty, -} - -impl std::str::FromStr for ImageStringEnum { - type Err = (); - fn from_str(input: &str) -> Result { - match input { - "" => Ok(Self::Empty), - _ => Err(()), - } - } + pub links: Option>, } #[derive(Debug, Deserialize, Clone, Serialize)] @@ -547,12 +519,130 @@ pub enum ImageEnum { // F1 F1(Image), // F2 - F2(ImageStringEnum), + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, } /// `SecurityGroups` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SecurityGroups { - #[serde(default)] - pub name: Option, + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } } diff --git a/types/compute/src/v2/server/response/get_226.rs b/types/compute/src/v2/server/response/get_226.rs new file mode 100644 index 000000000..378e4f0a0 --- /dev/null +++ b/types/compute/src/v2/server/response/get_226.rs @@ -0,0 +1,654 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + #[structable(serialize)] + pub config_drive: ConfigDrive, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// The host status. Values where next value in list can override the + /// previous: + /// + /// - `UP` if nova-compute up. + /// - `UNKNOWN` if nova-compute not reported by servicegroup driver. + /// - `DOWN` if nova-compute forced down. + /// - `MAINTENANCE` if nova-compute is disabled. + /// - Empty string indicates there is no host for server. + /// + /// This attribute appears in the response only if the policy permits. By + /// default, only administrators can get this parameter. + /// + /// **New in version 2.16** + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hostname of the instance reported in the metadata service. This + /// parameter only appears in responses for administrators until + /// microversion 2.90, after which it is shown for all users. + /// + /// Note + /// + /// This information is published via the metadata service and requires + /// application such as `cloud-init` to propagate it through to the + /// instance. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The UUID of the kernel image when using an AMI. Will be null if not. By + /// default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + /// When servers are launched via multiple create, this is the sequence in + /// which the servers were launched. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + /// The UUID of the ramdisk image when using an AMI. Will be null if not. + /// By default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + /// The reservation id for the server. This is an id that can be useful in + /// tracking groups of servers created with multiple create, that will all + /// have the same reservation_id. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + /// The root device name for the instance By default, it appears in the + /// response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + /// The user_data the instance was created with. By default, it appears in + /// the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// One or more security groups objects. + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_23.rs b/types/compute/src/v2/server/response/get_23.rs new file mode 100644 index 000000000..e04955535 --- /dev/null +++ b/types/compute/src/v2/server/response/get_23.rs @@ -0,0 +1,581 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + #[structable(serialize)] + pub config_drive: ConfigDrive, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hostname of the instance reported in the metadata service. This + /// parameter only appears in responses for administrators until + /// microversion 2.90, after which it is shown for all users. + /// + /// Note + /// + /// This information is published via the metadata service and requires + /// application such as `cloud-init` to propagate it through to the + /// instance. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The UUID of the kernel image when using an AMI. Will be null if not. By + /// default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + /// When servers are launched via multiple create, this is the sequence in + /// which the servers were launched. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + /// The UUID of the ramdisk image when using an AMI. Will be null if not. + /// By default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + /// The reservation id for the server. This is an id that can be useful in + /// tracking groups of servers created with multiple create, that will all + /// have the same reservation_id. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + /// The root device name for the instance By default, it appears in the + /// response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + /// The user_data the instance was created with. By default, it appears in + /// the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// One or more security groups objects. + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_247.rs b/types/compute/src/v2/server/response/get_247.rs new file mode 100644 index 000000000..e8e0cda57 --- /dev/null +++ b/types/compute/src/v2/server/response/get_247.rs @@ -0,0 +1,659 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + #[structable(serialize)] + pub config_drive: ConfigDrive, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// The host status. Values where next value in list can override the + /// previous: + /// + /// - `UP` if nova-compute up. + /// - `UNKNOWN` if nova-compute not reported by servicegroup driver. + /// - `DOWN` if nova-compute forced down. + /// - `MAINTENANCE` if nova-compute is disabled. + /// - Empty string indicates there is no host for server. + /// + /// This attribute appears in the response only if the policy permits. By + /// default, only administrators can get this parameter. + /// + /// **New in version 2.16** + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + /// The UUID of the server. + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hostname of the instance reported in the metadata service. This + /// parameter only appears in responses for administrators until + /// microversion 2.90, after which it is shown for all users. + /// + /// Note + /// + /// This information is published via the metadata service and requires + /// application such as `cloud-init` to propagate it through to the + /// instance. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The UUID of the kernel image when using an AMI. Will be null if not. By + /// default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + /// When servers are launched via multiple create, this is the sequence in + /// which the servers were launched. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + /// The UUID of the ramdisk image when using an AMI. Will be null if not. + /// By default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + /// The reservation id for the server. This is an id that can be useful in + /// tracking groups of servers created with multiple create, that will all + /// have the same reservation_id. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + /// The root device name for the instance By default, it appears in the + /// response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + /// The user_data the instance was created with. By default, it appears in + /// the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// One or more security groups objects. + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_263.rs b/types/compute/src/v2/server/response/get_263.rs new file mode 100644 index 000000000..57b194cf0 --- /dev/null +++ b/types/compute/src/v2/server/response/get_263.rs @@ -0,0 +1,668 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + #[structable(serialize)] + pub config_drive: ConfigDrive, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// The host status. Values where next value in list can override the + /// previous: + /// + /// - `UP` if nova-compute up. + /// - `UNKNOWN` if nova-compute not reported by servicegroup driver. + /// - `DOWN` if nova-compute forced down. + /// - `MAINTENANCE` if nova-compute is disabled. + /// - Empty string indicates there is no host for server. + /// + /// This attribute appears in the response only if the policy permits. By + /// default, only administrators can get this parameter. + /// + /// **New in version 2.16** + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + /// The UUID of the server. + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hostname of the instance reported in the metadata service. This + /// parameter only appears in responses for administrators until + /// microversion 2.90, after which it is shown for all users. + /// + /// Note + /// + /// This information is published via the metadata service and requires + /// application such as `cloud-init` to propagate it through to the + /// instance. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The UUID of the kernel image when using an AMI. Will be null if not. By + /// default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + /// When servers are launched via multiple create, this is the sequence in + /// which the servers were launched. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + /// The UUID of the ramdisk image when using an AMI. Will be null if not. + /// By default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + /// The reservation id for the server. This is an id that can be useful in + /// tracking groups of servers created with multiple create, that will all + /// have the same reservation_id. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + /// The root device name for the instance By default, it appears in the + /// response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + /// The user_data the instance was created with. By default, it appears in + /// the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// One or more security groups objects. + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: String, + + /// A list of trusted certificate IDs, that were used during image + /// signature verification to verify the signing certificate. The list is + /// restricted to a maximum of 50 IDs. The value is `null` if trusted + /// certificate IDs are not set. + /// + /// **New in version 2.63** + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + /// 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_269_a.rs b/types/compute/src/v2/server/response/get_269_a.rs new file mode 100644 index 000000000..7625e1ee3 --- /dev/null +++ b/types/compute/src/v2/server/response/get_269_a.rs @@ -0,0 +1,471 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[structable(serialize)] + pub config_drive: ConfigDrive, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_269_b.rs b/types/compute/src/v2/server/response/get_269_b.rs new file mode 100644 index 000000000..579796ea1 --- /dev/null +++ b/types/compute/src/v2/server/response/get_269_b.rs @@ -0,0 +1,117 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable()] + pub created: String, + + #[structable(serialize)] + pub flavor: Flavor, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[structable()] + pub status: String, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub user_id: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} diff --git a/types/compute/src/v2/server/response/get_271_a.rs b/types/compute/src/v2/server/response/get_271_a.rs new file mode 100644 index 000000000..803ac2c05 --- /dev/null +++ b/types/compute/src/v2/server/response/get_271_a.rs @@ -0,0 +1,474 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[structable(serialize)] + pub config_drive: ConfigDrive, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_271_b.rs b/types/compute/src/v2/server/response/get_271_b.rs new file mode 100644 index 000000000..19b82b4a3 --- /dev/null +++ b/types/compute/src/v2/server/response/get_271_b.rs @@ -0,0 +1,120 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable()] + pub created: String, + + #[structable(serialize)] + pub flavor: Flavor, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable()] + pub status: String, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub user_id: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} diff --git a/types/compute/src/v2/server/response/get_273_a.rs b/types/compute/src/v2/server/response/get_273_a.rs new file mode 100644 index 000000000..3b48b5ee5 --- /dev/null +++ b/types/compute/src/v2/server/response/get_273_a.rs @@ -0,0 +1,477 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[structable(serialize)] + pub config_drive: ConfigDrive, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_273_b.rs b/types/compute/src/v2/server/response/get_273_b.rs new file mode 100644 index 000000000..19b82b4a3 --- /dev/null +++ b/types/compute/src/v2/server/response/get_273_b.rs @@ -0,0 +1,120 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable()] + pub created: String, + + #[structable(serialize)] + pub flavor: Flavor, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable()] + pub status: String, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub user_id: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} diff --git a/types/compute/src/v2/server/response/get_29.rs b/types/compute/src/v2/server/response/get_29.rs new file mode 100644 index 000000000..711871384 --- /dev/null +++ b/types/compute/src/v2/server/response/get_29.rs @@ -0,0 +1,587 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + #[structable(serialize)] + pub config_drive: ConfigDrive, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hostname of the instance reported in the metadata service. This + /// parameter only appears in responses for administrators until + /// microversion 2.90, after which it is shown for all users. + /// + /// Note + /// + /// This information is published via the metadata service and requires + /// application such as `cloud-init` to propagate it through to the + /// instance. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The UUID of the kernel image when using an AMI. Will be null if not. By + /// default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + /// When servers are launched via multiple create, this is the sequence in + /// which the servers were launched. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + /// The UUID of the ramdisk image when using an AMI. Will be null if not. + /// By default, it appears in the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + /// The reservation id for the server. This is an id that can be useful in + /// tracking groups of servers created with multiple create, that will all + /// have the same reservation_id. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + /// The root device name for the instance By default, it appears in the + /// response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + /// The user_data the instance was created with. By default, it appears in + /// the response for administrative users only. + /// + /// **New in version 2.3** + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// One or more security groups objects. + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_290_a.rs b/types/compute/src/v2/server/response/get_290_a.rs new file mode 100644 index 000000000..c4831b100 --- /dev/null +++ b/types/compute/src/v2/server/response/get_290_a.rs @@ -0,0 +1,477 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[structable(serialize)] + pub config_drive: ConfigDrive, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_290_b.rs b/types/compute/src/v2/server/response/get_290_b.rs new file mode 100644 index 000000000..19b82b4a3 --- /dev/null +++ b/types/compute/src/v2/server/response/get_290_b.rs @@ -0,0 +1,120 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable()] + pub created: String, + + #[structable(serialize)] + pub flavor: Flavor, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable()] + pub status: String, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub user_id: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} diff --git a/types/compute/src/v2/server/response/get_296_a.rs b/types/compute/src/v2/server/response/get_296_a.rs new file mode 100644 index 000000000..9f16269ea --- /dev/null +++ b/types/compute/src/v2/server/response/get_296_a.rs @@ -0,0 +1,480 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[structable(serialize)] + pub config_drive: ConfigDrive, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional)] + pub pinned_availability_zone: Option, + + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_296_b.rs b/types/compute/src/v2/server/response/get_296_b.rs new file mode 100644 index 000000000..19b82b4a3 --- /dev/null +++ b/types/compute/src/v2/server/response/get_296_b.rs @@ -0,0 +1,120 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable()] + pub created: String, + + #[structable(serialize)] + pub flavor: Flavor, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable()] + pub status: String, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub user_id: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} diff --git a/types/compute/src/v2/server/response/get_298_a.rs b/types/compute/src/v2/server/response/get_298_a.rs new file mode 100644 index 000000000..a222a41a8 --- /dev/null +++ b/types/compute/src/v2/server/response/get_298_a.rs @@ -0,0 +1,482 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[structable(serialize)] + pub config_drive: ConfigDrive, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional)] + pub pinned_availability_zone: Option, + + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, + #[serde(default)] + pub properties: Option>>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get_298_b.rs b/types/compute/src/v2/server/response/get_298_b.rs new file mode 100644 index 000000000..19b82b4a3 --- /dev/null +++ b/types/compute/src/v2/server/response/get_298_b.rs @@ -0,0 +1,120 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable()] + pub created: String, + + #[structable(serialize)] + pub flavor: Flavor, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable()] + pub status: String, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub user_id: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} diff --git a/types/compute/src/v2/server/response/list_21.rs b/types/compute/src/v2/server/response/list_21.rs new file mode 100644 index 000000000..d3a3c1958 --- /dev/null +++ b/types/compute/src/v2/server/response/list_21.rs @@ -0,0 +1,60 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + /// The UUID of the server. + #[structable()] + pub id: String, + + #[structable()] + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} diff --git a/types/compute/src/v2/server/response/list_269_a.rs b/types/compute/src/v2/server/response/list_269_a.rs new file mode 100644 index 000000000..c969300b2 --- /dev/null +++ b/types/compute/src/v2/server/response/list_269_a.rs @@ -0,0 +1,59 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable()] + pub id: String, + + #[structable()] + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} diff --git a/types/compute/src/v2/server/response/list_269_b.rs b/types/compute/src/v2/server/response/list_269_b.rs new file mode 100644 index 000000000..29cf8779b --- /dev/null +++ b/types/compute/src/v2/server/response/list_269_b.rs @@ -0,0 +1,59 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable()] + pub id: String, + + #[structable()] + pub status: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} diff --git a/types/compute/src/v2/server/response/list_detailed_21.rs b/types/compute/src/v2/server/response/list_detailed_21.rs new file mode 100644 index 000000000..6f6c63062 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_21.rs @@ -0,0 +1,382 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_2100_a.rs b/types/compute/src/v2/server/response/list_detailed_2100_a.rs new file mode 100644 index 000000000..04a21c47e --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_2100_a.rs @@ -0,0 +1,501 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(optional, wide)] + pub locked_reason: Option, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional, wide)] + pub pinned_availability_zone: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[structable(serialize, wide)] + pub scheduler_hints: SchedulerHints, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize, wide)] + pub tags: Vec, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(serialize, wide)] + pub trusted_image_certificates: Vec, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, + #[serde(default)] + pub properties: Option>>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SchedulerHints` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SchedulerHints { + #[serde(default)] + pub build_near_host_ip: Option, + #[serde(default)] + pub cidr: Option, + #[serde(default)] + pub different_cell: Option>, + #[serde(default)] + pub different_host: Option>, + #[serde(default)] + pub group: Option>, + #[serde(default)] + pub query: Option, + #[serde(default)] + pub same_host: Option>, + #[serde(default)] + pub target_cell: Option, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/os_get_serial_console.rs b/types/compute/src/v2/server/response/list_detailed_2100_b.rs similarity index 60% rename from types/compute/src/v2/server/response/os_get_serial_console.rs rename to types/compute/src/v2/server/response/list_detailed_2100_b.rs index a0232f16b..37f343529 100644 --- a/types/compute/src/v2/server/response/os_get_serial_console.rs +++ b/types/compute/src/v2/server/response/list_detailed_2100_b.rs @@ -14,7 +14,7 @@ // // WARNING: This file is automatically generated from OpenAPI schema using // `openstack-codegenerator`. -//! Response type for the POST `servers/{id}/action` operation +//! Response type for the GET `servers/detail` operation use serde::{Deserialize, Serialize}; use structable::{StructTable, StructTableOptions}; @@ -22,44 +22,44 @@ use structable::{StructTable, StructTableOptions}; /// Server response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServerResponse { - /// The type of the remote console - #[serde(rename = "type")] - #[structable(serialize, title = "type")] - pub _type: Type, + #[structable(wide)] + pub created: String, - /// The URL used to connect to the console. #[structable()] - pub url: String, -} + pub id: String, -#[derive(Debug, Deserialize, Clone, Serialize)] -pub enum Type { - // Novnc - #[serde(rename = "novnc")] - Novnc, + #[structable()] + pub status: String, - // RdpHtml5 - #[serde(rename = "rdp-html5")] - RdpHtml5, + #[structable(wide)] + pub tenant_id: String, +} - // Serial - #[serde(rename = "serial")] - Serial, +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, - // SpiceHtml5 - #[serde(rename = "spice-html5")] - SpiceHtml5, + // Current + #[serde(rename = "self")] + Current, } -impl std::str::FromStr for Type { +impl std::str::FromStr for Rel { type Err = (); fn from_str(input: &str) -> Result { match input { - "novnc" => Ok(Self::Novnc), - "rdp-html5" => Ok(Self::RdpHtml5), - "serial" => Ok(Self::Serial), - "spice-html5" => Ok(Self::SpiceHtml5), + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), _ => Err(()), } } } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} diff --git a/types/compute/src/v2/server/response/list_detailed_216.rs b/types/compute/src/v2/server/response/list_detailed_216.rs new file mode 100644 index 000000000..0eee78a4d --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_216.rs @@ -0,0 +1,455 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_219.rs b/types/compute/src/v2/server/response/list_detailed_219.rs new file mode 100644 index 000000000..08b515164 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_219.rs @@ -0,0 +1,458 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_226.rs b/types/compute/src/v2/server/response/list_detailed_226.rs new file mode 100644 index 000000000..f5c661255 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_226.rs @@ -0,0 +1,461 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize, wide)] + pub tags: Vec, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_23.rs b/types/compute/src/v2/server/response/list_detailed_23.rs new file mode 100644 index 000000000..dd049b051 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_23.rs @@ -0,0 +1,411 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_247.rs b/types/compute/src/v2/server/response/list_detailed_247.rs new file mode 100644 index 000000000..1fb3d7607 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_247.rs @@ -0,0 +1,465 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize, wide)] + pub tags: Vec, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_263.rs b/types/compute/src/v2/server/response/list_detailed_263.rs new file mode 100644 index 000000000..97fd6cc7d --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_263.rs @@ -0,0 +1,468 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize, wide)] + pub tags: Vec, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(serialize, wide)] + pub trusted_image_certificates: Vec, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_269_a.rs b/types/compute/src/v2/server/response/list_detailed_269_a.rs new file mode 100644 index 000000000..97fd6cc7d --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_269_a.rs @@ -0,0 +1,468 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize, wide)] + pub tags: Vec, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(serialize, wide)] + pub trusted_image_certificates: Vec, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/os_get_vncconsole.rs b/types/compute/src/v2/server/response/list_detailed_269_b.rs similarity index 60% rename from types/compute/src/v2/server/response/os_get_vncconsole.rs rename to types/compute/src/v2/server/response/list_detailed_269_b.rs index a0232f16b..37f343529 100644 --- a/types/compute/src/v2/server/response/os_get_vncconsole.rs +++ b/types/compute/src/v2/server/response/list_detailed_269_b.rs @@ -14,7 +14,7 @@ // // WARNING: This file is automatically generated from OpenAPI schema using // `openstack-codegenerator`. -//! Response type for the POST `servers/{id}/action` operation +//! Response type for the GET `servers/detail` operation use serde::{Deserialize, Serialize}; use structable::{StructTable, StructTableOptions}; @@ -22,44 +22,44 @@ use structable::{StructTable, StructTableOptions}; /// Server response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServerResponse { - /// The type of the remote console - #[serde(rename = "type")] - #[structable(serialize, title = "type")] - pub _type: Type, + #[structable(wide)] + pub created: String, - /// The URL used to connect to the console. #[structable()] - pub url: String, -} + pub id: String, -#[derive(Debug, Deserialize, Clone, Serialize)] -pub enum Type { - // Novnc - #[serde(rename = "novnc")] - Novnc, + #[structable()] + pub status: String, - // RdpHtml5 - #[serde(rename = "rdp-html5")] - RdpHtml5, + #[structable(wide)] + pub tenant_id: String, +} - // Serial - #[serde(rename = "serial")] - Serial, +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, - // SpiceHtml5 - #[serde(rename = "spice-html5")] - SpiceHtml5, + // Current + #[serde(rename = "self")] + Current, } -impl std::str::FromStr for Type { +impl std::str::FromStr for Rel { type Err = (); fn from_str(input: &str) -> Result { match input { - "novnc" => Ok(Self::Novnc), - "rdp-html5" => Ok(Self::RdpHtml5), - "serial" => Ok(Self::Serial), - "spice-html5" => Ok(Self::SpiceHtml5), + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), _ => Err(()), } } } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} diff --git a/types/compute/src/v2/server/response/list_detailed_273_a.rs b/types/compute/src/v2/server/response/list_detailed_273_a.rs new file mode 100644 index 000000000..a6ead9f39 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_273_a.rs @@ -0,0 +1,471 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(optional, wide)] + pub locked_reason: Option, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize, wide)] + pub tags: Vec, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(serialize, wide)] + pub trusted_image_certificates: Vec, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_273_b.rs b/types/compute/src/v2/server/response/list_detailed_273_b.rs new file mode 100644 index 000000000..37f343529 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_273_b.rs @@ -0,0 +1,65 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable(wide)] + pub created: String, + + #[structable()] + pub id: String, + + #[structable()] + pub status: String, + + #[structable(wide)] + pub tenant_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} diff --git a/types/compute/src/v2/server/response/list_detailed_29.rs b/types/compute/src/v2/server/response/list_detailed_29.rs new file mode 100644 index 000000000..725741830 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_29.rs @@ -0,0 +1,414 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_290_a.rs b/types/compute/src/v2/server/response/list_detailed_290_a.rs new file mode 100644 index 000000000..e36e08838 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_290_a.rs @@ -0,0 +1,471 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(optional, wide)] + pub locked_reason: Option, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize, wide)] + pub tags: Vec, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(serialize, wide)] + pub trusted_image_certificates: Vec, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_290_b.rs b/types/compute/src/v2/server/response/list_detailed_290_b.rs new file mode 100644 index 000000000..37f343529 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_290_b.rs @@ -0,0 +1,65 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable(wide)] + pub created: String, + + #[structable()] + pub id: String, + + #[structable()] + pub status: String, + + #[structable(wide)] + pub tenant_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} diff --git a/types/compute/src/v2/server/response/list_detailed_296_a.rs b/types/compute/src/v2/server/response/list_detailed_296_a.rs new file mode 100644 index 000000000..56417c959 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_296_a.rs @@ -0,0 +1,474 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(optional, wide)] + pub locked_reason: Option, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional, wide)] + pub pinned_availability_zone: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize, wide)] + pub tags: Vec, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(serialize, wide)] + pub trusted_image_certificates: Vec, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_296_b.rs b/types/compute/src/v2/server/response/list_detailed_296_b.rs new file mode 100644 index 000000000..37f343529 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_296_b.rs @@ -0,0 +1,65 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable(wide)] + pub created: String, + + #[structable()] + pub id: String, + + #[structable()] + pub status: String, + + #[structable(wide)] + pub tenant_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} diff --git a/types/compute/src/v2/server/response/list_detailed_298_a.rs b/types/compute/src/v2/server/response/list_detailed_298_a.rs new file mode 100644 index 000000000..b2017f573 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_298_a.rs @@ -0,0 +1,476 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4", wide)] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6", wide)] + pub access_ipv6: String, + + #[structable(serialize, wide)] + pub addresses: BTreeMap>, + + #[structable(serialize, wide)] + pub config_drive: ConfigDrive, + + #[structable(wide)] + pub created: String, + + #[structable(optional, wide)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub fault: Option, + + #[structable(serialize, wide)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId", wide)] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize, wide)] + pub image: ImageEnum, + + #[structable(optional, wide)] + pub key_name: Option, + + #[structable(wide)] + pub locked: bool, + + #[structable(optional, wide)] + pub locked_reason: Option, + + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig", wide)] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone", wide)] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host", wide)] + pub os_ext_srv_attr_host: Option, + + #[serde(rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(title = "OS-EXT-SRV-ATTR:hostname", wide)] + pub os_ext_srv_attr_hostname: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname", wide)] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name", wide)] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id", wide)] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index", wide)] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id", wide)] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id", wide)] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name", wide)] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data", wide)] + pub os_ext_srv_attr_user_data: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state", wide)] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state", wide)] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state", wide)] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached", wide)] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at", wide)] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at", wide)] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional, wide)] + pub pinned_availability_zone: Option, + + #[serde(default)] + #[structable(optional, wide)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize, wide)] + pub security_groups: Option>, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize, wide)] + pub tags: Vec, + + #[structable(wide)] + pub tenant_id: String, + + #[structable(serialize, wide)] + pub trusted_image_certificates: Vec, + + #[structable(wide)] + pub updated: String, + + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum ConfigDrive { + // Empty + #[serde(rename = "")] + Empty, + + // False + #[serde(rename = "False")] + False, + + // True + #[serde(rename = "True")] + True, +} + +impl std::str::FromStr for ConfigDrive { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "False" => Ok(Self::False), + "True" => Ok(Self::True), + _ => Err(()), + } + } +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum HostStatus { + // Empty + #[serde(rename = "")] + Empty, + + // Down + #[serde(rename = "DOWN")] + Down, + + // Maintenance + #[serde(rename = "MAINTENANCE")] + Maintenance, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // Up + #[serde(rename = "UP")] + Up, +} + +impl std::str::FromStr for HostStatus { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "" => Ok(Self::Empty), + "DOWN" => Ok(Self::Down), + "MAINTENANCE" => Ok(Self::Maintenance), + "UNKNOWN" => Ok(Self::Unknown), + "UP" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, + #[serde(default)] + pub properties: Option>>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/list_detailed_298_b.rs b/types/compute/src/v2/server/response/list_detailed_298_b.rs new file mode 100644 index 000000000..37f343529 --- /dev/null +++ b/types/compute/src/v2/server/response/list_detailed_298_b.rs @@ -0,0 +1,65 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/detail` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[structable(wide)] + pub created: String, + + #[structable()] + pub id: String, + + #[structable()] + pub status: String, + + #[structable(wide)] + pub tenant_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} diff --git a/types/compute/src/v2/server/response/os_get_rdpconsole_21.rs b/types/compute/src/v2/server/response/os_get_rdpconsole_21.rs new file mode 100644 index 000000000..40ebe8f00 --- /dev/null +++ b/types/compute/src/v2/server/response/os_get_rdpconsole_21.rs @@ -0,0 +1,31 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "type")] + #[structable(title = "type")] + pub _type: String, + + #[structable()] + pub url: String, +} diff --git a/types/compute/src/v2/server/response/os_get_serial_console_21.rs b/types/compute/src/v2/server/response/os_get_serial_console_21.rs new file mode 100644 index 000000000..40ebe8f00 --- /dev/null +++ b/types/compute/src/v2/server/response/os_get_serial_console_21.rs @@ -0,0 +1,31 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "type")] + #[structable(title = "type")] + pub _type: String, + + #[structable()] + pub url: String, +} diff --git a/types/compute/src/v2/server/response/os_get_spiceconsole_21.rs b/types/compute/src/v2/server/response/os_get_spiceconsole_21.rs new file mode 100644 index 000000000..40ebe8f00 --- /dev/null +++ b/types/compute/src/v2/server/response/os_get_spiceconsole_21.rs @@ -0,0 +1,31 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "type")] + #[structable(title = "type")] + pub _type: String, + + #[structable()] + pub url: String, +} diff --git a/types/compute/src/v2/server/response/os_get_spiceconsole.rs b/types/compute/src/v2/server/response/os_get_vncconsole_21.rs similarity index 77% rename from types/compute/src/v2/server/response/os_get_spiceconsole.rs rename to types/compute/src/v2/server/response/os_get_vncconsole_21.rs index a0232f16b..171c2aab2 100644 --- a/types/compute/src/v2/server/response/os_get_spiceconsole.rs +++ b/types/compute/src/v2/server/response/os_get_vncconsole_21.rs @@ -22,12 +22,10 @@ use structable::{StructTable, StructTableOptions}; /// Server response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServerResponse { - /// The type of the remote console #[serde(rename = "type")] #[structable(serialize, title = "type")] pub _type: Type, - /// The URL used to connect to the console. #[structable()] pub url: String, } @@ -38,17 +36,9 @@ pub enum Type { #[serde(rename = "novnc")] Novnc, - // RdpHtml5 - #[serde(rename = "rdp-html5")] - RdpHtml5, - - // Serial - #[serde(rename = "serial")] - Serial, - - // SpiceHtml5 - #[serde(rename = "spice-html5")] - SpiceHtml5, + // Xvpvnc + #[serde(rename = "xvpvnc")] + Xvpvnc, } impl std::str::FromStr for Type { @@ -56,9 +46,7 @@ impl std::str::FromStr for Type { fn from_str(input: &str) -> Result { match input { "novnc" => Ok(Self::Novnc), - "rdp-html5" => Ok(Self::RdpHtml5), - "serial" => Ok(Self::Serial), - "spice-html5" => Ok(Self::SpiceHtml5), + "xvpvnc" => Ok(Self::Xvpvnc), _ => Err(()), } } diff --git a/types/compute/src/v2/server/response/rebuild_20.rs b/types/compute/src/v2/server/response/rebuild_20.rs new file mode 100644 index 000000000..7b4d8a4f0 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_20.rs @@ -0,0 +1,273 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub status: Status, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_2100.rs b/types/compute/src/v2/server/response/rebuild_2100.rs new file mode 100644 index 000000000..3b5d83ffb --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_2100.rs @@ -0,0 +1,445 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable(optional)] + pub config_drive: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional)] + pub pinned_availability_zone: Option, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub scheduler_hints: SchedulerHints, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable(optional)] + pub user_data: Option, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, + #[serde(default)] + pub properties: Option>>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SchedulerHints` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SchedulerHints { + #[serde(default)] + pub build_near_host_ip: Option, + #[serde(default)] + pub cidr: Option, + #[serde(default)] + pub different_cell: Option>, + #[serde(default)] + pub different_host: Option>, + #[serde(default)] + pub group: Option>, + #[serde(default)] + pub query: Option, + #[serde(default)] + pub same_host: Option>, + #[serde(default)] + pub target_cell: Option, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_219.rs b/types/compute/src/v2/server/response/rebuild_219.rs new file mode 100644 index 000000000..b0d97f1c9 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_219.rs @@ -0,0 +1,279 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub status: Status, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_226.rs b/types/compute/src/v2/server/response/rebuild_226.rs new file mode 100644 index 000000000..999b1ca35 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_226.rs @@ -0,0 +1,282 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_247.rs b/types/compute/src/v2/server/response/rebuild_247.rs new file mode 100644 index 000000000..3d05e60d3 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_247.rs @@ -0,0 +1,286 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_254.rs b/types/compute/src/v2/server/response/rebuild_254.rs new file mode 100644 index 000000000..441a53cc0 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_254.rs @@ -0,0 +1,289 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_257.rs b/types/compute/src/v2/server/response/rebuild_257.rs new file mode 100644 index 000000000..c863251f5 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_257.rs @@ -0,0 +1,292 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub updated: String, + + #[structable(optional)] + pub user_data: Option, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_263.rs b/types/compute/src/v2/server/response/rebuild_263.rs new file mode 100644 index 000000000..654b6f45a --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_263.rs @@ -0,0 +1,295 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable(optional)] + pub user_data: Option, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_271.rs b/types/compute/src/v2/server/response/rebuild_271.rs new file mode 100644 index 000000000..37571c0df --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_271.rs @@ -0,0 +1,298 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable(optional)] + pub user_data: Option, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_273.rs b/types/compute/src/v2/server/response/rebuild_273.rs new file mode 100644 index 000000000..694dbd947 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_273.rs @@ -0,0 +1,301 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable(optional)] + pub user_data: Option, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_275.rs b/types/compute/src/v2/server/response/rebuild_275.rs new file mode 100644 index 000000000..2612752c8 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_275.rs @@ -0,0 +1,415 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable(optional)] + pub config_drive: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable(optional)] + pub user_data: Option, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_29.rs b/types/compute/src/v2/server/response/rebuild_29.rs new file mode 100644 index 000000000..eac5396b5 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_29.rs @@ -0,0 +1,276 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable()] + pub created: String, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub status: Status, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub updated: String, + + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_296.rs b/types/compute/src/v2/server/response/rebuild_296.rs new file mode 100644 index 000000000..3f85e7185 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_296.rs @@ -0,0 +1,418 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable(optional)] + pub config_drive: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional)] + pub pinned_availability_zone: Option, + + #[structable(optional)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable(optional)] + pub user_data: Option, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rebuild_298.rs b/types/compute/src/v2/server/response/rebuild_298.rs new file mode 100644 index 000000000..d3ced4165 --- /dev/null +++ b/types/compute/src/v2/server/response/rebuild_298.rs @@ -0,0 +1,420 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{id}/action` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Server response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerResponse { + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, + + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + #[structable(serialize)] + pub addresses: BTreeMap>, + + #[serde(default, rename = "adminPass")] + #[structable(optional, title = "adminPass")] + pub admin_pass: Option, + + #[structable(optional)] + pub config_drive: Option, + + #[structable()] + pub created: String, + + #[structable(optional)] + pub description: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + #[structable(serialize)] + pub flavor: Flavor, + + #[serde(default)] + #[structable(optional)] + pub host_status: Option, + + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + #[structable(serialize)] + pub image: ImageEnum, + + #[structable(optional)] + pub key_name: Option, + + #[structable(serialize)] + pub links: Vec, + + #[structable()] + pub locked: bool, + + #[structable(optional)] + pub locked_reason: Option, + + #[structable(serialize)] + pub metadata: BTreeMap, + + #[structable(optional)] + pub name: Option, + + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + #[structable(optional)] + pub pinned_availability_zone: Option, + + #[structable(optional)] + pub progress: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + #[structable(serialize)] + pub server_groups: Vec, + + #[structable(serialize)] + pub status: Status, + + #[structable(serialize)] + pub tags: Vec, + + #[structable()] + pub tenant_id: String, + + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + #[structable()] + pub updated: String, + + #[structable(optional)] + pub user_data: Option, + + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, + #[serde(default)] + pub properties: Option>>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/rescue.rs b/types/compute/src/v2/server/response/rescue.rs index a63d9fd83..73703af1b 100644 --- a/types/compute/src/v2/server/response/rescue.rs +++ b/types/compute/src/v2/server/response/rescue.rs @@ -22,9 +22,6 @@ use structable::{StructTable, StructTableOptions}; /// Server response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServerResponse { - /// An administrative password to access moved instance. If you set - /// enable_instance_password configuration option to False, the API - /// wouldn’t return the adminPass field in response. #[serde(rename = "adminPass")] #[structable(title = "adminPass")] pub admin_pass: String, diff --git a/types/compute/src/v2/server/response/set_20.rs b/types/compute/src/v2/server/response/set_20.rs new file mode 100644 index 000000000..9f7d69c64 --- /dev/null +++ b/types/compute/src/v2/server/response/set_20.rs @@ -0,0 +1,346 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/set_2100.rs b/types/compute/src/v2/server/response/set_2100.rs new file mode 100644 index 000000000..c51af548c --- /dev/null +++ b/types/compute/src/v2/server/response/set_2100.rs @@ -0,0 +1,684 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + /// + /// **New in version 2.75** + #[structable(optional)] + pub config_drive: Option, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// The host status. Values where next value in list can override the + /// previous: + /// + /// - `UP` if nova-compute up. + /// - `UNKNOWN` if nova-compute not reported by servicegroup driver. + /// - `DOWN` if nova-compute forced down. + /// - `MAINTENANCE` if nova-compute is disabled. + /// - Empty string indicates there is no host for server. + /// + /// This attribute appears in the response only if the policy permits. By + /// default, only administrators can get this parameter. + /// + /// **New in version 2.75** + #[serde(default)] + #[structable(optional)] + pub host_status: Option, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + /// The UUID of the server. + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + /// + /// **New in version 2.75** + #[serde(default)] + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// The reason behind locking a server. + /// + /// **New in version 2.73** + #[structable(optional)] + pub locked_reason: Option, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hostname of the instance reported in the metadata service. This + /// parameter only appears in responses for administrators until + /// microversion 2.90, after which it is shown for all users. + /// + /// Note + /// + /// This information is published via the metadata service and requires + /// application such as `cloud-init` to propagate it through to the + /// instance. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The UUID of the kernel image when using an AMI. Will be null if not. By + /// default, it appears in the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + /// When servers are launched via multiple create, this is the sequence in + /// which the servers were launched. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + /// The UUID of the ramdisk image when using an AMI. Will be null if not. + /// By default, it appears in the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + /// The reservation id for the server. This is an id that can be useful in + /// tracking groups of servers created with multiple create, that will all + /// have the same reservation_id. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + /// The root device name for the instance By default, it appears in the + /// response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + /// The user_data the instance was created with. By default, it appears in + /// the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + /// + /// **New in version 2.75** + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + /// + /// **New in version 2.75** + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + /// + /// **New in version 2.75** + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// This is the availability zone requested during server creation. Also + /// when cross_az_attach option is false and booting an instance from + /// volume, the instance can be pinned to AZ and in that case, instance + /// will be scheduled on host belonging to pinned AZ. Also when + /// default_schedule_zone config option set to specific AZ, in that case, + /// instance would be pinned to that specific AZ, and instance will be + /// scheduled on host belonging to pinned AZ. In case of no pinned + /// availability zone, this value is set to null. + /// + /// **New in version 2.96** + #[structable(optional)] + pub pinned_availability_zone: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + #[structable(serialize)] + pub scheduler_hints: SchedulerHints, + + /// One or more security groups objects. + /// + /// **New in version 2.75** + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The UUIDs of the server groups to which the server belongs. Currently + /// this can contain at most one entry. + /// + /// **New in version 2.71** + #[structable(serialize)] + pub server_groups: Vec, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: String, + + /// A list of trusted certificate IDs, that were used during image + /// signature verification to verify the signing certificate. The list is + /// restricted to a maximum of 50 IDs. The value is `null` if trusted + /// certificate IDs are not set. + /// + /// **New in version 2.63** + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + /// 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, + #[serde(default)] + pub properties: Option>>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SchedulerHints` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SchedulerHints { + #[serde(default)] + pub build_near_host_ip: Option, + #[serde(default)] + pub cidr: Option, + #[serde(default)] + pub different_cell: Option>, + #[serde(default)] + pub different_host: Option>, + #[serde(default)] + pub group: Option>, + #[serde(default)] + pub query: Option, + #[serde(default)] + pub same_host: Option>, + #[serde(default)] + pub target_cell: Option, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/set_219.rs b/types/compute/src/v2/server/response/set_219.rs new file mode 100644 index 000000000..5403263ea --- /dev/null +++ b/types/compute/src/v2/server/response/set_219.rs @@ -0,0 +1,359 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/set_226.rs b/types/compute/src/v2/server/response/set_226.rs new file mode 100644 index 000000000..bd4050393 --- /dev/null +++ b/types/compute/src/v2/server/response/set_226.rs @@ -0,0 +1,365 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/set_247.rs b/types/compute/src/v2/server/response/set_247.rs new file mode 100644 index 000000000..8a5b1aca6 --- /dev/null +++ b/types/compute/src/v2/server/response/set_247.rs @@ -0,0 +1,370 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + /// The UUID of the server. + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/set_263.rs b/types/compute/src/v2/server/response/set_263.rs new file mode 100644 index 000000000..18ab5257c --- /dev/null +++ b/types/compute/src/v2/server/response/set_263.rs @@ -0,0 +1,379 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + /// The UUID of the server. + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: String, + + /// A list of trusted certificate IDs, that were used during image + /// signature verification to verify the signing certificate. The list is + /// restricted to a maximum of 50 IDs. The value is `null` if trusted + /// certificate IDs are not set. + /// + /// **New in version 2.63** + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + /// 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/set_271.rs b/types/compute/src/v2/server/response/set_271.rs new file mode 100644 index 000000000..d0589df78 --- /dev/null +++ b/types/compute/src/v2/server/response/set_271.rs @@ -0,0 +1,386 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + /// The UUID of the server. + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// The UUIDs of the server groups to which the server belongs. Currently + /// this can contain at most one entry. + /// + /// **New in version 2.71** + #[structable(serialize)] + pub server_groups: Vec, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: String, + + /// A list of trusted certificate IDs, that were used during image + /// signature verification to verify the signing certificate. The list is + /// restricted to a maximum of 50 IDs. The value is `null` if trusted + /// certificate IDs are not set. + /// + /// **New in version 2.63** + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + /// 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/set_273.rs b/types/compute/src/v2/server/response/set_273.rs new file mode 100644 index 000000000..2cbff5877 --- /dev/null +++ b/types/compute/src/v2/server/response/set_273.rs @@ -0,0 +1,392 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + /// The UUID of the server. + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// The reason behind locking a server. + /// + /// **New in version 2.73** + #[structable(optional)] + pub locked_reason: Option, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// The UUIDs of the server groups to which the server belongs. Currently + /// this can contain at most one entry. + /// + /// **New in version 2.71** + #[structable(serialize)] + pub server_groups: Vec, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: String, + + /// A list of trusted certificate IDs, that were used during image + /// signature verification to verify the signing certificate. The list is + /// restricted to a maximum of 50 IDs. The value is `null` if trusted + /// certificate IDs are not set. + /// + /// **New in version 2.63** + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + /// 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/get.rs b/types/compute/src/v2/server/response/set_275.rs similarity index 72% rename from types/compute/src/v2/server/response/get.rs rename to types/compute/src/v2/server/response/set_275.rs index e292c627d..12a2d2f32 100644 --- a/types/compute/src/v2/server/response/get.rs +++ b/types/compute/src/v2/server/response/set_275.rs @@ -14,10 +14,9 @@ // // WARNING: This file is automatically generated from OpenAPI schema using // `openstack-codegenerator`. -//! Response type for the GET `servers/{id}` operation +//! Response type for the PUT `servers/{id}` operation use serde::{Deserialize, Serialize}; -use serde_json::Value; use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; @@ -26,30 +25,28 @@ use structable::{StructTable, StructTableOptions}; pub struct ServerResponse { /// IPv4 address that should be used to access this server. May be /// automatically set by the provider. - #[serde(default, rename = "accessIPv4")] - #[structable(optional, title = "accessIPv4")] - pub access_ipv4: Option, + #[serde(rename = "accessIPv4")] + #[structable(title = "accessIPv4")] + pub access_ipv4: String, /// IPv6 address that should be used to access this server. May be /// automatically set by the provider. - #[serde(default, rename = "accessIPv6")] - #[structable(optional, title = "accessIPv6")] - pub access_ipv6: Option, + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, /// The addresses for the server. Servers with status `BUILD` hide their /// addresses information. This view is not updated immediately. Please /// consult with OpenStack Networking API for up-to-date information. - #[serde(default)] - #[structable(optional, serialize)] - pub addresses: Option>>, + #[structable(serialize)] + pub addresses: BTreeMap>, /// Indicates whether or not a config drive was used for this server. The /// value is `True` or an empty string. An empty string stands for `False`. /// /// **New in version 2.75** - #[serde(default)] #[structable(optional)] - pub config_drive: Option, + pub config_drive: Option, /// The date and time when the resource was created. The date and time /// stamp format is [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) @@ -61,15 +58,13 @@ pub struct ServerResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub created: Option, + #[structable()] + pub created: String, /// The description of the server. Before microversion 2.19 this was set to /// the server name. /// /// **New in version 2.19** - #[serde(default)] #[structable(optional)] pub description: Option, @@ -103,8 +98,8 @@ pub struct ServerResponse { /// /// **New in version 2.75** #[serde(default)] - #[structable(optional, serialize)] - pub host_status: Option, + #[structable(optional)] + pub host_status: Option, /// An ID string representing the host. This is a hashed value so will not /// actually look like a hostname, and is hashed with data from the @@ -113,11 +108,11 @@ pub struct ServerResponse { /// project you need to determine if two instances are on the same or /// different physical hosts for the purposes of availability or /// performance. - #[serde(default, rename = "hostId")] - #[structable(optional, title = "hostId")] - pub host_id: Option, + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, - /// Id of the server + /// The UUID of the server. #[structable()] pub id: String, @@ -136,26 +131,29 @@ pub struct ServerResponse { /// Links to the resources in question. See /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) /// for more info. - #[serde(default)] - #[structable(optional, serialize)] - pub links: Option>, + #[structable(serialize)] + pub links: Vec, /// True if the instance is locked otherwise False. /// /// **New in version 2.9** - #[serde(default)] + #[structable()] + pub locked: bool, + + /// The reason behind locking a server. + /// + /// **New in version 2.73** #[structable(optional)] - pub locked: Option, + pub locked_reason: Option, /// A dictionary of metadata key-and-value pairs, which is maintained for /// backward compatibility. - #[serde(default)] - #[structable(optional, serialize)] - pub metadata: Option>, + #[structable(serialize)] + pub metadata: BTreeMap, /// The server name. - #[structable()] - pub name: String, + #[structable(optional)] + pub name: Option, /// Disk configuration. The value is either: /// @@ -165,16 +163,16 @@ pub struct ServerResponse { /// - `MANUAL`. The API builds the server by using the partition scheme and /// file system that is in the source image. If the target flavor disk is /// larger, The API does not partition the remaining disk space. - #[serde(default, rename = "OS-DCF:diskConfig")] - #[structable(optional, serialize, title = "OS-DCF:diskConfig")] - pub os_dcf_disk_config: Option, + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, /// The availability zone name. /// /// **New in version 2.75** - #[serde(default, rename = "OS-EXT-AZ:availability_zone")] - #[structable(optional, title = "OS-EXT-AZ:availability_zone")] - pub os_ext_az_availability_zone: Option, + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, /// The name of the compute host on which this instance is running. Appears /// in the response for administrative users only. @@ -281,30 +279,30 @@ pub struct ServerResponse { /// ``` /// /// **New in version 2.75** - #[serde(default, rename = "OS-EXT-STS:power_state")] - #[structable(optional, title = "OS-EXT-STS:power_state")] - pub os_ext_sts_power_state: Option, + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, /// The task state of the instance. /// /// **New in version 2.75** - #[serde(default, rename = "OS-EXT-STS:task_state")] + #[serde(rename = "OS-EXT-STS:task_state")] #[structable(optional, title = "OS-EXT-STS:task_state")] pub os_ext_sts_task_state: Option, /// The VM state. /// /// **New in version 2.75** - #[serde(default, rename = "OS-EXT-STS:vm_state")] + #[serde(rename = "OS-EXT-STS:vm_state")] #[structable(optional, title = "OS-EXT-STS:vm_state")] pub os_ext_sts_vm_state: Option, /// The attached volumes, if any. /// /// **New in version 2.75** - #[serde(default, rename = "os-extended-volumes:volumes_attached")] - #[structable(optional, serialize, title = "os-extended-volumes:volumes_attached")] - pub os_extended_volumes_volumes_attached: Option>>, + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, /// The date and time when the server was launched. /// @@ -322,7 +320,7 @@ pub struct ServerResponse { /// `null`. /// /// **New in version 2.75** - #[serde(default, rename = "OS-SRV-USG:launched_at")] + #[serde(rename = "OS-SRV-USG:launched_at")] #[structable(optional, title = "OS-SRV-USG:launched_at")] pub os_srv_usg_launched_at: Option, @@ -340,7 +338,7 @@ pub struct ServerResponse { /// date and time stamp is not set, its value is `null`. /// /// **New in version 2.75** - #[serde(default, rename = "OS-SRV-USG:terminated_at")] + #[serde(rename = "OS-SRV-USG:terminated_at")] #[structable(optional, title = "OS-SRV-USG:terminated_at")] pub os_srv_usg_terminated_at: Option, @@ -349,7 +347,7 @@ pub struct ServerResponse { /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. #[serde(default)] #[structable(optional)] - pub progress: Option, + pub progress: Option, /// One or more security groups objects. /// @@ -362,26 +360,22 @@ pub struct ServerResponse { /// this can contain at most one entry. /// /// **New in version 2.71** - #[serde(default)] - #[structable(optional, serialize)] - pub server_groups: Option>, + #[structable(serialize)] + pub server_groups: Vec, /// The server status. - #[serde(default)] - #[structable(optional)] - pub status: Option, + #[structable(serialize)] + pub status: Status, /// A list of tags. The maximum count of tags in this list is 50. /// /// **New in version 2.26** - #[serde(default)] - #[structable(optional, serialize)] - pub tags: Option>, + #[structable(serialize)] + pub tags: Vec, /// The UUID of the tenant in a multi-tenancy cloud. - #[serde(default)] - #[structable(optional)] - pub tenant_id: Option, + #[structable()] + pub tenant_id: String, /// A list of trusted certificate IDs, that were used during image /// signature verification to verify the signing certificate. The list is @@ -389,9 +383,8 @@ pub struct ServerResponse { /// certificate IDs are not set. /// /// **New in version 2.63** - #[serde(default)] - #[structable(optional, serialize)] - pub trusted_image_certificates: Option>, + #[structable(serialize)] + pub trusted_image_certificates: Vec, /// 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) @@ -403,45 +396,45 @@ pub struct ServerResponse { /// 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`. - #[serde(default)] - #[structable(optional)] - pub updated: Option, + #[structable()] + pub updated: String, /// The user ID of the user who owns the server. - #[serde(default)] - #[structable(optional)] - pub user_id: Option, + #[structable()] + pub user_id: String, } #[derive(Debug, Deserialize, Clone, Serialize)] -pub enum OsDcfDiskConfig { - // Auto - #[serde(rename = "AUTO")] - Auto, - - // Manual - #[serde(rename = "MANUAL")] - Manual, +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, } -impl std::str::FromStr for OsDcfDiskConfig { +impl std::str::FromStr for OsExtIpsType { type Err = (); fn from_str(input: &str) -> Result { match input { - "AUTO" => Ok(Self::Auto), - "MANUAL" => Ok(Self::Manual), + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), _ => Err(()), } } } -/// `Addresses` type +/// `AddressesItem` type #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Addresses { - #[serde(default)] - pub addr: Option, - #[serde(default)] - pub version: Option, +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, } /// A fault object. Only displayed when the server status is `ERROR` or @@ -449,26 +442,11 @@ pub struct Addresses { /// `Fault` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Fault { - #[serde(default)] - pub code: Option, - #[serde(default)] - pub created: Option, + pub code: i32, + pub created: String, #[serde(default)] pub details: Option, - #[serde(default)] - pub message: Option, -} - -/// Links to the resources in question. See -/// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) -/// for more info. -/// `Links` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Links { - #[serde(default)] - pub href: Option, - #[serde(default)] - pub rel: Option, + pub message: String, } /// Before microversion 2.47 this contains the ID and links for the flavor used @@ -481,94 +459,54 @@ pub struct Links { /// `Flavor` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Flavor { - #[serde(default)] - pub disk: Option, - #[serde(default)] - pub ephemeral: Option, + pub disk: i32, + pub ephemeral: i32, #[serde(default)] pub extra_specs: Option>, - #[serde(default)] - pub id: Option, - #[serde(default)] - pub links: Option>, - #[serde(default)] - pub original_name: Option, - #[serde(default)] - pub ram: Option, - #[serde(default)] - pub swap: Option, - #[serde(default)] - pub vcpus: Option, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, } #[derive(Debug, Deserialize, Clone, Serialize)] -pub enum HostStatus { - // Empty - #[serde(rename = "")] - Empty, - - // Down - #[serde(rename = "DOWN")] - Down, - - // Maintenance - #[serde(rename = "MAINTENANCE")] - Maintenance, - - // Null - #[serde(rename = "null")] - Null, - - // Unknown - #[serde(rename = "UNKNOWN")] - Unknown, - - // Up - #[serde(rename = "UP")] - Up, +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, } -impl std::str::FromStr for HostStatus { +impl std::str::FromStr for Rel { type Err = (); fn from_str(input: &str) -> Result { match input { - "" => Ok(Self::Empty), - "DOWN" => Ok(Self::Down), - "MAINTENANCE" => Ok(Self::Maintenance), - "null" => Ok(Self::Null), - "UNKNOWN" => Ok(Self::Unknown), - "UP" => Ok(Self::Up), + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), _ => Err(()), } } } -/// The image property as returned from server. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. /// `Image` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Image { - pub id: String, #[serde(default)] - pub links: Option>, + pub id: Option, #[serde(default)] - pub properties: Option>, -} - -#[derive(Debug, Deserialize, Clone, Serialize)] -pub enum ImageStringEnum { - // Empty - #[serde(rename = "")] - Empty, -} - -impl std::str::FromStr for ImageStringEnum { - type Err = (); - fn from_str(input: &str) -> Result { - match input { - "" => Ok(Self::Empty), - _ => Err(()), - } - } + pub links: Option>, } #[derive(Debug, Deserialize, Clone, Serialize)] @@ -577,12 +515,130 @@ pub enum ImageEnum { // F1 F1(Image), // F2 - F2(ImageStringEnum), + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, } /// `SecurityGroups` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SecurityGroups { - #[serde(default)] - pub name: Option, + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } } diff --git a/types/compute/src/v2/server/response/set_29.rs b/types/compute/src/v2/server/response/set_29.rs new file mode 100644 index 000000000..929c4a63c --- /dev/null +++ b/types/compute/src/v2/server/response/set_29.rs @@ -0,0 +1,352 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/set_296.rs b/types/compute/src/v2/server/response/set_296.rs new file mode 100644 index 000000000..49206d2ef --- /dev/null +++ b/types/compute/src/v2/server/response/set_296.rs @@ -0,0 +1,657 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + /// + /// **New in version 2.75** + #[structable(optional)] + pub config_drive: Option, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// The host status. Values where next value in list can override the + /// previous: + /// + /// - `UP` if nova-compute up. + /// - `UNKNOWN` if nova-compute not reported by servicegroup driver. + /// - `DOWN` if nova-compute forced down. + /// - `MAINTENANCE` if nova-compute is disabled. + /// - Empty string indicates there is no host for server. + /// + /// This attribute appears in the response only if the policy permits. By + /// default, only administrators can get this parameter. + /// + /// **New in version 2.75** + #[serde(default)] + #[structable(optional)] + pub host_status: Option, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + /// The UUID of the server. + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + /// + /// **New in version 2.75** + #[serde(default)] + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// The reason behind locking a server. + /// + /// **New in version 2.73** + #[structable(optional)] + pub locked_reason: Option, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hostname of the instance reported in the metadata service. This + /// parameter only appears in responses for administrators until + /// microversion 2.90, after which it is shown for all users. + /// + /// Note + /// + /// This information is published via the metadata service and requires + /// application such as `cloud-init` to propagate it through to the + /// instance. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The UUID of the kernel image when using an AMI. Will be null if not. By + /// default, it appears in the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + /// When servers are launched via multiple create, this is the sequence in + /// which the servers were launched. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + /// The UUID of the ramdisk image when using an AMI. Will be null if not. + /// By default, it appears in the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + /// The reservation id for the server. This is an id that can be useful in + /// tracking groups of servers created with multiple create, that will all + /// have the same reservation_id. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + /// The root device name for the instance By default, it appears in the + /// response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + /// The user_data the instance was created with. By default, it appears in + /// the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + /// + /// **New in version 2.75** + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + /// + /// **New in version 2.75** + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + /// + /// **New in version 2.75** + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// This is the availability zone requested during server creation. Also + /// when cross_az_attach option is false and booting an instance from + /// volume, the instance can be pinned to AZ and in that case, instance + /// will be scheduled on host belonging to pinned AZ. Also when + /// default_schedule_zone config option set to specific AZ, in that case, + /// instance would be pinned to that specific AZ, and instance will be + /// scheduled on host belonging to pinned AZ. In case of no pinned + /// availability zone, this value is set to null. + /// + /// **New in version 2.96** + #[structable(optional)] + pub pinned_availability_zone: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// One or more security groups objects. + /// + /// **New in version 2.75** + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The UUIDs of the server groups to which the server belongs. Currently + /// this can contain at most one entry. + /// + /// **New in version 2.71** + #[structable(serialize)] + pub server_groups: Vec, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: String, + + /// A list of trusted certificate IDs, that were used during image + /// signature verification to verify the signing certificate. The list is + /// restricted to a maximum of 50 IDs. The value is `null` if trusted + /// certificate IDs are not set. + /// + /// **New in version 2.63** + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + /// 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/response/set_298.rs b/types/compute/src/v2/server/response/set_298.rs new file mode 100644 index 000000000..a045500db --- /dev/null +++ b/types/compute/src/v2/server/response/set_298.rs @@ -0,0 +1,659 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `servers/{id}` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +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")] + pub access_ipv4: String, + + /// IPv6 address that should be used to access this server. May be + /// automatically set by the provider. + #[serde(rename = "accessIPv6")] + #[structable(title = "accessIPv6")] + pub access_ipv6: String, + + /// The addresses for the server. Servers with status `BUILD` hide their + /// addresses information. This view is not updated immediately. Please + /// consult with OpenStack Networking API for up-to-date information. + #[structable(serialize)] + pub addresses: BTreeMap>, + + /// Indicates whether or not a config drive was used for this server. The + /// value is `True` or an empty string. An empty string stands for `False`. + /// + /// **New in version 2.75** + #[structable(optional)] + pub config_drive: Option, + + /// The date and time when the resource was created. 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`. + #[structable()] + pub created: String, + + /// The description of the server. Before microversion 2.19 this was set to + /// the server name. + /// + /// **New in version 2.19** + #[structable(optional)] + pub description: Option, + + /// A fault object. Only displayed when the server status is `ERROR` or + /// `DELETED` and a fault occurred. + #[serde(default)] + #[structable(optional, serialize)] + pub fault: Option, + + /// Before microversion 2.47 this contains the ID and links for the flavor + /// used to boot the server instance. This can be an empty object in case + /// flavor information is no longer present in the system. + /// + /// As of microversion 2.47 this contains a subset of the actual flavor + /// information used to create the server instance, represented as a nested + /// dictionary. + #[structable(serialize)] + pub flavor: Flavor, + + /// The host status. Values where next value in list can override the + /// previous: + /// + /// - `UP` if nova-compute up. + /// - `UNKNOWN` if nova-compute not reported by servicegroup driver. + /// - `DOWN` if nova-compute forced down. + /// - `MAINTENANCE` if nova-compute is disabled. + /// - Empty string indicates there is no host for server. + /// + /// This attribute appears in the response only if the policy permits. By + /// default, only administrators can get this parameter. + /// + /// **New in version 2.75** + #[serde(default)] + #[structable(optional)] + pub host_status: Option, + + /// An ID string representing the host. This is a hashed value so will not + /// actually look like a hostname, and is hashed with data from the + /// project_id, so the same physical host as seen by two different + /// project_ids, will be different. It is useful when within the same + /// project you need to determine if two instances are on the same or + /// different physical hosts for the purposes of availability or + /// performance. + #[serde(rename = "hostId")] + #[structable(title = "hostId")] + pub host_id: String, + + /// The UUID of the server. + #[structable()] + pub id: String, + + /// The UUID and links for the image for your server instance. The `image` + /// object will be an empty string when you boot the server from a volume. + #[structable(serialize)] + pub image: ImageEnum, + + /// The name of associated key pair, if any. + /// + /// **New in version 2.75** + #[serde(default)] + #[structable(optional)] + pub key_name: Option, + + /// Links to the resources in question. See + /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) + /// for more info. + #[structable(serialize)] + pub links: Vec, + + /// True if the instance is locked otherwise False. + /// + /// **New in version 2.9** + #[structable()] + pub locked: bool, + + /// The reason behind locking a server. + /// + /// **New in version 2.73** + #[structable(optional)] + pub locked_reason: Option, + + /// A dictionary of metadata key-and-value pairs, which is maintained for + /// backward compatibility. + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The server name. + #[structable(optional)] + pub name: Option, + + /// Disk configuration. The value is either: + /// + /// - `AUTO`. The API builds the server with a single partition the size of + /// the target flavor disk. The API automatically adjusts the file system + /// to fit the entire partition. + /// - `MANUAL`. The API builds the server by using the partition scheme and + /// file system that is in the source image. If the target flavor disk is + /// larger, The API does not partition the remaining disk space. + #[serde(rename = "OS-DCF:diskConfig")] + #[structable(title = "OS-DCF:diskConfig")] + pub os_dcf_disk_config: String, + + /// The availability zone name. + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-AZ:availability_zone")] + #[structable(title = "OS-EXT-AZ:availability_zone")] + pub os_ext_az_availability_zone: String, + + /// The name of the compute host on which this instance is running. Appears + /// in the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:host")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:host")] + pub os_ext_srv_attr_host: Option, + + /// The hostname of the instance reported in the metadata service. This + /// parameter only appears in responses for administrators until + /// microversion 2.90, after which it is shown for all users. + /// + /// Note + /// + /// This information is published via the metadata service and requires + /// application such as `cloud-init` to propagate it through to the + /// instance. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hostname")] + pub os_ext_srv_attr_hostname: Option, + + /// The hypervisor host name provided by the Nova virt driver. For the + /// Ironic driver, it is the Ironic node uuid. Appears in the response for + /// administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:hypervisor_hostname")] + pub os_ext_srv_attr_hypervisor_hostname: Option, + + /// The instance name. The Compute API generates the instance name from the + /// instance name template. Appears in the response for administrative + /// users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:instance_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:instance_name")] + pub os_ext_srv_attr_instance_name: Option, + + /// The UUID of the kernel image when using an AMI. Will be null if not. By + /// default, it appears in the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:kernel_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:kernel_id")] + pub os_ext_srv_attr_kernel_id: Option, + + /// When servers are launched via multiple create, this is the sequence in + /// which the servers were launched. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:launch_index")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:launch_index")] + pub os_ext_srv_attr_launch_index: Option, + + /// The UUID of the ramdisk image when using an AMI. Will be null if not. + /// By default, it appears in the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:ramdisk_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:ramdisk_id")] + pub os_ext_srv_attr_ramdisk_id: Option, + + /// The reservation id for the server. This is an id that can be useful in + /// tracking groups of servers created with multiple create, that will all + /// have the same reservation_id. By default, it appears in the response + /// for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:reservation_id")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:reservation_id")] + pub os_ext_srv_attr_reservation_id: Option, + + /// The root device name for the instance By default, it appears in the + /// response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:root_device_name")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:root_device_name")] + pub os_ext_srv_attr_root_device_name: Option, + + /// The user_data the instance was created with. By default, it appears in + /// the response for administrative users only. + /// + /// **New in version 2.75** + #[serde(default, rename = "OS-EXT-SRV-ATTR:user_data")] + #[structable(optional, title = "OS-EXT-SRV-ATTR:user_data")] + pub os_ext_srv_attr_user_data: Option, + + /// The power state of the instance. This is an enum value that is mapped + /// as: + /// + /// ```text + /// 0: NOSTATE + /// 1: RUNNING + /// 3: PAUSED + /// 4: SHUTDOWN + /// 6: CRASHED + /// 7: SUSPENDED + /// ``` + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-STS:power_state")] + #[structable(title = "OS-EXT-STS:power_state")] + pub os_ext_sts_power_state: i32, + + /// The task state of the instance. + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-STS:task_state")] + #[structable(optional, title = "OS-EXT-STS:task_state")] + pub os_ext_sts_task_state: Option, + + /// The VM state. + /// + /// **New in version 2.75** + #[serde(rename = "OS-EXT-STS:vm_state")] + #[structable(optional, title = "OS-EXT-STS:vm_state")] + pub os_ext_sts_vm_state: Option, + + /// The attached volumes, if any. + /// + /// **New in version 2.75** + #[serde(rename = "os-extended-volumes:volumes_attached")] + #[structable(serialize, title = "os-extended-volumes:volumes_attached")] + pub os_extended_volumes_volumes_attached: Vec, + + /// The date and time when the server was launched. + /// + /// 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. If the `deleted_at` date and time stamp is not set, its value is + /// `null`. + /// + /// **New in version 2.75** + #[serde(rename = "OS-SRV-USG:launched_at")] + #[structable(optional, title = "OS-SRV-USG:launched_at")] + pub os_srv_usg_launched_at: Option, + + /// The date and time when the server was deleted. + /// + /// 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. If the `deleted_at` + /// date and time stamp is not set, its value is `null`. + /// + /// **New in version 2.75** + #[serde(rename = "OS-SRV-USG:terminated_at")] + #[structable(optional, title = "OS-SRV-USG:terminated_at")] + pub os_srv_usg_terminated_at: Option, + + /// This is the availability zone requested during server creation. Also + /// when cross_az_attach option is false and booting an instance from + /// volume, the instance can be pinned to AZ and in that case, instance + /// will be scheduled on host belonging to pinned AZ. Also when + /// default_schedule_zone config option set to specific AZ, in that case, + /// instance would be pinned to that specific AZ, and instance will be + /// scheduled on host belonging to pinned AZ. In case of no pinned + /// availability zone, this value is set to null. + /// + /// **New in version 2.96** + #[structable(optional)] + pub pinned_availability_zone: Option, + + /// A percentage value of the operation progress. This parameter only + /// appears when the server status is `ACTIVE`, `BUILD`, `REBUILD`, + /// `RESIZE`, `VERIFY_RESIZE` or `MIGRATING`. + #[serde(default)] + #[structable(optional)] + pub progress: Option, + + /// One or more security groups objects. + /// + /// **New in version 2.75** + #[serde(default)] + #[structable(optional, serialize)] + pub security_groups: Option>, + + /// The UUIDs of the server groups to which the server belongs. Currently + /// this can contain at most one entry. + /// + /// **New in version 2.71** + #[structable(serialize)] + pub server_groups: Vec, + + /// The server status. + #[structable(serialize)] + pub status: Status, + + /// A list of tags. The maximum count of tags in this list is 50. + /// + /// **New in version 2.26** + #[structable(serialize)] + pub tags: Vec, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: String, + + /// A list of trusted certificate IDs, that were used during image + /// signature verification to verify the signing certificate. The list is + /// restricted to a maximum of 50 IDs. The value is `null` if trusted + /// certificate IDs are not set. + /// + /// **New in version 2.63** + #[structable(serialize)] + pub trusted_image_certificates: Vec, + + /// 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`. + #[structable()] + pub updated: String, + + /// The user ID of the user who owns the server. + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum OsExtIpsType { + // Fixed + #[serde(rename = "fixed")] + Fixed, + + // Floating + #[serde(rename = "floating")] + Floating, +} + +impl std::str::FromStr for OsExtIpsType { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "fixed" => Ok(Self::Fixed), + "floating" => Ok(Self::Floating), + _ => Err(()), + } + } +} + +/// `AddressesItem` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AddressesItem { + pub addr: String, + #[serde(rename = "OS-EXT-IPS-MAC:mac_addr")] + pub os_ext_ips_mac_mac_addr: String, + #[serde(rename = "OS-EXT-IPS:type")] + pub os_ext_ips_type: OsExtIpsType, + pub version: i32, +} + +/// A fault object. Only displayed when the server status is `ERROR` or +/// `DELETED` and a fault occurred. +/// `Fault` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Fault { + pub code: i32, + pub created: String, + #[serde(default)] + pub details: Option, + pub message: String, +} + +/// Before microversion 2.47 this contains the ID and links for the flavor used +/// to boot the server instance. This can be an empty object in case flavor +/// information is no longer present in the system. +/// +/// As of microversion 2.47 this contains a subset of the actual flavor +/// information used to create the server instance, represented as a nested +/// dictionary. +/// `Flavor` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Flavor { + pub disk: i32, + pub ephemeral: i32, + #[serde(default)] + pub extra_specs: Option>, + pub original_name: String, + pub ram: i32, + pub swap: i32, + pub vcpus: i32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Rel { + // Bookmark + #[serde(rename = "bookmark")] + Bookmark, + + // Current + #[serde(rename = "self")] + Current, +} + +impl std::str::FromStr for Rel { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "bookmark" => Ok(Self::Bookmark), + "self" => Ok(Self::Current), + _ => Err(()), + } + } +} + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + pub href: String, + pub rel: Rel, +} + +/// The UUID and links for the image for your server instance. The `image` +/// object will be an empty string when you boot the server from a volume. +/// `Image` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Image { + #[serde(default)] + pub id: Option, + #[serde(default)] + pub links: Option>, + #[serde(default)] + pub properties: Option>>, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +#[serde(untagged)] +pub enum ImageEnum { + // F1 + F1(Image), + // F2 + F2(String), +} + +/// `OsExtendedVolumesVolumesAttached` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct OsExtendedVolumesVolumesAttached { + pub delete_on_termination: bool, + pub id: String, +} + +/// `SecurityGroups` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct SecurityGroups { + pub name: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Active + #[serde(rename = "ACTIVE")] + Active, + + // Build + #[serde(rename = "BUILD")] + Build, + + // Deleted + #[serde(rename = "DELETED")] + Deleted, + + // Error + #[serde(rename = "ERROR")] + Error, + + // HardReboot + #[serde(rename = "HARD_REBOOT")] + HardReboot, + + // Migrating + #[serde(rename = "MIGRATING")] + Migrating, + + // Password + #[serde(rename = "PASSWORD")] + Password, + + // Paused + #[serde(rename = "PAUSED")] + Paused, + + // Reboot + #[serde(rename = "REBOOT")] + Reboot, + + // Rebuild + #[serde(rename = "REBUILD")] + Rebuild, + + // Rescue + #[serde(rename = "RESCUE")] + Rescue, + + // Resize + #[serde(rename = "RESIZE")] + Resize, + + // RevertResize + #[serde(rename = "REVERT_RESIZE")] + RevertResize, + + // Shelved + #[serde(rename = "SHELVED")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "SHELVED_OFFLOADED")] + ShelvedOffloaded, + + // Shutoff + #[serde(rename = "SHUTOFF")] + Shutoff, + + // SoftDeleted + #[serde(rename = "SOFT_DELETED")] + SoftDeleted, + + // Suspended + #[serde(rename = "SUSPENDED")] + Suspended, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, + + // VerifyResize + #[serde(rename = "VERIFY_RESIZE")] + VerifyResize, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ACTIVE" => Ok(Self::Active), + "BUILD" => Ok(Self::Build), + "DELETED" => Ok(Self::Deleted), + "ERROR" => Ok(Self::Error), + "HARD_REBOOT" => Ok(Self::HardReboot), + "MIGRATING" => Ok(Self::Migrating), + "PASSWORD" => Ok(Self::Password), + "PAUSED" => Ok(Self::Paused), + "REBOOT" => Ok(Self::Reboot), + "REBUILD" => Ok(Self::Rebuild), + "RESCUE" => Ok(Self::Rescue), + "RESIZE" => Ok(Self::Resize), + "REVERT_RESIZE" => Ok(Self::RevertResize), + "SHELVED" => Ok(Self::Shelved), + "SHELVED_OFFLOADED" => Ok(Self::ShelvedOffloaded), + "SHUTOFF" => Ok(Self::Shutoff), + "SOFT_DELETED" => Ok(Self::SoftDeleted), + "SUSPENDED" => Ok(Self::Suspended), + "UNKNOWN" => Ok(Self::Unknown), + "VERIFY_RESIZE" => Ok(Self::VerifyResize), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server/security_group/response/list.rs b/types/compute/src/v2/server/security_group/response/list.rs index 9f44d7554..010ae878f 100644 --- a/types/compute/src/v2/server/security_group/response/list.rs +++ b/types/compute/src/v2/server/security_group/response/list.rs @@ -38,13 +38,11 @@ pub struct SecurityGroupResponse { #[structable(serialize, wide)] pub rules: Vec, - /// The UUID of the tenant that owns this security group. + /// The UUID of the tenant in a multi-tenancy cloud. #[structable(wide)] pub tenant_id: String, } -/// A `group` object. Includes the `tenant_id` and the source security group -/// `name`. /// `Group` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Group { @@ -54,7 +52,6 @@ pub struct Group { pub tenant_id: Option, } -/// An IP range object. Includes the security group rule `cidr`. /// `IpRange` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct IpRange { @@ -62,7 +59,6 @@ pub struct IpRange { pub cidr: Option, } -/// A `security_group_rule` object. /// `Rules` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Rules { diff --git a/types/compute/src/v2/server/share/response.rs b/types/compute/src/v2/server/share/response.rs index 57479c591..0b8dd9512 100644 --- a/types/compute/src/v2/server/share/response.rs +++ b/types/compute/src/v2/server/share/response.rs @@ -16,6 +16,6 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod create; -pub mod get; -pub mod list; +pub mod create_297; +pub mod get_297; +pub mod list_297; diff --git a/types/compute/src/v2/server/share/response/create.rs b/types/compute/src/v2/server/share/response/create_297.rs similarity index 97% rename from types/compute/src/v2/server/share/response/create.rs rename to types/compute/src/v2/server/share/response/create_297.rs index 6b07e9332..f1fc4d1fc 100644 --- a/types/compute/src/v2/server/share/response/create.rs +++ b/types/compute/src/v2/server/share/response/create_297.rs @@ -22,7 +22,6 @@ use structable::{StructTable, StructTableOptions}; /// Share response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ShareResponse { - /// The export location used to attach the share to the underlying host. #[serde(default)] #[structable(optional)] pub export_location: Option, diff --git a/types/compute/src/v2/server/share/response/get.rs b/types/compute/src/v2/server/share/response/get_297.rs similarity index 100% rename from types/compute/src/v2/server/share/response/get.rs rename to types/compute/src/v2/server/share/response/get_297.rs diff --git a/types/compute/src/v2/server/share/response/list.rs b/types/compute/src/v2/server/share/response/list_297.rs similarity index 97% rename from types/compute/src/v2/server/share/response/list.rs rename to types/compute/src/v2/server/share/response/list_297.rs index db85a8613..0c3b3b176 100644 --- a/types/compute/src/v2/server/share/response/list.rs +++ b/types/compute/src/v2/server/share/response/list_297.rs @@ -22,7 +22,6 @@ use structable::{StructTable, StructTableOptions}; /// Share response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ShareResponse { - /// The export location used to attach the share to the underlying host. #[serde(default)] #[structable(optional)] pub export_location: Option, diff --git a/types/compute/src/v2/server/tag/response.rs b/types/compute/src/v2/server/tag/response.rs index 66087d6ef..8c5e0f930 100644 --- a/types/compute/src/v2/server/tag/response.rs +++ b/types/compute/src/v2/server/tag/response.rs @@ -16,6 +16,5 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; -pub mod list; -pub mod replace; +pub mod list_226; +pub mod replace_226; diff --git a/types/compute/src/v2/server/tag/response/list.rs b/types/compute/src/v2/server/tag/response/list_226.rs similarity index 100% rename from types/compute/src/v2/server/tag/response/list.rs rename to types/compute/src/v2/server/tag/response/list_226.rs diff --git a/types/compute/src/v2/server/tag/response/replace.rs b/types/compute/src/v2/server/tag/response/replace_226.rs similarity index 100% rename from types/compute/src/v2/server/tag/response/replace.rs rename to types/compute/src/v2/server/tag/response/replace_226.rs diff --git a/types/compute/src/v2/server/topology/response.rs b/types/compute/src/v2/server/topology/response.rs index d3864d160..55a0ebe86 100644 --- a/types/compute/src/v2/server/topology/response.rs +++ b/types/compute/src/v2/server/topology/response.rs @@ -16,4 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod list; +pub mod list_278; diff --git a/types/compute/src/v2/server/topology/response/list.rs b/types/compute/src/v2/server/topology/response/list.rs deleted file mode 100644 index f778f5184..000000000 --- a/types/compute/src/v2/server/topology/response/list.rs +++ /dev/null @@ -1,56 +0,0 @@ -// 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 -// -// WARNING: This file is automatically generated from OpenAPI schema using -// `openstack-codegenerator`. -//! Response type for the GET `servers/{server_id}/topology` operation - -use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; -use structable::{StructTable, StructTableOptions}; - -/// Topology response representation -#[derive(Clone, Deserialize, Serialize, StructTable)] -pub struct TopologyResponse { - /// The mapping of server cores to host physical CPU - #[serde(default)] - #[structable(optional, serialize)] - pub cpu_pinning: Option>, - - /// The host NUMA node the virtual NUMA node is map to. - #[serde(default)] - #[structable(optional)] - pub host_node: Option, - - /// The amount of memory assigned to this NUMA node in MB. - #[serde(default)] - #[structable(optional)] - pub memory_mb: Option, - - /// The page size in KB of a server. This field is `null` if the page size - /// information is not available. - #[serde(default)] - #[structable(optional)] - pub pagesize_kb: Option, - - /// A mapping of host cpus thread sibling. - #[serde(default)] - #[structable(optional, serialize)] - pub siblings: Option>, - - /// A list of IDs of the virtual CPU assigned to this NUMA node. - #[serde(default)] - #[structable(optional, serialize)] - pub vcpu_set: Option>, -} diff --git a/types/compute/src/v2/server/topology/response/list_278.rs b/types/compute/src/v2/server/topology/response/list_278.rs new file mode 100644 index 000000000..fdd152ad1 --- /dev/null +++ b/types/compute/src/v2/server/topology/response/list_278.rs @@ -0,0 +1,42 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/topology` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Topology response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct TopologyResponse { + #[serde(default)] + #[structable(optional, serialize)] + pub cpu_pinning: Option>, + + #[serde(default)] + #[structable(optional)] + pub host_node: Option, + + #[structable()] + pub memory_mb: i32, + + #[structable(serialize)] + pub siblings: Vec>, + + #[structable(serialize)] + pub vcpu_set: Vec, +} diff --git a/types/compute/src/v2/server/volume_attachment/response.rs b/types/compute/src/v2/server/volume_attachment/response.rs index cd3e19c6c..ad4445deb 100644 --- a/types/compute/src/v2/server/volume_attachment/response.rs +++ b/types/compute/src/v2/server/volume_attachment/response.rs @@ -16,7 +16,15 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod create; -pub mod get; -pub mod list; +pub mod create_20; +pub mod create_270; +pub mod create_279; +pub mod get_20; +pub mod get_270; +pub mod get_279; +pub mod get_289; +pub mod list_20; +pub mod list_270; +pub mod list_279; +pub mod list_289; pub mod set; diff --git a/types/compute/src/v2/server/volume_attachment/response/create_20.rs b/types/compute/src/v2/server/volume_attachment/response/create_20.rs new file mode 100644 index 000000000..67fd43a99 --- /dev/null +++ b/types/compute/src/v2/server/volume_attachment/response/create_20.rs @@ -0,0 +1,43 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{server_id}/os-volume_attachments` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// VolumeAttachment response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct VolumeAttachmentResponse { + /// Name of the device such as, `/dev/vdb`. + #[serde(default)] + #[structable(optional)] + pub device: Option, + + /// The UUID of the attached volume. + #[structable()] + pub id: String, + + /// The UUID of the server. + #[serde(rename = "serverId")] + #[structable(title = "serverId")] + pub server_id: String, + + /// The UUID of the attached volume. + #[serde(rename = "volumeId")] + #[structable(title = "volumeId")] + pub volume_id: String, +} diff --git a/types/compute/src/v2/server/volume_attachment/response/create_270.rs b/types/compute/src/v2/server/volume_attachment/response/create_270.rs new file mode 100644 index 000000000..6e9a9b492 --- /dev/null +++ b/types/compute/src/v2/server/volume_attachment/response/create_270.rs @@ -0,0 +1,48 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{server_id}/os-volume_attachments` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// VolumeAttachment response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct VolumeAttachmentResponse { + /// Name of the device such as, `/dev/vdb`. + #[structable(optional)] + pub device: Option, + + /// The UUID of the attached volume. + #[structable()] + pub id: String, + + /// The UUID of the server. + #[serde(rename = "serverId")] + #[structable(title = "serverId")] + pub server_id: String, + + /// The device tag applied to the volume block device or `null`. + /// + /// **New in version 2.70** + #[structable(optional)] + pub tag: Option, + + /// The UUID of the attached volume. + #[serde(rename = "volumeId")] + #[structable(title = "volumeId")] + pub volume_id: String, +} diff --git a/types/compute/src/v2/server/volume_attachment/response/create_279.rs b/types/compute/src/v2/server/volume_attachment/response/create_279.rs new file mode 100644 index 000000000..dce7efad0 --- /dev/null +++ b/types/compute/src/v2/server/volume_attachment/response/create_279.rs @@ -0,0 +1,55 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `servers/{server_id}/os-volume_attachments` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// VolumeAttachment response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct VolumeAttachmentResponse { + /// A flag indicating if the attached volume will be deleted when the + /// server is deleted. + /// + /// **New in version 2.79** + #[structable()] + pub delete_on_termination: bool, + + /// Name of the device such as, `/dev/vdb`. + #[structable(optional)] + pub device: Option, + + /// The UUID of the attached volume. + #[structable()] + pub id: String, + + /// The UUID of the server. + #[serde(rename = "serverId")] + #[structable(title = "serverId")] + pub server_id: String, + + /// The device tag applied to the volume block device or `null`. + /// + /// **New in version 2.70** + #[structable(optional)] + pub tag: Option, + + /// The UUID of the attached volume. + #[serde(rename = "volumeId")] + #[structable(title = "volumeId")] + pub volume_id: String, +} diff --git a/types/compute/src/v2/server/volume_attachment/response/get_20.rs b/types/compute/src/v2/server/volume_attachment/response/get_20.rs new file mode 100644 index 000000000..fa9c7f534 --- /dev/null +++ b/types/compute/src/v2/server/volume_attachment/response/get_20.rs @@ -0,0 +1,43 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-volume_attachments/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// VolumeAttachment response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct VolumeAttachmentResponse { + /// Name of the device in the attachment object, such as, `/dev/vdb`. + #[serde(default)] + #[structable(optional)] + pub device: Option, + + /// The UUID of the attached volume. + #[structable()] + pub id: String, + + /// The UUID of the server. + #[serde(rename = "serverId")] + #[structable(title = "serverId")] + pub server_id: String, + + /// The UUID of the attached volume. + #[serde(rename = "volumeId")] + #[structable(title = "volumeId")] + pub volume_id: String, +} diff --git a/types/compute/src/v2/server/volume_attachment/response/get_270.rs b/types/compute/src/v2/server/volume_attachment/response/get_270.rs new file mode 100644 index 000000000..64e82c1d4 --- /dev/null +++ b/types/compute/src/v2/server/volume_attachment/response/get_270.rs @@ -0,0 +1,49 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-volume_attachments/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// VolumeAttachment response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct VolumeAttachmentResponse { + /// Name of the device in the attachment object, such as, `/dev/vdb`. + #[serde(default)] + #[structable(optional)] + pub device: Option, + + /// The UUID of the attached volume. + #[structable()] + pub id: String, + + /// The UUID of the server. + #[serde(rename = "serverId")] + #[structable(title = "serverId")] + pub server_id: String, + + /// The device tag applied to the volume block device or `null`. + /// + /// **New in version 2.70** + #[structable(optional)] + pub tag: Option, + + /// The UUID of the attached volume. + #[serde(rename = "volumeId")] + #[structable(title = "volumeId")] + pub volume_id: String, +} diff --git a/types/compute/src/v2/server/volume_attachment/response/create.rs b/types/compute/src/v2/server/volume_attachment/response/get_279.rs similarity index 71% rename from types/compute/src/v2/server/volume_attachment/response/create.rs rename to types/compute/src/v2/server/volume_attachment/response/get_279.rs index d4ae114ca..571c7a729 100644 --- a/types/compute/src/v2/server/volume_attachment/response/create.rs +++ b/types/compute/src/v2/server/volume_attachment/response/get_279.rs @@ -14,7 +14,7 @@ // // WARNING: This file is automatically generated from OpenAPI schema using // `openstack-codegenerator`. -//! Response type for the POST `servers/{server_id}/os-volume_attachments` operation +//! Response type for the GET `servers/{server_id}/os-volume_attachments/{id}` operation use serde::{Deserialize, Serialize}; use structable::{StructTable, StructTableOptions}; @@ -22,35 +22,19 @@ use structable::{StructTable, StructTableOptions}; /// VolumeAttachment response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct VolumeAttachmentResponse { - /// The UUID of the associated volume attachment in Cinder. - /// - /// **New in version 2.89** - #[serde(default)] - #[structable(optional)] - pub attachment_id: Option, - - /// The UUID of the block device mapping record in Nova for the attachment. - /// - /// **New in version 2.89** - #[serde(default)] - #[structable(optional)] - pub bdm_uuid: Option, - /// A flag indicating if the attached volume will be deleted when the /// server is deleted. /// /// **New in version 2.79** - #[serde(default)] - #[structable(optional)] - pub delete_on_termination: Option, + #[structable()] + pub delete_on_termination: bool, /// Name of the device in the attachment object, such as, `/dev/vdb`. - #[structable()] - pub device: String, + #[serde(default)] + #[structable(optional)] + pub device: Option, - /// The volume ID of the attachment. - /// - /// **Available until version 2.88** + /// The UUID of the attached volume. #[structable()] pub id: String, @@ -62,7 +46,6 @@ pub struct VolumeAttachmentResponse { /// The device tag applied to the volume block device or `null`. /// /// **New in version 2.70** - #[serde(default)] #[structable(optional)] pub tag: Option, diff --git a/types/compute/src/v2/server/volume_attachment/response/get.rs b/types/compute/src/v2/server/volume_attachment/response/get_289.rs similarity index 84% rename from types/compute/src/v2/server/volume_attachment/response/get.rs rename to types/compute/src/v2/server/volume_attachment/response/get_289.rs index f47fea921..6fbecc628 100644 --- a/types/compute/src/v2/server/volume_attachment/response/get.rs +++ b/types/compute/src/v2/server/volume_attachment/response/get_289.rs @@ -25,34 +25,26 @@ pub struct VolumeAttachmentResponse { /// The UUID of the associated volume attachment in Cinder. /// /// **New in version 2.89** - #[serde(default)] - #[structable(optional)] - pub attachment_id: Option, + #[structable()] + pub attachment_id: String, /// The UUID of the block device mapping record in Nova for the attachment. /// /// **New in version 2.89** - #[serde(default)] - #[structable(optional)] - pub bdm_uuid: Option, + #[structable()] + pub bdm_uuid: String, /// A flag indicating if the attached volume will be deleted when the /// server is deleted. /// /// **New in version 2.79** - #[serde(default)] - #[structable(optional)] - pub delete_on_termination: Option, - - /// Name of the device in the attachment object, such as, `/dev/vdb`. #[structable()] - pub device: String, + pub delete_on_termination: bool, - /// The volume ID of the attachment. - /// - /// **Available until version 2.88** - #[structable()] - pub id: String, + /// Name of the device in the attachment object, such as, `/dev/vdb`. + #[serde(default)] + #[structable(optional)] + pub device: Option, /// The UUID of the server. #[serde(rename = "serverId")] @@ -62,7 +54,6 @@ pub struct VolumeAttachmentResponse { /// The device tag applied to the volume block device or `null`. /// /// **New in version 2.70** - #[serde(default)] #[structable(optional)] pub tag: Option, diff --git a/types/compute/src/v2/server/volume_attachment/response/list_20.rs b/types/compute/src/v2/server/volume_attachment/response/list_20.rs new file mode 100644 index 000000000..467b99682 --- /dev/null +++ b/types/compute/src/v2/server/volume_attachment/response/list_20.rs @@ -0,0 +1,43 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-volume_attachments` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// VolumeAttachment response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct VolumeAttachmentResponse { + /// Name of the device in the attachment object, such as, `/dev/vdb`. + #[serde(default)] + #[structable(optional, wide)] + pub device: Option, + + /// The UUID of the attached volume. + #[structable()] + pub id: String, + + /// The UUID of the server. + #[serde(rename = "serverId")] + #[structable(title = "serverId", wide)] + pub server_id: String, + + /// The UUID of the attached volume. + #[serde(rename = "volumeId")] + #[structable(title = "volumeId", wide)] + pub volume_id: String, +} diff --git a/types/compute/src/v2/server/volume_attachment/response/list_270.rs b/types/compute/src/v2/server/volume_attachment/response/list_270.rs new file mode 100644 index 000000000..933ccad45 --- /dev/null +++ b/types/compute/src/v2/server/volume_attachment/response/list_270.rs @@ -0,0 +1,49 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-volume_attachments` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// VolumeAttachment response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct VolumeAttachmentResponse { + /// Name of the device in the attachment object, such as, `/dev/vdb`. + #[serde(default)] + #[structable(optional, wide)] + pub device: Option, + + /// The UUID of the attached volume. + #[structable()] + pub id: String, + + /// The UUID of the server. + #[serde(rename = "serverId")] + #[structable(title = "serverId", wide)] + pub server_id: String, + + /// The device tag applied to the volume block device or `null`. + /// + /// **New in version 2.70** + #[structable(optional, wide)] + pub tag: Option, + + /// The UUID of the attached volume. + #[serde(rename = "volumeId")] + #[structable(title = "volumeId", wide)] + pub volume_id: String, +} diff --git a/types/compute/src/v2/server/volume_attachment/response/list_279.rs b/types/compute/src/v2/server/volume_attachment/response/list_279.rs new file mode 100644 index 000000000..ae83563c4 --- /dev/null +++ b/types/compute/src/v2/server/volume_attachment/response/list_279.rs @@ -0,0 +1,56 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `servers/{server_id}/os-volume_attachments` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// VolumeAttachment response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct VolumeAttachmentResponse { + /// A flag indicating if the attached volume will be deleted when the + /// server is deleted. + /// + /// **New in version 2.79** + #[structable(wide)] + pub delete_on_termination: bool, + + /// Name of the device in the attachment object, such as, `/dev/vdb`. + #[serde(default)] + #[structable(optional, wide)] + pub device: Option, + + /// The UUID of the attached volume. + #[structable()] + pub id: String, + + /// The UUID of the server. + #[serde(rename = "serverId")] + #[structable(title = "serverId", wide)] + pub server_id: String, + + /// The device tag applied to the volume block device or `null`. + /// + /// **New in version 2.70** + #[structable(optional, wide)] + pub tag: Option, + + /// The UUID of the attached volume. + #[serde(rename = "volumeId")] + #[structable(title = "volumeId", wide)] + pub volume_id: String, +} diff --git a/types/compute/src/v2/server/volume_attachment/response/list.rs b/types/compute/src/v2/server/volume_attachment/response/list_289.rs similarity index 80% rename from types/compute/src/v2/server/volume_attachment/response/list.rs rename to types/compute/src/v2/server/volume_attachment/response/list_289.rs index 25eed1efb..21fc513c0 100644 --- a/types/compute/src/v2/server/volume_attachment/response/list.rs +++ b/types/compute/src/v2/server/volume_attachment/response/list_289.rs @@ -25,34 +25,26 @@ pub struct VolumeAttachmentResponse { /// The UUID of the associated volume attachment in Cinder. /// /// **New in version 2.89** - #[serde(default)] - #[structable(optional, wide)] - pub attachment_id: Option, + #[structable()] + pub attachment_id: String, /// The UUID of the block device mapping record in Nova for the attachment. /// /// **New in version 2.89** - #[serde(default)] - #[structable(optional, wide)] - pub bdm_uuid: Option, + #[structable()] + pub bdm_uuid: String, /// A flag indicating if the attached volume will be deleted when the /// server is deleted. /// /// **New in version 2.79** - #[serde(default)] - #[structable(optional, wide)] - pub delete_on_termination: Option, + #[structable()] + pub delete_on_termination: bool, /// Name of the device in the attachment object, such as, `/dev/vdb`. - #[structable(wide)] - pub device: String, - - /// The volume ID of the attachment. - /// - /// **Available until version 2.88** - #[structable()] - pub id: String, + #[serde(default)] + #[structable(optional)] + pub device: Option, /// The UUID of the server. #[serde(rename = "serverId")] @@ -62,8 +54,7 @@ pub struct VolumeAttachmentResponse { /// The device tag applied to the volume block device or `null`. /// /// **New in version 2.70** - #[serde(default)] - #[structable(optional, wide)] + #[structable(optional)] pub tag: Option, /// The UUID of the attached volume. diff --git a/types/compute/src/v2/server/volume_attachment/response/set.rs b/types/compute/src/v2/server/volume_attachment/response/set.rs index 3cbc05792..518c9d465 100644 --- a/types/compute/src/v2/server/volume_attachment/response/set.rs +++ b/types/compute/src/v2/server/volume_attachment/response/set.rs @@ -23,34 +23,26 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct VolumeAttachmentResponse { /// The UUID of the associated volume attachment in Cinder. - /// - /// **New in version 2.89** #[serde(default)] #[structable(optional)] pub attachment_id: Option, /// The UUID of the block device mapping record in Nova for the attachment. - /// - /// **New in version 2.89** #[serde(default)] #[structable(optional)] pub bdm_uuid: Option, /// A flag indicating if the attached volume will be deleted when the /// server is deleted. - /// - /// **New in version 2.79** #[serde(default)] #[structable(optional)] pub delete_on_termination: Option, - /// Name of the device in the attachment object, such as, `/dev/vdb`. + /// Name of the device in the attachment object, such as, /dev/vdb. #[structable()] pub device: String, - /// The volume ID of the attachment. - /// - /// **Available until version 2.88** + /// The volume ID of the attachment #[structable()] pub id: String, @@ -59,9 +51,7 @@ pub struct VolumeAttachmentResponse { #[structable(title = "serverId")] pub server_id: String, - /// The device tag applied to the volume block device or `null`. - /// - /// **New in version 2.70** + /// The device tag applied to the volume block device or null. #[serde(default)] #[structable(optional)] pub tag: Option, diff --git a/types/compute/src/v2/server_external_event/response.rs b/types/compute/src/v2/server_external_event/response.rs index 9dde6d7c8..931be0118 100644 --- a/types/compute/src/v2/server_external_event/response.rs +++ b/types/compute/src/v2/server_external_event/response.rs @@ -16,4 +16,8 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod create; +pub mod create_20; +pub mod create_251; +pub mod create_276; +pub mod create_282; +pub mod create_293; diff --git a/types/compute/src/v2/server_external_event/response/create_20.rs b/types/compute/src/v2/server_external_event/response/create_20.rs new file mode 100644 index 000000000..d4bc83cf7 --- /dev/null +++ b/types/compute/src/v2/server_external_event/response/create_20.rs @@ -0,0 +1,98 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-server-external-events` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// ServerExternalEvent response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerExternalEventResponse { + /// List of external events to process. + #[structable(serialize)] + pub events: Vec, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Name { + // NetworkChanged + #[serde(rename = "network-changed")] + NetworkChanged, + + // NetworkVifDeleted + #[serde(rename = "network-vif-deleted")] + NetworkVifDeleted, + + // NetworkVifPlugged + #[serde(rename = "network-vif-plugged")] + NetworkVifPlugged, + + // NetworkVifUnplugged + #[serde(rename = "network-vif-unplugged")] + NetworkVifUnplugged, +} + +impl std::str::FromStr for Name { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "network-changed" => Ok(Self::NetworkChanged), + "network-vif-deleted" => Ok(Self::NetworkVifDeleted), + "network-vif-plugged" => Ok(Self::NetworkVifPlugged), + "network-vif-unplugged" => Ok(Self::NetworkVifUnplugged), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Completed + #[serde(rename = "completed")] + Completed, + + // Failed + #[serde(rename = "failed")] + Failed, + + // InProgress + #[serde(rename = "in-progress")] + InProgress, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "completed" => Ok(Self::Completed), + "failed" => Ok(Self::Failed), + "in-progress" => Ok(Self::InProgress), + _ => Err(()), + } + } +} + +/// `Events` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Events { + pub code: i32, + pub name: Name, + pub server_uuid: String, + pub status: Status, + #[serde(default)] + pub tag: Option, +} diff --git a/types/compute/src/v2/server_external_event/response/create_251.rs b/types/compute/src/v2/server_external_event/response/create_251.rs new file mode 100644 index 000000000..4e2d6d00b --- /dev/null +++ b/types/compute/src/v2/server_external_event/response/create_251.rs @@ -0,0 +1,103 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-server-external-events` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// ServerExternalEvent response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerExternalEventResponse { + /// List of external events to process. + #[structable(serialize)] + pub events: Vec, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Name { + // NetworkChanged + #[serde(rename = "network-changed")] + NetworkChanged, + + // NetworkVifDeleted + #[serde(rename = "network-vif-deleted")] + NetworkVifDeleted, + + // NetworkVifPlugged + #[serde(rename = "network-vif-plugged")] + NetworkVifPlugged, + + // NetworkVifUnplugged + #[serde(rename = "network-vif-unplugged")] + NetworkVifUnplugged, + + // VolumeExtended + #[serde(rename = "volume-extended")] + VolumeExtended, +} + +impl std::str::FromStr for Name { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "network-changed" => Ok(Self::NetworkChanged), + "network-vif-deleted" => Ok(Self::NetworkVifDeleted), + "network-vif-plugged" => Ok(Self::NetworkVifPlugged), + "network-vif-unplugged" => Ok(Self::NetworkVifUnplugged), + "volume-extended" => Ok(Self::VolumeExtended), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Completed + #[serde(rename = "completed")] + Completed, + + // Failed + #[serde(rename = "failed")] + Failed, + + // InProgress + #[serde(rename = "in-progress")] + InProgress, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "completed" => Ok(Self::Completed), + "failed" => Ok(Self::Failed), + "in-progress" => Ok(Self::InProgress), + _ => Err(()), + } + } +} + +/// `Events` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Events { + pub code: i32, + pub name: Name, + pub server_uuid: String, + pub status: Status, + #[serde(default)] + pub tag: Option, +} diff --git a/types/compute/src/v2/server_external_event/response/create_276.rs b/types/compute/src/v2/server_external_event/response/create_276.rs new file mode 100644 index 000000000..94a342037 --- /dev/null +++ b/types/compute/src/v2/server_external_event/response/create_276.rs @@ -0,0 +1,108 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-server-external-events` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// ServerExternalEvent response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerExternalEventResponse { + /// List of external events to process. + #[structable(serialize)] + pub events: Vec, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Name { + // NetworkChanged + #[serde(rename = "network-changed")] + NetworkChanged, + + // NetworkVifDeleted + #[serde(rename = "network-vif-deleted")] + NetworkVifDeleted, + + // NetworkVifPlugged + #[serde(rename = "network-vif-plugged")] + NetworkVifPlugged, + + // NetworkVifUnplugged + #[serde(rename = "network-vif-unplugged")] + NetworkVifUnplugged, + + // PowerUpdate + #[serde(rename = "power-update")] + PowerUpdate, + + // VolumeExtended + #[serde(rename = "volume-extended")] + VolumeExtended, +} + +impl std::str::FromStr for Name { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "network-changed" => Ok(Self::NetworkChanged), + "network-vif-deleted" => Ok(Self::NetworkVifDeleted), + "network-vif-plugged" => Ok(Self::NetworkVifPlugged), + "network-vif-unplugged" => Ok(Self::NetworkVifUnplugged), + "power-update" => Ok(Self::PowerUpdate), + "volume-extended" => Ok(Self::VolumeExtended), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Completed + #[serde(rename = "completed")] + Completed, + + // Failed + #[serde(rename = "failed")] + Failed, + + // InProgress + #[serde(rename = "in-progress")] + InProgress, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "completed" => Ok(Self::Completed), + "failed" => Ok(Self::Failed), + "in-progress" => Ok(Self::InProgress), + _ => Err(()), + } + } +} + +/// `Events` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Events { + pub code: i32, + pub name: Name, + pub server_uuid: String, + pub status: Status, + #[serde(default)] + pub tag: Option, +} diff --git a/types/compute/src/v2/server_external_event/response/create.rs b/types/compute/src/v2/server_external_event/response/create_282.rs similarity index 99% rename from types/compute/src/v2/server_external_event/response/create.rs rename to types/compute/src/v2/server_external_event/response/create_282.rs index 518ebcc36..5204cb54b 100644 --- a/types/compute/src/v2/server_external_event/response/create.rs +++ b/types/compute/src/v2/server_external_event/response/create_282.rs @@ -104,6 +104,7 @@ impl std::str::FromStr for Status { /// `Events` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Events { + pub code: i32, pub name: Name, pub server_uuid: String, pub status: Status, diff --git a/types/compute/src/v2/server_external_event/response/create_293.rs b/types/compute/src/v2/server_external_event/response/create_293.rs new file mode 100644 index 000000000..e104e2334 --- /dev/null +++ b/types/compute/src/v2/server_external_event/response/create_293.rs @@ -0,0 +1,118 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-server-external-events` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// ServerExternalEvent response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerExternalEventResponse { + /// List of external events to process. + #[structable(serialize)] + pub events: Vec, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Name { + // AcceleratorRequestBound + #[serde(rename = "accelerator-request-bound")] + AcceleratorRequestBound, + + // NetworkChanged + #[serde(rename = "network-changed")] + NetworkChanged, + + // NetworkVifDeleted + #[serde(rename = "network-vif-deleted")] + NetworkVifDeleted, + + // NetworkVifPlugged + #[serde(rename = "network-vif-plugged")] + NetworkVifPlugged, + + // NetworkVifUnplugged + #[serde(rename = "network-vif-unplugged")] + NetworkVifUnplugged, + + // PowerUpdate + #[serde(rename = "power-update")] + PowerUpdate, + + // VolumeExtended + #[serde(rename = "volume-extended")] + VolumeExtended, + + // VolumeReimaged + #[serde(rename = "volume-reimaged")] + VolumeReimaged, +} + +impl std::str::FromStr for Name { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "accelerator-request-bound" => Ok(Self::AcceleratorRequestBound), + "network-changed" => Ok(Self::NetworkChanged), + "network-vif-deleted" => Ok(Self::NetworkVifDeleted), + "network-vif-plugged" => Ok(Self::NetworkVifPlugged), + "network-vif-unplugged" => Ok(Self::NetworkVifUnplugged), + "power-update" => Ok(Self::PowerUpdate), + "volume-extended" => Ok(Self::VolumeExtended), + "volume-reimaged" => Ok(Self::VolumeReimaged), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Completed + #[serde(rename = "completed")] + Completed, + + // Failed + #[serde(rename = "failed")] + Failed, + + // InProgress + #[serde(rename = "in-progress")] + InProgress, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "completed" => Ok(Self::Completed), + "failed" => Ok(Self::Failed), + "in-progress" => Ok(Self::InProgress), + _ => Err(()), + } + } +} + +/// `Events` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Events { + pub code: i32, + pub name: Name, + pub server_uuid: String, + pub status: Status, + #[serde(default)] + pub tag: Option, +} diff --git a/types/compute/src/v2/server_group/response.rs b/types/compute/src/v2/server_group/response.rs index 57479c591..5de6d2be1 100644 --- a/types/compute/src/v2/server_group/response.rs +++ b/types/compute/src/v2/server_group/response.rs @@ -16,6 +16,15 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod create; -pub mod get; -pub mod list; +pub mod create_21; +pub mod create_213; +pub mod create_215; +pub mod create_264; +pub mod get_21; +pub mod get_213; +pub mod get_215; +pub mod get_264; +pub mod list_21; +pub mod list_213; +pub mod list_215; +pub mod list_264; diff --git a/types/compute/src/v2/server_group/response/create_21.rs b/types/compute/src/v2/server_group/response/create_21.rs new file mode 100644 index 000000000..0a854549e --- /dev/null +++ b/types/compute/src/v2/server_group/response/create_21.rs @@ -0,0 +1,88 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-server-groups` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// ServerGroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerGroupResponse { + /// The UUID of the server group. + #[structable()] + pub id: String, + + /// A list of members in the server group. + #[structable(serialize)] + pub members: Vec, + + /// Metadata key and value pairs. The maximum size for each metadata key + /// and value pair is 255 bytes. It’s always empty and only used for + /// keeping compatibility. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The name of the server group. + #[structable()] + pub name: String, + + /// A list of exactly one policy name to associate with the server group. + /// The current valid policy names are: + /// + /// - `anti-affinity` - servers in this group must be scheduled to + /// different hosts. + /// - `affinity` - servers in this group must be scheduled to the same + /// host. + /// - `soft-anti-affinity` - servers in this group should be scheduled to + /// different hosts if possible, but if not possible then they should + /// still be scheduled instead of resulting in a build failure. This + /// policy was added in microversion 2.15. + /// - `soft-affinity` - servers in this group should be scheduled to the + /// same host if possible, but if not possible then they should still be + /// scheduled instead of resulting in a build failure. This policy was + /// added in microversion 2.15. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub policies: Vec, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Policies { + // Affinity + #[serde(rename = "affinity")] + Affinity, + + // AntiAffinity + #[serde(rename = "anti-affinity")] + AntiAffinity, +} + +impl std::str::FromStr for Policies { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "affinity" => Ok(Self::Affinity), + "anti-affinity" => Ok(Self::AntiAffinity), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server_group/response/create_213.rs b/types/compute/src/v2/server_group/response/create_213.rs new file mode 100644 index 000000000..6fd95d929 --- /dev/null +++ b/types/compute/src/v2/server_group/response/create_213.rs @@ -0,0 +1,100 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-server-groups` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// ServerGroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerGroupResponse { + /// The UUID of the server group. + #[structable()] + pub id: String, + + /// A list of members in the server group. + #[structable(serialize)] + pub members: Vec, + + /// Metadata key and value pairs. The maximum size for each metadata key + /// and value pair is 255 bytes. It’s always empty and only used for + /// keeping compatibility. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The name of the server group. + #[structable()] + pub name: String, + + /// A list of exactly one policy name to associate with the server group. + /// The current valid policy names are: + /// + /// - `anti-affinity` - servers in this group must be scheduled to + /// different hosts. + /// - `affinity` - servers in this group must be scheduled to the same + /// host. + /// - `soft-anti-affinity` - servers in this group should be scheduled to + /// different hosts if possible, but if not possible then they should + /// still be scheduled instead of resulting in a build failure. This + /// policy was added in microversion 2.15. + /// - `soft-affinity` - servers in this group should be scheduled to the + /// same host if possible, but if not possible then they should still be + /// scheduled instead of resulting in a build failure. This policy was + /// added in microversion 2.15. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub policies: Vec, + + /// The project ID who owns the server group. + /// + /// **New in version 2.13** + #[structable()] + pub project_id: String, + + /// The user ID who owns the server group. + /// + /// **New in version 2.13** + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Policies { + // Affinity + #[serde(rename = "affinity")] + Affinity, + + // AntiAffinity + #[serde(rename = "anti-affinity")] + AntiAffinity, +} + +impl std::str::FromStr for Policies { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "affinity" => Ok(Self::Affinity), + "anti-affinity" => Ok(Self::AntiAffinity), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server_group/response/create_215.rs b/types/compute/src/v2/server_group/response/create_215.rs new file mode 100644 index 000000000..808d6f423 --- /dev/null +++ b/types/compute/src/v2/server_group/response/create_215.rs @@ -0,0 +1,110 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `os-server-groups` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// ServerGroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerGroupResponse { + /// The UUID of the server group. + #[structable()] + pub id: String, + + /// A list of members in the server group. + #[structable(serialize)] + pub members: Vec, + + /// Metadata key and value pairs. The maximum size for each metadata key + /// and value pair is 255 bytes. It’s always empty and only used for + /// keeping compatibility. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The name of the server group. + #[structable()] + pub name: String, + + /// A list of exactly one policy name to associate with the server group. + /// The current valid policy names are: + /// + /// - `anti-affinity` - servers in this group must be scheduled to + /// different hosts. + /// - `affinity` - servers in this group must be scheduled to the same + /// host. + /// - `soft-anti-affinity` - servers in this group should be scheduled to + /// different hosts if possible, but if not possible then they should + /// still be scheduled instead of resulting in a build failure. This + /// policy was added in microversion 2.15. + /// - `soft-affinity` - servers in this group should be scheduled to the + /// same host if possible, but if not possible then they should still be + /// scheduled instead of resulting in a build failure. This policy was + /// added in microversion 2.15. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub policies: Vec, + + /// The project ID who owns the server group. + /// + /// **New in version 2.13** + #[structable()] + pub project_id: String, + + /// The user ID who owns the server group. + /// + /// **New in version 2.13** + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Policies { + // Affinity + #[serde(rename = "affinity")] + Affinity, + + // AntiAffinity + #[serde(rename = "anti-affinity")] + AntiAffinity, + + // SoftAffinity + #[serde(rename = "soft-affinity")] + SoftAffinity, + + // SoftAntiAffinity + #[serde(rename = "soft-anti-affinity")] + SoftAntiAffinity, +} + +impl std::str::FromStr for Policies { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "affinity" => Ok(Self::Affinity), + "anti-affinity" => Ok(Self::AntiAffinity), + "soft-affinity" => Ok(Self::SoftAffinity), + "soft-anti-affinity" => Ok(Self::SoftAntiAffinity), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server_group/response/create.rs b/types/compute/src/v2/server_group/response/create_264.rs similarity index 62% rename from types/compute/src/v2/server_group/response/create.rs rename to types/compute/src/v2/server_group/response/create_264.rs index 408fcc248..f7619338d 100644 --- a/types/compute/src/v2/server_group/response/create.rs +++ b/types/compute/src/v2/server_group/response/create_264.rs @@ -17,7 +17,6 @@ //! Response type for the POST `os-server-groups` operation use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; /// ServerGroup response representation @@ -28,44 +27,13 @@ pub struct ServerGroupResponse { pub id: String, /// A list of members in the server group. - #[serde(default)] - #[structable(optional, serialize)] - pub members: Option>, - - /// Metadata key and value pairs. The maximum size for each metadata key - /// and value pair is 255 bytes. It’s always empty and only used for - /// keeping compatibility. - /// - /// **Available until version 2.63** - #[serde(default)] - #[structable(optional, serialize)] - pub metadata: Option>, + #[structable(serialize)] + pub members: Vec, /// The name of the server group. #[structable()] pub name: String, - /// A list of exactly one policy name to associate with the server group. - /// The current valid policy names are: - /// - /// - `anti-affinity` - servers in this group must be scheduled to - /// different hosts. - /// - `affinity` - servers in this group must be scheduled to the same - /// host. - /// - `soft-anti-affinity` - servers in this group should be scheduled to - /// different hosts if possible, but if not possible then they should - /// still be scheduled instead of resulting in a build failure. This - /// policy was added in microversion 2.15. - /// - `soft-affinity` - servers in this group should be scheduled to the - /// same host if possible, but if not possible then they should still be - /// scheduled instead of resulting in a build failure. This policy was - /// added in microversion 2.15. - /// - /// **Available until version 2.63** - #[serde(default)] - #[structable(optional, serialize)] - pub policies: Option>, - /// The `policy` field represents the name of the policy. The current valid /// policy names are: /// @@ -98,9 +66,8 @@ pub struct ServerGroupResponse { /// anti-affinity group can reside on a given host. /// /// **New in version 2.64** - #[serde(default)] - #[structable(optional, serialize)] - pub rules: Option, + #[structable(serialize)] + pub rules: Rules, /// The user ID who owns the server group. /// @@ -109,38 +76,6 @@ pub struct ServerGroupResponse { pub user_id: String, } -#[derive(Debug, Deserialize, Clone, Serialize)] -pub enum Policies { - // Affinity - #[serde(rename = "affinity")] - Affinity, - - // AntiAffinity - #[serde(rename = "anti-affinity")] - AntiAffinity, - - // SoftAffinity - #[serde(rename = "soft-affinity")] - SoftAffinity, - - // SoftAntiAffinity - #[serde(rename = "soft-anti-affinity")] - SoftAntiAffinity, -} - -impl std::str::FromStr for Policies { - type Err = (); - fn from_str(input: &str) -> Result { - match input { - "affinity" => Ok(Self::Affinity), - "anti-affinity" => Ok(Self::AntiAffinity), - "soft-affinity" => Ok(Self::SoftAffinity), - "soft-anti-affinity" => Ok(Self::SoftAntiAffinity), - _ => Err(()), - } - } -} - #[derive(Debug, Deserialize, Clone, Serialize)] pub enum Policy { // Affinity @@ -184,9 +119,6 @@ impl std::str::FromStr for Policy { /// `Rules` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Rules { - #[serde( - default, - deserialize_with = "openstack_types_core::common::deser_num_str_opt" - )] - pub max_server_per_host: Option, + #[serde(default)] + pub max_server_per_host: Option, } diff --git a/types/compute/src/v2/server_group/response/get_21.rs b/types/compute/src/v2/server_group/response/get_21.rs new file mode 100644 index 000000000..83288d249 --- /dev/null +++ b/types/compute/src/v2/server_group/response/get_21.rs @@ -0,0 +1,88 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-server-groups/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// ServerGroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerGroupResponse { + /// The UUID of the server group. + #[structable()] + pub id: String, + + /// A list of members in the server group. + #[structable(serialize)] + pub members: Vec, + + /// Metadata key and value pairs. The maximum size for each metadata key + /// and value pair is 255 bytes. It’s always empty and only used for + /// keeping compatibility. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The name of the server group. + #[structable()] + pub name: String, + + /// A list of exactly one policy name to associate with the server group. + /// The current valid policy names are: + /// + /// - `anti-affinity` - servers in this group must be scheduled to + /// different hosts. + /// - `affinity` - servers in this group must be scheduled to the same + /// host. + /// - `soft-anti-affinity` - servers in this group should be scheduled to + /// different hosts if possible, but if not possible then they should + /// still be scheduled instead of resulting in a build failure. This + /// policy was added in microversion 2.15. + /// - `soft-affinity` - servers in this group should be scheduled to the + /// same host if possible, but if not possible then they should still be + /// scheduled instead of resulting in a build failure. This policy was + /// added in microversion 2.15. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub policies: Vec, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Policies { + // Affinity + #[serde(rename = "affinity")] + Affinity, + + // AntiAffinity + #[serde(rename = "anti-affinity")] + AntiAffinity, +} + +impl std::str::FromStr for Policies { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "affinity" => Ok(Self::Affinity), + "anti-affinity" => Ok(Self::AntiAffinity), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server_group/response/get_213.rs b/types/compute/src/v2/server_group/response/get_213.rs new file mode 100644 index 000000000..c2c7b7299 --- /dev/null +++ b/types/compute/src/v2/server_group/response/get_213.rs @@ -0,0 +1,100 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-server-groups/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// ServerGroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerGroupResponse { + /// The UUID of the server group. + #[structable()] + pub id: String, + + /// A list of members in the server group. + #[structable(serialize)] + pub members: Vec, + + /// Metadata key and value pairs. The maximum size for each metadata key + /// and value pair is 255 bytes. It’s always empty and only used for + /// keeping compatibility. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The name of the server group. + #[structable()] + pub name: String, + + /// A list of exactly one policy name to associate with the server group. + /// The current valid policy names are: + /// + /// - `anti-affinity` - servers in this group must be scheduled to + /// different hosts. + /// - `affinity` - servers in this group must be scheduled to the same + /// host. + /// - `soft-anti-affinity` - servers in this group should be scheduled to + /// different hosts if possible, but if not possible then they should + /// still be scheduled instead of resulting in a build failure. This + /// policy was added in microversion 2.15. + /// - `soft-affinity` - servers in this group should be scheduled to the + /// same host if possible, but if not possible then they should still be + /// scheduled instead of resulting in a build failure. This policy was + /// added in microversion 2.15. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub policies: Vec, + + /// The project ID who owns the server group. + /// + /// **New in version 2.13** + #[structable()] + pub project_id: String, + + /// The user ID who owns the server group. + /// + /// **New in version 2.13** + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Policies { + // Affinity + #[serde(rename = "affinity")] + Affinity, + + // AntiAffinity + #[serde(rename = "anti-affinity")] + AntiAffinity, +} + +impl std::str::FromStr for Policies { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "affinity" => Ok(Self::Affinity), + "anti-affinity" => Ok(Self::AntiAffinity), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server_group/response/get_215.rs b/types/compute/src/v2/server_group/response/get_215.rs new file mode 100644 index 000000000..77ffd28d5 --- /dev/null +++ b/types/compute/src/v2/server_group/response/get_215.rs @@ -0,0 +1,110 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-server-groups/{id}` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// ServerGroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerGroupResponse { + /// The UUID of the server group. + #[structable()] + pub id: String, + + /// A list of members in the server group. + #[structable(serialize)] + pub members: Vec, + + /// Metadata key and value pairs. The maximum size for each metadata key + /// and value pair is 255 bytes. It’s always empty and only used for + /// keeping compatibility. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub metadata: BTreeMap, + + /// The name of the server group. + #[structable()] + pub name: String, + + /// A list of exactly one policy name to associate with the server group. + /// The current valid policy names are: + /// + /// - `anti-affinity` - servers in this group must be scheduled to + /// different hosts. + /// - `affinity` - servers in this group must be scheduled to the same + /// host. + /// - `soft-anti-affinity` - servers in this group should be scheduled to + /// different hosts if possible, but if not possible then they should + /// still be scheduled instead of resulting in a build failure. This + /// policy was added in microversion 2.15. + /// - `soft-affinity` - servers in this group should be scheduled to the + /// same host if possible, but if not possible then they should still be + /// scheduled instead of resulting in a build failure. This policy was + /// added in microversion 2.15. + /// + /// **Available until version 2.63** + #[structable(serialize)] + pub policies: Vec, + + /// The project ID who owns the server group. + /// + /// **New in version 2.13** + #[structable()] + pub project_id: String, + + /// The user ID who owns the server group. + /// + /// **New in version 2.13** + #[structable()] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Policies { + // Affinity + #[serde(rename = "affinity")] + Affinity, + + // AntiAffinity + #[serde(rename = "anti-affinity")] + AntiAffinity, + + // SoftAffinity + #[serde(rename = "soft-affinity")] + SoftAffinity, + + // SoftAntiAffinity + #[serde(rename = "soft-anti-affinity")] + SoftAntiAffinity, +} + +impl std::str::FromStr for Policies { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "affinity" => Ok(Self::Affinity), + "anti-affinity" => Ok(Self::AntiAffinity), + "soft-affinity" => Ok(Self::SoftAffinity), + "soft-anti-affinity" => Ok(Self::SoftAntiAffinity), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server_group/response/get.rs b/types/compute/src/v2/server_group/response/get_264.rs similarity index 62% rename from types/compute/src/v2/server_group/response/get.rs rename to types/compute/src/v2/server_group/response/get_264.rs index 260c0ec1b..cf37a6aac 100644 --- a/types/compute/src/v2/server_group/response/get.rs +++ b/types/compute/src/v2/server_group/response/get_264.rs @@ -17,7 +17,6 @@ //! Response type for the GET `os-server-groups/{id}` operation use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; /// ServerGroup response representation @@ -28,44 +27,13 @@ pub struct ServerGroupResponse { pub id: String, /// A list of members in the server group. - #[serde(default)] - #[structable(optional, serialize)] - pub members: Option>, - - /// Metadata key and value pairs. The maximum size for each metadata key - /// and value pair is 255 bytes. It’s always empty and only used for - /// keeping compatibility. - /// - /// **Available until version 2.63** - #[serde(default)] - #[structable(optional, serialize)] - pub metadata: Option>, + #[structable(serialize)] + pub members: Vec, /// The name of the server group. #[structable()] pub name: String, - /// A list of exactly one policy name to associate with the server group. - /// The current valid policy names are: - /// - /// - `anti-affinity` - servers in this group must be scheduled to - /// different hosts. - /// - `affinity` - servers in this group must be scheduled to the same - /// host. - /// - `soft-anti-affinity` - servers in this group should be scheduled to - /// different hosts if possible, but if not possible then they should - /// still be scheduled instead of resulting in a build failure. This - /// policy was added in microversion 2.15. - /// - `soft-affinity` - servers in this group should be scheduled to the - /// same host if possible, but if not possible then they should still be - /// scheduled instead of resulting in a build failure. This policy was - /// added in microversion 2.15. - /// - /// **Available until version 2.63** - #[serde(default)] - #[structable(optional, serialize)] - pub policies: Option>, - /// The `policy` field represents the name of the policy. The current valid /// policy names are: /// @@ -98,9 +66,8 @@ pub struct ServerGroupResponse { /// anti-affinity group can reside on a given host. /// /// **New in version 2.64** - #[serde(default)] - #[structable(optional, serialize)] - pub rules: Option, + #[structable(serialize)] + pub rules: Rules, /// The user ID who owns the server group. /// @@ -109,38 +76,6 @@ pub struct ServerGroupResponse { pub user_id: String, } -#[derive(Debug, Deserialize, Clone, Serialize)] -pub enum Policies { - // Affinity - #[serde(rename = "affinity")] - Affinity, - - // AntiAffinity - #[serde(rename = "anti-affinity")] - AntiAffinity, - - // SoftAffinity - #[serde(rename = "soft-affinity")] - SoftAffinity, - - // SoftAntiAffinity - #[serde(rename = "soft-anti-affinity")] - SoftAntiAffinity, -} - -impl std::str::FromStr for Policies { - type Err = (); - fn from_str(input: &str) -> Result { - match input { - "affinity" => Ok(Self::Affinity), - "anti-affinity" => Ok(Self::AntiAffinity), - "soft-affinity" => Ok(Self::SoftAffinity), - "soft-anti-affinity" => Ok(Self::SoftAntiAffinity), - _ => Err(()), - } - } -} - #[derive(Debug, Deserialize, Clone, Serialize)] pub enum Policy { // Affinity @@ -184,9 +119,6 @@ impl std::str::FromStr for Policy { /// `Rules` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Rules { - #[serde( - default, - deserialize_with = "openstack_types_core::common::deser_num_str_opt" - )] - pub max_server_per_host: Option, + #[serde(default)] + pub max_server_per_host: Option, } diff --git a/types/compute/src/v2/server_group/response/list_21.rs b/types/compute/src/v2/server_group/response/list_21.rs new file mode 100644 index 000000000..177f2aa15 --- /dev/null +++ b/types/compute/src/v2/server_group/response/list_21.rs @@ -0,0 +1,88 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-server-groups` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// ServerGroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerGroupResponse { + /// The UUID of the server group. + #[structable()] + pub id: String, + + /// A list of members in the server group. + #[structable(serialize, wide)] + pub members: Vec, + + /// Metadata key and value pairs. The maximum size for each metadata key + /// and value pair is 255 bytes. It’s always empty and only used for + /// keeping compatibility. + /// + /// **Available until version 2.63** + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + /// The name of the server group. + #[structable()] + pub name: String, + + /// A list of exactly one policy name to associate with the server group. + /// The current valid policy names are: + /// + /// - `anti-affinity` - servers in this group must be scheduled to + /// different hosts. + /// - `affinity` - servers in this group must be scheduled to the same + /// host. + /// - `soft-anti-affinity` - servers in this group should be scheduled to + /// different hosts if possible, but if not possible then they should + /// still be scheduled instead of resulting in a build failure. This + /// policy was added in microversion 2.15. + /// - `soft-affinity` - servers in this group should be scheduled to the + /// same host if possible, but if not possible then they should still be + /// scheduled instead of resulting in a build failure. This policy was + /// added in microversion 2.15. + /// + /// **Available until version 2.63** + #[structable(serialize, wide)] + pub policies: Vec, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Policies { + // Affinity + #[serde(rename = "affinity")] + Affinity, + + // AntiAffinity + #[serde(rename = "anti-affinity")] + AntiAffinity, +} + +impl std::str::FromStr for Policies { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "affinity" => Ok(Self::Affinity), + "anti-affinity" => Ok(Self::AntiAffinity), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server_group/response/list_213.rs b/types/compute/src/v2/server_group/response/list_213.rs new file mode 100644 index 000000000..ec05dd3f7 --- /dev/null +++ b/types/compute/src/v2/server_group/response/list_213.rs @@ -0,0 +1,100 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-server-groups` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// ServerGroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerGroupResponse { + /// The UUID of the server group. + #[structable()] + pub id: String, + + /// A list of members in the server group. + #[structable(serialize, wide)] + pub members: Vec, + + /// Metadata key and value pairs. The maximum size for each metadata key + /// and value pair is 255 bytes. It’s always empty and only used for + /// keeping compatibility. + /// + /// **Available until version 2.63** + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + /// The name of the server group. + #[structable()] + pub name: String, + + /// A list of exactly one policy name to associate with the server group. + /// The current valid policy names are: + /// + /// - `anti-affinity` - servers in this group must be scheduled to + /// different hosts. + /// - `affinity` - servers in this group must be scheduled to the same + /// host. + /// - `soft-anti-affinity` - servers in this group should be scheduled to + /// different hosts if possible, but if not possible then they should + /// still be scheduled instead of resulting in a build failure. This + /// policy was added in microversion 2.15. + /// - `soft-affinity` - servers in this group should be scheduled to the + /// same host if possible, but if not possible then they should still be + /// scheduled instead of resulting in a build failure. This policy was + /// added in microversion 2.15. + /// + /// **Available until version 2.63** + #[structable(serialize, wide)] + pub policies: Vec, + + /// The project ID who owns the server group. + /// + /// **New in version 2.13** + #[structable(wide)] + pub project_id: String, + + /// The user ID who owns the server group. + /// + /// **New in version 2.13** + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Policies { + // Affinity + #[serde(rename = "affinity")] + Affinity, + + // AntiAffinity + #[serde(rename = "anti-affinity")] + AntiAffinity, +} + +impl std::str::FromStr for Policies { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "affinity" => Ok(Self::Affinity), + "anti-affinity" => Ok(Self::AntiAffinity), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server_group/response/list_215.rs b/types/compute/src/v2/server_group/response/list_215.rs new file mode 100644 index 000000000..efc8c6220 --- /dev/null +++ b/types/compute/src/v2/server_group/response/list_215.rs @@ -0,0 +1,110 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-server-groups` operation + +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// ServerGroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServerGroupResponse { + /// The UUID of the server group. + #[structable()] + pub id: String, + + /// A list of members in the server group. + #[structable(serialize, wide)] + pub members: Vec, + + /// Metadata key and value pairs. The maximum size for each metadata key + /// and value pair is 255 bytes. It’s always empty and only used for + /// keeping compatibility. + /// + /// **Available until version 2.63** + #[structable(serialize, wide)] + pub metadata: BTreeMap, + + /// The name of the server group. + #[structable()] + pub name: String, + + /// A list of exactly one policy name to associate with the server group. + /// The current valid policy names are: + /// + /// - `anti-affinity` - servers in this group must be scheduled to + /// different hosts. + /// - `affinity` - servers in this group must be scheduled to the same + /// host. + /// - `soft-anti-affinity` - servers in this group should be scheduled to + /// different hosts if possible, but if not possible then they should + /// still be scheduled instead of resulting in a build failure. This + /// policy was added in microversion 2.15. + /// - `soft-affinity` - servers in this group should be scheduled to the + /// same host if possible, but if not possible then they should still be + /// scheduled instead of resulting in a build failure. This policy was + /// added in microversion 2.15. + /// + /// **Available until version 2.63** + #[structable(serialize, wide)] + pub policies: Vec, + + /// The project ID who owns the server group. + /// + /// **New in version 2.13** + #[structable(wide)] + pub project_id: String, + + /// The user ID who owns the server group. + /// + /// **New in version 2.13** + #[structable(wide)] + pub user_id: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Policies { + // Affinity + #[serde(rename = "affinity")] + Affinity, + + // AntiAffinity + #[serde(rename = "anti-affinity")] + AntiAffinity, + + // SoftAffinity + #[serde(rename = "soft-affinity")] + SoftAffinity, + + // SoftAntiAffinity + #[serde(rename = "soft-anti-affinity")] + SoftAntiAffinity, +} + +impl std::str::FromStr for Policies { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "affinity" => Ok(Self::Affinity), + "anti-affinity" => Ok(Self::AntiAffinity), + "soft-affinity" => Ok(Self::SoftAffinity), + "soft-anti-affinity" => Ok(Self::SoftAntiAffinity), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/server_group/response/list.rs b/types/compute/src/v2/server_group/response/list_264.rs similarity index 61% rename from types/compute/src/v2/server_group/response/list.rs rename to types/compute/src/v2/server_group/response/list_264.rs index 5baf90edb..173e25442 100644 --- a/types/compute/src/v2/server_group/response/list.rs +++ b/types/compute/src/v2/server_group/response/list_264.rs @@ -17,7 +17,6 @@ //! Response type for the GET `os-server-groups` operation use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; /// ServerGroup response representation @@ -28,44 +27,13 @@ pub struct ServerGroupResponse { pub id: String, /// A list of members in the server group. - #[serde(default)] - #[structable(optional, serialize, wide)] - pub members: Option>, - - /// Metadata key and value pairs. The maximum size for each metadata key - /// and value pair is 255 bytes. It’s always empty and only used for - /// keeping compatibility. - /// - /// **Available until version 2.63** - #[serde(default)] - #[structable(optional, serialize, wide)] - pub metadata: Option>, + #[structable(serialize, wide)] + pub members: Vec, /// The name of the server group. #[structable()] pub name: String, - /// A list of exactly one policy name to associate with the server group. - /// The current valid policy names are: - /// - /// - `anti-affinity` - servers in this group must be scheduled to - /// different hosts. - /// - `affinity` - servers in this group must be scheduled to the same - /// host. - /// - `soft-anti-affinity` - servers in this group should be scheduled to - /// different hosts if possible, but if not possible then they should - /// still be scheduled instead of resulting in a build failure. This - /// policy was added in microversion 2.15. - /// - `soft-affinity` - servers in this group should be scheduled to the - /// same host if possible, but if not possible then they should still be - /// scheduled instead of resulting in a build failure. This policy was - /// added in microversion 2.15. - /// - /// **Available until version 2.63** - #[serde(default)] - #[structable(optional, serialize, wide)] - pub policies: Option>, - /// The `policy` field represents the name of the policy. The current valid /// policy names are: /// @@ -98,9 +66,8 @@ pub struct ServerGroupResponse { /// anti-affinity group can reside on a given host. /// /// **New in version 2.64** - #[serde(default)] - #[structable(optional, serialize, wide)] - pub rules: Option, + #[structable(serialize, wide)] + pub rules: Rules, /// The user ID who owns the server group. /// @@ -109,38 +76,6 @@ pub struct ServerGroupResponse { pub user_id: String, } -#[derive(Debug, Deserialize, Clone, Serialize)] -pub enum Policies { - // Affinity - #[serde(rename = "affinity")] - Affinity, - - // AntiAffinity - #[serde(rename = "anti-affinity")] - AntiAffinity, - - // SoftAffinity - #[serde(rename = "soft-affinity")] - SoftAffinity, - - // SoftAntiAffinity - #[serde(rename = "soft-anti-affinity")] - SoftAntiAffinity, -} - -impl std::str::FromStr for Policies { - type Err = (); - fn from_str(input: &str) -> Result { - match input { - "affinity" => Ok(Self::Affinity), - "anti-affinity" => Ok(Self::AntiAffinity), - "soft-affinity" => Ok(Self::SoftAffinity), - "soft-anti-affinity" => Ok(Self::SoftAntiAffinity), - _ => Err(()), - } - } -} - #[derive(Debug, Deserialize, Clone, Serialize)] pub enum Policy { // Affinity @@ -184,9 +119,6 @@ impl std::str::FromStr for Policy { /// `Rules` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Rules { - #[serde( - default, - deserialize_with = "openstack_types_core::common::deser_num_str_opt" - )] - pub max_server_per_host: Option, + #[serde(default)] + pub max_server_per_host: Option, } diff --git a/types/compute/src/v2/service/response.rs b/types/compute/src/v2/service/response.rs index bdd6b2dd4..cf15ab242 100644 --- a/types/compute/src/v2/service/response.rs +++ b/types/compute/src/v2/service/response.rs @@ -16,5 +16,11 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod list; -pub mod set; +pub mod list_20; +pub mod list_211; +pub mod list_253; +pub mod list_269; +pub mod set_20_a; +pub mod set_20_b; +pub mod set_253; +pub mod set_269; diff --git a/types/compute/src/v2/service/response/list_20.rs b/types/compute/src/v2/service/response/list_20.rs new file mode 100644 index 000000000..2a2a9fad4 --- /dev/null +++ b/types/compute/src/v2/service/response/list_20.rs @@ -0,0 +1,111 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-services` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Service response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServiceResponse { + /// The binary name of the service. + #[structable(wide)] + pub binary: String, + + /// The reason for disabling a service. + #[structable(optional, wide)] + pub disabled_reason: Option, + + /// The name of the host. + #[structable(wide)] + pub host: String, + + /// The id of the service as a uuid. + /// + /// **New in version 2.53** + #[structable()] + pub id: i32, + + /// The state of the service. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the service. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// 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`. + #[structable(optional)] + pub updated_at: Option, + + /// The availability zone name. + #[structable(wide)] + pub zone: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/service/response/list.rs b/types/compute/src/v2/service/response/list_211.rs similarity index 80% rename from types/compute/src/v2/service/response/list.rs rename to types/compute/src/v2/service/response/list_211.rs index 7fd689ea1..2588f7194 100644 --- a/types/compute/src/v2/service/response/list.rs +++ b/types/compute/src/v2/service/response/list_211.rs @@ -23,12 +23,10 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServiceResponse { /// The binary name of the service. - #[serde(default)] - #[structable(optional, wide)] - pub binary: Option, + #[structable(wide)] + pub binary: String, /// The reason for disabling a service. - #[serde(default)] #[structable(optional, wide)] pub disabled_reason: Option, @@ -36,27 +34,24 @@ pub struct ServiceResponse { /// administrator after the service was fenced. This value is useful to /// know that some 3rd party has verified the service should be marked /// down. - #[serde(default)] - #[structable(optional, wide)] - pub forced_down: Option, + /// + /// **New in version 2.11** + #[structable(wide)] + pub forced_down: bool, /// The name of the host. #[structable(wide)] pub host: String, /// The id of the service as a uuid. - #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] + /// + /// **New in version 2.53** #[structable()] - pub id: i64, - - /// Service name - #[serde(default)] - #[structable(optional)] - pub name: Option, + pub id: i32, /// The state of the service. One of `up` or `down`. - #[structable()] - pub state: String, + #[structable(serialize)] + pub state: State, /// The status of the service. One of `enabled` or `disabled`. #[structable(serialize)] @@ -72,7 +67,6 @@ pub struct ServiceResponse { /// 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`. - #[serde(default)] #[structable(optional)] pub updated_at: Option, @@ -81,6 +75,28 @@ pub struct ServiceResponse { pub zone: String, } +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + #[derive(Debug, Deserialize, Clone, Serialize)] pub enum Status { // Disabled diff --git a/types/compute/src/v2/service/response/list_253.rs b/types/compute/src/v2/service/response/list_253.rs new file mode 100644 index 000000000..198899ff2 --- /dev/null +++ b/types/compute/src/v2/service/response/list_253.rs @@ -0,0 +1,120 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-services` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Service response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServiceResponse { + /// The binary name of the service. + #[structable(wide)] + pub binary: String, + + /// The reason for disabling a service. + #[structable(optional, wide)] + pub disabled_reason: Option, + + /// Whether or not this service was forced down manually by an + /// administrator after the service was fenced. This value is useful to + /// know that some 3rd party has verified the service should be marked + /// down. + /// + /// **New in version 2.11** + #[structable(wide)] + pub forced_down: bool, + + /// The name of the host. + #[structable(wide)] + pub host: String, + + /// The id of the service as a uuid. + /// + /// **New in version 2.53** + #[structable()] + pub id: String, + + /// The state of the service. One of `up` or `down`. + #[structable(serialize)] + pub state: State, + + /// The status of the service. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// 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`. + #[structable(optional)] + pub updated_at: Option, + + /// The availability zone name. + #[structable(wide)] + pub zone: String, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/service/response/list_269.rs b/types/compute/src/v2/service/response/list_269.rs new file mode 100644 index 000000000..e199717a7 --- /dev/null +++ b/types/compute/src/v2/service/response/list_269.rs @@ -0,0 +1,131 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-services` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Service response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServiceResponse { + /// The binary name of the service. + #[structable(wide)] + pub binary: String, + + /// The reason for disabling a service. + #[serde(default)] + #[structable(optional, wide)] + pub disabled_reason: Option, + + /// Whether or not this service was forced down manually by an + /// administrator after the service was fenced. This value is useful to + /// know that some 3rd party has verified the service should be marked + /// down. + /// + /// **New in version 2.11** + #[serde(default)] + #[structable(optional, wide)] + pub forced_down: Option, + + /// The name of the host. + #[structable(wide)] + pub host: String, + + /// The id of the service as a uuid. + /// + /// **New in version 2.53** + #[serde(default)] + #[structable(optional)] + pub id: Option, + + /// The state of the service. One of `up` or `down`. + #[serde(default)] + #[structable(optional, serialize)] + pub state: Option, + + /// The status of the service. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// 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`. + #[serde(default)] + #[structable(optional)] + pub updated_at: Option, + + /// The availability zone name. + #[serde(default)] + #[structable(optional, wide)] + pub zone: Option, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + "UNKNOWN" => Ok(Self::Unknown), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/service/response/set_20_a.rs b/types/compute/src/v2/service/response/set_20_a.rs new file mode 100644 index 000000000..c0d61eac7 --- /dev/null +++ b/types/compute/src/v2/service/response/set_20_a.rs @@ -0,0 +1,59 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `os-services/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Service response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServiceResponse { + #[structable()] + pub binary: String, + + #[serde(default)] + #[structable(optional)] + pub disabled_reason: Option, + + #[structable()] + pub host: String, + + #[structable(serialize)] + pub status: Status, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/service/response/set_20_b.rs b/types/compute/src/v2/service/response/set_20_b.rs new file mode 100644 index 000000000..71b49166a --- /dev/null +++ b/types/compute/src/v2/service/response/set_20_b.rs @@ -0,0 +1,33 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `os-services/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Service response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServiceResponse { + #[structable()] + pub binary: String, + + #[structable()] + pub forced_down: bool, + + #[structable()] + pub host: String, +} diff --git a/types/compute/src/v2/service/response/set.rs b/types/compute/src/v2/service/response/set_253.rs similarity index 83% rename from types/compute/src/v2/service/response/set.rs rename to types/compute/src/v2/service/response/set_253.rs index 82d1b35f7..f500d9663 100644 --- a/types/compute/src/v2/service/response/set.rs +++ b/types/compute/src/v2/service/response/set_253.rs @@ -23,12 +23,10 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServiceResponse { /// The binary name of the service. - #[serde(default)] - #[structable(optional)] - pub binary: Option, + #[structable()] + pub binary: String, /// The reason for disabling a service. - #[serde(default)] #[structable(optional)] pub disabled_reason: Option, @@ -36,27 +34,20 @@ pub struct ServiceResponse { /// administrator after the service was fenced. This value is useful to /// know that some 3rd party has verified the service should be marked /// down. - #[serde(default)] - #[structable(optional)] - pub forced_down: Option, + #[structable()] + pub forced_down: bool, /// The name of the host. #[structable()] pub host: String, /// The id of the service as a uuid. - #[serde(deserialize_with = "openstack_types_core::common::deser_num_str")] #[structable()] - pub id: i64, - - /// Service name - #[serde(default)] - #[structable(optional)] - pub name: Option, + pub id: String, /// The state of the service. One of `up` or `down`. - #[structable()] - pub state: String, + #[structable(serialize)] + pub state: State, /// The status of the service. One of `enabled` or `disabled`. #[structable(serialize)] @@ -72,7 +63,6 @@ pub struct ServiceResponse { /// 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`. - #[serde(default)] #[structable(optional)] pub updated_at: Option, @@ -81,6 +71,28 @@ pub struct ServiceResponse { pub zone: String, } +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + #[derive(Debug, Deserialize, Clone, Serialize)] pub enum Status { // Disabled diff --git a/types/compute/src/v2/service/response/set_269.rs b/types/compute/src/v2/service/response/set_269.rs new file mode 100644 index 000000000..f35f3b6ea --- /dev/null +++ b/types/compute/src/v2/service/response/set_269.rs @@ -0,0 +1,127 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the PUT `os-services/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Service response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ServiceResponse { + /// The binary name of the service. + #[structable()] + pub binary: String, + + /// The reason for disabling a service. + #[serde(default)] + #[structable(optional)] + pub disabled_reason: Option, + + /// Whether or not this service was forced down manually by an + /// administrator after the service was fenced. This value is useful to + /// know that some 3rd party has verified the service should be marked + /// down. + #[serde(default)] + #[structable(optional)] + pub forced_down: Option, + + /// The name of the host. + #[structable()] + pub host: String, + + /// The id of the service as a uuid. + #[serde(default)] + #[structable(optional)] + pub id: Option, + + /// The state of the service. One of `up` or `down`. + #[serde(default)] + #[structable(optional, serialize)] + pub state: Option, + + /// The status of the service. One of `enabled` or `disabled`. + #[structable(serialize)] + pub status: Status, + + /// 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`. + #[serde(default)] + #[structable(optional)] + pub updated_at: Option, + + /// The availability zone name. + #[serde(default)] + #[structable(optional)] + pub zone: Option, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Down + #[serde(rename = "down")] + Down, + + // Up + #[serde(rename = "up")] + Up, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "down" => Ok(Self::Down), + "up" => Ok(Self::Up), + _ => Err(()), + } + } +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // Disabled + #[serde(rename = "disabled")] + Disabled, + + // Enabled + #[serde(rename = "enabled")] + Enabled, + + // Unknown + #[serde(rename = "UNKNOWN")] + Unknown, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "disabled" => Ok(Self::Disabled), + "enabled" => Ok(Self::Enabled), + "UNKNOWN" => Ok(Self::Unknown), + _ => Err(()), + } + } +} diff --git a/types/compute/src/v2/simple_tenant_usage/response.rs b/types/compute/src/v2/simple_tenant_usage/response.rs index 0eccfe57e..40064d206 100644 --- a/types/compute/src/v2/simple_tenant_usage/response.rs +++ b/types/compute/src/v2/simple_tenant_usage/response.rs @@ -16,5 +16,9 @@ // `openstack-codegenerator`. //! `response` REST operations of compute -pub mod get; -pub mod list; +pub mod get_21_a; +pub mod get_21_b; +pub mod get_240_a; +pub mod get_240_b; +pub mod list_21; +pub mod list_240; diff --git a/types/compute/src/v2/simple_tenant_usage/response/get.rs b/types/compute/src/v2/simple_tenant_usage/response/get.rs deleted file mode 100644 index cec3bd327..000000000 --- a/types/compute/src/v2/simple_tenant_usage/response/get.rs +++ /dev/null @@ -1,100 +0,0 @@ -// 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 -// -// WARNING: This file is automatically generated from OpenAPI schema using -// `openstack-codegenerator`. -//! Response type for the GET `os-simple-tenant-usage/{id}` operation - -use serde::{Deserialize, Serialize}; -use structable::{StructTable, StructTableOptions}; - -/// SimpleTenantUsage response representation -#[derive(Clone, Deserialize, Serialize, StructTable)] -pub struct SimpleTenantUsageResponse { - /// A list of the tenant usage objects. - #[serde(default)] - #[structable(optional, serialize)] - pub tenant_usages: Option>, - - /// Links pertaining to usage. See - /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) - /// for more info. - /// - /// **New in version 2.40** - #[serde(default)] - #[structable(optional, serialize)] - pub tenant_usages_links: Option>, -} - -/// `ServerUsages` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ServerUsages { - #[serde(default)] - pub ended_at: Option, - #[serde(default)] - pub flavor: Option, - #[serde(default)] - pub hours: Option, - #[serde(default)] - pub instance_id: Option, - #[serde(default)] - pub local_gb: Option, - #[serde(default)] - pub memory_mb: Option, - #[serde(default)] - pub name: Option, - #[serde(default)] - pub started_at: Option, - #[serde(default)] - pub state: Option, - #[serde(default)] - pub tenant_id: Option, - #[serde(default)] - pub uptime: Option, - #[serde(default)] - pub vcpus: Option, -} - -/// `TenantUsages` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TenantUsages { - #[serde(default)] - pub server_usages: Option>, - #[serde(default)] - pub start: Option, - #[serde(default)] - pub stop: Option, - #[serde(default)] - pub tenant_id: Option, - #[serde(default)] - pub total_hours: Option, - #[serde(default)] - pub total_local_gb_usage: Option, - #[serde(default)] - pub total_memory_mb_usage: Option, - #[serde(default)] - pub total_vcpus_usage: Option, -} - -/// Links to the resources in question. See -/// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) -/// for more info. -/// `TenantUsagesLinks` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TenantUsagesLinks { - #[serde(default)] - pub href: Option, - #[serde(default)] - pub rel: Option, -} diff --git a/types/compute/src/v2/simple_tenant_usage/response/get_21_a.rs b/types/compute/src/v2/simple_tenant_usage/response/get_21_a.rs new file mode 100644 index 000000000..e46fe36fa --- /dev/null +++ b/types/compute/src/v2/simple_tenant_usage/response/get_21_a.rs @@ -0,0 +1,135 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-simple-tenant-usage/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// SimpleTenantUsage response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct SimpleTenantUsageResponse { + #[structable(serialize)] + pub server_usages: Vec, + + #[structable()] + pub start: String, + + #[structable()] + pub stop: String, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub total_hours: f32, + + #[structable()] + pub total_local_gb_usage: f32, + + #[structable()] + pub total_memory_mb_usage: f32, + + #[structable()] + pub total_vcpus_usage: f32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Active + #[serde(rename = "active")] + Active, + + // Building + #[serde(rename = "building")] + Building, + + // Error + #[serde(rename = "error")] + Error, + + // Paused + #[serde(rename = "paused")] + Paused, + + // Rescued + #[serde(rename = "rescued")] + Rescued, + + // Resized + #[serde(rename = "resized")] + Resized, + + // Shelved + #[serde(rename = "shelved")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "shelved_offloaded")] + ShelvedOffloaded, + + // Stopped + #[serde(rename = "stopped")] + Stopped, + + // Suspended + #[serde(rename = "suspended")] + Suspended, + + // Terminated + #[serde(rename = "terminated")] + Terminated, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "active" => Ok(Self::Active), + "building" => Ok(Self::Building), + "error" => Ok(Self::Error), + "paused" => Ok(Self::Paused), + "rescued" => Ok(Self::Rescued), + "resized" => Ok(Self::Resized), + "shelved" => Ok(Self::Shelved), + "shelved_offloaded" => Ok(Self::ShelvedOffloaded), + "stopped" => Ok(Self::Stopped), + "suspended" => Ok(Self::Suspended), + "terminated" => Ok(Self::Terminated), + _ => Err(()), + } + } +} + +/// `ServerUsages` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ServerUsages { + pub ended_at: Option, + pub flavor: String, + pub hours: f32, + pub instance_id: String, + #[serde(default)] + pub local_gb: Option, + #[serde(default)] + pub memory_mb: Option, + pub name: String, + pub started_at: String, + pub state: State, + pub tenant_id: String, + pub uptime: u32, + #[serde(default)] + pub vcpus: Option, +} diff --git a/types/compute/src/v2/simple_tenant_usage/response/get_21_b.rs b/types/compute/src/v2/simple_tenant_usage/response/get_21_b.rs new file mode 100644 index 000000000..c83c53ca0 --- /dev/null +++ b/types/compute/src/v2/simple_tenant_usage/response/get_21_b.rs @@ -0,0 +1,46 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-simple-tenant-usage/{id}` 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 SimpleTenantUsageResponse(BTreeMap); + +impl StructTable for SimpleTenantUsageResponse { + 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())) + } +} + +impl StructTable for &SimpleTenantUsageResponse { + 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())) + } +} diff --git a/types/compute/src/v2/simple_tenant_usage/response/get_240_a.rs b/types/compute/src/v2/simple_tenant_usage/response/get_240_a.rs new file mode 100644 index 000000000..e46fe36fa --- /dev/null +++ b/types/compute/src/v2/simple_tenant_usage/response/get_240_a.rs @@ -0,0 +1,135 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-simple-tenant-usage/{id}` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// SimpleTenantUsage response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct SimpleTenantUsageResponse { + #[structable(serialize)] + pub server_usages: Vec, + + #[structable()] + pub start: String, + + #[structable()] + pub stop: String, + + #[structable()] + pub tenant_id: String, + + #[structable()] + pub total_hours: f32, + + #[structable()] + pub total_local_gb_usage: f32, + + #[structable()] + pub total_memory_mb_usage: f32, + + #[structable()] + pub total_vcpus_usage: f32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Active + #[serde(rename = "active")] + Active, + + // Building + #[serde(rename = "building")] + Building, + + // Error + #[serde(rename = "error")] + Error, + + // Paused + #[serde(rename = "paused")] + Paused, + + // Rescued + #[serde(rename = "rescued")] + Rescued, + + // Resized + #[serde(rename = "resized")] + Resized, + + // Shelved + #[serde(rename = "shelved")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "shelved_offloaded")] + ShelvedOffloaded, + + // Stopped + #[serde(rename = "stopped")] + Stopped, + + // Suspended + #[serde(rename = "suspended")] + Suspended, + + // Terminated + #[serde(rename = "terminated")] + Terminated, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "active" => Ok(Self::Active), + "building" => Ok(Self::Building), + "error" => Ok(Self::Error), + "paused" => Ok(Self::Paused), + "rescued" => Ok(Self::Rescued), + "resized" => Ok(Self::Resized), + "shelved" => Ok(Self::Shelved), + "shelved_offloaded" => Ok(Self::ShelvedOffloaded), + "stopped" => Ok(Self::Stopped), + "suspended" => Ok(Self::Suspended), + "terminated" => Ok(Self::Terminated), + _ => Err(()), + } + } +} + +/// `ServerUsages` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ServerUsages { + pub ended_at: Option, + pub flavor: String, + pub hours: f32, + pub instance_id: String, + #[serde(default)] + pub local_gb: Option, + #[serde(default)] + pub memory_mb: Option, + pub name: String, + pub started_at: String, + pub state: State, + pub tenant_id: String, + pub uptime: u32, + #[serde(default)] + pub vcpus: Option, +} diff --git a/types/compute/src/v2/simple_tenant_usage/response/get_240_b.rs b/types/compute/src/v2/simple_tenant_usage/response/get_240_b.rs new file mode 100644 index 000000000..c83c53ca0 --- /dev/null +++ b/types/compute/src/v2/simple_tenant_usage/response/get_240_b.rs @@ -0,0 +1,46 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-simple-tenant-usage/{id}` 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 SimpleTenantUsageResponse(BTreeMap); + +impl StructTable for SimpleTenantUsageResponse { + 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())) + } +} + +impl StructTable for &SimpleTenantUsageResponse { + 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())) + } +} diff --git a/types/compute/src/v2/simple_tenant_usage/response/list.rs b/types/compute/src/v2/simple_tenant_usage/response/list.rs deleted file mode 100644 index 8fc1688e6..000000000 --- a/types/compute/src/v2/simple_tenant_usage/response/list.rs +++ /dev/null @@ -1,100 +0,0 @@ -// 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 -// -// WARNING: This file is automatically generated from OpenAPI schema using -// `openstack-codegenerator`. -//! Response type for the GET `os-simple-tenant-usage` operation - -use serde::{Deserialize, Serialize}; -use structable::{StructTable, StructTableOptions}; - -/// SimpleTenantUsage response representation -#[derive(Clone, Deserialize, Serialize, StructTable)] -pub struct SimpleTenantUsageResponse { - /// A list of the tenant usage objects. - #[serde(default)] - #[structable(optional, serialize)] - pub tenant_usages: Option>, - - /// Links pertaining to usage. See - /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) - /// for more info. - /// - /// **New in version 2.40** - #[serde(default)] - #[structable(optional, serialize)] - pub tenant_usages_links: Option>, -} - -/// `ServerUsages` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ServerUsages { - #[serde(default)] - pub ended_at: Option, - #[serde(default)] - pub flavor: Option, - #[serde(default)] - pub hours: Option, - #[serde(default)] - pub instance_id: Option, - #[serde(default)] - pub local_gb: Option, - #[serde(default)] - pub memory_mb: Option, - #[serde(default)] - pub name: Option, - #[serde(default)] - pub started_at: Option, - #[serde(default)] - pub state: Option, - #[serde(default)] - pub tenant_id: Option, - #[serde(default)] - pub uptime: Option, - #[serde(default)] - pub vcpus: Option, -} - -/// `TenantUsages` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TenantUsages { - #[serde(default)] - pub server_usages: Option>, - #[serde(default)] - pub start: Option, - #[serde(default)] - pub stop: Option, - #[serde(default)] - pub tenant_id: Option, - #[serde(default)] - pub total_hours: Option, - #[serde(default)] - pub total_local_gb_usage: Option, - #[serde(default)] - pub total_memory_mb_usage: Option, - #[serde(default)] - pub total_vcpus_usage: Option, -} - -/// Links to the resources in question. See -/// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) -/// for more info. -/// `TenantUsagesLinks` type -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TenantUsagesLinks { - #[serde(default)] - pub href: Option, - #[serde(default)] - pub rel: Option, -} diff --git a/types/compute/src/v2/simple_tenant_usage/response/list_21.rs b/types/compute/src/v2/simple_tenant_usage/response/list_21.rs new file mode 100644 index 000000000..02d5c3973 --- /dev/null +++ b/types/compute/src/v2/simple_tenant_usage/response/list_21.rs @@ -0,0 +1,161 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-simple-tenant-usage` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// SimpleTenantUsage response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct SimpleTenantUsageResponse { + /// A list of the server usage objects. + #[serde(default)] + #[structable(optional, serialize)] + pub server_usages: Option>, + + /// The beginning time to calculate usage statistics on compute and storage + /// resources. The date and time stamp format is as follows: + /// + /// ```text + /// CCYY-MM-DDThh:mm:ss.NNNNNN + /// ``` + /// + /// For example, `2015-08-27T09:49:58.123456`. + #[structable()] + pub start: String, + + /// The ending time to calculate usage statistics on compute and storage + /// resources. The date and time stamp format is as follows: + /// + /// ```text + /// CCYY-MM-DDThh:mm:ss.NNNNNN + /// ``` + /// + /// For example, `2015-08-27T09:49:58.123456`. + #[structable()] + pub stop: String, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: String, + + /// The total duration that servers exist (in hours). + #[structable()] + pub total_hours: f32, + + /// Multiplying the server disk size (in GiB) by hours the server exists, + /// and then adding that all together for each server. + #[structable()] + pub total_local_gb_usage: f32, + + /// Multiplying the server memory size (in MiB) by hours the server exists, + /// and then adding that all together for each server. + #[structable()] + pub total_memory_mb_usage: f32, + + /// Multiplying the number of virtual CPUs of the server by hours the + /// server exists, and then adding that all together for each server. + #[structable()] + pub total_vcpus_usage: f32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Active + #[serde(rename = "active")] + Active, + + // Building + #[serde(rename = "building")] + Building, + + // Error + #[serde(rename = "error")] + Error, + + // Paused + #[serde(rename = "paused")] + Paused, + + // Rescued + #[serde(rename = "rescued")] + Rescued, + + // Resized + #[serde(rename = "resized")] + Resized, + + // Shelved + #[serde(rename = "shelved")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "shelved_offloaded")] + ShelvedOffloaded, + + // Stopped + #[serde(rename = "stopped")] + Stopped, + + // Suspended + #[serde(rename = "suspended")] + Suspended, + + // Terminated + #[serde(rename = "terminated")] + Terminated, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "active" => Ok(Self::Active), + "building" => Ok(Self::Building), + "error" => Ok(Self::Error), + "paused" => Ok(Self::Paused), + "rescued" => Ok(Self::Rescued), + "resized" => Ok(Self::Resized), + "shelved" => Ok(Self::Shelved), + "shelved_offloaded" => Ok(Self::ShelvedOffloaded), + "stopped" => Ok(Self::Stopped), + "suspended" => Ok(Self::Suspended), + "terminated" => Ok(Self::Terminated), + _ => Err(()), + } + } +} + +/// `ServerUsages` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ServerUsages { + pub ended_at: Option, + pub flavor: String, + pub hours: f32, + pub instance_id: String, + #[serde(default)] + pub local_gb: Option, + #[serde(default)] + pub memory_mb: Option, + pub name: String, + pub started_at: String, + pub state: State, + pub tenant_id: String, + pub uptime: u32, + #[serde(default)] + pub vcpus: Option, +} diff --git a/types/compute/src/v2/simple_tenant_usage/response/list_240.rs b/types/compute/src/v2/simple_tenant_usage/response/list_240.rs new file mode 100644 index 000000000..02d5c3973 --- /dev/null +++ b/types/compute/src/v2/simple_tenant_usage/response/list_240.rs @@ -0,0 +1,161 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the GET `os-simple-tenant-usage` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// SimpleTenantUsage response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct SimpleTenantUsageResponse { + /// A list of the server usage objects. + #[serde(default)] + #[structable(optional, serialize)] + pub server_usages: Option>, + + /// The beginning time to calculate usage statistics on compute and storage + /// resources. The date and time stamp format is as follows: + /// + /// ```text + /// CCYY-MM-DDThh:mm:ss.NNNNNN + /// ``` + /// + /// For example, `2015-08-27T09:49:58.123456`. + #[structable()] + pub start: String, + + /// The ending time to calculate usage statistics on compute and storage + /// resources. The date and time stamp format is as follows: + /// + /// ```text + /// CCYY-MM-DDThh:mm:ss.NNNNNN + /// ``` + /// + /// For example, `2015-08-27T09:49:58.123456`. + #[structable()] + pub stop: String, + + /// The UUID of the tenant in a multi-tenancy cloud. + #[structable()] + pub tenant_id: String, + + /// The total duration that servers exist (in hours). + #[structable()] + pub total_hours: f32, + + /// Multiplying the server disk size (in GiB) by hours the server exists, + /// and then adding that all together for each server. + #[structable()] + pub total_local_gb_usage: f32, + + /// Multiplying the server memory size (in MiB) by hours the server exists, + /// and then adding that all together for each server. + #[structable()] + pub total_memory_mb_usage: f32, + + /// Multiplying the number of virtual CPUs of the server by hours the + /// server exists, and then adding that all together for each server. + #[structable()] + pub total_vcpus_usage: f32, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum State { + // Active + #[serde(rename = "active")] + Active, + + // Building + #[serde(rename = "building")] + Building, + + // Error + #[serde(rename = "error")] + Error, + + // Paused + #[serde(rename = "paused")] + Paused, + + // Rescued + #[serde(rename = "rescued")] + Rescued, + + // Resized + #[serde(rename = "resized")] + Resized, + + // Shelved + #[serde(rename = "shelved")] + Shelved, + + // ShelvedOffloaded + #[serde(rename = "shelved_offloaded")] + ShelvedOffloaded, + + // Stopped + #[serde(rename = "stopped")] + Stopped, + + // Suspended + #[serde(rename = "suspended")] + Suspended, + + // Terminated + #[serde(rename = "terminated")] + Terminated, +} + +impl std::str::FromStr for State { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "active" => Ok(Self::Active), + "building" => Ok(Self::Building), + "error" => Ok(Self::Error), + "paused" => Ok(Self::Paused), + "rescued" => Ok(Self::Rescued), + "resized" => Ok(Self::Resized), + "shelved" => Ok(Self::Shelved), + "shelved_offloaded" => Ok(Self::ShelvedOffloaded), + "stopped" => Ok(Self::Stopped), + "suspended" => Ok(Self::Suspended), + "terminated" => Ok(Self::Terminated), + _ => Err(()), + } + } +} + +/// `ServerUsages` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ServerUsages { + pub ended_at: Option, + pub flavor: String, + pub hours: f32, + pub instance_id: String, + #[serde(default)] + pub local_gb: Option, + #[serde(default)] + pub memory_mb: Option, + pub name: String, + pub started_at: String, + pub state: State, + pub tenant_id: String, + pub uptime: u32, + #[serde(default)] + pub vcpus: Option, +} diff --git a/types/compute/src/v2/version/response/get.rs b/types/compute/src/v2/version/response/get.rs index e2df51234..5032f4c71 100644 --- a/types/compute/src/v2/version/response/get.rs +++ b/types/compute/src/v2/version/response/get.rs @@ -22,14 +22,9 @@ use structable::{StructTable, StructTableOptions}; /// Version response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct VersionResponse { - /// A common name for the version in question. Informative only, it has no - /// real semantic meaning. #[structable()] pub id: String, - /// Links to the resources in question. See - /// [API Guide / Links and References](https://docs.openstack.org/api-guide/compute/links_and_references.html) - /// for more info. #[structable(serialize)] pub links: Vec, @@ -37,28 +32,12 @@ pub struct VersionResponse { #[structable(optional, serialize, title = "media-types")] pub media_types: Option>, - /// If this version of the API supports microversions, the minimum - /// microversion that is supported. This will be the empty string if - /// microversions are not supported. #[structable()] pub min_version: String, - /// The status of this API version. This can be one of: - /// - /// - `CURRENT`: this is the preferred version of the API to use - /// - `SUPPORTED`: this is an older, but still supported version of the API - /// - `DEPRECATED`: a deprecated version of the API that is slated for - /// removal #[structable(serialize)] pub status: Status, - /// This is a fixed string. It is `2011-01-21T11:33:21Z` in version 2.0, - /// `2013-07-23T11:33:21Z` in version 2.1. - /// - /// Note - /// - /// It is vestigial and provides no useful information. It will be - /// deprecated and removed in the future. #[structable()] pub updated: String, diff --git a/types/container-infrastructure-management/src/v1/cluster/nodegroup/response.rs b/types/container-infrastructure-management/src/v1/cluster/nodegroup/response.rs index 6634bdfe0..32d099e1c 100644 --- a/types/container-infrastructure-management/src/v1/cluster/nodegroup/response.rs +++ b/types/container-infrastructure-management/src/v1/cluster/nodegroup/response.rs @@ -17,6 +17,8 @@ //! `response` REST operations of container-infrastructure-management pub mod create; +pub mod create_a; +pub mod create_b; pub mod get; pub mod list; pub mod set; diff --git a/types/container-infrastructure-management/src/v1/cluster/nodegroup/response/create_a.rs b/types/container-infrastructure-management/src/v1/cluster/nodegroup/response/create_a.rs new file mode 100644 index 000000000..adedebed8 --- /dev/null +++ b/types/container-infrastructure-management/src/v1/cluster/nodegroup/response/create_a.rs @@ -0,0 +1,247 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `clusters/nodegroups` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Nodegroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct NodegroupResponse { + #[serde(default)] + #[structable(optional)] + pub cluster_id: Option, + + #[serde(default)] + #[structable(optional)] + pub created_at: Option, + + #[serde(default)] + #[structable(optional)] + pub docker_volume_size: Option, + + #[serde(default)] + #[structable(optional)] + pub flavor_id: Option, + + #[serde(default)] + #[structable(optional)] + pub id: Option, + + #[serde(default)] + #[structable(optional)] + pub image_id: Option, + + #[serde(default)] + #[structable(optional)] + pub is_default: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub labels: Option>, + + #[serde(default)] + #[structable(optional, serialize)] + pub labels_added: Option>, + + #[serde(default)] + #[structable(optional, serialize)] + pub labels_overridden: Option>, + + #[serde(default)] + #[structable(optional, serialize)] + pub labels_skipped: Option>, + + #[serde(default)] + #[structable(optional, serialize)] + pub links: Option>, + + #[serde(default)] + #[structable(optional)] + pub max_node_count: Option, + + #[serde(default)] + #[structable(optional)] + pub merge_labels: Option, + + #[serde(default)] + #[structable(optional)] + pub min_node_count: Option, + + #[serde(default)] + #[structable(optional)] + pub name: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub node_addresses: Option>, + + #[serde(default)] + #[structable(optional)] + pub node_count: Option, + + #[serde(default)] + #[structable(optional)] + pub project_id: Option, + + #[serde(default)] + #[structable(optional)] + pub role: Option, + + #[serde(default)] + #[structable(optional)] + pub stack_id: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub status: Option, + + #[serde(default)] + #[structable(optional)] + pub status_reason: Option, + + #[serde(default)] + #[structable(optional)] + pub updated_at: Option, + + #[serde(default)] + #[structable(optional)] + pub uuid: Option, + + #[serde(default)] + #[structable(optional)] + pub version: Option, +} + +/// A link representation. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub created_at: Option, + #[serde(default)] + pub href: Option, + #[serde(default)] + pub rel: Option, + #[serde(default, rename = "type")] + pub _type: Option, + #[serde(default)] + pub updated_at: Option, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // AdoptComplete + #[serde(rename = "ADOPT_COMPLETE")] + AdoptComplete, + + // CheckComplete + #[serde(rename = "CHECK_COMPLETE")] + CheckComplete, + + // CreateComplete + #[serde(rename = "CREATE_COMPLETE")] + CreateComplete, + + // CreateFailed + #[serde(rename = "CREATE_FAILED")] + CreateFailed, + + // CreateInProgress + #[serde(rename = "CREATE_IN_PROGRESS")] + CreateInProgress, + + // DeleteComplete + #[serde(rename = "DELETE_COMPLETE")] + DeleteComplete, + + // DeleteFailed + #[serde(rename = "DELETE_FAILED")] + DeleteFailed, + + // DeleteInProgress + #[serde(rename = "DELETE_IN_PROGRESS")] + DeleteInProgress, + + // RestoreComplete + #[serde(rename = "RESTORE_COMPLETE")] + RestoreComplete, + + // ResumeComplete + #[serde(rename = "RESUME_COMPLETE")] + ResumeComplete, + + // ResumeFailed + #[serde(rename = "RESUME_FAILED")] + ResumeFailed, + + // RollbackComplete + #[serde(rename = "ROLLBACK_COMPLETE")] + RollbackComplete, + + // RollbackFailed + #[serde(rename = "ROLLBACK_FAILED")] + RollbackFailed, + + // RollbackInProgress + #[serde(rename = "ROLLBACK_IN_PROGRESS")] + RollbackInProgress, + + // SnapshotComplete + #[serde(rename = "SNAPSHOT_COMPLETE")] + SnapshotComplete, + + // UpdateComplete + #[serde(rename = "UPDATE_COMPLETE")] + UpdateComplete, + + // UpdateFailed + #[serde(rename = "UPDATE_FAILED")] + UpdateFailed, + + // UpdateInProgress + #[serde(rename = "UPDATE_IN_PROGRESS")] + UpdateInProgress, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ADOPT_COMPLETE" => Ok(Self::AdoptComplete), + "CHECK_COMPLETE" => Ok(Self::CheckComplete), + "CREATE_COMPLETE" => Ok(Self::CreateComplete), + "CREATE_FAILED" => Ok(Self::CreateFailed), + "CREATE_IN_PROGRESS" => Ok(Self::CreateInProgress), + "DELETE_COMPLETE" => Ok(Self::DeleteComplete), + "DELETE_FAILED" => Ok(Self::DeleteFailed), + "DELETE_IN_PROGRESS" => Ok(Self::DeleteInProgress), + "RESTORE_COMPLETE" => Ok(Self::RestoreComplete), + "RESUME_COMPLETE" => Ok(Self::ResumeComplete), + "RESUME_FAILED" => Ok(Self::ResumeFailed), + "ROLLBACK_COMPLETE" => Ok(Self::RollbackComplete), + "ROLLBACK_FAILED" => Ok(Self::RollbackFailed), + "ROLLBACK_IN_PROGRESS" => Ok(Self::RollbackInProgress), + "SNAPSHOT_COMPLETE" => Ok(Self::SnapshotComplete), + "UPDATE_COMPLETE" => Ok(Self::UpdateComplete), + "UPDATE_FAILED" => Ok(Self::UpdateFailed), + "UPDATE_IN_PROGRESS" => Ok(Self::UpdateInProgress), + _ => Err(()), + } + } +} diff --git a/types/container-infrastructure-management/src/v1/cluster/nodegroup/response/create_b.rs b/types/container-infrastructure-management/src/v1/cluster/nodegroup/response/create_b.rs new file mode 100644 index 000000000..adedebed8 --- /dev/null +++ b/types/container-infrastructure-management/src/v1/cluster/nodegroup/response/create_b.rs @@ -0,0 +1,247 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `clusters/nodegroups` operation + +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use structable::{StructTable, StructTableOptions}; + +/// Nodegroup response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct NodegroupResponse { + #[serde(default)] + #[structable(optional)] + pub cluster_id: Option, + + #[serde(default)] + #[structable(optional)] + pub created_at: Option, + + #[serde(default)] + #[structable(optional)] + pub docker_volume_size: Option, + + #[serde(default)] + #[structable(optional)] + pub flavor_id: Option, + + #[serde(default)] + #[structable(optional)] + pub id: Option, + + #[serde(default)] + #[structable(optional)] + pub image_id: Option, + + #[serde(default)] + #[structable(optional)] + pub is_default: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub labels: Option>, + + #[serde(default)] + #[structable(optional, serialize)] + pub labels_added: Option>, + + #[serde(default)] + #[structable(optional, serialize)] + pub labels_overridden: Option>, + + #[serde(default)] + #[structable(optional, serialize)] + pub labels_skipped: Option>, + + #[serde(default)] + #[structable(optional, serialize)] + pub links: Option>, + + #[serde(default)] + #[structable(optional)] + pub max_node_count: Option, + + #[serde(default)] + #[structable(optional)] + pub merge_labels: Option, + + #[serde(default)] + #[structable(optional)] + pub min_node_count: Option, + + #[serde(default)] + #[structable(optional)] + pub name: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub node_addresses: Option>, + + #[serde(default)] + #[structable(optional)] + pub node_count: Option, + + #[serde(default)] + #[structable(optional)] + pub project_id: Option, + + #[serde(default)] + #[structable(optional)] + pub role: Option, + + #[serde(default)] + #[structable(optional)] + pub stack_id: Option, + + #[serde(default)] + #[structable(optional, serialize)] + pub status: Option, + + #[serde(default)] + #[structable(optional)] + pub status_reason: Option, + + #[serde(default)] + #[structable(optional)] + pub updated_at: Option, + + #[serde(default)] + #[structable(optional)] + pub uuid: Option, + + #[serde(default)] + #[structable(optional)] + pub version: Option, +} + +/// A link representation. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub created_at: Option, + #[serde(default)] + pub href: Option, + #[serde(default)] + pub rel: Option, + #[serde(default, rename = "type")] + pub _type: Option, + #[serde(default)] + pub updated_at: Option, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Status { + // AdoptComplete + #[serde(rename = "ADOPT_COMPLETE")] + AdoptComplete, + + // CheckComplete + #[serde(rename = "CHECK_COMPLETE")] + CheckComplete, + + // CreateComplete + #[serde(rename = "CREATE_COMPLETE")] + CreateComplete, + + // CreateFailed + #[serde(rename = "CREATE_FAILED")] + CreateFailed, + + // CreateInProgress + #[serde(rename = "CREATE_IN_PROGRESS")] + CreateInProgress, + + // DeleteComplete + #[serde(rename = "DELETE_COMPLETE")] + DeleteComplete, + + // DeleteFailed + #[serde(rename = "DELETE_FAILED")] + DeleteFailed, + + // DeleteInProgress + #[serde(rename = "DELETE_IN_PROGRESS")] + DeleteInProgress, + + // RestoreComplete + #[serde(rename = "RESTORE_COMPLETE")] + RestoreComplete, + + // ResumeComplete + #[serde(rename = "RESUME_COMPLETE")] + ResumeComplete, + + // ResumeFailed + #[serde(rename = "RESUME_FAILED")] + ResumeFailed, + + // RollbackComplete + #[serde(rename = "ROLLBACK_COMPLETE")] + RollbackComplete, + + // RollbackFailed + #[serde(rename = "ROLLBACK_FAILED")] + RollbackFailed, + + // RollbackInProgress + #[serde(rename = "ROLLBACK_IN_PROGRESS")] + RollbackInProgress, + + // SnapshotComplete + #[serde(rename = "SNAPSHOT_COMPLETE")] + SnapshotComplete, + + // UpdateComplete + #[serde(rename = "UPDATE_COMPLETE")] + UpdateComplete, + + // UpdateFailed + #[serde(rename = "UPDATE_FAILED")] + UpdateFailed, + + // UpdateInProgress + #[serde(rename = "UPDATE_IN_PROGRESS")] + UpdateInProgress, +} + +impl std::str::FromStr for Status { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "ADOPT_COMPLETE" => Ok(Self::AdoptComplete), + "CHECK_COMPLETE" => Ok(Self::CheckComplete), + "CREATE_COMPLETE" => Ok(Self::CreateComplete), + "CREATE_FAILED" => Ok(Self::CreateFailed), + "CREATE_IN_PROGRESS" => Ok(Self::CreateInProgress), + "DELETE_COMPLETE" => Ok(Self::DeleteComplete), + "DELETE_FAILED" => Ok(Self::DeleteFailed), + "DELETE_IN_PROGRESS" => Ok(Self::DeleteInProgress), + "RESTORE_COMPLETE" => Ok(Self::RestoreComplete), + "RESUME_COMPLETE" => Ok(Self::ResumeComplete), + "RESUME_FAILED" => Ok(Self::ResumeFailed), + "ROLLBACK_COMPLETE" => Ok(Self::RollbackComplete), + "ROLLBACK_FAILED" => Ok(Self::RollbackFailed), + "ROLLBACK_IN_PROGRESS" => Ok(Self::RollbackInProgress), + "SNAPSHOT_COMPLETE" => Ok(Self::SnapshotComplete), + "UPDATE_COMPLETE" => Ok(Self::UpdateComplete), + "UPDATE_FAILED" => Ok(Self::UpdateFailed), + "UPDATE_IN_PROGRESS" => Ok(Self::UpdateInProgress), + _ => Err(()), + } + } +} diff --git a/types/container-infrastructure-management/src/v1/cluster/response.rs b/types/container-infrastructure-management/src/v1/cluster/response.rs index 6634bdfe0..6afd52304 100644 --- a/types/container-infrastructure-management/src/v1/cluster/response.rs +++ b/types/container-infrastructure-management/src/v1/cluster/response.rs @@ -16,7 +16,8 @@ // `openstack-codegenerator`. //! `response` REST operations of container-infrastructure-management -pub mod create; +pub mod create_a; +pub mod create_b; pub mod get; pub mod list; pub mod set; diff --git a/types/container-infrastructure-management/src/v1/cluster/response/create_a.rs b/types/container-infrastructure-management/src/v1/cluster/response/create_a.rs new file mode 100644 index 000000000..d46987ce7 --- /dev/null +++ b/types/container-infrastructure-management/src/v1/cluster/response/create_a.rs @@ -0,0 +1,28 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `clusters` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Cluster response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ClusterResponse { + /// The UUID of the cluster. + #[structable()] + pub uuid: String, +} diff --git a/types/container-infrastructure-management/src/v1/cluster/response/create_b.rs b/types/container-infrastructure-management/src/v1/cluster/response/create_b.rs new file mode 100644 index 000000000..d46987ce7 --- /dev/null +++ b/types/container-infrastructure-management/src/v1/cluster/response/create_b.rs @@ -0,0 +1,28 @@ +// 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 +// +// WARNING: This file is automatically generated from OpenAPI schema using +// `openstack-codegenerator`. +//! Response type for the POST `clusters` operation + +use serde::{Deserialize, Serialize}; +use structable::{StructTable, StructTableOptions}; + +/// Cluster response representation +#[derive(Clone, Deserialize, Serialize, StructTable)] +pub struct ClusterResponse { + /// The UUID of the cluster. + #[structable()] + pub uuid: String, +} diff --git a/types/dns/src/v2.rs b/types/dns/src/v2.rs index ae158540a..c276768cf 100644 --- a/types/dns/src/v2.rs +++ b/types/dns/src/v2.rs @@ -16,13 +16,8 @@ // `openstack-codegenerator`. //! `Dns` Service bindings -pub mod blacklist; pub mod limit; -pub mod pool; pub mod quota; pub mod recordset; pub mod reverse; -pub mod service_status; -pub mod tld; -pub mod tsigkey; pub mod zone; diff --git a/types/dns/src/v2/recordset/response.rs b/types/dns/src/v2/recordset/response.rs index 2db39dd76..26a39af5d 100644 --- a/types/dns/src/v2/recordset/response.rs +++ b/types/dns/src/v2/recordset/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of dns -pub mod get; pub mod list; diff --git a/types/dns/src/v2/zone.rs b/types/dns/src/v2/zone.rs index fcac2bdb5..e5e63abb8 100644 --- a/types/dns/src/v2/zone.rs +++ b/types/dns/src/v2/zone.rs @@ -20,4 +20,3 @@ pub mod nameserver; pub mod recordset; pub mod response; pub mod share; -pub mod task; diff --git a/types/identity/src/v3.rs b/types/identity/src/v3.rs index 5557e95aa..438c8ac4f 100644 --- a/types/identity/src/v3.rs +++ b/types/identity/src/v3.rs @@ -19,27 +19,18 @@ pub mod auth; pub mod credential; pub mod domain; -pub mod ec2token; pub mod endpoint; pub mod group; pub mod limit; pub mod os_ep_filter; pub mod os_federation; -pub mod os_inherit; -pub mod os_oauth1; -pub mod os_oauth2; -pub mod os_revoke; -pub mod os_simple_cert; pub mod os_trust; -pub mod policy; pub mod project; pub mod region; pub mod registered_limit; pub mod role; pub mod role_assignment; pub mod role_inference; -pub mod s3token; pub mod service; pub mod system; pub mod user; -pub mod version; diff --git a/types/identity/src/v3/auth/catalog/response.rs b/types/identity/src/v3/auth/catalog/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/auth/catalog/response.rs +++ b/types/identity/src/v3/auth/catalog/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/auth/domain/response.rs b/types/identity/src/v3/auth/domain/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/auth/domain/response.rs +++ b/types/identity/src/v3/auth/domain/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/auth/os_federation.rs b/types/identity/src/v3/auth/os_federation.rs index f21a19f5a..bdba587c2 100644 --- a/types/identity/src/v3/auth/os_federation.rs +++ b/types/identity/src/v3/auth/os_federation.rs @@ -17,5 +17,4 @@ //! `v4/federation/mapping` REST operations of identity pub mod identity_provider; -pub mod saml2; pub mod websso; diff --git a/types/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/response.rs b/types/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/response.rs index feac47e58..43dddaee3 100644 --- a/types/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/response.rs +++ b/types/identity/src/v3/auth/os_federation/identity_provider/protocol/websso/response.rs @@ -18,4 +18,3 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; diff --git a/types/identity/src/v3/auth/os_federation/websso/response.rs b/types/identity/src/v3/auth/os_federation/websso/response.rs index feac47e58..43dddaee3 100644 --- a/types/identity/src/v3/auth/os_federation/websso/response.rs +++ b/types/identity/src/v3/auth/os_federation/websso/response.rs @@ -18,4 +18,3 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; diff --git a/types/identity/src/v3/auth/project/response.rs b/types/identity/src/v3/auth/project/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/auth/project/response.rs +++ b/types/identity/src/v3/auth/project/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/auth/system/response.rs b/types/identity/src/v3/auth/system/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/auth/system/response.rs +++ b/types/identity/src/v3/auth/system/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/auth/token.rs b/types/identity/src/v3/auth/token.rs index eea7cbedf..4c08ee417 100644 --- a/types/identity/src/v3/auth/token.rs +++ b/types/identity/src/v3/auth/token.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod os_pki; pub mod response; diff --git a/types/identity/src/v3/auth/token/response.rs b/types/identity/src/v3/auth/token/response.rs index feac47e58..43dddaee3 100644 --- a/types/identity/src/v3/auth/token/response.rs +++ b/types/identity/src/v3/auth/token/response.rs @@ -18,4 +18,3 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; diff --git a/types/identity/src/v3/credential/response.rs b/types/identity/src/v3/credential/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/credential/response.rs +++ b/types/identity/src/v3/credential/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/credential/response/create.rs b/types/identity/src/v3/credential/response/create.rs index 184730f00..e45c292ee 100644 --- a/types/identity/src/v3/credential/response/create.rs +++ b/types/identity/src/v3/credential/response/create.rs @@ -32,7 +32,7 @@ pub struct CredentialResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The links for the `credential` resource. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -54,7 +54,7 @@ pub struct CredentialResponse { pub user_id: Option, } -/// The link to the resources in question. +/// The links for the `credential` resource. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/credential/response/get.rs b/types/identity/src/v3/credential/response/get.rs index 7260ba300..5c5378669 100644 --- a/types/identity/src/v3/credential/response/get.rs +++ b/types/identity/src/v3/credential/response/get.rs @@ -32,7 +32,7 @@ pub struct CredentialResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The links for the `credential` resource. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -54,7 +54,7 @@ pub struct CredentialResponse { pub user_id: Option, } -/// The link to the resources in question. +/// The links for the `credential` resource. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/credential/response/list.rs b/types/identity/src/v3/credential/response/list.rs index 91b48890e..531785290 100644 --- a/types/identity/src/v3/credential/response/list.rs +++ b/types/identity/src/v3/credential/response/list.rs @@ -49,7 +49,7 @@ pub struct CredentialResponse { pub user_id: Option, } -/// The link to the resources in question. +/// The links for the `credentials` resource. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/credential/response/set.rs b/types/identity/src/v3/credential/response/set.rs index 93ead94fa..90e8b5b74 100644 --- a/types/identity/src/v3/credential/response/set.rs +++ b/types/identity/src/v3/credential/response/set.rs @@ -32,7 +32,7 @@ pub struct CredentialResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The links for the `credential` resource. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -54,7 +54,7 @@ pub struct CredentialResponse { pub user_id: Option, } -/// The link to the resources in question. +/// The links for the `credential` resource. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/domain/config/group/option/response.rs b/types/identity/src/v3/domain/config/group/option/response.rs index 737387f0e..4e70191f4 100644 --- a/types/identity/src/v3/domain/config/group/option/response.rs +++ b/types/identity/src/v3/domain/config/group/option/response.rs @@ -18,5 +18,4 @@ //! `response` REST operations of identity pub mod default; pub mod get; -pub mod head; pub mod set; diff --git a/types/identity/src/v3/domain/config/group/response.rs b/types/identity/src/v3/domain/config/group/response.rs index 737387f0e..4e70191f4 100644 --- a/types/identity/src/v3/domain/config/group/response.rs +++ b/types/identity/src/v3/domain/config/group/response.rs @@ -18,5 +18,4 @@ //! `response` REST operations of identity pub mod default; pub mod get; -pub mod head; pub mod set; diff --git a/types/identity/src/v3/domain/config/response.rs b/types/identity/src/v3/domain/config/response.rs index fe229ba14..aef5912e7 100644 --- a/types/identity/src/v3/domain/config/response.rs +++ b/types/identity/src/v3/domain/config/response.rs @@ -17,7 +17,6 @@ //! `response` REST operations of identity pub mod default; -pub mod head; pub mod list; pub mod replace; pub mod set; diff --git a/types/identity/src/v3/domain/group/role/response.rs b/types/identity/src/v3/domain/group/role/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/domain/group/role/response.rs +++ b/types/identity/src/v3/domain/group/role/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/domain/response.rs b/types/identity/src/v3/domain/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/domain/response.rs +++ b/types/identity/src/v3/domain/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/domain/response/create.rs b/types/identity/src/v3/domain/response/create.rs index 5b90201ea..68c6afab0 100644 --- a/types/identity/src/v3/domain/response/create.rs +++ b/types/identity/src/v3/domain/response/create.rs @@ -38,12 +38,12 @@ pub struct DomainResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The links to the `domain` resource. #[serde(default)] #[structable(optional, serialize)] pub links: Option, - /// The name of the project. + /// The name of the domain. #[serde(default)] #[structable(optional)] pub name: Option, @@ -54,13 +54,12 @@ pub struct DomainResponse { #[structable(optional, serialize)] pub options: Option, - /// A list of simple strings assigned to a project. #[serde(default)] #[structable(optional, serialize)] pub tags: Option>, } -/// The link to the resources in question. +/// The links to the `domain` resource. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/domain/response/get.rs b/types/identity/src/v3/domain/response/get.rs index 8a8bfb21b..9a453187a 100644 --- a/types/identity/src/v3/domain/response/get.rs +++ b/types/identity/src/v3/domain/response/get.rs @@ -38,12 +38,12 @@ pub struct DomainResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The links to the `domain` resource. #[serde(default)] #[structable(optional, serialize)] pub links: Option, - /// The name of the project. + /// The name of the domain. #[serde(default)] #[structable(optional)] pub name: Option, @@ -54,13 +54,12 @@ pub struct DomainResponse { #[structable(optional, serialize)] pub options: Option, - /// A list of simple strings assigned to a project. #[serde(default)] #[structable(optional, serialize)] pub tags: Option>, } -/// The link to the resources in question. +/// The links to the `domain` resource. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/domain/response/list.rs b/types/identity/src/v3/domain/response/list.rs index d33feed5f..82a8c2159 100644 --- a/types/identity/src/v3/domain/response/list.rs +++ b/types/identity/src/v3/domain/response/list.rs @@ -38,24 +38,21 @@ pub struct DomainResponse { #[structable(optional)] pub id: Option, - /// The name of the project. + /// The name of the domain. #[serde(default)] #[structable(optional)] pub name: Option, - /// The resource options for the role. Available resource options are - /// `immutable`. #[serde(default)] #[structable(optional, serialize, wide)] pub options: Option, - /// A list of simple strings assigned to a project. #[serde(default)] #[structable(optional, serialize, wide)] pub tags: Option>, } -/// The link to the resources in question. +/// The links to the `domain` resource. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { @@ -63,8 +60,6 @@ pub struct Links { pub _self: Option, } -/// The resource options for the role. Available resource options are -/// `immutable`. /// `Options` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Options { diff --git a/types/identity/src/v3/domain/response/set.rs b/types/identity/src/v3/domain/response/set.rs index 13a8572e3..77cbde0be 100644 --- a/types/identity/src/v3/domain/response/set.rs +++ b/types/identity/src/v3/domain/response/set.rs @@ -38,12 +38,12 @@ pub struct DomainResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The links to the `domain` resource. #[serde(default)] #[structable(optional, serialize)] pub links: Option, - /// The name of the project. + /// The name of the domain. #[serde(default)] #[structable(optional)] pub name: Option, @@ -54,13 +54,12 @@ pub struct DomainResponse { #[structable(optional, serialize)] pub options: Option, - /// A list of simple strings assigned to a project. #[serde(default)] #[structable(optional, serialize)] pub tags: Option>, } -/// The link to the resources in question. +/// The links to the `domain` resource. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/domain/user/role/response.rs b/types/identity/src/v3/domain/user/role/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/domain/user/role/response.rs +++ b/types/identity/src/v3/domain/user/role/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/endpoint.rs b/types/identity/src/v3/endpoint.rs index d7f1730ed..0bbb7edcc 100644 --- a/types/identity/src/v3/endpoint.rs +++ b/types/identity/src/v3/endpoint.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `Identity` Service bindings -pub mod os_endpoint_policy; pub mod response; diff --git a/types/identity/src/v3/endpoint/response.rs b/types/identity/src/v3/endpoint/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/endpoint/response.rs +++ b/types/identity/src/v3/endpoint/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/endpoint/response/list.rs b/types/identity/src/v3/endpoint/response/list.rs index 03671f4cb..02af1a34d 100644 --- a/types/identity/src/v3/endpoint/response/list.rs +++ b/types/identity/src/v3/endpoint/response/list.rs @@ -22,6 +22,11 @@ use structable::{StructTable, StructTableOptions}; /// Endpoint response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct EndpointResponse { + /// The endpoint description. It is returned only when set on the resource. + #[serde(default)] + #[structable(optional, wide)] + pub description: Option, + /// Indicates whether the endpoint appears in the service catalog: - /// `false`. The endpoint does not appear in the service catalog. - `true`. /// The endpoint appears in the service catalog. @@ -43,6 +48,16 @@ pub struct EndpointResponse { #[structable(optional, serialize, wide)] pub interface: Option, + /// (Deprecated) The endpoint name. The field will only be returned in + /// responses when set on the resource. + /// + /// This field is deprecated as it provides no value. Endpoints are better + /// described by the combination of service, region and interface they + /// describe or by their ID. + #[serde(default)] + #[structable(optional)] + pub name: Option, + /// (Deprecated in v3.2) The geographic location of the service endpoint. #[serde(default)] #[structable(optional, wide)] @@ -90,3 +105,11 @@ impl std::str::FromStr for Interface { } } } + +/// The links for the `endpoints` resource. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/group/response.rs b/types/identity/src/v3/group/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/group/response.rs +++ b/types/identity/src/v3/group/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/group/response/create.rs b/types/identity/src/v3/group/response/create.rs index 7e1502771..1c6eee8b5 100644 --- a/types/identity/src/v3/group/response/create.rs +++ b/types/identity/src/v3/group/response/create.rs @@ -27,7 +27,7 @@ pub struct GroupResponse { #[structable(optional)] pub description: Option, - /// The ID of the domain. + /// The ID of the domain of the group. #[serde(default)] #[structable(optional)] pub domain_id: Option, diff --git a/types/identity/src/v3/group/response/get.rs b/types/identity/src/v3/group/response/get.rs index 23bb60fb5..415c0e4d3 100644 --- a/types/identity/src/v3/group/response/get.rs +++ b/types/identity/src/v3/group/response/get.rs @@ -27,7 +27,7 @@ pub struct GroupResponse { #[structable(optional)] pub description: Option, - /// The ID of the domain. + /// The ID of the domain of the group. #[serde(default)] #[structable(optional)] pub domain_id: Option, diff --git a/types/identity/src/v3/group/response/list.rs b/types/identity/src/v3/group/response/list.rs index 904a4b618..9e8b29bf7 100644 --- a/types/identity/src/v3/group/response/list.rs +++ b/types/identity/src/v3/group/response/list.rs @@ -27,7 +27,7 @@ pub struct GroupResponse { #[structable(optional, wide)] pub description: Option, - /// The ID of the domain. + /// The ID of the domain of the group. #[serde(default)] #[structable(optional, wide)] pub domain_id: Option, diff --git a/types/identity/src/v3/group/response/set.rs b/types/identity/src/v3/group/response/set.rs index 3a99ae2bf..3f0e9a279 100644 --- a/types/identity/src/v3/group/response/set.rs +++ b/types/identity/src/v3/group/response/set.rs @@ -27,7 +27,7 @@ pub struct GroupResponse { #[structable(optional)] pub description: Option, - /// The ID of the domain. + /// The ID of the domain of the group. #[serde(default)] #[structable(optional)] pub domain_id: Option, diff --git a/types/identity/src/v3/group/user/response.rs b/types/identity/src/v3/group/user/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/group/user/response.rs +++ b/types/identity/src/v3/group/user/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/group/user/response/list.rs b/types/identity/src/v3/group/user/response/list.rs index e9931d050..d31e2167d 100644 --- a/types/identity/src/v3/group/user/response/list.rs +++ b/types/identity/src/v3/group/user/response/list.rs @@ -36,26 +36,15 @@ pub struct UserResponse { #[structable(wide)] pub domain_id: String, - /// If the user is enabled, this value is `true`. If the user is disabled, - /// this value is `false`. + /// If the user is enabled, this value is true. If the user is disabled, + /// this value is false. #[structable(wide)] pub enabled: bool, /// List of federated objects associated with a user. Each object in the - /// list contains the `idp_id` and `protocols`. `protocols` is a list of - /// objects, each of which contains `protocol_id` and `unique_id` of the - /// protocol and user respectively. For example: - /// - /// ```text - /// "federated": [ - /// { - /// "idp_id": "efbab5a6acad4d108fec6c63d9609d83", - /// "protocols": [ - /// {"protocol_id": "mapped", "unique_id": "test@example.com"} - /// ] - /// } - /// ] - /// ``` + /// list contains the idp_id and protocols. protocols is a list of objects, + /// each of which contains protocol_id and unique_id of the protocol and + /// user respectively. #[serde(default)] #[structable(optional, serialize, wide)] pub federated: Option>, @@ -72,12 +61,8 @@ pub struct UserResponse { #[structable(optional, serialize, wide)] pub options: Option, - /// The date and time when the password expires. The time zone is UTC. - /// - /// This is a response object attribute; not valid for requests. A `null` - /// value indicates that the password never expires. - /// - /// **New in version 3.7** + /// The date and time when the password expires. The time zone is UTC. A + /// null value indicates that the password never expires. #[serde(default)] #[structable(optional, wide)] pub password_expires_at: Option, @@ -97,7 +82,7 @@ pub struct Federated { pub protocols: Vec, } -/// The links for the `user` resource. +/// Links for the collection of resources. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/limit/model/response.rs b/types/identity/src/v3/limit/model/response.rs index 255272cf4..57373026d 100644 --- a/types/identity/src/v3/limit/model/response.rs +++ b/types/identity/src/v3/limit/model/response.rs @@ -17,4 +17,3 @@ //! `response` REST operations of identity pub mod get; -pub mod head; diff --git a/types/identity/src/v3/limit/response.rs b/types/identity/src/v3/limit/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/limit/response.rs +++ b/types/identity/src/v3/limit/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/limit/response/list.rs b/types/identity/src/v3/limit/response/list.rs index 8c46fdb6d..c6cb89295 100644 --- a/types/identity/src/v3/limit/response/list.rs +++ b/types/identity/src/v3/limit/response/list.rs @@ -64,7 +64,7 @@ pub struct LimitResponse { pub service_id: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/os_ep_filter.rs b/types/identity/src/v3/os_ep_filter.rs index f86370452..3b7fd07fc 100644 --- a/types/identity/src/v3/os_ep_filter.rs +++ b/types/identity/src/v3/os_ep_filter.rs @@ -16,6 +16,4 @@ // `openstack-codegenerator`. //! `Identity` Service bindings -pub mod endpoint; pub mod endpoint_group; -pub mod project; diff --git a/types/identity/src/v3/os_ep_filter/endpoint_group.rs b/types/identity/src/v3/os_ep_filter/endpoint_group.rs index c3fb193fe..4c08ee417 100644 --- a/types/identity/src/v3/os_ep_filter/endpoint_group.rs +++ b/types/identity/src/v3/os_ep_filter/endpoint_group.rs @@ -16,6 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod endpoint; -pub mod project; pub mod response; diff --git a/types/identity/src/v3/os_ep_filter/endpoint_group/response.rs b/types/identity/src/v3/os_ep_filter/endpoint_group/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/os_ep_filter/endpoint_group/response.rs +++ b/types/identity/src/v3/os_ep_filter/endpoint_group/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/os_ep_filter/endpoint_group/response/create.rs b/types/identity/src/v3/os_ep_filter/endpoint_group/response/create.rs index 76e7d1629..60bc69c3c 100644 --- a/types/identity/src/v3/os_ep_filter/endpoint_group/response/create.rs +++ b/types/identity/src/v3/os_ep_filter/endpoint_group/response/create.rs @@ -40,7 +40,7 @@ pub struct EndpointGroupResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The link to the resource in question. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -95,7 +95,7 @@ pub struct Filters { pub service_id: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/os_ep_filter/endpoint_group/response/get.rs b/types/identity/src/v3/os_ep_filter/endpoint_group/response/get.rs index 5cda42a8f..930392cd0 100644 --- a/types/identity/src/v3/os_ep_filter/endpoint_group/response/get.rs +++ b/types/identity/src/v3/os_ep_filter/endpoint_group/response/get.rs @@ -40,7 +40,7 @@ pub struct EndpointGroupResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The link to the resource in question. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -95,7 +95,7 @@ pub struct Filters { pub service_id: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/os_ep_filter/endpoint_group/response/list.rs b/types/identity/src/v3/os_ep_filter/endpoint_group/response/list.rs index 1f5549402..51ab4bffd 100644 --- a/types/identity/src/v3/os_ep_filter/endpoint_group/response/list.rs +++ b/types/identity/src/v3/os_ep_filter/endpoint_group/response/list.rs @@ -90,7 +90,7 @@ pub struct Filters { pub service_id: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/os_ep_filter/endpoint_group/response/set.rs b/types/identity/src/v3/os_ep_filter/endpoint_group/response/set.rs index bc2ffba50..4c87c0172 100644 --- a/types/identity/src/v3/os_ep_filter/endpoint_group/response/set.rs +++ b/types/identity/src/v3/os_ep_filter/endpoint_group/response/set.rs @@ -40,7 +40,7 @@ pub struct EndpointGroupResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The link to the resource in question. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -95,7 +95,7 @@ pub struct Filters { pub service_id: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/os_federation.rs b/types/identity/src/v3/os_federation.rs index 42f792244..a296f4c0d 100644 --- a/types/identity/src/v3/os_federation.rs +++ b/types/identity/src/v3/os_federation.rs @@ -20,5 +20,4 @@ pub mod domain; pub mod identity_provider; pub mod mapping; pub mod project; -pub mod saml2; pub mod service_provider; diff --git a/types/identity/src/v3/os_federation/domain/response.rs b/types/identity/src/v3/os_federation/domain/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/os_federation/domain/response.rs +++ b/types/identity/src/v3/os_federation/domain/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/os_federation/identity_provider/protocol/auth/response.rs b/types/identity/src/v3/os_federation/identity_provider/protocol/auth/response.rs index feac47e58..43dddaee3 100644 --- a/types/identity/src/v3/os_federation/identity_provider/protocol/auth/response.rs +++ b/types/identity/src/v3/os_federation/identity_provider/protocol/auth/response.rs @@ -18,4 +18,3 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; diff --git a/types/identity/src/v3/os_federation/identity_provider/protocol/response.rs b/types/identity/src/v3/os_federation/identity_provider/protocol/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/os_federation/identity_provider/protocol/response.rs +++ b/types/identity/src/v3/os_federation/identity_provider/protocol/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/os_federation/identity_provider/protocol/response/create.rs b/types/identity/src/v3/os_federation/identity_provider/protocol/response/create.rs index 848641f68..f821389d2 100644 --- a/types/identity/src/v3/os_federation/identity_provider/protocol/response/create.rs +++ b/types/identity/src/v3/os_federation/identity_provider/protocol/response/create.rs @@ -22,16 +22,27 @@ use structable::{StructTable, StructTableOptions}; /// Protocol response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ProtocolResponse { - /// The federation protocol ID - #[serde(default)] - #[structable(optional)] - pub id: Option, + /// The resource name. + #[structable()] + pub id: String, #[serde(default)] - #[structable(optional)] - pub mapping_id: Option, + #[structable(optional, serialize)] + pub links: Option, + + #[structable()] + pub mapping_id: String, #[serde(default)] #[structable(optional)] pub remote_id_attribute: Option, } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub identity_provider: Option, + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/os_federation/identity_provider/protocol/response/get.rs b/types/identity/src/v3/os_federation/identity_provider/protocol/response/get.rs index b55699a3d..65537c270 100644 --- a/types/identity/src/v3/os_federation/identity_provider/protocol/response/get.rs +++ b/types/identity/src/v3/os_federation/identity_provider/protocol/response/get.rs @@ -22,16 +22,27 @@ use structable::{StructTable, StructTableOptions}; /// Protocol response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ProtocolResponse { - /// The federation protocol ID - #[serde(default)] - #[structable(optional)] - pub id: Option, + /// The resource name. + #[structable()] + pub id: String, #[serde(default)] - #[structable(optional)] - pub mapping_id: Option, + #[structable(optional, serialize)] + pub links: Option, + + #[structable()] + pub mapping_id: String, #[serde(default)] #[structable(optional)] pub remote_id_attribute: Option, } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub identity_provider: Option, + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/os_federation/identity_provider/protocol/response/list.rs b/types/identity/src/v3/os_federation/identity_provider/protocol/response/list.rs index e20421877..07644885d 100644 --- a/types/identity/src/v3/os_federation/identity_provider/protocol/response/list.rs +++ b/types/identity/src/v3/os_federation/identity_provider/protocol/response/list.rs @@ -22,16 +22,25 @@ use structable::{StructTable, StructTableOptions}; /// Protocol response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ProtocolResponse { - /// The federation protocol ID - #[serde(default)] - #[structable(optional)] - pub id: Option, + #[structable()] + pub id: String, - #[serde(default)] - #[structable(optional, wide)] - pub mapping_id: Option, + /// The identity provider ID + #[structable(wide)] + pub idp_id: String, + + #[structable(wide)] + pub mapping_id: String, - #[serde(default)] #[structable(optional, wide)] pub remote_id_attribute: Option, } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub identity_provider: Option, + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/os_federation/identity_provider/protocol/response/set.rs b/types/identity/src/v3/os_federation/identity_provider/protocol/response/set.rs index ba7198f96..6a0f1f242 100644 --- a/types/identity/src/v3/os_federation/identity_provider/protocol/response/set.rs +++ b/types/identity/src/v3/os_federation/identity_provider/protocol/response/set.rs @@ -22,16 +22,27 @@ use structable::{StructTable, StructTableOptions}; /// Protocol response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ProtocolResponse { - /// The federation protocol ID - #[serde(default)] - #[structable(optional)] - pub id: Option, + /// The resource name. + #[structable()] + pub id: String, #[serde(default)] - #[structable(optional)] - pub mapping_id: Option, + #[structable(optional, serialize)] + pub links: Option, + + #[structable()] + pub mapping_id: String, #[serde(default)] #[structable(optional)] pub remote_id_attribute: Option, } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub identity_provider: Option, + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/os_federation/identity_provider/response.rs b/types/identity/src/v3/os_federation/identity_provider/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/os_federation/identity_provider/response.rs +++ b/types/identity/src/v3/os_federation/identity_provider/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/os_federation/identity_provider/response/create.rs b/types/identity/src/v3/os_federation/identity_provider/response/create.rs index b6e65ac20..3988a32b0 100644 --- a/types/identity/src/v3/os_federation/identity_provider/response/create.rs +++ b/types/identity/src/v3/os_federation/identity_provider/response/create.rs @@ -23,33 +23,42 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct IdentityProviderResponse { /// The length of validity in minutes for group memberships carried over - /// through mapping and persisted in the database. + /// through mapping and persisted in the database. If left unset, the + /// default value configured in keystone will be used, if enabled. #[serde(default)] #[structable(optional)] - pub authorization_ttl: Option, + pub authorization_ttl: Option, - /// The Identity Provider description + /// The identity provider description #[serde(default)] #[structable(optional)] pub description: Option, - /// The ID of a domain that is associated with the Identity Provider. - #[serde(default)] - #[structable(optional)] - pub domain_id: Option, - - /// Whether the Identity Provider is enabled or not + /// Whether the identity provider is enabled or not #[serde(default)] #[structable(optional)] pub enabled: Option, - /// The Identity Provider unique ID + /// The identity provider ID #[serde(default)] #[structable(optional)] pub id: Option, - /// List of the unique Identity Provider’s remote IDs + #[serde(default)] + #[structable(optional, serialize)] + pub links: Option, + + /// List of the unique identity provider's remote IDs #[serde(default)] #[structable(optional, serialize)] pub remote_ids: Option>, } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub protocols: Option, + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/os_federation/identity_provider/response/get.rs b/types/identity/src/v3/os_federation/identity_provider/response/get.rs index 331d633af..3a5862f1f 100644 --- a/types/identity/src/v3/os_federation/identity_provider/response/get.rs +++ b/types/identity/src/v3/os_federation/identity_provider/response/get.rs @@ -23,33 +23,42 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct IdentityProviderResponse { /// The length of validity in minutes for group memberships carried over - /// through mapping and persisted in the database. + /// through mapping and persisted in the database. If left unset, the + /// default value configured in keystone will be used, if enabled. #[serde(default)] #[structable(optional)] - pub authorization_ttl: Option, + pub authorization_ttl: Option, - /// The Identity Provider description + /// The identity provider description #[serde(default)] #[structable(optional)] pub description: Option, - /// The ID of a domain that is associated with the Identity Provider. - #[serde(default)] - #[structable(optional)] - pub domain_id: Option, - - /// Whether the Identity Provider is enabled or not + /// Whether the identity provider is enabled or not #[serde(default)] #[structable(optional)] pub enabled: Option, - /// The Identity Provider unique ID + /// The identity provider ID #[serde(default)] #[structable(optional)] pub id: Option, - /// List of the unique Identity Provider’s remote IDs + #[serde(default)] + #[structable(optional, serialize)] + pub links: Option, + + /// List of the unique identity provider's remote IDs #[serde(default)] #[structable(optional, serialize)] pub remote_ids: Option>, } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub protocols: Option, + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/os_federation/identity_provider/response/list.rs b/types/identity/src/v3/os_federation/identity_provider/response/list.rs index 8ac28ba04..0fc9cdc49 100644 --- a/types/identity/src/v3/os_federation/identity_provider/response/list.rs +++ b/types/identity/src/v3/os_federation/identity_provider/response/list.rs @@ -23,33 +23,38 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct IdentityProviderResponse { /// The length of validity in minutes for group memberships carried over - /// through mapping and persisted in the database. + /// through mapping and persisted in the database. If left unset, the + /// default value configured in keystone will be used, if enabled. #[serde(default)] #[structable(optional, wide)] - pub authorization_ttl: Option, + pub authorization_ttl: Option, - /// The Identity Provider description + /// The identity provider description #[serde(default)] #[structable(optional, wide)] pub description: Option, - /// The ID of a domain that is associated with the Identity Provider. - #[serde(default)] - #[structable(optional, wide)] - pub domain_id: Option, - - /// Whether the Identity Provider is enabled or not + /// Whether the identity provider is enabled or not #[serde(default)] #[structable(optional, wide)] pub enabled: Option, - /// The Identity Provider unique ID + /// The identity provider ID #[serde(default)] #[structable(optional)] pub id: Option, - /// List of the unique Identity Provider’s remote IDs + /// List of the unique identity provider's remote IDs #[serde(default)] #[structable(optional, serialize, wide)] pub remote_ids: Option>, } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub protocols: Option, + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/os_federation/identity_provider/response/set.rs b/types/identity/src/v3/os_federation/identity_provider/response/set.rs index e8d1f4863..2acedaaaa 100644 --- a/types/identity/src/v3/os_federation/identity_provider/response/set.rs +++ b/types/identity/src/v3/os_federation/identity_provider/response/set.rs @@ -23,33 +23,42 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct IdentityProviderResponse { /// The length of validity in minutes for group memberships carried over - /// through mapping and persisted in the database. + /// through mapping and persisted in the database. If left unset, the + /// default value configured in keystone will be used, if enabled. #[serde(default)] #[structable(optional)] - pub authorization_ttl: Option, + pub authorization_ttl: Option, - /// The Identity Provider description + /// The identity provider description #[serde(default)] #[structable(optional)] pub description: Option, - /// The ID of a domain that is associated with the Identity Provider. - #[serde(default)] - #[structable(optional)] - pub domain_id: Option, - - /// Whether the Identity Provider is enabled or not + /// Whether the identity provider is enabled or not #[serde(default)] #[structable(optional)] pub enabled: Option, - /// The Identity Provider unique ID + /// The identity provider ID #[serde(default)] #[structable(optional)] pub id: Option, - /// List of the unique Identity Provider’s remote IDs + #[serde(default)] + #[structable(optional, serialize)] + pub links: Option, + + /// List of the unique identity provider's remote IDs #[serde(default)] #[structable(optional, serialize)] pub remote_ids: Option>, } + +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default)] + pub protocols: Option, + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/os_federation/mapping/response.rs b/types/identity/src/v3/os_federation/mapping/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/os_federation/mapping/response.rs +++ b/types/identity/src/v3/os_federation/mapping/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/os_federation/project/response.rs b/types/identity/src/v3/os_federation/project/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/os_federation/project/response.rs +++ b/types/identity/src/v3/os_federation/project/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/os_federation/service_provider/response.rs b/types/identity/src/v3/os_federation/service_provider/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/os_federation/service_provider/response.rs +++ b/types/identity/src/v3/os_federation/service_provider/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/os_federation/service_provider/response/create.rs b/types/identity/src/v3/os_federation/service_provider/response/create.rs index 9eb3a9510..9079fc3dd 100644 --- a/types/identity/src/v3/os_federation/service_provider/response/create.rs +++ b/types/identity/src/v3/os_federation/service_provider/response/create.rs @@ -42,7 +42,7 @@ pub struct ServiceProviderResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The link to the resource in question. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -58,7 +58,7 @@ pub struct ServiceProviderResponse { pub sp_url: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/os_federation/service_provider/response/get.rs b/types/identity/src/v3/os_federation/service_provider/response/get.rs index 4b0631c3c..0b6e577ce 100644 --- a/types/identity/src/v3/os_federation/service_provider/response/get.rs +++ b/types/identity/src/v3/os_federation/service_provider/response/get.rs @@ -42,7 +42,7 @@ pub struct ServiceProviderResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The link to the resource in question. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -58,7 +58,7 @@ pub struct ServiceProviderResponse { pub sp_url: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/os_federation/service_provider/response/list.rs b/types/identity/src/v3/os_federation/service_provider/response/list.rs index e48341cb8..2210d087b 100644 --- a/types/identity/src/v3/os_federation/service_provider/response/list.rs +++ b/types/identity/src/v3/os_federation/service_provider/response/list.rs @@ -53,7 +53,7 @@ pub struct ServiceProviderResponse { pub sp_url: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/os_federation/service_provider/response/set.rs b/types/identity/src/v3/os_federation/service_provider/response/set.rs index a99152e77..a57497fb6 100644 --- a/types/identity/src/v3/os_federation/service_provider/response/set.rs +++ b/types/identity/src/v3/os_federation/service_provider/response/set.rs @@ -42,7 +42,7 @@ pub struct ServiceProviderResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The link to the resource in question. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -58,7 +58,7 @@ pub struct ServiceProviderResponse { pub sp_url: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/os_trust/trust.rs b/types/identity/src/v3/os_trust/trust.rs index 49089e675..4c08ee417 100644 --- a/types/identity/src/v3/os_trust/trust.rs +++ b/types/identity/src/v3/os_trust/trust.rs @@ -17,4 +17,3 @@ //! `response` REST operations of identity pub mod response; -pub mod role; diff --git a/types/identity/src/v3/os_trust/trust/response.rs b/types/identity/src/v3/os_trust/trust/response.rs index 49d089f0f..2927e22bc 100644 --- a/types/identity/src/v3/os_trust/trust/response.rs +++ b/types/identity/src/v3/os_trust/trust/response.rs @@ -18,5 +18,4 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; diff --git a/types/identity/src/v3/os_trust/trust/response/create.rs b/types/identity/src/v3/os_trust/trust/response/create.rs index a046ee346..3ddb80518 100644 --- a/types/identity/src/v3/os_trust/trust/response/create.rs +++ b/types/identity/src/v3/os_trust/trust/response/create.rs @@ -57,7 +57,7 @@ pub struct TrustResponse { #[structable(optional)] pub impersonation: Option, - /// The links for the `user` resource. + /// Links for the collection of resources. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -110,7 +110,7 @@ pub struct TrustResponse { #[structable(optional, serialize)] pub roles: Option>, - /// The links for the `user` resource. + /// Links for the collection of resources. #[serde(default)] #[structable(optional, serialize)] pub roles_links: Option, @@ -127,7 +127,7 @@ pub struct TrustResponse { pub trustor_user_id: Option, } -/// The links for the `user` resource. +/// Links for the collection of resources. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { @@ -163,7 +163,7 @@ pub struct Roles { pub options: Option, } -/// The links for the `user` resource. +/// Links for the collection of resources. /// `RolesLinks` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct RolesLinks { diff --git a/types/identity/src/v3/os_trust/trust/response/get.rs b/types/identity/src/v3/os_trust/trust/response/get.rs index efa1d2a0f..93d945f29 100644 --- a/types/identity/src/v3/os_trust/trust/response/get.rs +++ b/types/identity/src/v3/os_trust/trust/response/get.rs @@ -57,7 +57,7 @@ pub struct TrustResponse { #[structable(optional)] pub impersonation: Option, - /// The links for the `user` resource. + /// Links for the collection of resources. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -110,7 +110,7 @@ pub struct TrustResponse { #[structable(optional, serialize)] pub roles: Option>, - /// The links for the `user` resource. + /// Links for the collection of resources. #[serde(default)] #[structable(optional, serialize)] pub roles_links: Option, @@ -127,7 +127,7 @@ pub struct TrustResponse { pub trustor_user_id: Option, } -/// The links for the `user` resource. +/// Links for the collection of resources. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { @@ -163,7 +163,7 @@ pub struct Roles { pub options: Option, } -/// The links for the `user` resource. +/// Links for the collection of resources. /// `RolesLinks` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct RolesLinks { diff --git a/types/identity/src/v3/os_trust/trust/response/list.rs b/types/identity/src/v3/os_trust/trust/response/list.rs index 86dd95325..0a8ee1b54 100644 --- a/types/identity/src/v3/os_trust/trust/response/list.rs +++ b/types/identity/src/v3/os_trust/trust/response/list.rs @@ -105,7 +105,7 @@ pub struct TrustResponse { #[structable(optional, serialize, wide)] pub roles: Option>, - /// The links for the `user` resource. + /// Links for the collection of resources. #[serde(default)] #[structable(optional, serialize, wide)] pub roles_links: Option, @@ -122,7 +122,7 @@ pub struct TrustResponse { pub trustor_user_id: Option, } -/// The links for the `user` resource. +/// Links for the collection of resources. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { @@ -158,7 +158,7 @@ pub struct Roles { pub options: Option, } -/// The links for the `user` resource. +/// Links for the collection of resources. /// `RolesLinks` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct RolesLinks { diff --git a/types/identity/src/v3/project/group/role/response.rs b/types/identity/src/v3/project/group/role/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/project/group/role/response.rs +++ b/types/identity/src/v3/project/group/role/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/project/response.rs b/types/identity/src/v3/project/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/project/response.rs +++ b/types/identity/src/v3/project/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/project/response/create.rs b/types/identity/src/v3/project/response/create.rs index e5d7eae1d..f3856be05 100644 --- a/types/identity/src/v3/project/response/create.rs +++ b/types/identity/src/v3/project/response/create.rs @@ -32,8 +32,8 @@ pub struct ProjectResponse { #[structable(optional)] pub domain_id: Option, - /// If the user is enabled, this value is `true`. If the user is disabled, - /// this value is `false`. + /// If set to `true`, project is enabled. If set to `false`, project is + /// disabled. #[serde(default)] #[structable(optional)] pub enabled: Option, @@ -43,8 +43,8 @@ pub struct ProjectResponse { #[structable(optional)] pub id: Option, - /// If the user is enabled, this value is `true`. If the user is disabled, - /// this value is `false`. + /// If set to `true`, project is enabled. If set to `false`, project is + /// disabled. #[serde(default)] #[structable(optional)] pub is_domain: Option, @@ -72,7 +72,6 @@ pub struct ProjectResponse { #[structable(optional)] pub parent_id: Option, - /// A list of simple strings assigned to a project. #[serde(default)] #[structable(optional, serialize)] pub tags: Option>, diff --git a/types/identity/src/v3/project/response/get.rs b/types/identity/src/v3/project/response/get.rs index 20f956e95..93fb3b931 100644 --- a/types/identity/src/v3/project/response/get.rs +++ b/types/identity/src/v3/project/response/get.rs @@ -32,8 +32,8 @@ pub struct ProjectResponse { #[structable(optional)] pub domain_id: Option, - /// If the user is enabled, this value is `true`. If the user is disabled, - /// this value is `false`. + /// If set to `true`, project is enabled. If set to `false`, project is + /// disabled. #[serde(default)] #[structable(optional)] pub enabled: Option, @@ -43,8 +43,8 @@ pub struct ProjectResponse { #[structable(optional)] pub id: Option, - /// If the user is enabled, this value is `true`. If the user is disabled, - /// this value is `false`. + /// If set to `true`, project is enabled. If set to `false`, project is + /// disabled. #[serde(default)] #[structable(optional)] pub is_domain: Option, @@ -72,7 +72,6 @@ pub struct ProjectResponse { #[structable(optional)] pub parent_id: Option, - /// A list of simple strings assigned to a project. #[serde(default)] #[structable(optional, serialize)] pub tags: Option>, diff --git a/types/identity/src/v3/project/response/list.rs b/types/identity/src/v3/project/response/list.rs index ab5bea916..743c03ed2 100644 --- a/types/identity/src/v3/project/response/list.rs +++ b/types/identity/src/v3/project/response/list.rs @@ -32,8 +32,8 @@ pub struct ProjectResponse { #[structable(optional, wide)] pub domain_id: Option, - /// If the user is enabled, this value is `true`. If the user is disabled, - /// this value is `false`. + /// If set to `true`, project is enabled. If set to `false`, project is + /// disabled. #[serde(default)] #[structable(optional, wide)] pub enabled: Option, @@ -43,8 +43,8 @@ pub struct ProjectResponse { #[structable(optional)] pub id: Option, - /// If the user is enabled, this value is `true`. If the user is disabled, - /// this value is `false`. + /// If set to `true`, project is enabled. If set to `false`, project is + /// disabled. #[serde(default)] #[structable(optional, wide)] pub is_domain: Option, @@ -54,8 +54,6 @@ pub struct ProjectResponse { #[structable(optional)] pub name: Option, - /// The resource options for the project. Available resource options are - /// `immutable`. #[serde(default)] #[structable(optional, serialize, wide)] pub options: Option, @@ -81,8 +79,6 @@ pub struct Links { pub _self: Option, } -/// The resource options for the project. Available resource options are -/// `immutable`. /// `Options` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Options { diff --git a/types/identity/src/v3/project/response/set.rs b/types/identity/src/v3/project/response/set.rs index 27296e80f..2e600e452 100644 --- a/types/identity/src/v3/project/response/set.rs +++ b/types/identity/src/v3/project/response/set.rs @@ -32,8 +32,8 @@ pub struct ProjectResponse { #[structable(optional)] pub domain_id: Option, - /// If the user is enabled, this value is `true`. If the user is disabled, - /// this value is `false`. + /// If set to `true`, project is enabled. If set to `false`, project is + /// disabled. #[serde(default)] #[structable(optional)] pub enabled: Option, @@ -43,8 +43,8 @@ pub struct ProjectResponse { #[structable(optional)] pub id: Option, - /// If the user is enabled, this value is `true`. If the user is disabled, - /// this value is `false`. + /// If set to `true`, project is enabled. If set to `false`, project is + /// disabled. #[serde(default)] #[structable(optional)] pub is_domain: Option, @@ -72,7 +72,6 @@ pub struct ProjectResponse { #[structable(optional)] pub parent_id: Option, - /// A list of simple strings assigned to a project. #[serde(default)] #[structable(optional, serialize)] pub tags: Option>, diff --git a/types/identity/src/v3/project/tag/response.rs b/types/identity/src/v3/project/tag/response.rs index dbe8534f4..227eaa57a 100644 --- a/types/identity/src/v3/project/tag/response.rs +++ b/types/identity/src/v3/project/tag/response.rs @@ -16,6 +16,5 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; pub mod replace; diff --git a/types/identity/src/v3/project/user/role/response.rs b/types/identity/src/v3/project/user/role/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/project/user/role/response.rs +++ b/types/identity/src/v3/project/user/role/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/region/response.rs b/types/identity/src/v3/region/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/region/response.rs +++ b/types/identity/src/v3/region/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/region/response/list.rs b/types/identity/src/v3/region/response/list.rs index 61d0a08c0..b33ce1a70 100644 --- a/types/identity/src/v3/region/response/list.rs +++ b/types/identity/src/v3/region/response/list.rs @@ -23,18 +23,23 @@ use structable::{StructTable, StructTableOptions}; #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct RegionResponse { /// The region description. - #[serde(default)] #[structable(optional, wide)] pub description: Option, /// The ID for the region. - #[serde(default)] #[structable(optional)] pub id: Option, /// To make this region a child of another region, set this parameter to /// the ID of the parent region. - #[serde(default)] #[structable(optional, wide)] - pub parent_id: Option, + pub parent_region_id: Option, +} + +/// The link to the resource in question. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default, rename = "self")] + pub _self: Option, } diff --git a/types/identity/src/v3/registered_limit/response.rs b/types/identity/src/v3/registered_limit/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/registered_limit/response.rs +++ b/types/identity/src/v3/registered_limit/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/registered_limit/response/list.rs b/types/identity/src/v3/registered_limit/response/list.rs index 773338eb9..282e1191c 100644 --- a/types/identity/src/v3/registered_limit/response/list.rs +++ b/types/identity/src/v3/registered_limit/response/list.rs @@ -54,7 +54,7 @@ pub struct RegisteredLimitResponse { pub service_id: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/role/imply/response.rs b/types/identity/src/v3/role/imply/response.rs index c95076cf5..48f18f6fe 100644 --- a/types/identity/src/v3/role/imply/response.rs +++ b/types/identity/src/v3/role/imply/response.rs @@ -17,6 +17,5 @@ //! `response` REST operations of identity pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/role/imply/response/get.rs b/types/identity/src/v3/role/imply/response/get.rs index 802804d43..b1a7ae380 100644 --- a/types/identity/src/v3/role/imply/response/get.rs +++ b/types/identity/src/v3/role/imply/response/get.rs @@ -22,49 +22,77 @@ use structable::{StructTable, StructTableOptions}; /// Imply response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ImplyResponse { - /// A prior role object. + /// Links for the collection of resources. #[serde(default)] #[structable(optional, serialize)] - pub implies: Option, + pub links: Option, - /// A prior role object. + /// Role inference object that contains `prior_role` object and `implies` + /// object. #[serde(default)] #[structable(optional, serialize)] - pub prior_role: Option, + pub role_inference: Option, } -/// The link to the resources in question. +/// Links for the collection of resources. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { + #[serde(default)] + pub next: Option, + #[serde(default)] + pub previous: Option, + #[serde(rename = "self")] + pub _self: String, +} + +/// The link to the resource in question. +/// `ImpliesLinks` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ImpliesLinks { #[serde(default, rename = "self")] pub _self: Option, } -/// A prior role object. +/// An implied role object. /// `Implies` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Implies { - #[serde(default)] - pub description: Option, #[serde(default)] pub id: Option, #[serde(default)] - pub links: Option, + pub links: Option, #[serde(default)] pub name: Option, } +/// The link to the resources in question. +/// `PriorRoleLinks` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct PriorRoleLinks { + #[serde(default, rename = "self")] + pub _self: Option, +} + /// A prior role object. /// `PriorRole` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct PriorRole { - #[serde(default)] - pub description: Option, #[serde(default)] pub id: Option, #[serde(default)] - pub links: Option, + pub links: Option, #[serde(default)] pub name: Option, } + +/// Role inference object that contains `prior_role` object and `implies` +/// object. +/// `RoleInference` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct RoleInference { + #[serde(default)] + pub implies: Option, + #[serde(default)] + pub prior_role: Option, +} diff --git a/types/identity/src/v3/role/imply/response/list.rs b/types/identity/src/v3/role/imply/response/list.rs index dc90100d5..50d26f9e8 100644 --- a/types/identity/src/v3/role/imply/response/list.rs +++ b/types/identity/src/v3/role/imply/response/list.rs @@ -33,7 +33,7 @@ pub struct ImplyResponse { pub prior_role: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { @@ -41,12 +41,10 @@ pub struct Links { pub _self: Option, } -/// A prior role object. +/// An implied role object. /// `Implies` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Implies { - #[serde(default)] - pub description: Option, #[serde(default)] pub id: Option, #[serde(default)] @@ -55,16 +53,22 @@ pub struct Implies { pub name: Option, } +/// The link to the resources in question. +/// `PriorRoleLinks` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct PriorRoleLinks { + #[serde(default, rename = "self")] + pub _self: Option, +} + /// A prior role object. /// `PriorRole` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct PriorRole { - #[serde(default)] - pub description: Option, #[serde(default)] pub id: Option, #[serde(default)] - pub links: Option, + pub links: Option, #[serde(default)] pub name: Option, } diff --git a/types/identity/src/v3/role/imply/response/set.rs b/types/identity/src/v3/role/imply/response/set.rs index 4437190f3..d067e7575 100644 --- a/types/identity/src/v3/role/imply/response/set.rs +++ b/types/identity/src/v3/role/imply/response/set.rs @@ -22,49 +22,77 @@ use structable::{StructTable, StructTableOptions}; /// Imply response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ImplyResponse { - /// A prior role object. + /// Links for the collection of resources. #[serde(default)] #[structable(optional, serialize)] - pub implies: Option, + pub links: Option, - /// A prior role object. + /// Role inference object that contains `prior_role` object and `implies` + /// object. #[serde(default)] #[structable(optional, serialize)] - pub prior_role: Option, + pub role_inference: Option, } -/// The link to the resources in question. +/// Links for the collection of resources. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { + #[serde(default)] + pub next: Option, + #[serde(default)] + pub previous: Option, + #[serde(rename = "self")] + pub _self: String, +} + +/// The link to the resource in question. +/// `ImpliesLinks` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ImpliesLinks { #[serde(default, rename = "self")] pub _self: Option, } -/// A prior role object. +/// An implied role object. /// `Implies` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Implies { - #[serde(default)] - pub description: Option, #[serde(default)] pub id: Option, #[serde(default)] - pub links: Option, + pub links: Option, #[serde(default)] pub name: Option, } +/// The link to the resources in question. +/// `PriorRoleLinks` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct PriorRoleLinks { + #[serde(default, rename = "self")] + pub _self: Option, +} + /// A prior role object. /// `PriorRole` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct PriorRole { - #[serde(default)] - pub description: Option, #[serde(default)] pub id: Option, #[serde(default)] - pub links: Option, + pub links: Option, #[serde(default)] pub name: Option, } + +/// Role inference object that contains `prior_role` object and `implies` +/// object. +/// `RoleInference` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct RoleInference { + #[serde(default)] + pub implies: Option, + #[serde(default)] + pub prior_role: Option, +} diff --git a/types/identity/src/v3/role/response.rs b/types/identity/src/v3/role/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/role/response.rs +++ b/types/identity/src/v3/role/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/role/response/list.rs b/types/identity/src/v3/role/response/list.rs index b634615db..d4d89f3d7 100644 --- a/types/identity/src/v3/role/response/list.rs +++ b/types/identity/src/v3/role/response/list.rs @@ -42,15 +42,19 @@ pub struct RoleResponse { #[structable(optional)] pub name: Option, - /// The resource options for the role. Available resource options are - /// `immutable`. #[serde(default)] #[structable(optional, serialize, wide)] pub options: Option, } -/// The resource options for the role. Available resource options are -/// `immutable`. +/// The link to the resource in question. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default, rename = "self")] + pub _self: Option, +} + /// `Options` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Options { diff --git a/types/identity/src/v3/role_assignment/response.rs b/types/identity/src/v3/role_assignment/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/role_assignment/response.rs +++ b/types/identity/src/v3/role_assignment/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/role_inference/response.rs b/types/identity/src/v3/role_inference/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/role_inference/response.rs +++ b/types/identity/src/v3/role_inference/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/role_inference/response/list.rs b/types/identity/src/v3/role_inference/response/list.rs index 2a3dce80a..82e086bba 100644 --- a/types/identity/src/v3/role_inference/response/list.rs +++ b/types/identity/src/v3/role_inference/response/list.rs @@ -41,12 +41,10 @@ pub struct Links { pub _self: Option, } -/// A prior role object. +/// An implied role object. /// `Implies` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Implies { - #[serde(default)] - pub description: Option, #[serde(default)] pub id: Option, #[serde(default)] @@ -59,8 +57,6 @@ pub struct Implies { /// `PriorRole` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct PriorRole { - #[serde(default)] - pub description: Option, #[serde(default)] pub id: Option, #[serde(default)] diff --git a/types/identity/src/v3/service/response.rs b/types/identity/src/v3/service/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/service/response.rs +++ b/types/identity/src/v3/service/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/service/response/create.rs b/types/identity/src/v3/service/response/create.rs index 4d01eeefb..7e7363668 100644 --- a/types/identity/src/v3/service/response/create.rs +++ b/types/identity/src/v3/service/response/create.rs @@ -28,9 +28,7 @@ pub struct ServiceResponse { pub description: Option, /// Defines whether the service and its endpoints appear in the service - /// catalog: - `false`. The service and its endpoints do not appear in the - /// service catalog. - `true`. The service and its endpoints appear in the - /// service catalog. + /// catalog. #[serde(default)] #[structable(optional)] pub enabled: Option, diff --git a/types/identity/src/v3/service/response/get.rs b/types/identity/src/v3/service/response/get.rs index 78ff61bcc..7534012a2 100644 --- a/types/identity/src/v3/service/response/get.rs +++ b/types/identity/src/v3/service/response/get.rs @@ -28,9 +28,7 @@ pub struct ServiceResponse { pub description: Option, /// Defines whether the service and its endpoints appear in the service - /// catalog: - `false`. The service and its endpoints do not appear in the - /// service catalog. - `true`. The service and its endpoints appear in the - /// service catalog. + /// catalog. #[serde(default)] #[structable(optional)] pub enabled: Option, diff --git a/types/identity/src/v3/service/response/list.rs b/types/identity/src/v3/service/response/list.rs index f854eb21d..50cf34567 100644 --- a/types/identity/src/v3/service/response/list.rs +++ b/types/identity/src/v3/service/response/list.rs @@ -22,11 +22,6 @@ use structable::{StructTable, StructTableOptions}; /// Service response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ServiceResponse { - /// The service description. - #[serde(default)] - #[structable(optional, wide)] - pub description: Option, - /// Defines whether the service and its endpoints appear in the service /// catalog: - `false`. The service and its endpoints do not appear in the /// service catalog. - `true`. The service and its endpoints appear in the @@ -51,3 +46,11 @@ pub struct ServiceResponse { #[structable(optional, title = "type", wide)] pub _type: Option, } + +/// The links for the `service` resource. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default, rename = "self")] + pub _self: Option, +} diff --git a/types/identity/src/v3/service/response/set.rs b/types/identity/src/v3/service/response/set.rs index 1a0b90091..cbaffa64e 100644 --- a/types/identity/src/v3/service/response/set.rs +++ b/types/identity/src/v3/service/response/set.rs @@ -28,9 +28,7 @@ pub struct ServiceResponse { pub description: Option, /// Defines whether the service and its endpoints appear in the service - /// catalog: - `false`. The service and its endpoints do not appear in the - /// service catalog. - `true`. The service and its endpoints appear in the - /// service catalog. + /// catalog. #[serde(default)] #[structable(optional)] pub enabled: Option, diff --git a/types/identity/src/v3/system/group/role/response.rs b/types/identity/src/v3/system/group/role/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/system/group/role/response.rs +++ b/types/identity/src/v3/system/group/role/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/system/group/role/response/list.rs b/types/identity/src/v3/system/group/role/response/list.rs index 11f030239..e94fa3909 100644 --- a/types/identity/src/v3/system/group/role/response/list.rs +++ b/types/identity/src/v3/system/group/role/response/list.rs @@ -47,7 +47,7 @@ pub struct RoleResponse { pub options: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/system/user/role/response.rs b/types/identity/src/v3/system/user/role/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/system/user/role/response.rs +++ b/types/identity/src/v3/system/user/role/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/system/user/role/response/list.rs b/types/identity/src/v3/system/user/role/response/list.rs index be9ae2bd5..0833f7295 100644 --- a/types/identity/src/v3/system/user/role/response/list.rs +++ b/types/identity/src/v3/system/user/role/response/list.rs @@ -47,7 +47,7 @@ pub struct RoleResponse { pub options: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/user.rs b/types/identity/src/v3/user.rs index 63e5d49b7..b60085d03 100644 --- a/types/identity/src/v3/user.rs +++ b/types/identity/src/v3/user.rs @@ -18,8 +18,6 @@ //! `Identity` Service bindings pub mod access_rule; pub mod application_credential; -pub mod credential; pub mod group; -pub mod os_oauth1; pub mod project; pub mod response; diff --git a/types/identity/src/v3/user/access_rule/response.rs b/types/identity/src/v3/user/access_rule/response.rs index a9ac725df..96bf3eba2 100644 --- a/types/identity/src/v3/user/access_rule/response.rs +++ b/types/identity/src/v3/user/access_rule/response.rs @@ -17,5 +17,4 @@ //! `response` REST operations of identity pub mod get; -pub mod head; pub mod list; diff --git a/types/identity/src/v3/user/access_rule/response/get.rs b/types/identity/src/v3/user/access_rule/response/get.rs index cc40b690e..334643014 100644 --- a/types/identity/src/v3/user/access_rule/response/get.rs +++ b/types/identity/src/v3/user/access_rule/response/get.rs @@ -27,7 +27,7 @@ pub struct AccessRuleResponse { #[structable(optional)] pub id: Option, - /// The link to the resources in question. + /// The link to the resource in question. #[serde(default)] #[structable(optional, serialize)] pub links: Option, @@ -51,7 +51,7 @@ pub struct AccessRuleResponse { pub service: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/user/access_rule/response/list.rs b/types/identity/src/v3/user/access_rule/response/list.rs index 21edab078..1f641e7b7 100644 --- a/types/identity/src/v3/user/access_rule/response/list.rs +++ b/types/identity/src/v3/user/access_rule/response/list.rs @@ -46,7 +46,7 @@ pub struct AccessRuleResponse { pub service: Option, } -/// The link to the resources in question. +/// The link to the resource in question. /// `Links` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Links { diff --git a/types/identity/src/v3/user/application_credential/response.rs b/types/identity/src/v3/user/application_credential/response.rs index 49d089f0f..2927e22bc 100644 --- a/types/identity/src/v3/user/application_credential/response.rs +++ b/types/identity/src/v3/user/application_credential/response.rs @@ -18,5 +18,4 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; diff --git a/types/identity/src/v3/user/application_credential/response/create.rs b/types/identity/src/v3/user/application_credential/response/create.rs index 6566abd91..cd9111a6f 100644 --- a/types/identity/src/v3/user/application_credential/response/create.rs +++ b/types/identity/src/v3/user/application_credential/response/create.rs @@ -17,12 +17,14 @@ //! Response type for the POST `users/{user_id}/application_credentials` operation use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; /// ApplicationCredential response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ApplicationCredentialResponse { - /// A list of access_rules objects + /// A list of access_rules objects. #[serde(default)] #[structable(optional, serialize)] pub access_rules: Option>, @@ -32,15 +34,22 @@ pub struct ApplicationCredentialResponse { #[structable(optional)] pub description: Option, + /// The expiration time of the application credential, if one was + /// specified. #[serde(default)] #[structable(optional)] pub expires_at: Option, - /// The ID of the application credential. + /// The UUID of the application credential #[serde(default)] #[structable(optional)] pub id: Option, + /// The link to the resource in question. + #[serde(default)] + #[structable(optional, serialize)] + pub links: Option, + /// The name of the application credential. Must be unique to a user. #[serde(default)] #[structable(optional)] @@ -53,28 +62,74 @@ pub struct ApplicationCredentialResponse { #[structable(optional)] pub project_id: Option, - /// An optional list of role objects, identified by ID or name. The list - /// may only contain roles that the user has assigned on the project. If - /// not provided, the roles assigned to the application credential will be - /// the same as the roles in the current token. + /// A list of one or more roles that this application credential has + /// associated with its project. A token using this application credential + /// will have these same roles. #[serde(default)] #[structable(optional, serialize)] pub roles: Option>, - /// The secret for the application credential, either generated by the - /// server or provided by the user. This is only ever shown once in the - /// response to a create request. It is not stored nor ever shown again. If - /// the secret is lost, a new application credential must be created. + /// The secret that the application credential will be created with. #[serde(default)] #[structable(optional)] pub secret: Option, - /// An optional flag to restrict whether the application credential may be - /// used for the creation or destruction of other application credentials - /// or trusts. Defaults to false. + #[serde(default)] + #[structable(optional)] + pub system: Option, + + /// A flag indicating whether the application credential may be used for + /// creation or destruction of other application credentials or trusts. #[serde(default)] #[structable(optional)] pub unrestricted: Option, + + /// The ID of the user. + #[serde(default)] + #[structable(optional)] + pub user_id: Option, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Method { + // Delete + #[serde(rename = "DELETE")] + Delete, + + // Get + #[serde(rename = "GET")] + Get, + + // Head + #[serde(rename = "HEAD")] + Head, + + // Patch + #[serde(rename = "PATCH")] + Patch, + + // Post + #[serde(rename = "POST")] + Post, + + // Put + #[serde(rename = "PUT")] + Put, +} + +impl std::str::FromStr for Method { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "DELETE" => Ok(Self::Delete), + "GET" => Ok(Self::Get), + "HEAD" => Ok(Self::Head), + "PATCH" => Ok(Self::Patch), + "POST" => Ok(Self::Post), + "PUT" => Ok(Self::Put), + _ => Err(()), + } + } } /// `AccessRules` type @@ -83,18 +138,32 @@ pub struct AccessRules { #[serde(default)] pub id: Option, #[serde(default)] - pub method: Option, + pub method: Option, #[serde(default)] pub path: Option, #[serde(default)] pub service: Option, } +/// The link to the resource in question. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default, rename = "self")] + pub _self: Option, +} + /// `Roles` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Roles { + #[serde(default)] + pub description: Option, + #[serde(default)] + pub domain_id: Option, #[serde(default)] pub id: Option, #[serde(default)] pub name: Option, + #[serde(default)] + pub options: Option>, } diff --git a/types/identity/src/v3/user/application_credential/response/get.rs b/types/identity/src/v3/user/application_credential/response/get.rs index 23bf16a54..054b88ac1 100644 --- a/types/identity/src/v3/user/application_credential/response/get.rs +++ b/types/identity/src/v3/user/application_credential/response/get.rs @@ -17,12 +17,14 @@ //! Response type for the GET `users/{user_id}/application_credentials/{application_credential_id}` operation use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; /// ApplicationCredential response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ApplicationCredentialResponse { - /// A list of access_rules objects + /// A list of access_rules objects. #[serde(default)] #[structable(optional, serialize)] pub access_rules: Option>, @@ -32,15 +34,22 @@ pub struct ApplicationCredentialResponse { #[structable(optional)] pub description: Option, + /// The expiration time of the application credential, if one was + /// specified. #[serde(default)] #[structable(optional)] pub expires_at: Option, - /// The ID of the application credential. + /// The UUID of the application credential #[serde(default)] #[structable(optional)] pub id: Option, + /// The link to the resource in question. + #[serde(default)] + #[structable(optional, serialize)] + pub links: Option, + /// The name of the application credential. Must be unique to a user. #[serde(default)] #[structable(optional)] @@ -53,20 +62,69 @@ pub struct ApplicationCredentialResponse { #[structable(optional)] pub project_id: Option, - /// An optional list of role objects, identified by ID or name. The list - /// may only contain roles that the user has assigned on the project. If - /// not provided, the roles assigned to the application credential will be - /// the same as the roles in the current token. + /// A list of one or more roles that this application credential has + /// associated with its project. A token using this application credential + /// will have these same roles. #[serde(default)] #[structable(optional, serialize)] pub roles: Option>, - /// An optional flag to restrict whether the application credential may be - /// used for the creation or destruction of other application credentials - /// or trusts. Defaults to false. + #[serde(default)] + #[structable(optional)] + pub system: Option, + + /// A flag indicating whether the application credential may be used for + /// creation or destruction of other application credentials or trusts. #[serde(default)] #[structable(optional)] pub unrestricted: Option, + + /// The ID of the user. + #[serde(default)] + #[structable(optional)] + pub user_id: Option, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Method { + // Delete + #[serde(rename = "DELETE")] + Delete, + + // Get + #[serde(rename = "GET")] + Get, + + // Head + #[serde(rename = "HEAD")] + Head, + + // Patch + #[serde(rename = "PATCH")] + Patch, + + // Post + #[serde(rename = "POST")] + Post, + + // Put + #[serde(rename = "PUT")] + Put, +} + +impl std::str::FromStr for Method { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "DELETE" => Ok(Self::Delete), + "GET" => Ok(Self::Get), + "HEAD" => Ok(Self::Head), + "PATCH" => Ok(Self::Patch), + "POST" => Ok(Self::Post), + "PUT" => Ok(Self::Put), + _ => Err(()), + } + } } /// `AccessRules` type @@ -75,18 +133,32 @@ pub struct AccessRules { #[serde(default)] pub id: Option, #[serde(default)] - pub method: Option, + pub method: Option, #[serde(default)] pub path: Option, #[serde(default)] pub service: Option, } +/// The link to the resource in question. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default, rename = "self")] + pub _self: Option, +} + /// `Roles` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Roles { + #[serde(default)] + pub description: Option, + #[serde(default)] + pub domain_id: Option, #[serde(default)] pub id: Option, #[serde(default)] pub name: Option, + #[serde(default)] + pub options: Option>, } diff --git a/types/identity/src/v3/user/application_credential/response/list.rs b/types/identity/src/v3/user/application_credential/response/list.rs index c82143cf2..8b5f9c481 100644 --- a/types/identity/src/v3/user/application_credential/response/list.rs +++ b/types/identity/src/v3/user/application_credential/response/list.rs @@ -17,12 +17,14 @@ //! Response type for the GET `users/{user_id}/application_credentials` operation use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; use structable::{StructTable, StructTableOptions}; /// ApplicationCredential response representation #[derive(Clone, Deserialize, Serialize, StructTable)] pub struct ApplicationCredentialResponse { - /// A list of access_rules objects + /// A list of access_rules objects. #[serde(default)] #[structable(optional, serialize, wide)] pub access_rules: Option>, @@ -32,11 +34,13 @@ pub struct ApplicationCredentialResponse { #[structable(optional, wide)] pub description: Option, + /// The expiration time of the application credential, if one was + /// specified. #[serde(default)] #[structable(optional, wide)] pub expires_at: Option, - /// The ID of the application credential. + /// The UUID of the application credential #[serde(default)] #[structable(optional)] pub id: Option, @@ -53,20 +57,69 @@ pub struct ApplicationCredentialResponse { #[structable(optional, wide)] pub project_id: Option, - /// An optional list of role objects, identified by ID or name. The list - /// may only contain roles that the user has assigned on the project. If - /// not provided, the roles assigned to the application credential will be - /// the same as the roles in the current token. + /// A list of one or more roles that this application credential has + /// associated with its project. A token using this application credential + /// will have these same roles. #[serde(default)] #[structable(optional, serialize, wide)] pub roles: Option>, - /// An optional flag to restrict whether the application credential may be - /// used for the creation or destruction of other application credentials - /// or trusts. Defaults to false. + #[serde(default)] + #[structable(optional, wide)] + pub system: Option, + + /// A flag indicating whether the application credential may be used for + /// creation or destruction of other application credentials or trusts. #[serde(default)] #[structable(optional, wide)] pub unrestricted: Option, + + /// The ID of the user. + #[serde(default)] + #[structable(optional, wide)] + pub user_id: Option, +} + +#[derive(Debug, Deserialize, Clone, Serialize)] +pub enum Method { + // Delete + #[serde(rename = "DELETE")] + Delete, + + // Get + #[serde(rename = "GET")] + Get, + + // Head + #[serde(rename = "HEAD")] + Head, + + // Patch + #[serde(rename = "PATCH")] + Patch, + + // Post + #[serde(rename = "POST")] + Post, + + // Put + #[serde(rename = "PUT")] + Put, +} + +impl std::str::FromStr for Method { + type Err = (); + fn from_str(input: &str) -> Result { + match input { + "DELETE" => Ok(Self::Delete), + "GET" => Ok(Self::Get), + "HEAD" => Ok(Self::Head), + "PATCH" => Ok(Self::Patch), + "POST" => Ok(Self::Post), + "PUT" => Ok(Self::Put), + _ => Err(()), + } + } } /// `AccessRules` type @@ -75,18 +128,32 @@ pub struct AccessRules { #[serde(default)] pub id: Option, #[serde(default)] - pub method: Option, + pub method: Option, #[serde(default)] pub path: Option, #[serde(default)] pub service: Option, } +/// The link to the resource in question. +/// `Links` type +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Links { + #[serde(default, rename = "self")] + pub _self: Option, +} + /// `Roles` type #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Roles { + #[serde(default)] + pub description: Option, + #[serde(default)] + pub domain_id: Option, #[serde(default)] pub id: Option, #[serde(default)] pub name: Option, + #[serde(default)] + pub options: Option>, } diff --git a/types/identity/src/v3/user/group/response.rs b/types/identity/src/v3/user/group/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/user/group/response.rs +++ b/types/identity/src/v3/user/group/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/user/project/response.rs b/types/identity/src/v3/user/project/response.rs index b56da8f52..4a14b6492 100644 --- a/types/identity/src/v3/user/project/response.rs +++ b/types/identity/src/v3/user/project/response.rs @@ -16,5 +16,4 @@ // `openstack-codegenerator`. //! `response` REST operations of identity -pub mod head; pub mod list; diff --git a/types/identity/src/v3/user/response.rs b/types/identity/src/v3/user/response.rs index 2cc04c0fb..47be25f13 100644 --- a/types/identity/src/v3/user/response.rs +++ b/types/identity/src/v3/user/response.rs @@ -18,6 +18,5 @@ //! `response` REST operations of identity pub mod create; pub mod get; -pub mod head; pub mod list; pub mod set; diff --git a/types/identity/src/v3/user/response/list.rs b/types/identity/src/v3/user/response/list.rs index 4e2e9418f..c251b2374 100644 --- a/types/identity/src/v3/user/response/list.rs +++ b/types/identity/src/v3/user/response/list.rs @@ -42,20 +42,9 @@ pub struct UserResponse { pub enabled: bool, /// List of federated objects associated with a user. Each object in the - /// list contains the `idp_id` and `protocols`. `protocols` is a list of - /// objects, each of which contains `protocol_id` and `unique_id` of the - /// protocol and user respectively. For example: - /// - /// ```text - /// "federated": [ - /// { - /// "idp_id": "efbab5a6acad4d108fec6c63d9609d83", - /// "protocols": [ - /// {"protocol_id": "mapped", "unique_id": "test@example.com"} - /// ] - /// } - /// ] - /// ``` + /// list contains the idp_id and protocols. protocols is a list of objects, + /// each of which contains protocol_id and unique_id of the protocol and + /// user respectively. #[serde(default)] #[structable(optional, serialize, wide)] pub federated: Option>, diff --git a/types/image/src/v2.rs b/types/image/src/v2.rs index b592689cf..c11fb253b 100644 --- a/types/image/src/v2.rs +++ b/types/image/src/v2.rs @@ -16,7 +16,6 @@ // `openstack-codegenerator`. //! `Image` Service bindings -pub mod cache; pub mod image; pub mod info; pub mod metadef; diff --git a/types/image/src/v2/image.rs b/types/image/src/v2/image.rs index 836dc66c7..232abfea5 100644 --- a/types/image/src/v2/image.rs +++ b/types/image/src/v2/image.rs @@ -16,10 +16,7 @@ // `openstack-codegenerator`. //! `Image` Service bindings -pub mod file; pub mod location; pub mod member; pub mod response; -pub mod stage; -pub mod tag; pub mod task; diff --git a/types/image/src/v2/image/response.rs b/types/image/src/v2/image/response.rs index 7328b6b3b..7faacd547 100644 --- a/types/image/src/v2/image/response.rs +++ b/types/image/src/v2/image/response.rs @@ -17,8 +17,6 @@ //! `response` REST operations of image pub mod create; -pub mod deactivate; pub mod get; pub mod list; pub mod patch; -pub mod reactivate; diff --git a/types/image/src/v2/schema/metadef.rs b/types/image/src/v2/schema/metadef.rs index 71823f8e6..ec79c8aad 100644 --- a/types/image/src/v2/schema/metadef.rs +++ b/types/image/src/v2/schema/metadef.rs @@ -15,7 +15,7 @@ // WARNING: This file is automatically generated from OpenAPI schema using // `openstack-codegenerator`. -//! `v2/cache` REST operations of image +//! `v2/info/usage` REST operations of image pub mod namespace; pub mod namespaces; pub mod object; diff --git a/types/load-balancer/src/v2/pool/member/response.rs b/types/load-balancer/src/v2/pool/member/response.rs index 4abd7229e..71c5b6a93 100644 --- a/types/load-balancer/src/v2/pool/member/response.rs +++ b/types/load-balancer/src/v2/pool/member/response.rs @@ -19,5 +19,4 @@ pub mod create; pub mod get; pub mod list; -pub mod replace; pub mod set; diff --git a/types/load-balancer/src/v2/quota/response/get.rs b/types/load-balancer/src/v2/quota/response/get.rs index 997796f10..867187382 100644 --- a/types/load-balancer/src/v2/quota/response/get.rs +++ b/types/load-balancer/src/v2/quota/response/get.rs @@ -73,4 +73,12 @@ pub struct QuotaResponse { #[serde(default)] #[structable(optional)] pub pool: Option, + + #[serde(default)] + #[structable(optional)] + pub project_id: Option, + + #[serde(default)] + #[structable(optional)] + pub tenant_id: Option, } diff --git a/types/load-balancer/src/v2/quota/response/set.rs b/types/load-balancer/src/v2/quota/response/set.rs index c9bf50cfe..b7b6abece 100644 --- a/types/load-balancer/src/v2/quota/response/set.rs +++ b/types/load-balancer/src/v2/quota/response/set.rs @@ -73,4 +73,12 @@ pub struct QuotaResponse { #[serde(default)] #[structable(optional)] pub pool: Option, + + #[serde(default)] + #[structable(optional)] + pub project_id: Option, + + #[serde(default)] + #[structable(optional)] + pub tenant_id: Option, } diff --git a/types/object-store/src/v1.rs b/types/object-store/src/v1.rs index 1878e8c08..43598663c 100644 --- a/types/object-store/src/v1.rs +++ b/types/object-store/src/v1.rs @@ -18,4 +18,3 @@ //! `Object-store` Service bindings pub mod account; pub mod container; -pub mod object; diff --git a/types/object-store/src/v1/account/response.rs b/types/object-store/src/v1/account/response.rs index ee825dab9..cb496b9ea 100644 --- a/types/object-store/src/v1/account/response.rs +++ b/types/object-store/src/v1/account/response.rs @@ -17,4 +17,3 @@ //! `response` REST operations of object-store pub mod get; -pub mod head; diff --git a/types/object-store/src/v1/container/response.rs b/types/object-store/src/v1/container/response.rs index ee825dab9..cb496b9ea 100644 --- a/types/object-store/src/v1/container/response.rs +++ b/types/object-store/src/v1/container/response.rs @@ -17,4 +17,3 @@ //! `response` REST operations of object-store pub mod get; -pub mod head; diff --git a/types/placement/src/v1.rs b/types/placement/src/v1.rs index ae037f394..35510f36f 100644 --- a/types/placement/src/v1.rs +++ b/types/placement/src/v1.rs @@ -22,4 +22,3 @@ pub mod resource_class; pub mod resource_provider; pub mod r#trait; pub mod usage; -pub mod version; diff --git a/types/placement/src/v1/resource_provider.rs b/types/placement/src/v1/resource_provider.rs index 1da60fffb..20ca06ea2 100644 --- a/types/placement/src/v1/resource_provider.rs +++ b/types/placement/src/v1/resource_provider.rs @@ -21,4 +21,3 @@ pub mod allocation; pub mod inventory; pub mod response; pub mod r#trait; -pub mod usage;