asset promote

Promote project assets to the space.

Syntax

cpd-cli asset promote \
--asset-id=<asset-guid> \
[--context=<catalog-project-or-space-id>] \
[--cpd-config=<cpd-config-location>] \
[--cpd-scope=<cpd-scope>] \
[--jmes-query=<jmespath-query>] \
[--limit=<resource-limit>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
--profile=<cpd-profile-name> \
--project-id=<cpd-project-id> \
[--quiet] \
[--raw-output=true|false] \
--request-body=<request-body-map> \
[--revision-id=<revision-id>] \
[--verbose]

Arguments

The asset promote command has no arguments.

Options

Option Description
--asset-id Specify the asset GUID.
Status
Required.
Syntax
--asset-id=<asset-guid>
Default value
No default.
Valid values
Any valid asset GUID.
--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.
--cpd-scope The Cloud Pak for Data space, project, or catalog scope. For example, cpd://default-context/spaces/7bccdda4-9752-4f37-868e-891de6c48135.
Status
Optional.
Syntax
--cpd-scope=<cpd-scope>
Default value
No default.
Valid values
A valid Cloud Pak for Data space, project, or catalog scope.

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.
--jmes-query The Lucene query.
Status
Required.
Syntax
--query=<lucene-query>
Default value
No default.
Valid values
A valid Lucene query.
--output Specify an output format.
Status
Optional.
Syntax
--output=json|yaml|text
Default value
text
Valid values
Valid formats include JSON, YAML, or text (the default format).
--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-profile-name>
Default value
No default.
Valid values

The name of the profile that you created.

--project-id Specify a Cloud Pak for Data project instance.
Status
Required.
Syntax
--project-id=<cpd-project-id>
Default value
No default.
Valid values
A valid project identifier.
--quiet Suppress verbose messages.
Status
Optional.
Syntax
--quiet
Default value
No default.
Valid values
Not applicable.
--raw-output When set to true, single values are not surrounded by quotation marks in
 JSON output mode.
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.
--request-body Specify the asset permission and metadata. For example, { "mode": 0, "space_id":"string", "metadata":{"name":"string",
"description":"string", "tags":["string","string"]} }. Values for mode include 0 (public), 8
 (private), and 16 (hidden). The current mode applies when a mode is not specified. 'space_id' is the target space ID. Metadata can contain attributes to overwrite values in the original asset (name, description, and tags can be overwritten).
Status
Required.
Syntax
--request-body=<request-body-map>
Default value
No default.
Valid values
A valid asset permission and metadata map.
--revision-id Specify a revision ID. For
 example, 1, 2, 3.. The current asset version is used when no value is specified. Specify
'latest' for the most recent revision.
Status
Optional.
Syntax
--revision-id=<revision-id>
Default value
No default.
Valid values
Any valid revision ID.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.

Table 1: Command options

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 Best practice: Setting up installation environment variables.
Specify the environment variables, the script asset for promotion, and the expected name and metadata in a script file.
ASSET_ID=<The asset GUID>
PROJECT_CPD_INST_OPERANDS=os.getenv('PROJECT_ID')
PROMOTE={
    "mode": 0,
    "space_id": space_id,
    "metadata": {
        "name": "batch_job_script.py",
        "tags": ["cpdctl-demo", "promoted-asset-{}]".format(script_id)]
    }
}
PROMOTE_JSON=json.dumps(promote)
Promote an asset.
cpd-cli asset promote \
--asset-id=${FILE_PATH} \
--profile=${CPD_PROFILE_NAME} \
--project-id=${PROJECT_CPD_INST_OPERANDS} \
--request-body=${PROMOTE_JSON}