Managing Connections via the Command Line
You can use the datasphere command line interface to read, list, validate, create, edit, and delete connections.
Prerequisites
-
Data Warehouse General (-R------) - To access SAP Datasphere.
-
Data Warehouse Connection (CRUD----) - To create, edit, validate, or delete a connection.
-
Space Files (CRUD----) - To create, read, update, and delete objects in your spaces.
-
Connection (-R------)
-
Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line Interface).
-
Log in to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client).
datasphere spaces connections
For information about working with connections in SAP Datasphere, see Integrating Data via Connections.
Connection Types Supported for Creating and Editing Connections
Creating and editing connections via the command line is supported for the following connection types:
|
Connection Type |
Type ID in the Command Line |
More Information |
|---|---|---|
|
Amazon Athena |
ATHENA |
|
|
Amazon Redshift |
REDSHIFT |
|
|
Amazon Simple Storage Service |
S3 |
Amazon Simple Storage Service (Connection Definition File Format) |
|
Apache Kafka |
KAFKA |
|
|
Cloud Data Integration |
CDI |
|
|
Confluent |
CONFLUENT |
|
|
Generic JDBC |
GENERICJDBC |
|
|
Generic OData |
ODATA |
|
|
Generic SFTP |
SFTP |
|
|
Google BigQuery |
BIGQUERY |
|
|
Google Cloud Storage |
GCS |
|
|
Hadoop Distributed File System |
HDFS |
Hadoop Distributed File System (Connection Definition File Format) |
|
Microsoft Azure Blob Storage |
WASB |
Microsoft Azure Blob Storage (Connection Definition File Format) |
|
Microsoft Azure Data Lake Store Gen2 |
ADL |
Microsoft Azure Data Lake Store Gen2 (Connection Definition File Format) |
|
Microsoft Azure SQL Database |
AZURESQL |
Microsoft Azure SQL Database (Connection Definition File Format) |
|
Microsoft SQL Server |
MSSQL |
|
|
Oracle |
ORACLEDB |
|
|
SAP ABAP |
ABAP |
|
|
SAP BW |
SAPBW |
|
|
SAP BW∕4HANA Model Transfer |
SAPBWMODELTRANSFER |
SAP BW∕4HANA Model Transfer (Connection Definition File Format) |
|
SAP ECC |
SAPECC |
|
|
SAP HANA |
HANA |
|
|
SAP HANA Cloud, Data Lake Files |
HDL_FILES |
SAP HANA Cloud, Data Lake Files (Connection Definition File Format) |
|
SAP HANA Cloud, Data Lake Relational Engine |
HDLDB |
SAP HANA Cloud, Data Lake Relational Engine (Connection Definition File Format) |
|
SAP SuccessFactors |
SAPSF |
|
|
SAP S/4HANA Cloud |
SAPS4HANACLOUD |
|
|
SAP S/4HANA On-Premise |
SAPS4HANAOP |
List Connections in a Space
You can list all the connections in a space and optionally write the output to a file.
datasphere spaces connections list --space <space> [--accept <accept>] [--details] [--name] [--features ] [--top <n>] [--skip <n>] [--output file.json]
|
Parameter |
Description |
|---|---|
|
--space <space> |
Enter the Space ID of the space. |
|
--accept <accept> |
[optional] Specify the format to return the connections definition in. You can choose between:
|
|
--details |
[optional] List the connections with all their details except for credentials. |
|
--name |
[optional] List only the connections' technical names. |
|
--features |
[optional] List the connections with their technical names and their information about enabled and disabled features. |
|
--top <n> |
[optional] List only the first <n> connections (according to their creation date), up to a maximum of 200. Default: 10 |
|
--skip <n> |
[optional] Skip the first <n> connections. Default: 0 |
|
--output <file>.json |
[optional] Enter a path to a .json file to write the output to. If you do not include this option, the output will be printed to the command line. |
datasphere spaces connections list --space MySpace --output MySpaceConnections.json
Read Connection Details
You can read the JSON definition of a connection (without its credentials) in a space and optionally write the output to a file.
datasphere spaces connections get
--space <space>
--name <name>
[--output file.json]
|
Parameter |
Description |
|---|---|
|
--space <space> |
Enter the Space ID of the space. |
|
--name <name> |
[optional] Enter the technical name of the connection. |
|
--output <file>.json |
[optional] Enter a path to a .json file to write the output to. If you do not include this option, the output will be printed to the command line. |
datasphere spaces connections list --space MySpace --name MyConnection --output MySpaceConnections.json
Create Connections
You can create a connection in a space by providing a definition in a JSON file or an input string. For an overview of supported connection types and information about the required file format, see Connection Types Supported for Creating and Editing Connections.
datasphere spaces connections create
--space <space>
--type-id <connection type id>
--file-path<path> | --input <input>
|
Parameter |
Description |
|---|---|
|
--space <space> |
Enter the Space ID of the space. |
|
--type-id <connection type id> |
Enter the connection type id (see Connection Types Supported for Creating and Editing Connections). |
|
--file-path<path> |
[optional] Enter a path to a file with a .json extension containing your connection definition. |
|
--input <input> |
[optional] Provide your connection definition in stringified json format instead of via the --file-path option. |
datasphere spaces connections create --space MySpace --type-id SAPSF --file-path MySFConnectionDefinition.json
Validate Connections
You can validate a connection in a space.
datasphere spaces connections validate
--space <space>
--name <name>
|
Parameter |
Description |
|---|---|
|
--space <space> |
Enter the Space ID of the space. |
|
--name <name> |
Enter the technical name of the connection. |
datasphere spaces connections validate --space MySpace --name MyConnection
Edit Connections
You can edit a connection in a space by providing a new definition in a JSON file or an input string. For an overview of supported connection types and information about the required file format, see Connection Types Supported for Creating and Editing Connections.
datasphere spaces connections edit
--space <space>
--name <name>
--file-path<path> | --input <input>
|
Parameter |
Description |
|---|---|
|
--space <space> |
Enter the Space ID of the space. |
|
--name <name> |
Enter the technical name of the connection. |
|
--file-path<path> |
[optional] Enter a path to a file with a .json extension containing your connection definition. |
|
--input <input> |
[optional] Provide your connection definition in stringified json format instead of via the --file-path option. |
datasphere spaces connections edit --space MySpace --name MySFConnection --file-path MySFConnectionDefinition.json
Delete Connections
You can delete a connection in a space.
datasphere spaces connections delete
--space <space>
--name <name>
[--force]
|
Parameter |
Description |
|---|---|
|
--space <space> |
Enter the Space ID of the space. |
|
--name <name> |
Enter the technical name of the connection. |
|
--force |
[optional] Suppress the Confirm Deletion dialog and delete the connection without confirmation. |
datasphere spaces connections delete --space MySpace --name MyConnection --force