space list

Important: IBM Cloud Pak® for Data Version 4.7 will reach end of support (EOS) on 31 July, 2025. For more information, see the Discontinuance of service announcement for IBM Cloud Pak for Data Version 4.X.

Upgrade to IBM Software Hub Version 5.1 before IBM Cloud Pak for Data Version 4.7 reaches end of support. For more information, see Upgrading IBM Software Hub in the IBM Software Hub Version 5.1 documentation.

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

Option Description
--bss-account-id Specify the BSS account ID. Filtering by 'bss_account_id' is allowed only for accredited services.
Status
Optional.
Syntax
--bss-account-id=<bss-account-id>
Default value
No default.
Valid values
A valid BSS account ID.
--compute-crn Specify a compute.crn. The results are filtered to include only spaces with the specified compute.crn.
Status
Optional.
Syntax
--compute-crn=<compute.crn>
Default value
No default.
Valid values
A valid 'compute.crn'.
--context Specify the configuration context
 name.
Status
Optional.
Syntax
--context=<catalog-project-or-space-id>
Default value
Not applicable.
Valid values
A valid configuration context name.
--cpd-config The Cloud Pak for Data
 configuration location. For example, $HOME/.cpd-cli/config.
Status
Required.
Syntax
--cpd-config=<cpd-config-location>
Default value
$HOME/.cpd-cli/config
Valid values
A valid Cloud Pak for Data configuration location.

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.
--id Provide a comma-separated list of IDs to return.
Status
Optional.
Syntax
--id=<comma-separated-list-of-ids>
Default value
No default.
Valid values
A valid list of IDs.
--include Specify a list of comma-separated space sections to include in the query results.
Status
Optional.
Syntax
--include=<comma-separated-list-of-space-sections>
Default value
No default.
Valid values
A comma-separated list of space sections to include in the query results. Possible values include:
members
Returns up to 100 members.
nothing
Does not return space entity and metadata.
--jmes-query Provide a JMESPath query to customize the output.
Status
Optional.
Syntax
--jmes-query=<jmespath-query>
Default value
No default.
Valid values
A valid JMESPath query.
--limit Specify the total number of resources.
Status
Optional.
Syntax
--limit=<resource-limit>
Default value
100
Valid values
An integer value in the range 0 - 200.
--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.
Status
Optional.
Syntax
--member=<user-id>
Default value
No default.
Valid values
A valid user ID.
--output Specify an output format. Valid formats include json, yaml, or text (the default format).
Status
Optional.
Syntax
--output=json|yaml|text
Default value
text
Valid values
json|yaml|text
--output-file Specify a file path where all output is redirected.
Status
Optional.
Syntax
--output-file=<output-file-location>
Default value
No default.
Valid values
A valid output file path location.
--profile The name of the profile that you created to store information about an instance of Cloud Pak for Data and your credentials for the instance.
Status
Required.
Syntax
--profile=<cpd-configuration-profile-name>
Default value
No default.
Valid values

The name of the profile that you created.

--quiet Suppress verbose messages.
Status
Optional.
Syntax
--quiet
Default value
No default.
Valid values
Not applicable.
--raw-output When set to true, single values in
 JSON output mode are not surrounded by quotes.
Status
Optional.
Syntax
--raw-output=true|false
Default value
false
Valid values
false
Single values in JSON output mode are surrounded by quotation marks.
true
Single values in JSON output mode are not surrounded by quotation marks.
--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.
Status
Optional.
Syntax
--roles=<comma-separated-list-of-space-roles>
Default value
No default.
Valid values
A comma-separated list of space roles. The following roles are supported.
  • admin
  • editor
  • viewer
--start Specify the token that represents
the first resource.
Status
Optional.
Syntax
--start=<start-token>
Default value
No default.
Valid values
A valid token that represents the first resource.
--tags Specify a list of tags that are associated with a space.
Status
Optional.
Syntax
--tags=<tag1,tag2,...>
Default value
No default.
Valid values
A valid list of comma-separated 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.
Status
Optional.
Syntax
--total-count=<total-resource-value>
Default value
No default.
Valid values
A valid value to compute the total number of resources.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.

Table 1: Command options

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   []