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 rust/cube-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Every endpoint of the Console Server public API is covered:
| `attributes` | list, create, update, delete, values get/set |
| `policies` | get, set-user, set-group |
| `tenant` | settings, update |
| `embed` | generate-session, token, dashboard, tenant delete/groups/delete-group |
| `embed` | generate-session, token, dashboard, enable-dashboard, disable-dashboard, tenant delete/groups/delete-group |
| `integrations` | list, get, create, update, delete, tokens list/get/revoke/initiate |
| `oidc` | list, get, create, update, delete |
| `agents` | list, skills |
Expand Down
40 changes: 40 additions & 0 deletions rust/cube-cli/src/commands/embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ enum Cmd {
/// Public id
public_id: String,
},
/// Enable signed embedding for a dashboard (admin only)
EnableDashboard {
/// Public id
public_id: String,
},
/// Disable signed embedding for a dashboard (admin only)
DisableDashboard {
/// Public id
public_id: String,
},
/// Manage embed tenants
Tenant {
#[command(subcommand)]
Expand Down Expand Up @@ -97,6 +107,36 @@ pub async fn command(args: Args, ctx: &Ctx) -> Result<()> {
.await?;
output::print_json(&res);
}
Cmd::EnableDashboard { public_id } => {
let res = api
.patch(
&format!("/api/v1/embed/dashboard/{public_id}"),
Some(&json!({ "allowEmbed": true })),
)
.await?;
if ctx.json {
output::print_json(&res);
} else {
output::success(&format!(
"Enabled signed embedding for dashboard `{public_id}`"
));
}
}
Cmd::DisableDashboard { public_id } => {
let res = api
.patch(
&format!("/api/v1/embed/dashboard/{public_id}"),
Some(&json!({ "allowEmbed": false })),
)
.await?;
if ctx.json {
output::print_json(&res);
} else {
output::success(&format!(
"Disabled signed embedding for dashboard `{public_id}`"
));
}
}
Cmd::Tenant { cmd } => match cmd {
TenantCmd::Delete { name } => {
api.delete(&format!("/api/v1/embed-tenants/{name}/"), None)
Expand Down
Loading