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
3 changes: 3 additions & 0 deletions openstack_cli/src/identity/v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use openstack_sdk::AsyncOpenStack;

use crate::{Cli, OpenStackCliError};

pub mod federation;
pub mod user;

/// Identity (Keystone) commands
Expand Down Expand Up @@ -46,6 +47,7 @@ pub struct IdentityCommand {
#[allow(missing_docs)]
#[derive(Subcommand)]
pub enum IdentityCommands {
Federation(federation::FederationCommand),
User(user::UserCommand),
}

Expand All @@ -57,6 +59,7 @@ impl IdentityCommand {
session: &mut AsyncOpenStack,
) -> Result<(), OpenStackCliError> {
match &self.command {
IdentityCommands::Federation(cmd) => cmd.take_action(parsed_args, session).await,
IdentityCommands::User(cmd) => cmd.take_action(parsed_args, session).await,
}
}
Expand Down
63 changes: 63 additions & 0 deletions openstack_cli/src/identity/v4/federation/identity_provider.rs
Original file line number Diff line number Diff line change
@@ -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

//! IdentityProvider Identity Provider commands

use clap::{Parser, Subcommand};

use openstack_sdk::AsyncOpenStack;

use crate::{Cli, OpenStackCliError};

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

/// Federated identity provider commands
///
#[derive(Parser)]
pub struct IdentityProviderCommand {
#[command(subcommand)]
command: IdentityProviderCommands,
}

/// Supported subcommands
#[allow(missing_docs)]
#[derive(Subcommand)]
pub enum IdentityProviderCommands {
Create(create::IdentityProviderCommand),
Delete(delete::IdentityProviderCommand),
List(list::IdentityProvidersCommand),
Set(set::IdentityProviderCommand),
Show(show::IdentityProviderCommand),
}

impl IdentityProviderCommand {
/// Perform command action
pub async fn take_action(
&self,
parsed_args: &Cli,
session: &mut AsyncOpenStack,
) -> Result<(), OpenStackCliError> {
match &self.command {
IdentityProviderCommands::Create(cmd) => cmd.take_action(parsed_args, session).await,
IdentityProviderCommands::Delete(cmd) => cmd.take_action(parsed_args, session).await,
IdentityProviderCommands::List(cmd) => cmd.take_action(parsed_args, session).await,
IdentityProviderCommands::Set(cmd) => cmd.take_action(parsed_args, session).await,
IdentityProviderCommands::Show(cmd) => cmd.take_action(parsed_args, session).await,
}
}
}
63 changes: 63 additions & 0 deletions openstack_cli/src/identity/v4/federation/mapping.rs
Original file line number Diff line number Diff line change
@@ -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

//! Attribute Mapping commands

use clap::{Parser, Subcommand};

use openstack_sdk::AsyncOpenStack;

use crate::{Cli, OpenStackCliError};

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

/// Federated attribute mapping commands
///
#[derive(Parser)]
pub struct MappingCommand {
#[command(subcommand)]
command: MappingCommands,
}

/// Supported subcommands
#[allow(missing_docs)]
#[derive(Subcommand)]
pub enum MappingCommands {
Create(create::MappingCommand),
Delete(delete::MappingCommand),
List(list::MappingsCommand),
Set(set::MappingCommand),
Show(show::MappingCommand),
}

impl MappingCommand {
/// Perform command action
pub async fn take_action(
&self,
parsed_args: &Cli,
session: &mut AsyncOpenStack,
) -> Result<(), OpenStackCliError> {
match &self.command {
MappingCommands::Create(cmd) => cmd.take_action(parsed_args, session).await,
MappingCommands::Delete(cmd) => cmd.take_action(parsed_args, session).await,
MappingCommands::List(cmd) => cmd.take_action(parsed_args, session).await,
MappingCommands::Set(cmd) => cmd.take_action(parsed_args, session).await,
MappingCommands::Show(cmd) => cmd.take_action(parsed_args, session).await,
}
}
}
Loading