Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ jobs:
- name: Execute functional tests
env:
OS_CLOUD: devstack
run: cargo nextest run --test functional --all-features
run: cargo nextest run --test functional
4 changes: 4 additions & 0 deletions openstack_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ image = ["openstack_sdk/image"]
load_balancer = ["openstack_sdk/load_balancer"]
network = ["openstack_sdk/network"]
object_store = ["openstack_sdk/object_store"]
_test_net_auto-allocated-topology = []
_test_net_dhcp_agent_scheduler = []
_test_net_l3_agent_scheduler = []


[dependencies]
better-panic = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions openstack_cli/src/network/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod address_scope;
mod agent;
mod auto_allocated_topology;
mod availability_zone;
mod default_security_group_rule;
mod extension;
mod floatingip;
mod network;
Expand Down Expand Up @@ -53,6 +54,7 @@ pub enum NetworkCommands {
Agent(Box<agent::AgentCommand>),
AutoAllocatedTopology(Box<auto_allocated_topology::AutoAllocatedTopologyCommand>),
AvailabilityZone(Box<availability_zone::AvailabilityZoneCommand>),
DefaultSecurityGroupRule(Box<default_security_group_rule::DefaultSecurityGroupRuleCommand>),
Extension(Box<extension::ExtensionCommand>),
FloatingIP(Box<floatingip::FloatingIPCommand>),
Network(Box<network::NetworkCommand>),
Expand Down Expand Up @@ -85,6 +87,9 @@ impl NetworkCommand {
cmd.take_action(parsed_args, session).await
}
NetworkCommands::AvailabilityZone(cmd) => cmd.take_action(parsed_args, session).await,
NetworkCommands::DefaultSecurityGroupRule(cmd) => {
cmd.take_action(parsed_args, session).await
}
NetworkCommands::Extension(cmd) => cmd.take_action(parsed_args, session).await,
NetworkCommands::FloatingIP(cmd) => cmd.take_action(parsed_args, session).await,
NetworkCommands::Network(cmd) => cmd.take_action(parsed_args, session).await,
Expand Down
4 changes: 2 additions & 2 deletions openstack_cli/src/network/v2/agent/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ struct ResponseData {
///
#[serde()]
#[structable(optional, wide)]
alive: Option<String>,
alive: Option<bool>,

/// The availability zone of the agent.
///
Expand All @@ -196,7 +196,7 @@ struct ResponseData {
///
#[serde()]
#[structable(optional, wide)]
configurations: Option<String>,
configurations: Option<serde_json::Value>,

/// Time at which the resource has been created (in UTC ISO8601 format).
///
Expand Down
75 changes: 75 additions & 0 deletions openstack_cli/src/network/v2/default_security_group_rule.rs
Original file line number Diff line number Diff line change
@@ -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

//! DefaultSecurityGroupRule resource commands

use clap::{Parser, Subcommand};

use openstack_sdk::AsyncOpenStack;

use crate::{Cli, OpenStackCliError};

mod create;
mod delete;
mod list;
mod set;
mod show;

/// Security group default rules (security-group-default-rules)
///
/// Lists, creates, shows information for, and deletes security group default rules.
#[derive(Parser)]
pub struct DefaultSecurityGroupRuleCommand {
/// subcommand
#[command(subcommand)]
command: DefaultSecurityGroupRuleCommands,
}

/// Supported subcommands
#[allow(missing_docs)]
#[derive(Subcommand)]
pub enum DefaultSecurityGroupRuleCommands {
Create(Box<create::DefaultSecurityGroupRuleCommand>),
Delete(Box<delete::DefaultSecurityGroupRuleCommand>),
List(Box<list::DefaultSecurityGroupRulesCommand>),
Set(Box<set::DefaultSecurityGroupRuleCommand>),
Show(Box<show::DefaultSecurityGroupRuleCommand>),
}

impl DefaultSecurityGroupRuleCommand {
/// Perform command action
pub async fn take_action(
&self,
parsed_args: &Cli,
session: &mut AsyncOpenStack,
) -> Result<(), OpenStackCliError> {
match &self.command {
DefaultSecurityGroupRuleCommands::Create(cmd) => {
cmd.take_action(parsed_args, session).await
}
DefaultSecurityGroupRuleCommands::Delete(cmd) => {
cmd.take_action(parsed_args, session).await
}
DefaultSecurityGroupRuleCommands::List(cmd) => {
cmd.take_action(parsed_args, session).await
}
DefaultSecurityGroupRuleCommands::Set(cmd) => {
cmd.take_action(parsed_args, session).await
}
DefaultSecurityGroupRuleCommands::Show(cmd) => {
cmd.take_action(parsed_args, session).await
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use crate::OpenStackCliError;
use crate::OutputConfig;
use crate::StructTable;

use crate::common::parse_json;
use crate::common::parse_key_val;
use crate::common::BoolString;
use openstack_sdk::api::network::v2::default_security_group_rule::set;
Expand Down
31 changes: 31 additions & 0 deletions openstack_cli/tests/network/v2/auto_allocated_topology/list.rs
Original file line number Diff line number Diff line change
@@ -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`.

use assert_cmd::prelude::*;
use std::process::Command;

#[test]
fn list() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin("osc")?;

cmd.arg("network")
.arg("auto-allocated-topology")
.arg("list");
cmd.assert().success();

Ok(())
}
2 changes: 2 additions & 0 deletions openstack_cli/tests/network/v2/auto_allocated_topology/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod create_autogen;
mod delete_autogen;
#[cfg(feature = "_test_net_auto-allocated-topology")]
mod list;
mod list_autogen;
mod set_autogen;
mod show_autogen;
Expand Down
31 changes: 31 additions & 0 deletions openstack_cli/tests/network/v2/default_security_group_rule/list.rs
Original file line number Diff line number Diff line change
@@ -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`.

use assert_cmd::prelude::*;
use std::process::Command;

#[test]
fn help() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin("osc")?;

cmd.arg("network")
.arg("default-security-group-rule")
.arg("list");
cmd.assert().success();

Ok(())
}
35 changes: 35 additions & 0 deletions openstack_cli/tests/network/v2/default_security_group_rule/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

mod create_autogen;
mod delete_autogen;
mod list;
mod list_autogen;
mod set_autogen;
mod show_autogen;

use assert_cmd::prelude::*;
use std::process::Command;

#[test]
fn help() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin("osc")?;

cmd.arg("network")
.arg("default-security-group-rule")
.arg("--help");
cmd.assert().success();

Ok(())
}
1 change: 1 addition & 0 deletions openstack_cli/tests/network/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mod address_scope;
mod agent;
mod auto_allocated_topology;
mod availability_zone;
mod default_security_group_rule;
mod extension;
mod floatingip;
mod network;
Expand Down