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
294 changes: 179 additions & 115 deletions doc/src/osc.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions openstack_cli/src/identity/v3/domain/user/role/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::OutputConfig;
use crate::StructTable;

use bytes::Bytes;
use eyre::OptionExt;
use http::Response;
use openstack_sdk::api::find_by_name;
use openstack_sdk::api::identity::v3::domain::find as find_domain;
Expand Down Expand Up @@ -107,6 +108,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// Role response representation
#[derive(Deserialize, Serialize, Clone, StructTable)]
Expand Down Expand Up @@ -194,6 +198,15 @@ impl RoleCommand {
))
}
};
} else if self.path.user.current_user {
ep_builder.user_id(
client
.get_auth_info()
.ok_or_eyre("Cannot determine current authentication information")?
.token
.user
.id,
);
}
ep_builder.id(&self.path.id);
// Set query parameters
Expand Down
13 changes: 13 additions & 0 deletions openstack_cli/src/identity/v3/domain/user/role/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use crate::OpenStackCliError;
use crate::OutputConfig;
use crate::StructTable;

use eyre::OptionExt;
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;
Expand Down Expand Up @@ -94,6 +95,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// Roles response representation
#[derive(Deserialize, Serialize, Clone, StructTable)]
Expand Down Expand Up @@ -199,6 +203,15 @@ impl RolesCommand {
))
}
};
} else if self.path.user.current_user {
ep_builder.user_id(
client
.get_auth_info()
.ok_or_eyre("Cannot determine current authentication information")?
.token
.user
.id,
);
}
// Set query parameters
// Set body parameters
Expand Down
13 changes: 13 additions & 0 deletions openstack_cli/src/identity/v3/domain/user/role/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::OutputConfig;
use crate::StructTable;

use bytes::Bytes;
use eyre::OptionExt;
use http::Response;
use openstack_sdk::api::find_by_name;
use openstack_sdk::api::identity::v3::domain::find as find_domain;
Expand Down Expand Up @@ -107,6 +108,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// Role response representation
#[derive(Deserialize, Serialize, Clone, StructTable)]
Expand Down Expand Up @@ -194,6 +198,15 @@ impl RoleCommand {
))
}
};
} else if self.path.user.current_user {
ep_builder.user_id(
client
.get_auth_info()
.ok_or_eyre("Cannot determine current authentication information")?
.token
.user
.id,
);
}
ep_builder.id(&self.path.id);
// Set query parameters
Expand Down
13 changes: 13 additions & 0 deletions openstack_cli/src/identity/v3/domain/user/role/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::OutputConfig;
use crate::StructTable;

use bytes::Bytes;
use eyre::OptionExt;
use http::Response;
use openstack_sdk::api::find_by_name;
use openstack_sdk::api::identity::v3::domain::find as find_domain;
Expand Down Expand Up @@ -105,6 +106,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// Role response representation
#[derive(Deserialize, Serialize, Clone, StructTable)]
Expand Down Expand Up @@ -192,6 +196,15 @@ impl RoleCommand {
))
}
};
} else if self.path.user.current_user {
ep_builder.user_id(
client
.get_auth_info()
.ok_or_eyre("Cannot determine current authentication information")?
.token
.user
.id,
);
}
ep_builder.id(&self.path.id);
// Set query parameters
Expand Down
4 changes: 4 additions & 0 deletions openstack_cli/src/identity/v3/group/user/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::OutputConfig;
use crate::StructTable;

use bytes::Bytes;
use eyre::OptionExt;
use http::Response;
use openstack_sdk::api::find_by_name;
use openstack_sdk::api::identity::v3::group::user::delete;
Expand Down Expand Up @@ -89,6 +90,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// User response representation
#[derive(Deserialize, Serialize, Clone, StructTable)]
Expand Down
4 changes: 4 additions & 0 deletions openstack_cli/src/identity/v3/group/user/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::OutputConfig;
use crate::StructTable;

use bytes::Bytes;
use eyre::OptionExt;
use http::Response;
use openstack_sdk::api::find_by_name;
use openstack_sdk::api::identity::v3::group::user::set;
Expand Down Expand Up @@ -89,6 +90,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// User response representation
#[derive(Deserialize, Serialize, Clone, StructTable)]
Expand Down
4 changes: 4 additions & 0 deletions openstack_cli/src/identity/v3/group/user/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::OutputConfig;
use crate::StructTable;

use bytes::Bytes;
use eyre::OptionExt;
use http::Response;
use openstack_sdk::api::find_by_name;
use openstack_sdk::api::identity::v3::group::user::get;
Expand Down Expand Up @@ -87,6 +88,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// User response representation
#[derive(Deserialize, Serialize, Clone, StructTable)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::OutputConfig;
use crate::StructTable;

use bytes::Bytes;
use eyre::OptionExt;
use http::Response;
use openstack_sdk::api::find_by_name;
use openstack_sdk::api::identity::v3::domain::find as find_domain;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use crate::OpenStackCliError;
use crate::OutputConfig;
use crate::StructTable;

use eyre::OptionExt;
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use crate::StructTable;

use crate::common::parse_json;
use crate::common::parse_key_val;
use eyre::OptionExt;
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::OutputConfig;
use crate::StructTable;

use bytes::Bytes;
use eyre::OptionExt;
use http::Response;
use openstack_sdk::api::find_by_name;
use openstack_sdk::api::identity::v3::domain::find as find_domain;
Expand Down Expand Up @@ -108,6 +109,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// InheritedToProject response representation
#[derive(Deserialize, Serialize, Clone, StructTable)]
Expand Down Expand Up @@ -195,6 +199,15 @@ impl InheritedToProjectCommand {
))
}
};
} else if self.path.user.current_user {
ep_builder.user_id(
client
.get_auth_info()
.ok_or_eyre("Cannot determine current authentication information")?
.token
.user
.id,
);
}
ep_builder.role_id(&self.path.role_id);
// Set query parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use crate::OpenStackCliError;
use crate::OutputConfig;
use crate::StructTable;

use eyre::OptionExt;
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;
Expand Down Expand Up @@ -96,6 +97,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// Response data as HashMap type
#[derive(Deserialize, Serialize)]
Expand Down Expand Up @@ -197,6 +201,15 @@ impl InheritedToProjectCommand {
))
}
};
} else if self.path.user.current_user {
ep_builder.user_id(
client
.get_auth_info()
.ok_or_eyre("Cannot determine current authentication information")?
.token
.user
.id,
);
}
// Set query parameters
// Set body parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use crate::StructTable;

use crate::common::parse_json;
use crate::common::parse_key_val;
use eyre::OptionExt;
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;
Expand Down Expand Up @@ -111,6 +112,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// Response data as HashMap type
#[derive(Deserialize, Serialize)]
Expand Down Expand Up @@ -212,6 +216,15 @@ impl InheritedToProjectCommand {
))
}
};
} else if self.path.user.current_user {
ep_builder.user_id(
client
.get_auth_info()
.ok_or_eyre("Cannot determine current authentication information")?
.token
.user
.id,
);
}
ep_builder.role_id(&self.path.role_id);
// Set query parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::OutputConfig;
use crate::StructTable;

use bytes::Bytes;
use eyre::OptionExt;
use http::Response;
use openstack_sdk::api::find_by_name;
use openstack_sdk::api::identity::v3::os_inherit::project::user::role::inherited_to_project::delete;
Expand Down Expand Up @@ -100,6 +101,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// InheritedToProject response representation
#[derive(Deserialize, Serialize, Clone, StructTable)]
Expand Down Expand Up @@ -154,6 +158,15 @@ impl InheritedToProjectCommand {
))
}
};
} else if self.path.user.current_user {
ep_builder.user_id(
client
.get_auth_info()
.ok_or_eyre("Cannot determine current authentication information")?
.token
.user
.id,
);
}
ep_builder.role_id(&self.path.role_id);
// Set query parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use crate::OpenStackCliError;
use crate::OutputConfig;
use crate::StructTable;

use eyre::OptionExt;
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::user::find as find_user;
Expand Down Expand Up @@ -99,6 +100,9 @@ struct UserInput {
/// User ID.
#[arg(long, help_heading = "Path parameters", value_name = "USER_ID")]
user_id: Option<String>,
/// Current authenticated user.
#[arg(long, help_heading = "Path parameters", action = clap::ArgAction::SetTrue)]
current_user: bool,
}
/// Response data as HashMap type
#[derive(Deserialize, Serialize)]
Expand Down Expand Up @@ -167,6 +171,15 @@ impl InheritedToProjectCommand {
))
}
};
} else if self.path.user.current_user {
ep_builder.user_id(
client
.get_auth_info()
.ok_or_eyre("Cannot determine current authentication information")?
.token
.user
.id,
);
}
ep_builder.role_id(&self.path.role_id);
// Set query parameters
Expand Down
Loading