project list

Return a list of projects that meet the provided query parameters. By default, the list returns projects of which the authenticated user is a member. The command lists only Analytics projects (Data Quality projects are not supported).

Syntax

cpd-cli project list \
[--bookmark=<pagination-bookmark>] \
[--bss-account-id=<bss-account-id>] \
[--guids=<comma-separated-list-of-project-ids>] \
[--include=<comma-separated-list-of-project-metadata-sections>] \
[--jmes-query=<jmespath-query>] \
[--limit=<project-limit>] \
[--match=<text-matching-type>] \
[--member=<project-member-filter>] \
[--name=<full-or-partial-project-name>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
--profile=<cpd-configuration-profile-name> \
[--raw-output=true|false] \
[--roles=<comma-separated-list-of-project-roles>]

Arguments

The project list command has no arguments.

Options

Option Description
--bookmark Specify a bookmark for results
 pagination.
Status
Optional.
Syntax
--bookmark=<pagination-bookmark>
Default value
No default.
Valid values
Any valid pagination bookmark.
--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.
--guids Specify a list of comma-separated project IDs to use to filter the query results.
Status
Optional.
Syntax
--guids=<comma-separated-list-of-project-ids>
Default value
No default.
Valid values
A comma separated list of project IDs.

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.
--include Specify list of comma-separated project metadata sections to include in the query results.
Status
Optional.
Syntax
--include=<comma-separated-list-of-response-fields>
Default value
No default.
Valid values
A comma-separated list of project metadata sections to include in the query results.
--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 a value that is used to specify the maximum number of projects that are returned in the query results. The option is used for pagination in conjunction with the 'bookmark' query parameter.
Status
Optional.
Syntax
--limit=<project-limit>
Default value
100
Valid values
An integer value in the range 0 - 200.
--match Specify the text matching type to perform. This query parameter must be used in conjunction with the 'name' query parameter. The 'exact' value matches projects if the specified text matches the exact project name. The 'keyword' value matches projects if the specified text matches any keyword that is parsed from the project name.
Status
Optional.
Syntax
--match=<text-matching-type>
Default value
exact
Valid values
exact
Matches projects when the specified text matches the exact project name.
keyword
Matched projects when the specified text matches any keyword that is parsed from the project name.
--member Specify a project member to use when filtering the query results by membership.
Status
Optional.
Syntax
--member=<project-member-filter>
Default value
No default.
Valid values
A valid project member.
--name Specify a full or partial project name to use when filtering the query results. This option must be used in conjunction with the 'bss_account_id' option. Use the 'match' option to control what type of text matching is performed. Project names are not unique and should not be used in place of project IDs.
Status
Optional.
Syntax
--name=<full-or-partial-project-name>
Default value
No default.
Valid values
A valid full or partial project name.
--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
Required.
Syntax
--output-file=<output-file-location>
Default value
No default.
Valid values
A valid output file path location.
--profile The profile-name from the Cloud Pak for Data configuration.
Status
Required.
Syntax
--profile=<cpd-configuration-profile-name>
Default value
default
Valid values
Any valid profile name from the Cloud Pak for Data configuration.
--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 quotes.
true
Single values in JSON output mode are not surrounded by quotes.
--roles Specify a list of comma-separated project roles to use when filtering the query results. The option must be used in conjunction with the 'member' option.
Status
Optional.
Syntax
--roles=<comma-separated-list-of-project-roles>
Default value
No default.
Valid values
A comma-separated list of project roles.

Examples

Note: The following examples use environment variables. Use a script to create environment variables with the correct values for your environment. You can optionally add the listed environment variables to the install variables script. For more information, see Best practice: Setting up install variables.
Define the environment variables.
export PROFILE=<The Cloud Pak for Data configuration profile name>
List available projects for the specified Cloud Pak for Data configuration profile name.
cpd-cli project list \
--profile=${PROFILE}
Example results.

...
ID                                     Name                               Created                    Description   Tags   
0cabb425-56d9-48fc-a178-f30d22737778   git-demo-project                   2021-02-19T13:47:11.811Z                 []   
45f48375-4cdf-4354-8f51-3dbe933dc0aa   Clustering Demo (git integrated)   2021-05-20T06:31:48.099Z                 []   
7fb76cf7-25be-435d-818e-bd6e9b5254f5   cpdctl-demo                        2021-01-29T08:01:23.363Z                 []