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.
|
--context |
Specify the configuration context
name.
|
--cpd-config |
The Cloud Pak for Data
configuration location. For example,
$HOME/.cpd-cli/config.
|
--cpd-scope |
The Cloud Pak for Data space, project, or catalog scope. For example, cpd://default-context/spaces/7bccdda4-9752-4f37-868e-891de6c48135.
|
|
Display command
help.
|
--jmes-query |
The Lucene
query.
|
--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 a Cloud Pak for Data
project instance.
|
--quiet |
Suppress verbose
messages.
|
--raw-output |
When set to true, single values
are not surrounded by quotation marks in
JSON output
mode.
|
--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).
|
--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.
|
--verbose |
Logs include more detailed
messages.
|
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}