Skip to content
Draft
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
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,40 @@ You can use it to set all projects of an organization to use a storage backend.
php ./cli.php manage:set-organization-storage-backend [--force/-f] <manage-token> <organization-id> <storage-backend-id> <hostname-suffix>
```

## List Storage Backends
Read-only inventory of a stack's storage backends with a cleanup verdict per backend. Nothing is modified.
Pairs with `manage:delete-backend` — the ID lists printed at the end are ready to paste into it.

- Run the command
```
php ./cli.php manage:list-backends <manage-token> <stack-url> [--format=table|csv] [--verdict=VERDICT] [--unsupported]
```
Arguments:
- manage-token (required) Manage API token for the stack.
- stack-url (required) Full stack URL, e.g. https://connection.keboola.com.

Options:
- --format Output format, `table` (default) or `csv`. In `csv` mode the summary goes to stderr so stdout stays parseable.
- --verdict Show only backends with the given verdict.
- --unsupported Show only backends that are not snowflake/bigquery — i.e. both `DELETE_UNSUPPORTED_UNUSED` and `REVIEW_UNSUPPORTED_IN_USE` in one pass. Composable with `--verdict`.

Verdicts (backends we keep are snowflake and bigquery; everything else is a decommissioned type
such as mysql/redshift/synapse/exasol/teradata, or a parked PoC such as supabase):
- `DELETE_UNSUPPORTED_UNUSED` — not snowflake/bigquery, 0 projects and 0 maintainers. Safe to delete.
- `DELETE_UNUSED` — snowflake/bigquery, 0 projects and 0 maintainers.
- `REVIEW_UNSUPPORTED_IN_USE` — not snowflake/bigquery, but still has projects or maintainers.
- `REVIEW_MAINTAINER_ONLY` — 0 projects, but a maintainer still points at it as its default backend.
- `KEEP` — has live projects.

Counts come from `assignedProjectsCount` / `assignedMaintainersCount` and cover live projects only.
A backend showing 0 can still be blocked by soft-deleted, not-yet-purged projects — the delete guard refuses those.

The command fetches the detail of every backend (`GET /manage/storage-backend/{id}`) to add columns that are
not in the list response: `loginType`, `keyRotated` (= `keyPairLastRotatedAt`, date only), `dynBackends`
(= `useDynamicBackends`), `useSso`, `ssoEnabled`, `ssoConfigured`. Booleans render as 1/0, empty when the
detail does not report the field (e.g. BigQuery has no `loginType`). A failed detail call leaves the extra
columns empty and keeps the row.

## Delete Storage Backend
Delete one or more storage backends from a stack by their IDs. Dry-run by default.

Expand Down
2 changes: 2 additions & 0 deletions cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Keboola\Console\Command\DeleteOwnerlessWorkspaces;
use Keboola\Console\Command\DescribeOrganizationWorkspaces;
use Keboola\Console\Command\LineageEventsExport;
use Keboola\Console\Command\ListStorageBackends;
use Keboola\Console\Command\MassDeleteProjectWorkspaces;
use Keboola\Console\Command\MassProjectEnableDynamicBackends;
use Keboola\Console\Command\MassProjectExtendExpiration;
Expand Down Expand Up @@ -71,4 +72,5 @@
$application->add(new OrganizationsAddFeature());
$application->add(new DeleteProjects());
$application->add(new DeleteStorageBackend());
$application->add(new ListStorageBackends());
$application->run();
Loading