asset data-asset create
Create an asset in the catalog or project.
Syntax
cpd-cli asset data-asset create \
--entity=<entity-map> \
--metadata=<assetmetadata-object> \
--profile=<profile-name> \
[--attachments=<asset-attachment-object>] \
[--catalog-id=<catalog-id>] \
[--context=<catalog-project-or-space-id>] \
[--cpd-config=<cpd-config-location>] \
[--cpd-scope=<cpd-scope>] \
[--jmes-query=<jmespath-query>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
[--project-id=<project-id>] \
[--quiet] \
[--raw-output=true|false] \
[--space-id=<space-identifier>] \
[--verbose]
Arguments
The asset data-asset create command
has no arguments.
Options
Table 1: Command options
| Option | Description |
|---|---|
--attachments |
The AssetAttachment
object.
|
--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.
|
--entity |
The underlying table
definition.
|
|
|
Display command
help.
|
--jmes-query |
Provide a JMESPath query to
customize the output.
|
--metadata |
The system metadata
(AssetMetadata
object) regarding the table definition.
|
--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 IBM Software Hub and your credentials for the
instance.
|
--project-id |
Specify an IBM Software Hub
project instance.
|
--quiet |
Suppress verbose
messages.
|
--raw-output |
When set to true, single values
are not surrounded by quotation marks in
JSON output
mode.
|
--space-id |
Specify a space
identifier.
|
--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.
- Replace the following properties with your
data.
export ASSET_METADATA= = ''' { "name": "connected-data-asset", "asset_type": "data_asset", "origin_country": "us", "asset_category": "USER" } ''' export ASSET_ENTITY = ''' { "data_asset": { "mime_type": "text/csv", "dataset": false } } ''' export ATTACHMENTS = ''' [ { "asset_type": "data_asset", "connection_id": "replace_with_connection_id", "connection_path": "CONNUSER/product.csv" } ] ''' export OUTPUT_TYPE=<The output format ('json', 'yaml', or 'text')> - Create a connected data asset.
-
cpd-cli asset data-asset create \ --attachments=${ATTACHMENTS} \ --entity=${ASSET_ENTITY} --metadata=${ASSET_METADATA} \ --output=${OUTPUT_TYPE} \ --project-id=${PROJECT_CPD_INST_OPERANDS}