Appearance
plexctl resource
Synopsis
plexctl resource is the operator surface for the Tenancy Resource aggregate. It spans the two origins the API exposes:
adopt— register an already-running workload (origin=adopted).create— declare a Provisioned workload (origin=provisioned) and hand the declaration to the broker.
text
plexctl resource <subcommand> [flags]Subcommands
plexctl resource create
POSTs /v1/projects/{project_id}/resources with origin=provisioned. The server responds 202 Accepted with a Location header pointing at /v1/resources/{id}; the CLI echoes the Location to stderr (stdout stays clean for parsers) and renders the hydrated ResourceResponse (including provisioning.phase = Pending) on stdout so the operator can chain into plexctl resource get to poll phase progression.
plexctl resource adopt
POSTs /v1/projects/{project_id}/resources with origin=adopted. The server responds 201 Created. The CLI renders the hydrated ResourceResponse; the provisioning field is absent because adopted Resources have no broker-owned substrate.
plexctl resource list
GETs /v1/projects/{project_id}/resources. Pagination is keyset-based via --cursor / --limit; the response carries a next_cursor the caller threads into the next --cursor to walk the pages.
plexctl resource get <id>
GETs /v1/resources/{id}. Local UUID validation rejects malformed id with exit 2. The text render includes the provisioning sub-object when present.
plexctl resource delete <id>
DELETEs /v1/resources/{id}. Requires --yes. The server branches on origin:
- Adopted →
204 No Content. - Provisioned →
202 Accepted(the broker drives the graceful-delete workflow).
Flags
plexctl resource create
| Flag | Type | Required | Description |
|---|---|---|---|
--project-id | UUID | yes | Owning Project UUID. |
--kind | string | yes | Resource kind (e.g. database, cluster). |
--blueprint-version-id | UUID | yes | BlueprintVersion the broker will render. |
--cloud-credential-id | UUID | yes | Cloud Credential the broker will draw on. |
--parameters | JSON object | no | Typed parameter values as an inline JSON object. Mutually exclusive with --parameters-file. |
--parameters-file | path | no | Path to a JSON file containing the typed parameter values. Mutually exclusive with --parameters. |
The server validates the parameter values against the BlueprintVersion's parameter_schema. The cobra layer enforces the mutual-exclusion of --parameters and --parameters-file at parse time so a misconfigured invocation exits 2 before the wire.
plexctl resource adopt
| Flag | Type | Required | Description |
|---|---|---|---|
--project-id | UUID | yes | Owning Project UUID. |
--kind | string | yes | Resource kind. |
--external-ref | string | no | Optional out-of-band reference (URN, ARN, vendor-opaque id) for the already-running workload. |
plexctl resource list
| Flag | Type | Required | Description |
|---|---|---|---|
--project-id | UUID | yes | Owning Project UUID. |
--limit | int | no | Maximum items per page (server default when zero). |
--cursor | string | no | Continuation token from a previous call. |
plexctl resource delete <id>
| Flag | Type | Required | Description |
|---|---|---|---|
--yes (persistent) | bool | yes | Required confirmation for the destructive operation. |
Persistent flags inherited from root
--server, --profile, --token-file, --output, --yes. See ../plexctl.md.
Exit codes
See ../plexctl.md#exit-code-taxonomy.
Examples
Provision a new Resource
shell
plexctl resource create \
--server "${PLEXSPHERE_URL}" \
--project-id 0190a8b8-a0c0-7a0a-8a0a-a0a0a0a0a0c0 \
--kind database \
--blueprint-version-id 0190a8b8-a0c0-7a0a-8a0a-a0a0a0a0a0d1 \
--cloud-credential-id 0190a8b8-a0c0-7a0a-8a0a-a0a0a0a0a0a1 \
--parameters '{"name":"acme-db","size":"medium"}'Or supply the values from a file (chmod 0600 the file when the parameter list contains sensitive values):
shell
plexctl resource create \
--server "${PLEXSPHERE_URL}" \
--project-id 0190a8b8-a0c0-7a0a-8a0a-a0a0a0a0a0c0 \
--kind database \
--blueprint-version-id 0190a8b8-a0c0-7a0a-8a0a-a0a0a0a0a0d1 \
--cloud-credential-id 0190a8b8-a0c0-7a0a-8a0a-a0a0a0a0a0a1 \
--parameters-file /var/secrets/acme-db.jsonAdopt an already-running workload
shell
plexctl resource adopt \
--server "${PLEXSPHERE_URL}" \
--project-id 0190a8b8-a0c0-7a0a-8a0a-a0a0a0a0a0c0 \
--kind cluster \
--external-ref arn:aws:eks:eu-central-1:123456789012:cluster/legacyDelete a Resource (requires --yes)
shell
plexctl resource delete 0190a8b8-a0c0-7a0a-8a0a-a0a0a0a0a0e0 \
--server "${PLEXSPHERE_URL}" \
--yes