connection create
Create a connection with shared credentials.
Syntax
cpd-cli connection create \
--datasource-type=<datasaource-type-id> \
--name=<connection-name> \
--profile=<cpd-profile-name> \
[--asset-category=SYSTEM|USER] \
[--catalog-id=<catalog-id>] \
[--child-source-system=<child-source-systems-list>] \
[--context=source|target] \
[--cpd-config=<cpd-config-location>] \
[--cpd-scope=<cpd-scope>] \
[--description=<description>] \
[--flags=<connection-flags>] \
[--gateway-id=<secure-gateway-id>] \
[--interaction-properties=<connection-interaction-properties>] \
[--jmes-query=<jmespath-query>] \
[--location-definition=<connection-location>] \
[--origin-country=<data-asset-country>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
[--owner-id=<connection-owner-id>] \
[--project-id=<project-id>] \
[--properties=<connections-properties>] \
[--quiet] \
[--raw-output=true|false] \
[--ref-asset-id=<reference-catalog-connection-id>] \
[--ref-catalog-id=<catalog-connection-id>] \
[--rov=<rules-of-visibility>] \
[--skip-enforcement] \
[--source-system=<source-system-information>] \
[--space-id=<space-identifier>] \
[--tags<tag1,tag2,...>] \
[--test=true|false] \
[--verbose]
Arguments
The connection create command has
no arguments.
Options
Table 1: Command options
| Option | Description |
|---|---|
--asset-category |
Specify the asset
category.
|
--catalog-id |
Specify either a catalog ID,
project ID, or space ID (specify one only).
|
--child-source-system |
Specify a list of child source
systems.
|
--context |
Specify whether assets
are discovered for reading (source) or writing (target). 'source' is the default when
no value is
specified.
|
--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.
|
--datasource-type |
Specify the name or ID of the
data
source type to connect to. For example, "cfdcb449-1204-44ba-baa6-9a8a878e6aa7"
or
"db2".
|
--description |
Specify a connection
description.
|
--flags |
Specify a comma-separated list of
flags that must be present for the connection to be included in the list. Only connections with no
flags are returned when the option is not specified.
|
--gateway-id |
Specify a secure gateway ID to use
with the connection. A secure gateway is required when you connecting to an on-premises data
source.
The secure gateway ID is created with the Secure Gateway Service. Your on-premises secure
gateway
client must be connected to the gateway with this ID. For
example,
'E9oXGRIhv1e_prod_ng'.
|
|
|
Display command
help.
|
--interaction-properties |
Specify the interaction
properties that are allowed for a connection.
|
--jmes-query |
Provide a JMESPath query to
customize the output.
|
--location-definition |
Specify the connection
location.
|
--name |
|
--origin-country |
Specify the data asset ISO 3166
origin country code.
|
--output |
Specify an output
format.
|
--output-file |
Specify a file path where all
output is redirected.
|
--owner-id |
Specify the connection owner or
creator ID. The owner or creator ID is provided when a service ID token is used to create a
connection.
|
--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.
|
--properties |
Specify a JSON
object
that contains a set of properties to configure asset
browsing
aspects.
|
--quiet |
Suppress verbose
messages.
|
--raw-output |
When set to true, single values
are not surrounded by quotation marks in
JSON output
mode.
|
--ref-asset-id |
Specify the ID of the connection
in the reference catalog that the connection refers to for properties
values.
|
--ref-catalog-id |
Specify the catalog ID that the
connection refers to for properties values.
|
--rov |
Specify the rules of visibility
for connections.
|
--skip-enforcement |
When the option is specified,
shared credentials disablement and vault credentials enforcement guards are disabled for creation
and updates.
|
--source-system |
Specify custom data that is
associated with an object.
|
--space-id |
Specify a space
identifier.
|
--tags |
Specify the data asset tags.
Multiple tags can be specified.
|
--test |
When the option is set to 'true',
the connection is tested before it is saved The connection is not saved when a connection is not
established.
|
--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 CONNECTION_DESCRIPTION=<The connection description> export CONNECTION_NAME=<The connection name> export CREATE_CONN_PROPERTIES= ''' { "database": "<database>", "host": "<host>", "password": "<password>", "username": "<username>" } ''' export COUNTRY_CODE=<The data asset ISO 3166 origin country code> export DS_TYPE=<The datasource type name or identifier> export OUTPUT_TYPE=<The output format ('json', 'yaml', or 'text')> - Create a connection.
-
cpd-cli connection create \ --description=${CONNECTION_DESCRIPTION} \ --datasource-type=${DS_TYPE} \ --origin-country=${COUNTRY_CODE} \ --output=${OUTPUT_TYPE} \ --profile=${CPD_PROFILE_NAME} \ --project-id=zen \ --properties=${CREATE_CONN_PROPERTIES} \ --name=${CONNECTION_NAME}