connection discover-adhoc

Discover assets from the data source that is accessed through a connection description.

Syntax

cpd-cli connection discover-adhoc \
--datasource-type=<datasaource-type-id> \
--name=<connection-name> \
--path=<asset-file-path> \
--profile=<profile-name> \
[--asset-category=SYSTEM|USER] \
[--asset-properties=<json-object>] \
[--child-source-system=<child-source-systems-list>] \
[--context=<catalog-project-or-space-id>] \
[--cpd-config=<cpd-config-location>] \
[--description=<description>] \
[--detail=true|false] \
[--discovery-context=source|target] \
[--fetch=<asset-type1,asset-type2,...>] \
[--filters=<json-filter>] \
[--flags=<connection-flags>] \
[--gateway-id=<secure-gateway-id>] \
[--interaction-properties=<connection-interaction-properties>] \
[--jmes-query=<jmespath-query>] \
[--limit=<resource-limit>] \
[--new-location-definition<location-definition>] \
[--new-source-system=<custom-data-map>] \
[--offset=<resource-offset>] \
[--origin-country=<data-asset-country>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
[--owner-id=<connection-owner-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>] \
[--tags=<tag1,tag2,...>] \
[--verbose]

Arguments

The connection discover-adhoc command has no arguments.

Options

Table 1: Command options
Option Description
--asset-category Specify the asset
 category.
Status
Optional.
Syntax
--asset-category=SYSTEM|USER
Default value
No default.
Valid values
SYSTEM|USER
--asset-properties Specify a JSON object that
 contains a set of properties to configure asset browsing
 aspects.
Status
Optional.
Syntax
--asset-properties=<json-object>
Default value
No default.
Valid values
Any valid JSON object name.
--child-source-system Specify a list of child source
 systems.
Status
Optional.
Syntax
--child-source-system=<child-source-systems-list>
Default value
No default.
Valid values
A valid 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.
Status
Optional.
Syntax
--context=source|target
Default value
source
Valid values
source
Assets are discovered for reading.
target
Assets are discovered for writing.
--cpd-config The IBM Software Hub
 configuration location. For example, $HOME/.cpd-cli/config.
Status
Optional.
Syntax
--cpd-config=<cpd-config-location>
Default value
$HOME/.cpd-cli/config
Valid values
A valid IBM® Software Hub configuration location.
--datasource-type Specify the name or ID of the data
source type to connect to. For example, "cfdcb449-1204-44ba-baa6-9a8a878e6aa7" or
"db2".
Status
Required.
Syntax
--datasource-type=<datasaource-type-id>
Default value
No default.
Valid values
A valid data source name or ID.
--description Specify a connection
 description.
Status
Optional.
Syntax
--description=<description>
Default value
No default.
Valid values
A valid connection description.
--detail When the option is set to 'true', additional asset-specific details are returned. When the option is set to 'false' specified, the details are
 not returned.
Status
Optional.
Syntax
--detail=true|false
Default value
true
Valid values
true
Additional asset-specific details are returned.
false
Additional asset-specific details are not returned.
--discovery-context Specify whether assets are
 discovered for reading (source) or writing (target). 'source' is the default when a
 value is not specified.
Status
Optional.
Syntax
--discovery-context=source|target
Default value
source
Valid values
source
Assets are discovered for reading.
target
Assets are discovered for writing.
--fetch Specify whether to return the
 asset's metadata, the asset's data, interaction properties, connection properties, or the data
source type. 'metadata' is the default when the option is not specified. The option applies only
 when requesting details about a data set. Use a comma-separated string to specify multiple fetch
 values. For example,
 --fetch=data,metadata,interaction,connection,datasource_type.
Status
Optional.
Syntax
--fetch=<asset-type1,asset-type2,...>
Default value
No default.
Valid values
A comma-separated string of asset properties.
--filters Specify a custom filters *.json file path. The default filters work for most cases.
Status
Optional.
Syntax
--filters=<json-file-path>
Default value
No default.
Valid values
A valid *.json file path. The following example provides typical filter formatting.
{
   "Custom": {
      "LDAP_USERFILTER": "(&(%s=%%v)(objectclass=ePerson))",
      "LDAP_GROUPFILTER": "(&(%s=%%v)(objectclass=groupOfUniqueNames))",
      "LDAP_USERIDMAP": "*:%s",
      "LDAP_GROUPIDMAP": "*:%s",
      "LDAP_GROUPMEMBERIDMAP": "groupOfUniqueNames:%s"
   }
}
The objectclass sections are customizable; the other strings are part of the template and must be left as is. In most cases, the defaults settings work. Editing the objectclass sections is only needed when special extended schema is used.
--flags Identify flags that specify how a
 connection is treated internally.
Status
Optional.
Syntax
--flags=<connection-flags>
Default value
No default.
Valid values
Valid flags that specify how a connection is treated internally.
--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'.
Status
Optional.
Syntax
--gateway-id=<secure-gateway-id>
Default value
No default.
Valid values
A secure gateway ID.

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.
--jmes-query Provide a JMESPath query to customize the output.
Status
Optional.
Syntax
--jmes-query=<jmespath-query>
Default value
No default.
Valid values
A valid JMESPath query.
--interaction-properties Specify the interaction properties that are allowed for a connection.
Status
Optional.
Syntax
--interaction-properties=<connection-interaction-properties>
Default value
No default.
Valid values
A valid list of interaction properties.
--limit Specify the total number of resources.
Status
Optional.
Syntax
--limit=<resource-limit>
Default value
100
Valid values
An integer value in the range 0 - 200.
--name
Status
Required.
Syntax
--name=<connection-name>
Default value
Specify the connection
 name.
No default.
Valid values
A valid connection name.
--new-location-definition Specify the location that is used by the connection.
Status
Optional.
Syntax
--new-location-definition=<location-definition>
Default value
No default.
Valid values
A valid connection location.
--new-source-system Specify custom data that is associated with an object.
Status
Optional.
Syntax
--new-source-system=<custom-data-map>
Default value
No default.
Valid values
A valid custom data map.
--offset Specify the 0-based index of the first result to return. For example, --offset=200. The default offset of 0 is used when no value is specified.
Status
Optional.
Syntax
Specify an offset value for
 returned resources.=<resource-offset>
Default value
0
Valid values
A valid offset value.
--origin-country Specify the data asset ISO 3166 origin country code.
Status
Optional.
Syntax
--origin-country=<data-asset-country>
Default value
us
Valid values
A valid ISO 3166 origin country code.
--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.
--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.
Status
Optional.
Syntax
--owner-id=<connection-owner-id>
Default value
No default.
Valid values
A valid connection owner or creator ID.
--path Specify the asset file path.
Status
Required.
Syntax
--path=<asset-file-path>
Default value
No default.
Valid values
A valid asset file path.
--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.
Status
Required.
Syntax
--profile=<profile-name>
Default value
No default.
Valid values

The name of the profile that you created.

--properties Specify a JSON object
that contains a set of properties to configure asset browsing
aspects.
Status
Optional.
Syntax
--properties=<connections-properties>
Default value
No default.
Valid values
A valid JSON object.
--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.
--ref-asset-id Specify the ID of the connection in the reference catalog that the connection refers to for properties values.
Status
Optional.
Syntax
--ref-asset-id=<reference-catalog-connection-id>
Default value
No default.
Valid values
A valid reference catalog connection ID.
--ref-catalog-id Specify the catalog ID that the
 connection refers to for properties values.
Status
Optional.
Syntax
--ref-catalog-id=<catalog-connection-id>
Default value
No default.
Valid values
A valid catalog connection ID.
--rov Specify the rules of visibility for connections.
Status
Optional.
Syntax
--rov=<rules-of-visibility>
Default value
No default.
Valid values
Any valid rules of visibility for connections.
--tags Specify the data asset tags. Multiple tags can be specified.
Status
Optional.
Syntax
--tags=<tag1,tag2,...>
Default value
No default.
Valid values
A valid list of comma-separated data asset tags.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.

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 DS_TYPE=<The data source name or identifier>
export CONNECTION_NAME=<The connection name>
export ASSET_PATH=<The asset file path>
export CONNECTION_PROPERTIES=<The JSON object
that contains a set of properties to configure asset browsing
aspects>
Discover connections.
cpd-cli connection discover-adhoc \
--datasource-type=${DS_TYPE} \
--name=${CONNECTION_NAME} \
--path=${ASSET_PATH} \
--properties=${CONNECTION_PROPERTIES}