asset search
In a specified catalog, search for assets of a generic asset type (asset) or a specific asset type.
Syntax
cpd-cli asset search \
--profile=<cpd-profile-name> \
--query=<lucene-query> \
--type-name=<asset-type-name> \
[--bookmark=<pagination-bookmark>] \
[--catalog-id=<catalog-id>] \
[--context=<catalog-project-or-space-id>] \
[--counts=<counts>] \
[--cpd-config=<cpd-config-location>] \
[--cpd-scope=<cpd-scope>] \
[--drilldown=<map-string-array-list>] \
[--include=<comma-separated-list-of-response-fields>] \
[--jmes-query=<jmespath-query>] \
[--limit=<resource-limit>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
[--project-id=<project-id>] \
[--quiet] \
[--raw-output=true|false] \
[--sort=<query-sort-order>] \
[--space-id=<space-identifier>] \
[--verbose]
Arguments
The asset search command has no
arguments.
Options
Table 1: Command options
| Option | Description |
|---|---|
--bookmark |
Specify a bookmark for
results
pagination.
|
--catalog-id |
Specify either a catalog ID,
project ID, or space ID (specify one only).
|
--context |
Specify the configuration context
name.
|
--cpd-config |
The IBM Software Hub
configuration location. For example,
$HOME/.cpd-cli/config.
|
--cpd-scope |
The IBM Software Hub space,
project, or catalog scope. For example,
cpd://default-context/spaces/7bccdda4-9752-4f37-868e-891de6c48135.
|
--drilldown |
Provide a JSON string option or
specify a JSON file to read from by providing a filepath option that begins with an `@` symbol. For
example, `--drilldown=@path/to/file.json`.
|
|
|
Display command
help.
|
--include |
Retrieves only fields from the
'decision_optimization' and 'scoring' sections. The output response fields are specified as a
comma-separated list. The option retrieves all fields when not
specified.
|
--jmes-query |
Provide a JMESPath query to
customize the output.
|
--limit |
Specify the total number of
resources.
|
--output |
Specify an output
format.
|
--output-file |
Specify a file path where all
output is redirected.
|
--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.
|
--project-id |
Specify an IBM Software Hub
project instance.
|
--query |
The Lucene
query.
|
--quiet |
Suppress verbose
messages.
|
--raw-output |
When set to true, single values
are not surrounded by quotation marks in
JSON output
mode.
|
--sort |
The query sort
order.
|
--space-id |
Specify a space
identifier.
|
--type-name |
The asset type name. For
example,
'data_asset'.
|
--verbose |
Logs include more detailed
messages.
|
Examples
Note: The following examples use environment variables. Use a script to create
environment variables with the correct values for your environment. You can add the listed
environment variables to the installation variables script. For more information, see Setting up installation environment variables.
- Define the environment variables.
-
export FILE_PATH=<upload-file-path-and-name> - List a project script asset with a type name of
script. -
cpd-cli asset search \ --profile=${CPD_PROFILE_NAME} \ --project-id=${PROJECT_CPD_INST_OPERANDS} \ --query=<lucene-query> \ --type-name=script - Search with pagination. You can define a specific number of search results
by adding a
--limitparameter to the request. The following example limits the number of search results to 2. -
cpd-cli asset search \ --limit=2 \ --profile=${CPD_PROFILE_NAME} \ --query=<lucene-query> \ --type-name=<asset-type-name>