space list
Retrieve the space list.
Syntax
cpd-cli space list \
[--bss-account-id=<bss-account-id>] \
[--compute-crn=<compute.crn>] \
[--context=<catalog-project-or-space-id>] \
[--cpd-config=<cpd-config-location>] \
[--id=<comma-separated-list-of-ids>] \
[--include=<comma-separated-list-of-space-sections>] \
[--jmes-query=<jmespath-query>] \
[--limit=<resource-limit>] \
[--member=<user-id>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
--profile=<cpd-configuration-profile-name> \
[--quiet] \
[--raw-output=true|false] \
[--roles=<comma-separated-list-of-space-roles>] \
[--start=<start-token>] \
[--tags=<tag1,tag2,...>] \
[--total-count=<total-resource-value>] \
[--verbose]
Arguments
The space list
command has no
arguments.
Options
Table 1: Command options
Option | Description |
---|---|
--bss-account-id |
Specify the BSS account ID. Filtering by 'bss_account_id' is allowed only for accredited services.
|
--compute-crn |
Specify a compute.crn. The results are filtered to include only spaces with the specified compute.crn.
|
--context |
Specify the configuration context
name.
|
--cpd-config |
The Cloud Pak for Data
configuration location (for example, $HOME/.cpd-cli/config).
|
|
Display command
help.
|
--id |
Provide a comma-separated list of IDs to return.
|
--include |
Specify a list of comma-separated space sections to include in the query results.
|
--jmes-query |
Provide a JMESPath query to customize the output.
|
--limit |
Specify the total number of
resources.
|
--member |
Specify a user ID. The results list is filtered to include only spaces where the user with a matching user ID is a member.
|
--output |
Specify an output format.
Valid formats include json, yaml, or text (the default
format).
|
--output-file |
Specify a file path where all output is redirected.
|
--profile |
The profile-name from the Cloud
Pak for Data configuration.
|
--quiet |
Suppress verbose messages.
|
--raw-output |
When set to true, single values in
JSON output mode are not surrounded by quotes.
|
--roles |
Specify a list of comma-separated space roles to use when filtering the query results. The results are filtered to include only spaces where the specified member has one of the specified roles. The option must be used in conjunction with the 'member' option.
|
--start |
Specify the token that represents
the first resource.
|
--tags |
Specify a list of tags that are associated with a space.
|
--total-count |
Specify a value to compute the total number of resources. Details about the total number of resources is returned.
|
--verbose |
Logs include more detailed
messages.
|
Examples
- List all spaces.
-
cpd-cli space list \
- Example results.
-
ID Name Created State Tags d9bfa660-1be7-46ab-aa53-e9010a634bba cpdctl-demo-space 2021-01-29T08:56:07.389Z active [] 6c205951-1c61-49b9-b46d-e5e199492775 cpdctl-prod-space-for-scripts 2021-02-22T07:45:34.787Z active [] 51824744-7b11-4a6b-aff0-6ee16de709d0 cpdctl-demo-new-qa-space 2021-02-22T13:31:23.319Z active [] 77ece893-36c2-43cd-b1ce-b155decbc05c cpdctl-qa-space-for-scripts 2021-04-30T12:02:24.332Z active []