Skip to content
Open
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
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions cli/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ license.workspace = true
edition.workspace = true
authors.workspace = true
# `yamlpatch`/`yamlpath` (see src/yaml_edit.rs) require a newer toolchain
# than the rest of the workspace. Scoped to this crate only: nothing else
# in the workspace depends on `openstack-cli-config`, so SDK-only consumers
# never pull this requirement in. See CONTRIBUTING.md / the PR description
# for context.
# than the rest of the workspace. Scoped to this crate rather than raised
# on the workspace: only `openstack_cli` (the `osc` binary) depends on
# `openstack-cli-config`, so `openstack_sdk` and the `sdk/*` crates never
# pull this requirement in and SDK-only consumers are unaffected. See
# CONTRIBUTING.md / the PR description for context.
# Keep in sync with .github/workflows/ci.yml's `rust_ver` — the workspace
# default build includes this crate, so a mismatch breaks CI.
rust-version = "1.97"
Expand All @@ -18,9 +19,11 @@ repository.workspace = true

[dependencies]
clap.workspace = true
dirs.workspace = true
eyre.workspace = true
indexmap.workspace = true
openstack-cli-core.workspace = true
openstack_sdk_core.workspace = true
serde.workspace = true
serde_json.workspace = true
structable = { workspace = true }
Expand All @@ -29,6 +32,10 @@ tracing.workspace = true
yaml_serde.workspace = true
yamlpatch.workspace = true
yamlpath.workspace = true
zeroize = { workspace = true, features = ["derive"] }

[dev-dependencies]
tempfile.workspace = true

[lints]
workspace = true
44 changes: 44 additions & 0 deletions cli/config/src/clouds.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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

//! Cloud entry operations on clouds.yaml/secure.yaml

use clap::{Parser, Subcommand};

use openstack_cli_core::{cli::CliArgs, error::OpenStackCliError};

pub mod add;

/// Manage cloud entries in clouds.yaml/secure.yaml
#[derive(Debug, Parser)]
pub struct CloudsCommand {
/// Cloud entry commands
#[command(subcommand)]
pub command: CloudsCommands,
}

#[allow(missing_docs)]
#[derive(Debug, Subcommand)]
pub enum CloudsCommands {
Add(add::AddCommand),
}

impl CloudsCommand {
/// Perform command action
pub fn take_action<C: CliArgs>(&self, parsed_args: &C) -> Result<(), OpenStackCliError> {
match &self.command {
CloudsCommands::Add(cmd) => cmd.take_action(parsed_args),
}
}
}
Loading
Loading