Nothing Special   »   [go: up one dir, main page]

Sap DATASPHERE

Download as pdf or txt
Download as pdf or txt
You are on page 1of 88

PUBLIC

Document Version: 2023.25 – 2023-11-28

Accessing SAP Datasphere via the Command Line


© 2023 SAP SE or an SAP affiliate company. All rights reserved.

THE BEST RUN


Content

1 Accessing SAP Datasphere via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


1.1 Install or Update the SAP Datasphere Command Line Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Set a Host Value to Identify Your SAP Datasphere Tenant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Log into the Command Line Interface via an OAuth Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Manage Users via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.5 Manage Scoped Roles via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.6 Manage Spaces via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
Manage Space Users via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Reset Database User Passwords via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
The Space Definition File Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.7 Manage Data Marketplace Data Providers via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . 36
The Data Provider Definition File Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
1.8 Manage Data Marketplace Data Products via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . 54
The Data Product Definition File Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64
1.9 Manage Tasks and Task Chains via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
1.10 Miscellaneous Options and Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
1.11 Command Line Roles and Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

Accessing SAP Datasphere via the Command Line


2 PUBLIC Content
1 Accessing SAP Datasphere via the
Command Line

You can use our command line interface, datasphere, to connect to SAP Datasphere and manage certain
types of objects.

 Note

The SAP Datasphere command line interface module has been renamed from dwc to datasphere. The
command dwc will be decommissioned at the end of 2023: please use the new datasphere command
instead. For more information, see https://www.npmjs.com/package/@sap/datasphere-cli .

To use datasphere, you must install it (see Install or Update the SAP Datasphere Command Line Interface
[page 4]).

We recommend that you log in via an OAuth client (see Log into the Command Line Interface via an OAuth
Client [page 6]).

The primary commands available are:

Command Description

datasphere dbusers Users with the DW Space Administrator role (or equivalent privileges) can reset database
user passwords (see Reset Database User Passwords via the Command Line [page 28]).

datasphere Users with the DW Modeler role (or equivalent privileges) can manage data providers (see
marketplace Manage Data Marketplace Data Providers via the Command Line [page 36]) and data
products (see Manage Data Marketplace Data Products via the Command Line [page 54]).

datasphere scoped- Users with the DW Administrator role (or equivalent privileges) can manage scoped roles
roles (see Manage Scoped Roles via the Command Line [page 12]).

datasphere spaces Users with the: DW Administrator role (or equivalent privileges) can create spaces and
allocate storage and memory to them, while users with the DW Space Administrator role can
manage and staff spaces (see Manage Spaces via the Command Line [page 20]).

datasphere tasks Users with the DW Integrator role (or equivalent privileges) can orchestrate tasks and task
chains (see Manage Tasks and Task Chains via the Command Line [page 82]).

datasphere users Users with the DW Administrator role (or equivalent privileges) can manage SAP Datasphere
users (see Manage Users via the Command Line [page 9]).

 Note

See the blog @sap/datasphere-cli: Command-Line Interface for SAP Datasphere: Overview (updated
September 2022) for a summary of blogs about working with the command line interface.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 3
1.1 Install or Update the SAP Datasphere Command Line
Interface
The SAP Datasphere command line interface (datasphere) is a Node.js package that you download using
the Node Package Manager (npm).

Context

datasphere is listed on https://www.npmjs.com/ at https://www.npmjs.com/package/@sap/datasphere-


cli .

 Note

The SAP Datasphere command line interface module has been renamed from dwc to datasphere. The
command dwc will be decommissioned at the end of 2023: please use the new datasphere command
instead. For more information, see https://www.npmjs.com/package/@sap/datasphere-cli .

Prerequisites
You have installed the following on your system:

• Node.js version >= 18


• npm version >= 8

npm is distributed with Node.js. Therefore, when you download Node.js, npm is automatically installed. To
download the Node.js installer, see nodejs.org .

 Note

You can test if Node.js and npm are installed on your system by executing the following commands:

• node -v
• npm -v

If Node.js and npm are already installed, then their current versions will appear. If you receive an error, you
have not installed them yet.

Procedure

1. Run the following command:

npm install -g @sap/datasphere-cli

 Note

To update datasphere to the latest version at any time, you just need to run npm install -g
@sap/datasphere-cli again.

Accessing SAP Datasphere via the Command Line


4 PUBLIC Accessing SAP Datasphere via the Command Line
2. Test if the installation was successful by running the following command:

datasphere --version

3. Run the following command to download the file of available datasphere commands:

datasphere config cache init --host "<url>"

Where <url> is the URL of your SAP Datasphere tenant. You can copy the URL of any page in your tenant.

 Note

If new commands become available for datasphere, you will be prompted to run this command again.

4. When prompted, enter the passcode to authorize the command.

1.2 Set a Host Value to Identify Your SAP Datasphere


Tenant

If you specify the url to your SAP Datasphere tenant with the host set command, you can issue any number
of other commands without the need to include the --host option.

 Note

The SAP Datasphere command line interface module has been renamed from dwc to datasphere. The
command dwc will be decommissioned at the end of 2023: please use the new datasphere command
instead. For more information, see https://www.npmjs.com/package/@sap/datasphere-cli .

To specify the url to your SAP Datasphere tenant, enter:

datasphere config host set <url>

To display the stored url, enter:

datasphere config host show

To delete the stored url, enter:

datasphere config host clean

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 5
1.3 Log into the Command Line Interface via an OAuth
Client

If an administrator has created an OAuth client for datasphere command line interface users to log into, there
are several methods for accessing it.

For information about creating an OAuth client, see Create OAuth2.0 Clients to Authenticate Against SAP
Datasphere.

This topic contains the following sections:

• Log in by Passing OAuth Client Information as Options [page 6]


• Log in by Passing OAuth Client Information in a Secrets File [page 7]
• Avoid Running a Login Command by Extracting Access and Refresh Tokens [page 8]
• Log Out from the Command Line Interface via an Oauth Client [page 9]

 Note

See the following blogs for more information about working with the command line interface and OAuth:

• @sap/datasphere-cli: Getting Rid of Passcodes Thanks to OAuth Client Support (published


September 2022)
• FAQ and Troubleshooting Guide for @sap/datasphere-cli (published June 2023)

 Note

The SAP Datasphere command line interface module has been renamed from dwc to datasphere. The
command dwc will be decommissioned at the end of 2023: please use the new datasphere command
instead. For more information, see https://www.npmjs.com/package/@sap/datasphere-cli .

Log in by Passing OAuth Client Information as Options

You can log in by passing the OAuth client information as options on the command line.

 Note

You must have write access to the CLI installation folder.

To log in, enter the following command and press Return :

datasphere login
--client-id "<id>"
--client-secret "<secret>"

 Note

You will be directed to log in with your SAP Datasphere username and password in a browser window once
at the beginning of your OAuth session to determine your space permissions.

Accessing SAP Datasphere via the Command Line


6 PUBLIC Accessing SAP Datasphere via the Command Line
You must specify the host which you are logging into using the option --host , or by first setting the host by
calling datasphere config host set <host>, to allow the CLI to store the secret for the defined tenant
URL. When running a command, the CLI uses the secret matching the currently maintained tenant URL via the
--host option or set via datasphere config host set <host>.

To connect to multiple tenants in parallel, switch the host info.


Complete the parameters as follows:

Parameter Description

--client-id "<id>" Enter the OAuth Client ID provided by your administrator.

 Note
The client ID must be encoded as a URI when passed as a parameter.

--client-secret Enter the Secret provided by your administrator.


"<secret>"
 Note
The secret must be encoded as a URI when passed as a parameter.

--authorization-url [optional] Enter the Authorization URL provided by your administrator.


"<url>"

--token-url "<url>" [optional] Enter the Token URL provided by your administrator.

Log in by Passing OAuth Client Information in a Secrets File

You can log in more securely by passing the OAuth client information in a secrets file instead of on the
command line.

 Note

You must have write access to the CLI installation folder.

To log in, enter the following command and press Return :

datasphere login
--secrets-file <file>.json

 Note

You will be directed to log in with your SAP Datasphere username and password in a browser window once
at the beginning of your OAuth session to determine your space permissions.

Complete the parameters as follows:

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 7
Parameter Description

--secrets-file Prepare a .json file with the following syntax:


<file>.json
{
"client_id": "<client-id>",
"client_secret": "<client-secret>",
"authorization_url": "<authorization-url>",
"token_url": "<token-url>"
}

 Note
Secrets files use versions of the options with underscores instead of hyphens.

Avoid Running a Login Command by Extracting Access and Refresh Tokens

You can avoid running a login command (and entering your SAP Datasphere username and password) at the
beginning of each OAuth session by extracting the personal access and refresh tokens and passing them either
as options or in a secrets file.

To extract your tokens, log into datasphere as usual and then enter the following command and press
Return :

datasphere config secrets show

Example output:

$ datasphere config secrets show


[
{
"id": 0,
"client_id": "sb-0d85e619...",
"client_secret": "1dcc0522-...",
"tenantUrl": "https://somehost.eu10.cloud.sap",
...
},
{
"id": 1,
"client_id": "sb-0d85e619...",
"client_secret": "1dcc0522-...",
"tenantUrl": "https://somehost.us10.cloud.sap",
...
}
]

Then copy the values for access_token and refresh_token. You can pass these values either as options on
the command line or in an options file.

 Note

Your access and refresh tokens are valid for 720 hours (30 days).

Having extracted your tokens, you no longer need to log in at the beginning of your session and can pass your
tokens in a secrets file with any command.

Accessing SAP Datasphere via the Command Line


8 PUBLIC Accessing SAP Datasphere via the Command Line
For example, the following command, to read a space, can be run without having logged in beforehand:

datasphere spaces read --space My_SPACE --options-file <options-file>.json --


secrets-file <secrets-file>.json

Where the <options-file>.json contains appropriate options and the <secrets-file>.json contains
the following options:

{
"client_id": "<client-id>",
"client_secret": "<client-secret>",
"authorization_url": "<authorization-url>",
"token_url": "<token-url>",
}

 Note

Secrets files use versions of the options with underscores instead of hyphens.

Log Out from the Command Line Interface via an Oauth Client

To log out from an account, use the datasphere logout command: this command allows you to optionally
specify the ID of the login/secret to remove using the option --login-id <id>.

To log out, enter the following command and press Return :

datasphere logout
--login-id <id>

By default, when you omit the option --login-id <id> the login/secret with ID 0 is removed.

Parameter Description

--login-id <id> Optional: specifies the login ID (choices: "0", default: "0").

1.4 Manage Users via the Command Line

Users with a DW Administrator role (or with equivalent privileges) can list, create, update, and delete users via
the command line.

This topic contains the following sections:

• Working with Users on the Command Line [page 10]


• List Users [page 10]
• Create Users [page 10]
• Update Users [page 11]
• Delete Users [page 12]

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 9
Working with Users on the Command Line

To work with users on the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Login to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client [page
6]).
• Have a role of DW Administrator or equivalent privileges (see Command Line Roles and Privileges [page
86]).

To browse the available commands entering the following and press Return :

datasphere users

For general information about working with users in SAP Datasphere, see Managing SAP Datasphere Users

List Users

You can list the user in your tenant, and optionally write them to a file.

Enter the following command and press Return :

datasphere users list


[--accept <format>]
[--output file.json]

Complete the parameters as follows:

Parameter Description

--accept <format> [optional] Specify the format to return the user definition in. You can choose between:

• application/vnd.sap.datasphere.space.users.list+json - [de-
fault] Standard list including user name, first name, last name, display name, and email.
• application/vnd.sap.datasphere.space.users.details+json - In
addition, includes manager and roles.

--output [optional] Enter a path to a .json file to write the output to.
<file>.json
If you do not include this option, the output will be printed to the command line.

Create Users

You can create users by providing definitions in a JSON file or an input string.

Enter the following command and press Return :

datasphere users create


--file-path <file>.json|--input '<stringified-json>'

Accessing SAP Datasphere via the Command Line


10 PUBLIC Accessing SAP Datasphere via the Command Line
Complete the parameters as follows:

Parameter Description

--file-path [optional] Enter a path to a file with a .json extension containing your user definitions.
<file>.json
[
{
"userName": "<userID>",
"firstName": "<firstName>",
"lastName": "<lastName>",
"email": "<email>"
},
{
"userName": "<userID>",
"firstName": "<firstName>",
"lastName": "<lastName>",
"email": "<email>"
}
]

--input [optional] Provide your input in stringified json format instead of via the --file-path
'<stringified- option.
json>'

For example, to create users from a file, enter the following command and press Return :

datasphere users create --file-path users.json

Where the file users.json contains the following:

[
{
"userName": "BBaxter",
"firstName": "Bob",
"lastName": "Baxter",
"email": "b.baxter@acme.com"
},
{
"userName": "JJones",
"firstName": "Jennifer",
"lastName": "Jones",
"email": "j.jones@acme.com"
}
]

Update Users

You can update the email or manager of a user by providing a new definition in a JSON file or an input string.

Enter the following command and press Return :

datasphere users update


--file-path <file>.json|--input '<stringified-json>'

Complete the parameters as follows:

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 11
Parameter Description

--file-path [optional] Enter a path to a file with a .json extension containing your user definitions.
<file>.json
[

{
"userName": "<userID>",
"email": "<email>"
},
{
"userName": "<userID>",
"manager": "<manager userID>"
},
{
"userName": "<userID>",
"manager": "<manager userID>",
"email": "<email>"
}
]

--input [optional] Provide your input in stringified json format instead of via the --file-path
'<stringified- option.
json>'

Delete Users

datasphere users delete


--users <ID[,ID...]>
[--force]

Complete the parameters as follows:

Parameter Description

--users Enter a comma-separated list of user IDs.


<ID[,ID...]>

--force [optional] Suppress the Confirm Deletion step and delete the scoped role without confirma-
tion.

1.5 Manage Scoped Roles via the Command Line

Users with a DW Administrator role (or with equivalent privileges) can create, read, update, and delete scoped
roles via the command line.

This topic contains the following sections:

• Working with Scoped Roles on the Command Line [page 13]


• List Scoped Roles [page 13]

Accessing SAP Datasphere via the Command Line


12 PUBLIC Accessing SAP Datasphere via the Command Line
• Read Scoped Roles [page 14]
• Create Scoped Roles [page 14]
• Update Scoped Roles [page 15]
• Add Spaces to Scoped Roles [page 16]
• Add Users to Scoped Roles [page 17]
• Remove Users from Scoped Roles [page 18]
• Remove Scopes from Scoped Roles [page 19]
• Delete Scoped Roles [page 19]

Working with Scoped Roles on the Command Line

To work with scoped roles on the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Login to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client [page
6]).
• Have a role of DW Administrator or equivalent privileges (see Command Line Roles and Privileges [page
86]).

To browse the available commands entering the following and press Return :

datasphere scoped-roles

For general information about working with scoped roles in SAP Datasphere, see Create a Scoped Role to
Assign Privileges to Users in Spaces.

List Scoped Roles

You can list the scoped roles in your tenant, and optionally write them to a file.

Enter the following command and press Return :

datasphere scoped-roles list


[--output <file>.json]

Complete the parameters as follows:

Parameter Description

--output [optional] Enter a path to a .json file to write the output to.
<file>.json
If you do not include this option, the output will be printed to the command line.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 13
Read Scoped Roles

You can read the CSN/JSON definition of a scoped role and optionally write it to a file.

Enter the following command and press Return :

datasphere scoped-roles read


--role <id>
[--output <file>.json]

To read the list of spaces that are assigned to a scoped role, and optionally write it to a file, enter the following
command and press Return :

datasphere scoped-roles scopes read


--role <ID>
--output <file>.json

To read the list of users assigned to a scoped role and optionally write it to a file, enter the following command
and press Return :

datasphere scoped-roles users read


--role <ID>
--output <file>.json

Complete the parameters as follows:

Parameter Description

--role <id> Enter the ID of a scoped role in the following form:

PROFILE:<package>.<id>:<roleid>

--output [optional] Enter a path to a .json file to write the output to.
<file>.json
If you do not include this option, the output will be printed to the command line.

Create Scoped Roles

You can create scoped roles by providing a definition in a JSON file or an input string.

Enter the following command and press Return :

datasphere scoped-roles create


--file-path <file>.json|--input '<stringified-json>'

Complete the parameters as follows:

Accessing SAP Datasphere via the Command Line


14 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--file-path [optional] Enter a path to a file with a .json extension containing your scoped role defini-
<file>.json tion.

{
"name": "<Name>",
"description": "<Description>",
"inheritance": [
"PROFILE:<package>.<id>:<Role_Template_Name>"
]
}

--input [optional] Provide your input in stringified json format instead of via the --file-path
'<stringified- option.
json>'

For example, to create the scoped role Sales_Modeler based on the role template Custom_Modeler, enter
the following command and press Return :

datasphere scoped-roles create --file-path sales_modeler.json

Where the file sales_modeler.json contains the following (where <package> and <id> for the tenant are t
and W respectively):

{
"name": "Sales_Modeler",
"description": "Modeler for Sales spaces",
"inheritance": [
"PROFILE:t.W:Custom_Modeler"
]
}

Update Scoped Roles

You can update the description or template role of a scoped role by providing a new definition in a JSON file or
an input string.

Enter the following command and press Return :

datasphere scoped-roles update


--file-path <file>.json|--input '<stringified-json>'

Complete the parameters as follows:

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 15
Parameter Description

--file-path [optional] Enter a path to a file with a .json extension containing your scoped role defini-
<file>.json tion.

{
"name": "<Name>",
"description": "<Description>",
"inheritance": [
"PROFILE:<package>.<id>:<Role_Template_Name>"
]
}

--input [optional] Provide your input in stringified json format instead of via the --file-path
'<stringified- option.
json>'

Add Spaces to Scoped Roles

You can add spaces to a scoped role as a comma-separated list of space IDs.

 Note

You must add one or more spaces to a scoped role before you can assign users to it.

Enter the following command and press Return :

datasphere scoped-roles scopes assign


--role <ID>
--scopes <ID[,ID...]>

Complete the parameters as follows:

Parameter Description

--role <id> Enter the ID of a scoped role in the following form:

PROFILE:<package>.<id>:<roleid>

--scopes Enter a comma-separated list of space IDs.


<ID[,ID...]>

For example, to add the two spaces SALES_EU and SALES_US to the scoped role Sales_Modeler, enter the
following command and press Return :

datasphere scoped-roles scopes assign --role PROFILE:t.W:Sales_Modeler --scopes


SALES_EU,SALES_US

Accessing SAP Datasphere via the Command Line


16 PUBLIC Accessing SAP Datasphere via the Command Line
Add Users to Scoped Roles

You can add users to a scoped role by providing a definition in a JSON file or an input string.

Enter the following command and press Return :

datasphere scoped-roles users assign


--role <ID>
--file-path <file>.json|--input '<stringified-json>'

Complete the parameters as follows:

Parameter Description

--role <id> Enter the ID of a scoped role in the following form:

PROFILE:<package>.<id>:<roleid>

--file-path Enter a path to a file with a .json extension containing the list of users to add. You must
<file>.json provide one entry for each user and each space you want to assign them to:

[
{
"id": "<userID>",
"scope": "<spaceID>"
},
{
"id": "<userID>",
"scope": "<spaceID>"
}
]

--input [optional] Provide your input in stringified json format instead of via the --file-path
'<stringified- option.
json>'

For example, to add the users BBAXTER and JJONES to the spaces SALES_EU and SALES_US via the scoped
role Sales_Modeler, enter the following command and press Return :

datasphere scoped-roles users assign --role PROFILE:t.W:Sales_Modeler --file-


path add.json

Where the file add.json contains the following:

[
{
"id": "BBAXTER",
"scope": "SALES_EU"
},
{
"id": "BBAXTER",
"scope": "SALES_US"
},
{
"id": "JJONES",
"scope": "SALES_EU"
},
{
"id": "JJONES",
"scope": "SALES_US"

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 17
}
]

 Note

Users with a DW Space Administrator role (or equivalent permissions) can add users to their space using
the datasphere spaces users add command (see Add Users to a Space [page 25]).

Remove Users from Scoped Roles

Enter the following command and press Return :

datasphere scoped-roles users unassign


--role <ID>
--file-path <file>.json|--input '<stringified-json>'

Complete the parameters as follows:

Parameter Description

--role <id> Enter the ID of a scoped role in the following form:

PROFILE:<package>.<id>:<roleid>

--file-path [optional] Enter a path to a file with a .json extension containing the list of users to
<file>.json remove. You must provide one entry for each user and each space you want to remove them
from:

[
{
"id": "<userID>",
"scope": "<spaceID>"
},
{
"id": "<userID>",
"scope": "<spaceID>"
}
]

--input [optional] Provide your input in stringified json format instead of via the --file-path
'<stringified- option.
json>'

For example, to unassign BBAXTER and JJONES from SALES_EU via the scoped role Sales_Modeler, enter the
following command and press Return :

datasphere scoped-roles users unassign --role PROFILE:t.W:Sales_Modeler --file-


path unassign.json

Where the file unassign.json contains the following:

[
{
"id": "BBAXTER",
"scope": "SALES_EU"

Accessing SAP Datasphere via the Command Line


18 PUBLIC Accessing SAP Datasphere via the Command Line
},
{
"id": "JJONES",
"scope": "SALES_EU"
}
]

 Note

Users with a DW Space Administrator role (or equivalent permissions) can remove users from their space
using the datasphere spaces users remove command (see Remove Users from a Space [page 27]).

Remove Scopes from Scoped Roles

You can remove scopes from a scoped role.

Enter the following command and press Return :

datasphere scoped-roles scopes unassign


--role <ID>
--scopes <ID[,ID...]>

Complete the parameters as follows:

Parameter Description

--role <id> Enter the ID of a scoped role in the following form:

PROFILE:<package>.<id>:<roleid>

--scopes Enter a comma-separated list of space IDs.


<ID[,ID...]>

For example, to remove the space SALES_EU from the scoped role Sales_Modeler, enter the following
command and press Return :

datasphere scoped-roles scopes unassign --role PROFILE:t.W:Sales_Modeler --


scopes SALES_EU

Delete Scoped Roles

You can delete scoped roles.

Enter the following command and press Return :

datasphere scoped-roles delete


--role <ID>
[--force]

Complete the parameters as follows:

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 19
Parameter Description

--role <id> Enter the ID of a scoped role in the following form:

PROFILE:<package>.<id>:<roleid>

--force [optional] Suppress the Confirm Deletion step and delete the scoped role without confirma-
tion.

For example, to delete the scoped role Sales_Modeler and suppress the confirmation, enter the following
command and press Enter :

datasphere scoped-roles delete --role PROFILE:t.W:Sales_Modeler --force

1.6 Manage Spaces via the Command Line

You can use the SAP Datasphere command line interface, datasphere, to create, read, update, and delete
spaces. You can set space properties, assign (or remove) users, create database users, create or update
objects (tables, views, and data access controls), and associate HDI containers to a space.

The following sections are available in this topic:

• Working with Spaces on the Command Line [page 20]


• List Spaces [page 21]
• Read a Space [page 21]
• Create or Update a Space [page 22]
• Delete a Space [page 23]

 Note

The SAP Datasphere command line interface module has been renamed from dwc to datasphere. The
command dwc will be decommissioned at the end of 2023: please use the new datasphere command
instead. For more information, see https://www.npmjs.com/package/@sap/datasphere-cli .

Working with Spaces on the Command Line

To work with spaces on the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Login to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client [page
6]).
• Have an appropriate role of (see Command Line Roles and Privileges [page 86]).

To browse the available commands entering the following and press Return :

datasphere spaces

Accessing SAP Datasphere via the Command Line


20 PUBLIC Accessing SAP Datasphere via the Command Line
For general information about working with spaces, see Creating Spaces and Allocating Storage and Managing
Your Space.

List Spaces

To list the spaces available to you on the tenant, enter the following command and press Return :

datasphere spaces list


[--host "<url>"]
[--output <file>.json]

Complete the parameters as follows:

Parameter Description

--host "<url>" Enter the URL of your SAP Datasphere tenant. You can copy the URL of any page in your
tenant. Alternatively, set a host value (see Set a Host Value to Identify Your SAP Datasphere
Tenant [page 5]).

--output [optional] Enter a path to a .json file to write the output to.
<file>.json
If you do not include this option, the output will be printed to the command line.

Read a Space

To read a space definition to the console or to a file, enter the following command and press Return :

datasphere spaces read


--space <id>
[--definitions [<obj1>,<obj2>]]
[--no-space-definition]
[--output <file>.json]

Complete the parameters as follows:

Parameter Description

--space <id> Enter the Space ID of the space.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 21
Parameter Description

--definitions [Optional] Read the object definitions contained in the space. You can use the --
[<obj1>,<obj2>] definitions parameter by itself to read all the objects, or specify a comma-separated
list of object technical names.

Object definitions are read using the standard CSN syntax (see Core Data Services Schema
Notation (CSN) ). The following objects can be read (exported):

• Local Tables - The definition of a local table contains the structure of the table only, and
does not have dependencies on any other objects.
• Remote Tables - The definition of a remote table contains information about its connec-
tion. Before importing a remote table, you must create the relevant connection with an
identical technical name in the receiving space.

 Note
Remote tables exported from one space can be imported into another only if they
were originally imported from a connection created in v2021.19 or later.

• Views - The definition of a view contains the definitions of all its sources and any used
data access controls. When you export a view, these objects are exported too.
• Data Access Controls - The definition of a data access control contains the definition of
its permissions entity. When you export a data access control, the permissions entity is
exported too.

 Note
You can also export content from and import content to your space via:

• The  (Transport) app (see Transporting Content Between Tenants).


• Export to CSN/JSON File buttons in selected Data Builder editors (see Importing
and Exporting Objects in CSN/JSON Files).

--no-space- [Optional] Suppress the display of the spaceDefinition property. When used with the
definition --definitions option, this allows you to read object definitions without seeing the
other properties of the space.

--output [optional] Enter a path to a .json file to write the output to.
<file>.json
If you do not include this option, the output will be printed to the command line.

The space definition is written to the console or to the specified file.

Create or Update a Space

To create or update a space, you must first prepare a space definition file (see The Space Definition File Format
[page 29]).

Accessing SAP Datasphere via the Command Line


22 PUBLIC Accessing SAP Datasphere via the Command Line
 Note

You need only complete the parameters that you want to set. All other space properties are either set to
default values or keep their current values. If your file contains valid CSN object definitions, then these
entities will be created or updated in the space.

When your file is ready, enter the following command and press Return :

datasphere spaces create


--file-path <file>.json
[--force-definition-deployment]
[--enforce-database-user-deletion]

Complete the parameters as follows:

Parameter Description

--file-path Enter a path to a file with a .json extension containing your space definition.
<file>.json

--force-definition- [Optional] Deploy changes to objects even if they will generate validation messages warning
deployment of impacts to objects that depend on them. Using this option is equivalent to clicking the
Deploy Anyway button in the Validation Messages dialog (see Modifying Objects That Have
Dependent Objects).

--enforce-database- [Optional] Allow the deletion of database users and their associated Open SQL schemas,
user-deletion when the dbusers section is present in the space definition file. If any existing database
user is not included in the dbusers section and this option is omitted, then they will not be
deleted in order to protect against unintended data loss.

--input [Optional] Provide your space definition in stringified json format instead of via the --
'<stringified- file-path option. For example:
json>'
--input '{"MY_SPACE":{"spaceDefinition":
{"version":"1.0.4"}}}'

The space is created or updated as you have specified.

 Note

If any parameters are set incorrectly, the creation or update is canceled and an error message is written to
the console.

Delete a Space

To delete a space, enter the following command and press Return :

datasphere spaces delete


--space <id>
[--force]

Complete the parameters as follows:

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 23
Parameter Description

--space <id> Enter the Space ID of the space.

--force Delete the space without confirmation. If you do not include this option you will be
prompted to confirm the deletion.

If prompted, confirm that you want to delete the space. The space is deleted and a confirmation message is
written to the console.

1.6.1 Manage Space Users via the Command Line

Users with a DW Space Administrator role (or equivalent permissions) can manage user access to their space
via the command line.

This topic contains the following sections:

• Working with Space Users on the Command Line [page 24]


• Update Users [page 11]
• Add Users to a Space [page 25]
• Update Space Users [page 26]
• Remove Users from a Space [page 27]

Working with Space Users on the Command Line

To work with space users on the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Login to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client [page
6]).
• Have a role of DW Space Administrator or equivalent privileges (see Command Line Roles and Privileges
[page 86]).

To browse the available commands entering the following and press Return :

datasphere spaces users

For general information about working with space users, see Control User Access to Your Space.

List Space Users

You can read a list of users in your space and optionally write it to a file.

Accessing SAP Datasphere via the Command Line


24 PUBLIC Accessing SAP Datasphere via the Command Line
Enter the following command and press Return :

datasphere spaces users read


--space <ID>
[--accept <format>]
[--output <file>.json]

Complete the parameters as follows:

Parameter Description

--space <ID> Enter the ID of your space.

--accept <format> [optional] Specify the format to return the list in. You can choose between:

• application/vnd.sap.datasphere.space.users.list+json - [de-
fault] User IDs only.
• application/vnd.sap.datasphere.space.users.details+json -
User IDs and scoped roles.

--output [optional] Enter a path to a .json file to write the output to.
<file>.json
If you do not include this option, the output will be printed to the command line.

Add Users to a Space

To add a user to your space, you must add them to a scoped role that includes your space as a scope and gives
the appropriate privileges.

Enter the following command and press Return :

datasphere spaces users add


--space <ID>
--file-path <file>.json|--input '<stringified-json>'

Complete the parameters as follows:

Parameter Description

--space <ID> Enter the ID of your space.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 25
Parameter Description

--file-path Enter a path to a file with a .json extension containing the list of users to add and the
<file>.json scoped roles you want to add them to:

[
{
"id": "<UserID>",
"role": "<RoleID>"
},
{
"id": "<UserID>",
"role": "<RoleID>"
}
]

Each user must exist on your tenant and each scoped role that you assign them to must
include your space as a scope.

For example, to add the users BBAXTER and JJONES to the space SALES_US via the scoped role
Sales_Modeler, enter the following command and press Return :

datasphere spaces users add --space SALES_US --file-path add.json

Where the file add.json contains the following (where <package> and <id> for the tenant are t and W
respectively):

[
{
"id": "BBAXTER",
"role": "PROFILE:t.W:Sales_Modeler"
},
{
"id": "JJONES",
"role": "PROFILE:t.W:Sales_Modeler"
}
]

Update Space Users

You can update the roles that are assigned to users for your space. For example you may want to remove a
user's modeling privileges and leave here only with viewing privileges

Enter the following command and press Return :

datasphere spaces users update


--space <ID>
--file-path <file>.json|--input '<stringified-json>'

Complete the parameters as follows:

Parameter Description

--space <ID> Enter the ID of your space.

Accessing SAP Datasphere via the Command Line


26 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--file-path Enter a path to a file with a .json extension containing containing the list of users to
<file>.json update and the new scoped roles you want them to belong to

[
{
"id": "<UserID>",
"roles": ["<RoleID>","<RoleID>"]"
},
{
"id": "<UserID>",
"roles": ["<RoleID>","<RoleID>"]
}
]

For example, to give BBAXTER the roles of both Sales_Modeler and Sales_Integrator, and to remove
JJONES from the role Sales_Modeler and to add her to Sales_Space_Admin, enter the following command
and press Return :

datasphere spaces users update --space SALES_US --file-path update.json

Where the file update.json contains the following:

[
{
"id": "BBAXTER",
"roles":
["PROFILE:t.W:Sales_Modeler","PROFILE:t.W:Sales_Integrator"]
},
{
"id": "JJONES",
"roles": ["PROFILE:t.W:Sales_Space_Admin"]
}
]

Remove Users from a Space

You can remove users from your space

Enter the following command and press Return :

datasphere spaces users remove


--space <ID>
--file-path <file>.json|--input '<stringified-json>'

Complete the parameters as follows:

Parameter Description

--space <ID> Enter the ID of your space.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 27
Parameter Description

--file-path Enter a path to a file with a .json extension containing the list of users to remove and the
<file>.json scoped roles to remove them from:

[
{
"id": "<UserID>",
"role": "<RoleID>"
}, {
"id": "<UserID>",
"role": "<RoleID>"
}
]

For example, to remove BBAXTER from both the Sales_Modeler and Sales_Integrator roles, enter the
following command and press Return :

datasphere spaces users remove --space SALES_US --file-path remove.json

Where the file remove.json contains the following:

[
{
"id": "BBAXTER",
"role": "PROFILE:t.W:Sales_Modeler"
},
{
"id": "BBAXTER",
"role": "PROFILE:t.W:Sales_Integrator"
}
]

1.6.2 Reset Database User Passwords via the Command Line

Users with the DW Space Administrator role (or equivalent privileges) can reset database user passwords from
the command line

To reset a database user password, enter the following command and press Return :

datasphere dbusers password reset


--space "<id>"
--databaseuser "<name>"
[--output <file>.json]

 Note

We recommend that, for reasons of security, you specify to receive the new password in an output file.

Complete the parameters as follows:

Parameter Description

--space <id> Enter the Space ID of the space.

Accessing SAP Datasphere via the Command Line


28 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--databaseuser Enter the name of the database user.


"<dbuser-name>"

--output [optional] Enter a path to a .json file to write the output to.
<file>.json
If you do not include this option, the output will be printed to the command line.

For example, to reset the password of the JEFF user in the SALES, and pretty-print it to the file jeff.json,
enter the following:

datasphere dbusers password reset --space "SALES" --databaseuser "SALES#JEFF" --


host "<server-url>" --no-pretty --output "jeff.json"

 Note

You can create database users with a space definition file (see The Space Definition File Format [page
29]).

1.6.3 The Space Definition File Format

Space properties are set and retrieved in the space definition file format and stored as a .json file.

• Space Properties [page 29]


• Members [page 32]
• Database Users [page 33]
• HDI Containers [page 35]
• Table, View, and Data Access Control Definitions [page 36]

Space Properties

Users with the DW Administrator role can create spaces and set any space properties (see Create a Space)
using the following syntax:

{
"<SPACE_ID>": {
"spaceDefinition": {
"version": "1.0.4",
"label": "<Space_Name>",
"assignedStorage": <bytes>,
"assignedRam": <bytes>A space definition file must not exceed 25MB, and
can contain the following space,
"priority": <value>,
"injection": {
"dppRead": {
"retentionPeriod": <days>,
"isAuditPolicyActive": true|false
},
"dppChange": {
"retentionPeriod": <days>,

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 29
"isAuditPolicyActive": true|false
}
},
"allowConsumption": true|false,
"enableDataLake": true|false,
"members": [],
"dbusers": {},
"hdicontainers": {},
"workloadClass": {
"totalStatementMemoryLimit": {
"value": 0,
"unit": "Gigabyte|Percent"
},
"totalStatementThreadLimit": {
"value": 0,
"unit": "Counter|Percent"
}
}
}

 Note

Users with the DW Space Administrator role cannot create spaces, but they can set space properties except
SPACE_ID, assignedStorage, assignedRam, and priority.

Parameters are set as follows:

Parameter Space Property Description

<SPACE_ID> Space ID [required] Enter the technical name of the space. Can contain a maxi-
mum of 20 uppercase letters or numbers and must not contain spaces
or special characters other than _ (underscore). Unless advised to do
so, must not contain prefix _SYS and should not contain prefixes: DWC_,
SAP_ (See Rules for Technical Names).

version - [required] Enter the version of the space definition file fomat. This must
always be set to 1.0.4.

label Space Name Enter the business name of the space. Can contain a maximum of 30
characters, and can contain spaces and special characters.

Default value: <Space_ID>

assignedStorage Disk (GB) Enter the amount of storage allocated to the space in bytes. You can
enter any value between 100000 bytes (100MB) and the total storage
size available in the tenant.

Default value: 2000000000 bytes (2GB)

 Note
To set no size limit for the space (and disable the Enable Space Quota
option), enter 0 for both this parameter and assignedRam.

assignedRam In-Memory (GB) Enter the amount of ram allocated to the space in bytes. You can enter
any value between 100000 bytes (100MB) and the total storage size
available in the tenant.

Default value: 1000000000 bytes (1GB)

Accessing SAP Datasphere via the Command Line


30 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Space Property Description

Priority Space Priority Enter the prioritization of this space when querying the database. You
can enter a value from 1 (lowest priority) to 8 (highest priority).

Default value: 5

Enable Audit Log for Enter the audit logging policy for read and change operations and the
dppRead.isAudit
number of days that the logs are retained. you can retain logs for any
PolicyActive Read Operations
period between 7 and 10000 days.
dppRead.retenti Keep Logs for <n>
Default values: false, 30, false, 30
onPeriod Days

Enable Audit Log for


dppChange.isAud
Change Operations
itPolicyActive
Keep Logs for <n>
dppChange.reten
Days
tionPeriod

allowConsumptio Expose for Consump- Choose the default setting for the Expose for Consumption property for
n tion by Default views created in this space.

Default value: false

enableDataLake Use This Space to Ac- Enable access to the SAP HANA Cloud data lake. Enabling this option is
cess the Data Lake only possible if no other space already has access to the data lake.

Default value: false

members User Assignment See Members [page 32].

dbusers Database Users See Database Users [page 33].

hdicontainers HDI Containers See HDI Containers [page 35].

Total Statement Mem- Enter the maximum number (or percentage) of GBs of memory that
workloadClass.t
statements running concurrently in the space can consume. You can
otalStatementMe ory Limit
enter any value or percentage between 0 (no limit) and the total amount
moryLimit.value GB/% of memory available in your tenant.

workloadClass.t Default values: 0, Gigabyte


otalStatementMe
moryLimit.unit

Total Statement Enter the maximum number (or percentage) of threads that statements
workloadClass.t
running concurrently in the space can consume. You can enter any value
otalStatementTh Thread Limit
or percentage between 0 (no limit) and the total number of threads
readLimit.value Threads/% available in your tenant.

workloadClass.t Default values: 0, Counter


otalStatementTh
readLimit.unit

For example, the following file will create a new space, with all default properties:

{
"NEWSPACE": {
"spaceDefinition": {
"version": "1.0.4"

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 31
}
}
}

 Note

If a property is not set it will receive the default value (on creation) or will keep its current value (on update).

This second file will update NEWSPACE by modifying the Space Name and increasing the Disk (GB) and
In-Memory (GB) allocations:

{
"NEWSPACE": {
"spaceDefinition": {
"version": "1.0.4",
"label": "My New Space",
"assignedStorage": 6000000000,
"assignedRam": 5000000000
}
}
}

This third file will update the Space Priority, and will leave the other parameters as previously set:

{
"NEWSPACE": {
"spaceDefinition": {
"version": "1.0.4",
"priority": 4
}
}
}

 Note

The following properties are not supported when creating, reading, or updating spaces using datasphere:

• Connections
• Time Data
• Space Status and other run-time properties

Members

 Note

Following the introduction of scoped roles, it is not currently possible to assign users to spaces via the
command line.

Accessing SAP Datasphere via the Command Line


32 PUBLIC Accessing SAP Datasphere via the Command Line
Database Users

Users with the DW Administrator, DW Space Administrator, or DW Integrator role can add database users to a
space (see Integrating Data via Database Users/Open SQL Schemas) using the following syntax:

{
...
"dbusers":{
"<Space_ID>#<DB_UserName>":{
"ingestion":{
"auditing":{
"dppRead":{
"retentionPeriod":<days>
"isAuditPolicyActive":false
},
"dppChange":{
"retentionPeriod":<days>
"isAuditPolicyActive":false
}
}
},
"consumption":{
"consumptionWithGrant":false,
"spaceSchemaAccess":false,
"scriptServerAccess":false,
"localSchemaAccess":false,
"hdiGrantorForCupsAccess":false
}
}
}
}

Parameters are set as follows:

Parameter Space Property Description

<SPACE_ID> Space ID [required] Must be the same as the <Space_ID> used at the root of the
space definition file.

<DB_UserName> Database User Name [required] Enter the name of the database user. Can contain a maximum
Suffix of 20 uppercase letters or numbers and must not contain spaces or
special characters other than _ (underscore).

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 33
Parameter Space Property Description

Enable Audit Log for Enter the audit logging policy for read and change operations and the
ingestion.audit
number of days that the logs are retained. you can retain logs for any
ing.dppRead.isA Read Operations
period between 7 and 10000 days.
uditPolicyActiv Keep Logs for <n>
e Default values: false, 30, false, 30
Days

ingestion.audit Enable Audit Log for


ing.dppRead.ret Change Operations
entionPeriod
Keep Logs for <n>
ingestion.audit Days
ing.dppChange.i
sAuditPolicyAct
ive

ingestion.audit
ing.dppChange.r
etentionPeriod

consumption.con With Grant Option Allow the database user to grant read access to the space schema to
sumptionWithGra other users.
nt
Default value: false

consumption.spa Enable Read Access Grant the database user read access to the space schema.
ceSchemaAccess (SQL)
Default value: false

consumption.scr Enable Automated Grant the database user access to the SAP HANA Cloud machine learn-
iptServerAccess Predictive Library ing libraries.
(APL) and Predictive
Analysis Library (PAL Default value: false

consumption.loc Enable Write Access Grant the database user write access to the OpenSQL schema.
alSchemaAccess (SQL, DDL, & DML)
Default value: false

consumption.hdi Enable HDI Grant the database user read access to HDI containers associated with
GrantorForCupsA Consumption the space.
ccess
Default value: false

For example, the following file will add a database user to NEWSPACE:

{
"NEWSPACE": {
"spaceDefinition": {
"version": "1.0.4",
"dbusers": {
"NEWSPACE#JJONES": {
"ingestion": {
"auditing": {
"dppRead": {
"retentionPeriod": 21,
"isAuditPolicyActive": true
}
}
},

Accessing SAP Datasphere via the Command Line


34 PUBLIC Accessing SAP Datasphere via the Command Line
"consumption": {
"consumptionWithGrant": true,
"spaceSchemaAccess": true,
"scriptServerAccess": true,
"localSchemaAccess": true,
"hdiGrantorForCupsAccess": true
}
}
}
}
}
}

When updating database users, you must always list all database users that you want to have assigned to
the space. To delete a database user, remove them from the dbusers section and include the --enforce-
database-user-deletion. If any existing database user is not included in the dbusers section and this
option is omitted, then they will not be deleted in order to protect against unintended data loss.

 Note

You can use the datasphere dbusers password reset command to obtain a new password for a
database user (seeManage Spaces via the Command Line [page 20]).

HDI Containers

Users with the DW Administrator, DW Space Administrator, or DW Integrator role can associate HDI containers
to a space (see Exchanging Data with SAP SQL Data Warehousing HDI Containers) using the following syntax:

{
...
"hdicontainers":{
"<Container_Name>":{}
},

Parameters are set as follows:

Parameter Space Property Description

<Container_Name> HDI Container Name [required] Enter the name of an HDI container that is associated with
your SAP Datasphere instance and which is not assigned to any other
space.

For example, the following file will associate two HDI containers to NEWSPACE:

{
"NEWSPACE": {
"spaceDefinition": {
"version": "1.0.4",
"hdicontainers": {
"MyHDIContainer": {},
"MyOtherContainer": {},
}
}
}
}

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 35
When updating HDI containers, you must always list all HDI containers that you want to have assigned to the
space. To delete an HDI container, remove them from the hdicontainers section.

Table, View, and Data Access Control Definitions

Users with the DW Administrator or DW Space Administrator role can add tables and views, and data access
controls to a space using the standard CSN syntax (see Core Data Services Schema Notation (CSN) ). Users
with the DW Modeler role can add tables and views.

For example, the following file will create a table with two columns in NEWSPACE:

{
"NEWSPACE": {
"spaceDefinition": {
"version": "1.0.4"
},
"definitions": {
"Products": {
"kind": "entity",
"elements": {
"Product ID": {
"type": "cds.Integer64",
"key": true,
"notNull": true
},
"Product Name": {
"type": "cds.String",
"length": 5000
}
}
}
}
}
}

 Note

To obtain more complex examples, read existing objects from a space into a file using the -D option (see
Read a Space [page 21]).

1.7 Manage Data Marketplace Data Providers via the


Command Line
You can use the SAP Datasphere command line interface, datasphere, to manage Data Marketplace data
providers.

 Note

The SAP Datasphere command line interface module has been renamed from dwc to datasphere. The
command dwc will be decommissioned at the end of 2023: please use the new datasphere command
instead. For more information, see https://www.npmjs.com/package/@sap/datasphere-cli .

Accessing SAP Datasphere via the Command Line


36 PUBLIC Accessing SAP Datasphere via the Command Line
You can easily create new data providers or update their properties in batch mode, For example update the
contact email addresses or the visibility in the marketplace. It is also possible to show all data providers that a
user has access to.

The following sections, each representing one command, are available in this topic:

• datasphere marketplace providers list [page 37]


• datasphere marketplace providers read [page 38]
• datasphere marketplace providers create [page 39]
• datasphere marketplace providers overwrite [page 39]
• datasphere marketplace providers update [page 40]

Working with Data Providers on the Command Line

To work with data providers on the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Login to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client [page
6]).
• Have a role of DW Modeler or equivalent privileges (see Command Line Roles and Privileges [page 86]).

To browse the available commands entering the following and press Return :

datasphere marketplace providers

To get access to a data provider the user needs to be member of the data provider profile. If a
contentAggregatorID is given as parameter, only data provider profiles that are managed by that content
aggregator are returned.

datasphere marketplace providers list

Returns a simplified list of all data providers that the current user has access to.

datasphere marketplace providers list

If you want a detailed representation of a certain data provider, use the read command.

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-o, --output <output> Specifies the file in which the output of the command is
stored (optional).

--no-pretty Don't pretty-formats JSON responses (optional).

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 37
Parameter Description

-d, --accept <accept> Format to return the content in (optional).

Choices:

• application/vnd.sap.marketplace.providers.list+json
(default)
• application/vnd.sap.marketplace.providers.details+json

datasphere marketplace providers read

Reads the metadata of a certain data provider after specifying its UUID or its content aggregator UUID.

datasphere marketplace providers read

Complete the parameters as follows:

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-o, --output <output> Specifies the file in which the output of the command is
stored (optional).

--no-pretty Don't pretty-formats JSON responses (optional).

-g, --provider-identifier <provider- Provider identifier (optional).


identifier>
You can either:

• Provide the UUID of the data provider or of the content


aggregator.
• Provide the UUID of a content aggregator and a
contentAggregatorProviderID separated by a
colon.
Example: List [ "0b0dfe8e-
f974-407d-8987-6d863b2c5e83", "f97dfe8e-
f9a4-4d2d-8187-ed863bdc5e88:rubix-b2b-risk-assess-
ment-amp-monitoring-solutions-all-cou-rubix-data-sci-
ences" ]”

Accessing SAP Datasphere via the Command Line


38 PUBLIC Accessing SAP Datasphere via the Command Line
datasphere marketplace providers create

Creates a new data provider or a new managed data provider (managed by a content aggregator) based on
a configuration following the data provider definition file format and stored as a .json file. See The Data
Provider Definition File Format [page 41] for more information.

datasphere marketplace providers create

Specify the full path to the input .json file, for example C:\temp\mydataproviderdefintion.json.

To create a managed data provider specify the contentAggregatorID in the request body.

 Note

Managed providers can only be created if you are a member of the assigned content aggregator profile.

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-f <Filename>.json Enter a path to a file with a .json extension containing your


data provider definition.

Alternative: --file-path Filename.json

datasphere marketplace providers overwrite

datasphere marketplace providers overwrite

 Note

If you want to update specific properties only, use the update command.

Overwrites all properties of the specified data provider


Parameter with the provided data inDescription

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-f <Filename>.json Enter a path to a file with a .json extension containing your


data provider definition.

Alternative: --file-path Filename.json

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 39
Overwrites all properties of the specified data provider
Parameter with the provided data inDescription

-g, --provider-identifier <provider- Provider identifier (optional).


identifier>
You can either:

• Provide the UUID of the data provider or of the content


aggregator.
• Provide the UUID of a content aggregator and a
contentAggregatorProviderID separated by a
colon.
Example: List [ "0b0dfe8e-
f974-407d-8987-6d863b2c5e83", "f97dfe8e-
f9a4-4d2d-8187-ed863bdc5e88:rubix-b2b-risk-assess-
ment-amp-monitoring-solutions-all-cou-rubix-data-sci-
ences" ]”

datasphere marketplace providers update

Updates only selected properties of the specified data provider which are defined in the provided data provider
definition file.

datasphere marketplace providers update

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-f <Filename>.json Enter a path to a file with a .json extension containing your


data provider definition.

Alternative: --file-path Filename.json

Accessing SAP Datasphere via the Command Line


40 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

-g, --provider-identifier <provider- Provider identifier (optional).


identifier>
You can either:

• Provide the UUID of the data provider or of the content


aggregator.
• Provide the UUID of a content aggregator and a
contentAggregatorProviderID separated by a
colon.
Example: List [ "0b0dfe8e-
f974-407d-8987-6d863b2c5e83", "f97dfe8e-
f9a4-4d2d-8187-ed863bdc5e88:rubix-b2b-risk-assess-
ment-amp-monitoring-solutions-all-cou-rubix-data-sci-
ences" ]”

1.7.1 The Data Provider Definition File Format

The properties of a data provider definition are set and retrieved in the space definition file format and stored
as a .json file.

A data provider definition file must not exceed 25MB, and can contain the following information:

Data Provider Properties

Users with the DW Modeler role can create data providers and set any data provider properties (see Manage
Data Marketplace Data Providers via the Command Line [page 36]) using the following syntax:

 Sample Code

{
"name": "<string>",
"contentAggregatorProviderID": "<string>",
"logo": "<string>",
"description": "<string>",
"homepageUrl": "<string>",
"linkedinUrl": "<string>",
"regionalCoverages": [
"<string>",
"<string>", ...
],
"dataCategories": [
"<string>",
"<string>", ...
],
"industries": [
"<string>",
"<string>", ...
],
"sapApplications": [

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 41
"<string>",
"<string>", ...
],
"contactEmail": "<string>",
"sapEmail": "<string>",
"country_code": "<contry_code>",
"zipCode": "<string>",
"city": "<string>",
"address1": "<string>",
"address2": "<string>",
"phoneNumber": "<string>",
"shipments": [
"Direct|External|OpenSql"
],
"marketplaceVisibility": [
"public|private|internal"
]
}

Parameters are set as follows:

Mapped Name of Data Provider Pro-


file Parameter used in Data Sharing
Technical Parameter Cockpit Description

<name> Name The name of the data provider.

<logo> Company Logo The logo of the data provider company.

It must be delivered as a string with


maximum 5000 characters, Base64
encoded.

The following mime-types are sup-


ported: bmp, svg, gif, jfif, jpe, jpeg, jpg,
png, tif, tiff

<description> Description Share some information about the data


provider: the products you offer, your
claim and your vision.

<homepageUrl> Homepage URL The URL of the data provider's home-


page.

<linkedinUrl> LinkedIn The URL to the data provider's LinkedIn


profile.

Accessing SAP Datasphere via the Command Line


42 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

<regionalCoverages> Regional Coverage String values for each region the data
is applicable to. Multiple values can be
specified.

[ Global, Europe, North


America, South America,
Central America, Asia,
Africa, Afghanistan,
Aland Islands, Albania,
Algeria, American Samoa,
Andorra, Angola, Anguilla,
Antarctica, Antigua
and Barbuda, Argentina,
Armenia, Aruba, Australia,
Austria, Azerbaijan,
Bahamas, Bahrain,
Bangladesh, Barbados,
Belarus, Belgium, Belize,
Benin, Bermuda, Bhutan,
Bolivia, Bonaire, Sint
Eustatius and Saba,
Bosnia and Herzegovina,
Botswana, Bouvet Island,
Brazil, British Indian
Ocean Territory, Brunei
Darussalam, Bulgaria,
Burkina Faso, Burundi,
Cambodia, Cameroon,
Canada, Cape Verde, Cayman
Islands, Central African
Republic, Chad, Chile,
China, Christmas Island,
Cocos (Keeling) Islands,
Colombia, Comoros, Congo,
Congo, The Democratic
Republic of, Cook Islands,
Costa Rica, Cote d'Ivoire,
Croatia, Cuba, Curaçao,
Cyprus, Czechia, Denmark,
Djibouti, Dominica,
Dominican Republic, Egypt,
El Salvador, Equatorial

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 43
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

Guinea, Eritrea, Estonia,


Ethiopia, Falkland
Islands (Malvinas), Faroe
Islands, Fiji, Finland,
France, French Guiana,
French Polynesia, French
Southern Territories,
Gabon, Gambia, Georgia,
Germany, Ghana, Gibraltar,
Greece, Greenland,
Grenada, Guadeloupe,
Guam, Guatemala, Guernsey,
Guinea, Guinea-Bissau,
Guyana, Haiti, Heard
and Mc Donald Islands,
Holy See (Vatican
City State), Honduras,
Hong Kong, Hungary,
Iceland, India, Indonesia,
Iran, Islamic Republic
of, Iraq, Ireland,
Isle of Man, Israel,
Italy, Jamaica, Japan,
Jersey, Jordan, Kazakstan,
Kenya, Kiribati, Korea,
Democratic People's
Republic of, Korea,
Republic of, Kosovo
(temporary code), Kuwait,
Kyrgyzstan, Lao, People's
Democratic Republic,
Latvia, Lebanon, Lesotho,
Liberia, Libyan Arab
Jamahiriya, Liechtenstein,
Lithuania, Luxembourg,
Macao, Macedonia,
Madagascar, Malawi,
Malaysia, Maldives, Mali,
Malta, Marshall Islands,
Martinique, Mauritania,
Mauritius, Mayotte,
Mexico, Micronesia,

Accessing SAP Datasphere via the Command Line


44 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

Federated States of,


Moldova, Republic
of, Monaco, Mongolia,
Montenegro, Montserrat,
Morocco, Mozambique,
Myanmar, Namibia, Nauru,
Nepal, Netherlands,
Netherlands Antilles, New
Caledonia, New Zealand,
Nicaragua, Niger, Nigeria,
Niue, Norfolk Island,
Northern Mariana Islands,
Norway, Oman, Pakistan,
Palau, Palestinian
Territory, Occupied,
Panama, Papua New
Guinea, Paraguay, Peru,
Philippines, Pitcairn,
Poland, Portugal, Puerto
Rico, Qatar, Republic of
Serbia, Reunion, Romania,
Russia Federation, Rwanda,
Saint BarthŽlemy, Saint
Helena, Saint Kitts &
Nevis, Saint Lucia, Saint
Martin, Saint Pierre and
Miquelon, Saint Vincent
and the Grenadines, Samoa,
San Marino, Sao Tome and
Principe, Saudi Arabia,
Senegal, Serbia and
Montenegro, Seychelles,
Sierra Leone, Singapore,
Sint Maarten, Slovakia,
Slovenia, Solomon Islands,
Somalia, South Africa,
South Georgia & The
South Sandwich Islands,
South Sudan, Spain,
Sri Lanka, Sudan,
Suriname, Svalbard and Jan
Mayen, Swaziland, Sweden,

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 45
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

Switzerland, Syrian Arab


Republic, Taiwan, Province
of China, Tajikistan,
Tanzania, United Republic
of, Thailand, Timor-
Leste, Togo, Tokelau,
Tonga, Trinidad and
Tobago, Tunisia, Turkey,
Turkish Rep N Cyprus,
Turkmenistan, Turks and
Caicos Islands, Tuvalu,
Uganda, Ukraine, United
Arab Emirates, United
Kingdom, United States,
United States Minor
Outlying Islands, Uruguay,
Uzbekistan, Vanuatu,
Venezuela, Vietnam, Virgin
Islands, British, Virgin
Islands, U.S., Wallis and
Futuna, Western Sahara,
Yemen, Zambia, Zimbabwe ]

Accessing SAP Datasphere via the Command Line


46 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

<dataCategories> Data Category Coded values for each data category.


Multiple values can be specified.

[ C001 - Benchmarking
Data, C011 - Company
Data, C021 - Countries,
Regions & Cities Data,
C031 - Culture & Sports
Data, C041 - Environmental
& Weather Data, C051
- Finance & Economy
Data, C061 - Geospatial
Data, C071 - Health
Data, C081 - Hospitality,
Travel & Tourism Data,
C091 - Industry-Specific
Data, C101 - Innovation
& Trend Data, C111 -
Legal & Justice Data,
C121 - Market & Consumer
Data, C131 - Media &
Entertainment Data, C141
- Mobility Data, C151 -
Natural Resources & Energy
Data, C161 - Political
Data, C171 - Product &
Services Data, C181 -
Public Sector & Society
Data, C191 - Science
& Technology Data, C201
- Social Media, News &
Communication Data, C206 -
Sustainability Data, C211
- Transport & Logistics
Data, C221 - Web, IoT &
Device Data, C231 - Other
Data Categories ]

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 47
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

<industries> Industry String values for each industry the data


is applicable to. Multiple values can be
specified.

[ All Industries, Energy


and Natural Ressources,
Energy and Natural
Ressources:Building
Products, Energy and
Natural
Ressources:Chemicals,
Energy and Natural
Ressources:Mill Products,
Energy and Natural
Ressources:Mining, Energy
and Natural Ressources:Oil
and Gas, Energy and
Natural
Ressources:Utilities,
Financial Services,
Financial
Services:Banking,
Financial
Services:Insurance,
Consumer Industries,
Consumer
Industries:Agribusiness,
Consumer
Industries:Consumer
Products, Consumer
Industries:Fashion,
Consumer Industries:Life
Sciences, Consumer
Industries:Retail,
Consumer
Industries:Wholesale
Distribution, Discrete
Industries, Discrete
Industries:Aerospace and
Defense, Discrete
Industries:Automotive,
Discrete Industries:High

Accessing SAP Datasphere via the Command Line


48 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

Tech, Discrete
Industries:Industrial
Machinery and Components,
Service Industries,
Service
Industries:Airlines,
Service
Industries:Engineering,
Construction, and
Operations, Service
Industries:Media, Service
Industries:Professional
Services, Service
Industries:Railways,
Service Industries:Sports
& Entertainment, Service
Industries:Telecommunicati
ons, Service
Industries:Travel and
Transportation, Public
Services, Public
Services:Defense and
Security, Public
Services:Future Cities,
Public
Services:Healthcare,
Public Services:Higher
Education and Research,
Public Services:Public
Sector ]

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 49
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

<sapApplications> SAP Application String values for each SAP Application


the data is applicable to. Multiple values
can be specified.

[ HR & People
Engagement, HR &
People Engagement:Employee
in HR and People
Engagements, HR &
People Engagement:Employee
Experience Management, HR
& People Engagement:Core
HR and Payroll, HR &
People Engagement:Talent
Management, HR &
People Engagement:HR
Analytics and Workforce
Planning, CRM and
Customer Experience,
CRM and Customer
Experience:Customer Data,
CRM and Customer
Experience:Marketing,
CRM and Customer
Experience:Commerce,
CRM and Customer
Experience:Sales, CRM
and Customer
Experience:Service, ERP
& Finance, ERP &
Finance:SAP S/4HANA, ERP
& Finance:ERP for Small
and Midsize Enterprises,
ERP & Finance:Financial
Planning and Analysis,
ERP & Finance:Accounting
and Financial Close,
ERP & Finance:Treasury
Management, ERP
& Finance:Accounts
Receivable, Billing &
Revenue Management, ERP

Accessing SAP Datasphere via the Command Line


50 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

& Finance:Cybersecurity,
Governance, Risk
& Compliance,
Network & Spend
Management, Network &
Spend Management:Supplier
Managemetn, Network &
Spend Management:Strategic
Sourcing, Network & Spend
Management:Procurement,
Network & Spend
Management:Services
Procurement and Contingent
Workforce, Network &
Spend Management:Selling
and Fulfillment, Network
& Spend Management:Travel
and Expense, Business
Technology Plattform,
Business Technology
Plattform:Database and
Data Management,
Business Technology
Plattform:Application
Development and
Integration,
Business Technology
Plattform:Analytics,
Business Technology
Plattform:Intelligent
Technologies, Digital
Supply Chain, Digital
Supply Chain:Supply
Chain Planning, Digital
Supply Chain:Supply Chain
Logistics, Digital Supply
Chain:Manufacturing,
Digital Supply Chain:R&D /
Engineering, Digital
Supply Chain:Asset
Management, Experience
Management, Experience

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 51
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

Management:Brand
Experience, Experience
Management:Customer
Experience, Experience
Management:Product
Experience, Experience
Management:Employee
Experience ]

<contactEmail> Email Email address all consumer contacts


are sent to if the consumer uses the
Contact Provider button in the Data
Provider page.

<sapEmail> SAP Email An email address for the internal com-


munication between the data provider
and SAP to get credentials from your
Data Marketplace system. This email is
for internal usage, consumers won't see
it.

<country_code> Country The country where the data provider is


located.

<zipCode> ZIP Code The data provider's ZIP code.

<city> City The city as part of the address.

<address1> First Address The business address of the data pro-


vider.

<address2> Second Address A second business address if needed.

<phoneNumber> Phone Number A business telephone number, where


customers can reach the data provider.

<shipments> Data Shipment The shipment types which the data pro-
vider supports:

• <Direct>
• <External>
• <OpenSql>

Accessing SAP Datasphere via the Command Line


52 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Provider Pro-
file Parameter used in Data Sharing
Technical Parameter Cockpit Description

<marketplaceVisibility> Marketplace Visibility The visibility of the data provider's pro-


file in Data Marketplace:

• <public>: The profile and data


products will be visible for every-
one in the Public Data Marketplace
context owned by SAP.
• <private>: The data provider can
create and participate in contexts
of type Private Data Products, Pri-
vate Data Exchange, or Data Shop.
The profile is only visible to users
that are members of the data pro-
vider's contexts.
• <internal>: Internal visibility of
the data provider profile is a pre-
requisite to join or create internal
Contexts. An internal context is
intended for data products that
should only be visible within a
company.

For example, the following file will create a new data provider definition:

 Sample Code

{
"name": "Example Provider",
"contentAggregatorProviderID": "string",
"logo": "image string",
"description": "Lorem Ipsum description of my Provider",
"homepageUrl": "www.mydataprovidercompany.com",
"linkedinUrl": "www.linkedin.com/mydataprovidercompany",
"regionalCoverages": [
"Germany",
"France"
],
"dataCategories": [
"C001",
"C031"
],
"industries": [
"Financial Services",
"Energy and Natural Ressources"
],
"sapApplications": [
"HR & People Engagement",
"ERP & Finance"
],
"contactEmail": "max.user@companymail.com",
"sapEmail": "max.user@sap.com",
"country_code": "DE",
"zipCode": "12345",
"city": "Walldorf",

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 53
"address1": "Dietmar-Hopp Allee 16",
"address2": "Address 2",
"phoneNumber": "+40(0) 151 123456",
"shipments": [
"OpenSql"
],
"marketplaceVisibility": [
"public"
]
}

Use the .json file format to store the data product definition. It is needed for the upload which is part of the
create command for example.

You can find more information on data provider profiles in the Data Provider's Guide under Maintaining your
Data Provider Profile.

1.8 Manage Data Marketplace Data Products via the


Command Line

You can use the SAP Datasphere command line interface, datasphere, to manage and orchestrate Data
Marketplace data products.

 Note

The SAP Datasphere command line interface module has been renamed from dwc to datasphere. The
command dwc will be decommissioned at the end of 2023: please use the new datasphere command
instead. For more information, see https://www.npmjs.com/package/@sap/datasphere-cli .

You can create new data products in mass operations, or update properties, such as pricing information,
publishing status, or context assignments. It is also possible to list all data products that belong to a certain
data provider and delete data products.

 Note

To create new releases for data products, you must use the Data Sharing Cockpit (see The Data Sharing
Cockpit). This operation is not available via the command line.

The following sections, each representing one command, are available in this topic:

• Working with Data Products on the Command Line [page 55]


• datasphere marketplace products list [page 55]
• datasphere marketplace products read [page 56]
• datasphere marketplace products create [page 56]
• datasphere marketplace products overwrite [page 57]
• datasphere marketplace products update [page 57]
• datasphere marketplace products change-lifecycle-status [page 58]
• datasphere marketplace products delete [page 58]
• datasphere marketplace products-by-provider list [page 59]

Accessing SAP Datasphere via the Command Line


54 PUBLIC Accessing SAP Datasphere via the Command Line
• datasphere marketplace products-by-provider read [page 59]
• datasphere marketplace products-by-provider create [page 60]
• datasphere marketplace products-by-provider delete [page 60]
• datasphere marketplace products-by-provider overwrite [page 61]
• datasphere marketplace products-by-provider update [page 62]
• datasphere marketplace products-by-provider change-lifecycle-status [page 63]

Working with Data Products on the Command Line

To work with data products on the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Login to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client [page
6]).
• Have a role of DW Modeler or equivalent privileges (see Command Line Roles and Privileges [page 86]).

To browse the available commands entering the following and press Return :

datasphere marketplace products

In environments where you are managing data products for multiple providers, you can use the following
command:

datasphere marketplace products-by-provider

datasphere marketplace products list

Returns a simple list of all existing data products assigned to your user.

datasphere marketplace products list

Listed are all data products of all data providers and content aggregators you are a member of.

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-o, --output <output> Specifies the file in which the output of the command is
stored (optional).

--no-pretty Don't pretty-formats JSON responses (optional).

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 55
Parameter Description

-d, --accept <accept> Format to return the content in (optional).

Choices:

• application/vnd.sap.marketplace.providers.list+json
(default)
• application/vnd.sap.marketplace.providers.details+json

datasphere marketplace products read

Lists the properties of a single data product. You need to specify the data products UUID.

datasphere marketplace products read

Use the list command to get all available UUIDs.

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-o, --output <output> Specifies the file in which the output of the command is
stored (optional).

--no-pretty Don't pretty-formats JSON responses (optional).

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

datasphere marketplace products create

Creates a new data product based on a configuration following the data product definition file format and
stored as a .json file. See The Data Product Definition File Format [page 64] for more information.

datasphere marketplace products create

Specify the full path to the input .json file, for example C:\temp\mydataproductdefinition.json.

The new data product is created in status Draft. You can change the status with the command change-
lifecycle-status.

Accessing SAP Datasphere via the Command Line


56 PUBLIC Accessing SAP Datasphere via the Command Line
datasphere marketplace products overwrite

Overwrites all properties of the specified data product with the provided data in the data product definition file.

datasphere marketplace products overwrite

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-f <Filename>.json Enter a path to a file with a .json extension containing your


data product definition.

Alternative: --file-path Filename.json

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

Specify the full path to the input .json file, for example C:\temp\mydataproductdefinition.json.

 Note

If you want to update specific properties only, use the update command.

datasphere marketplace products update

Updates only selected properties of the specified data product which are defined in the provided data product
definition file.

datasphere marketplace products update

You need to specify the data products UUID.

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-f <Filename>.json Enter a path to a file with a .json extension containing your


data product definition.

Alternative: --file-path Filename.json

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

Specify the full path to the input .json file, for example C:\temp\mydataproductdefinition.json.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 57
datasphere marketplace products change-lifecycle-status

With this command you can change the lifecycle status of a data product. A newly created data product is
automatically set to status Draft.

datasphere marketplace products change-lifecycle-status

Select one of the following status from the list:

• Listed
• Delisted
• Deactivated

Than specify the data products UUID.

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

-l, --lifecycle-status <lifecycle- New lifecycle status (optional).


status>
Choices: "Listed", "Delisted", "Deactivated".

datasphere marketplace products delete

Deletes an existing data product.

datasphere marketplace products delete

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

Confirm the intention to delete the data product.

Accessing SAP Datasphere via the Command Line


58 PUBLIC Accessing SAP Datasphere via the Command Line
datasphere marketplace products-by-provider list

Returns a list of data products of a certain data provider.

datasphere marketplace products-by-provider list

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-o, --output <output> Specifies the file in which the output of the command is
stored (optional).

--no-pretty Don't pretty-formats JSON responses (optional).

-d, --accept <accept> Format to return the content in (optional).

Choices:

• application/vnd.sap.marketplace.providers.list+json
(default)
• application/vnd.sap.marketplace.providers.details+json

-g, --provider-identifier <provider- Provider identifier (optional).


identifier>
You can either:

• Provide the UUID of the data provider or of the content


aggregator.
• Provide the UUID of a content aggregator and a
contentAggregatorProviderID separated by a
colon.
Example: List [ "0b0dfe8e-
f974-407d-8987-6d863b2c5e83", "f97dfe8e-
f9a4-4d2d-8187-ed863bdc5e88:rubix-b2b-risk-assess-
ment-amp-monitoring-solutions-all-cou-rubix-data-sci-
ences" ]”

datasphere marketplace products-by-provider read

Lists the properties of a single data product. You need to specify the technical ID and data provider UUID or
content aggregator UUID.

datasphere marketplace products-by-provider read

Parameter Description

-O, --options-file <file> Path to options file (optional).

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 59
Parameter Description

-s, --secrets-file <file> Path to secrets file (optional).

-o, --output <output> Specifies the file in which the output of the command is
stored (optional).

--no-pretty Don't pretty-formats JSON responses (optional).

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

-g, --provider-identifier <provider- Provider identifier (optional).


identifier>
You can either:

• Provide the UUID of the data provider or of the content


aggregator.
• Provide the UUID of a content aggregator and a
contentAggregatorProviderID separated by a
colon.
Example: List [ "0b0dfe8e-
f974-407d-8987-6d863b2c5e83", "f97dfe8e-
f9a4-4d2d-8187-ed863bdc5e88:rubix-b2b-risk-assess-
ment-amp-monitoring-solutions-all-cou-rubix-data-sci-
ences" ]”

datasphere marketplace products-by-provider create

datasphere marketplace products-by-provider delete

Deletes an existing data product of a specified data provider.

datasphere marketplace products-by-provider delete

Confirm the intention to delete the data product.

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

-l, --lifecycle-status <lifecycle- New lifecycle status (optional).


status>
Choices: "Listed", "Delisted", "Deactivated".

Accessing SAP Datasphere via the Command Line


60 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

-g, --provider-identifier <provider- Provider identifier (optional).


identifier>
You can either:

• Provide the UUID of the data provider or of the content


aggregator.
• Provide the UUID of a content aggregator and a
contentAggregatorProviderID separated by a
colon.
Example: List [ "0b0dfe8e-
f974-407d-8987-6d863b2c5e83", "f97dfe8e-
f9a4-4d2d-8187-ed863bdc5e88:rubix-b2b-risk-assess-
ment-amp-monitoring-solutions-all-cou-rubix-data-sci-
ences" ]”

datasphere marketplace products-by-provider overwrite

Overwrites all properties of the specified data product with the provided data in the data product definition file.

datasphere marketplace products-by-provider overwrite

 Note

If you want to update specific properties only, use the update command.

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 61
Parameter Description

-g, --provider-identifier <provider- Provider identifier (optional).


identifier>
You can either:

• Provide the UUID of the data provider or of the content


aggregator.
• Provide the UUID of a content aggregator and a
contentAggregatorProviderID separated by a
colon.
Example: List [ "0b0dfe8e-
f974-407d-8987-6d863b2c5e83", "f97dfe8e-
f9a4-4d2d-8187-ed863bdc5e88:rubix-b2b-risk-assess-
ment-amp-monitoring-solutions-all-cou-rubix-data-sci-
ences" ]”

datasphere marketplace products-by-provider update

Updates only selected properties of the specified data product which are defined in the provided data product
definition file.

datasphere marketplace products-by-provider update

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-f <Filename>.json Enter a path to a file with a .json extension containing your


data product definition.

Alternative: --file-path Filename.json

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

Accessing SAP Datasphere via the Command Line


62 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

-g, --provider-identifier <provider- Provider identifier (optional).


identifier>
You can either:

• Provide the UUID of the data provider or of the content


aggregator.
• Provide the UUID of a content aggregator and a
contentAggregatorProviderID separated by a
colon.
Example: List [ "0b0dfe8e-
f974-407d-8987-6d863b2c5e83", "f97dfe8e-
f9a4-4d2d-8187-ed863bdc5e88:rubix-b2b-risk-assess-
ment-amp-monitoring-solutions-all-cou-rubix-data-sci-
ences" ]”

datasphere marketplace products-by-provider change-lifecycle-status

With this command you can change the lifecycle status of a data product. A newly created data product is
automatically set to status Draft.

datasphere marketplace products-by-provider change-lifecycle-status

Select one of the following status from the list:

• Listed
• Delisted
• Deactivated

Than specify the data products UUID.

Parameter Description

-O, --options-file <file> Path to options file (optional).

-s, --secrets-file <file> Path to secrets file (optional).

-j, --data-product-uuid <data-product- Data product UUID (optional).


uuid>

-l, --lifecycle-status <lifecycle- New lifecycle status (optional).


status>
Choices: "Listed", "Delisted", "Deactivated".

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 63
Parameter Description

-g, --provider-identifier <provider- Provider identifier (optional).


identifier>
You can either:

• Provide the UUID of the data provider or of the content


aggregator.
• Provide the UUID of a content aggregator and a
contentAggregatorProviderID separated by a
colon.
Example: List [ "0b0dfe8e-
f974-407d-8987-6d863b2c5e83", "f97dfe8e-
f9a4-4d2d-8187-ed863bdc5e88:rubix-b2b-risk-assess-
ment-amp-monitoring-solutions-all-cou-rubix-data-sci-
ences" ]”

1.8.1 The Data Product Definition File Format

Properties of a data product are set and retrieved in the space definition file format and stored as a .json file.

A data product definition file must not exceed 25MB, and can contain the following information:

Data Product Properties

Users with the DW Modeler role can create data products and set any data product properties (see Manage
Data Marketplace Data Products via the Command Line [page 54]) using the following syntax:

 Sample Code

{
"dataProviderProductID": "<string>",
"contentAggregatorProductID": "<string>",
"name": "<string>",
"description": "<string>",
"space": "<string>",
"pricingModel": "OneTime|Monthly",
"pricingDescription": "<string>",
"price": "<number>",
"pricePerMonth": "<number>",
"priceCurrencyCode": "<string>",
"licenseKeyUrl": "<URL>",
"regionalCoverages": [
"<string>",
"<string>", ...
],
"dataCategories": [
"<string>",
"<string>", ...
],
"industries": [

Accessing SAP Datasphere via the Command Line


64 PUBLIC Accessing SAP Datasphere via the Command Line
"<string>",
"<string>", ...
],
"sapApplications": [
"<string>",
"<string>", ...
],
"shipments": [
"OpenSql|External|Direct"
],
"productArtifacts": [
{
"name": "<string>",
"dataFilter": "<string>",
"columns": [
{
"name": "<string>"
}
]
}
],
"dataDocumentation": [
{
"name": "<string>",
"description": "<string>",
"blobData": "<string>",
"mimeType": "pptx|ppt|doc|htm|html|pdf|xls|xlsx"
}
],
"additionalDataDocumentation": [
{
"name": "<string>",
"description": "<string>",
"blobData": "<string>",
"mimeType": "pptx|ppt|doc|htm|html|pdf|xls|xlsx"
}
],
"sampleBlobs": [
{
"name": "<string>",
"description": "<string>",
"blobData": "<string>",
"mimeType": "json"
}
],
"images": [
{
"name": "<string>",
"description": "<string>",
"blobData": "<string>",
"mimeType": "bmp|svg|gif|jfif|jpe|jpeg|jpg|png|tif|tiff"
}
],
"legalDocuments": [
{
"name": "<string>",
"description": "<string>",
"blobData": "<string>",
"mimeType": "pptx|ppt|doc|htm|html|pdf|xls|xlsx"
}
],
"termsOfUse": "string",
"sizeCategory": "S|M|L|XL|XXL|XXXL",
"contractType": "Free|LicenseKey|OnRequest",
"deliveryMode": "OneTime|Full",
"deliveryPattern": "Daily|Weekly|Biweekly|Monthly|Quarterly|Yearly|Other",
"deliveryPatternDescription": "<string>",
"contexts": [

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 65
"<string>",
"<string>", ...
],
}

Mapped Name of Data Product Pa-


Parameter rameter used in Data Sharing Cockpit Description

<dataProviderProductID> not set manually in Data Sharing Cock- The unique ID of the given product in
pit the system of the data provider.

<contentAggregatorProductID> not set manually Data Sharing Cockpit The unique ID of the given product in
the system of the content aggregator
(if the corresponding data provider is
managed by a content aggregator).

<name> Name Enter a name for your data product.

<description> Description Enter precise and meaningful informa-


tion about your data product: for exam-
ple, what kind of data it contains and
what it's used for.

<space> Artifact Space Enter the technical name of the space


that contains the referenced data arti-
facts of the product. This is a manda-
tory property if your shipment type is
set to Direct. For all other shipment
types the Source Space is optional. The
user who calls the API must have ac-
cess to the space (must be assigned to
space).

<pricingModel> Pricing Model Select the pricing model for your data
product: One Time or Monthly. This
setting is only relevant for contract type
LicenseKey.

<pricingDescription> Pricing Description Explain the pricing to your con-


sumers. Mandatory setting for
<contractType> LicenseKey, oth-
erwise optional. Verbal description of
the pricing model and/or metric and
potentially also the price.

<price> Price State the one-time price. Manda-


tory setting for <pricingModel>
OneTime, otherwise optional. The as-
sociated currency also has to be pro-
vided in (priceCurrencyCode).

<pricePerMonth> Price per Month State the monthly price. Manda-


tory setting for <pricingModel>
Monthly, otherwise optional. Gives
the monthly product subscription price.
The associated currency also has to be
provided (priceCurrencyCode).

Accessing SAP Datasphere via the Command Line


66 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

<priceCurrencyCode> Currency Code Enter the currency code to be used,


for example: EUR, USD. Mandatory set-
ting for <pricingModel> Monthly or
OneTime, otherwise optional. For valid
currency codes see the drop-down list
in the Data Sharing Cockpit under Cre-
ate New Data Provider Profile.

<licenseKeyUrl> URL for License Key Purchase Enter the URL to the shop of the
data provider where consumers can
purchase licenses for the data product.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 67
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

<regionalCoverages> Regional Coverage String values for each region the data
is applicable to. Multiple values can be
specified.

[ Global, Europe, North


America, South America,
Central America, Asia,
Africa, Afghanistan,
Aland Islands, Albania,
Algeria, American Samoa,
Andorra, Angola, Anguilla,
Antarctica, Antigua
and Barbuda, Argentina,
Armenia, Aruba, Australia,
Austria, Azerbaijan,
Bahamas, Bahrain,
Bangladesh, Barbados,
Belarus, Belgium, Belize,
Benin, Bermuda, Bhutan,
Bolivia, Bonaire, Sint
Eustatius and Saba,
Bosnia and Herzegovina,
Botswana, Bouvet Island,
Brazil, British Indian
Ocean Territory, Brunei
Darussalam, Bulgaria,
Burkina Faso, Burundi,
Cambodia, Cameroon,
Canada, Cape Verde, Cayman
Islands, Central African
Republic, Chad, Chile,
China, Christmas Island,
Cocos (Keeling) Islands,
Colombia, Comoros, Congo,
Congo, The Democratic
Republic of, Cook Islands,
Costa Rica, Cote d'Ivoire,
Croatia, Cuba, Curaçao,
Cyprus, Czechia, Denmark,
Djibouti, Dominica,
Dominican Republic, Egypt,
El Salvador, Equatorial
Guinea, Eritrea, Estonia,

Accessing SAP Datasphere via the Command Line


68 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

Ethiopia, Falkland
Islands (Malvinas), Faroe
Islands, Fiji, Finland,
France, French Guiana,
French Polynesia, French
Southern Territories,
Gabon, Gambia, Georgia,
Germany, Ghana, Gibraltar,
Greece, Greenland,
Grenada, Guadeloupe,
Guam, Guatemala, Guernsey,
Guinea, Guinea-Bissau,
Guyana, Haiti, Heard
and Mc Donald Islands,
Holy See (Vatican
City State), Honduras,
Hong Kong, Hungary,
Iceland, India, Indonesia,
Iran, Islamic Republic
of, Iraq, Ireland,
Isle of Man, Israel,
Italy, Jamaica, Japan,
Jersey, Jordan, Kazakstan,
Kenya, Kiribati, Korea,
Democratic People's
Republic of, Korea,
Republic of, Kosovo
(temporary code), Kuwait,
Kyrgyzstan, Lao, People's
Democratic Republic,
Latvia, Lebanon, Lesotho,
Liberia, Libyan Arab
Jamahiriya, Liechtenstein,
Lithuania, Luxembourg,
Macao, Macedonia,
Madagascar, Malawi,
Malaysia, Maldives, Mali,
Malta, Marshall Islands,
Martinique, Mauritania,
Mauritius, Mayotte,
Mexico, Micronesia,
Federated States of,

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 69
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

Moldova, Republic
of, Monaco, Mongolia,
Montenegro, Montserrat,
Morocco, Mozambique,
Myanmar, Namibia, Nauru,
Nepal, Netherlands,
Netherlands Antilles, New
Caledonia, New Zealand,
Nicaragua, Niger, Nigeria,
Niue, Norfolk Island,
Northern Mariana Islands,
Norway, Oman, Pakistan,
Palau, Palestinian
Territory, Occupied,
Panama, Papua New
Guinea, Paraguay, Peru,
Philippines, Pitcairn,
Poland, Portugal, Puerto
Rico, Qatar, Republic of
Serbia, Reunion, Romania,
Russia Federation, Rwanda,
Saint BarthŽlemy, Saint
Helena, Saint Kitts &
Nevis, Saint Lucia, Saint
Martin, Saint Pierre and
Miquelon, Saint Vincent
and the Grenadines, Samoa,
San Marino, Sao Tome and
Principe, Saudi Arabia,
Senegal, Serbia and
Montenegro, Seychelles,
Sierra Leone, Singapore,
Sint Maarten, Slovakia,
Slovenia, Solomon Islands,
Somalia, South Africa,
South Georgia & The
South Sandwich Islands,
South Sudan, Spain,
Sri Lanka, Sudan,
Suriname, Svalbard and Jan
Mayen, Swaziland, Sweden,
Switzerland, Syrian Arab

Accessing SAP Datasphere via the Command Line


70 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

Republic, Taiwan, Province


of China, Tajikistan,
Tanzania, United Republic
of, Thailand, Timor-
Leste, Togo, Tokelau,
Tonga, Trinidad and
Tobago, Tunisia, Turkey,
Turkish Rep N Cyprus,
Turkmenistan, Turks and
Caicos Islands, Tuvalu,
Uganda, Ukraine, United
Arab Emirates, United
Kingdom, United States,
United States Minor
Outlying Islands, Uruguay,
Uzbekistan, Vanuatu,
Venezuela, Vietnam, Virgin
Islands, British, Virgin
Islands, U.S., Wallis and
Futuna, Western Sahara,
Yemen, Zambia, Zimbabwe ]

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 71
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

<dataCategories> Data Category Coded values for each data category.


Multiple values can be specified.

[ C001 - Benchmarking
Data, C011 - Company
Data, C021 - Countries,
Regions & Cities Data,
C031 - Culture & Sports
Data, C041 - Environmental
& Weather Data, C051
- Finance & Economy
Data, C061 - Geospatial
Data, C071 - Health
Data, C081 - Hospitality,
Travel & Tourism Data,
C091 - Industry-Specific
Data, C101 - Innovation
& Trend Data, C111 -
Legal & Justice Data,
C121 - Market & Consumer
Data, C131 - Media &
Entertainment Data, C141
- Mobility Data, C151 -
Natural Resources & Energy
Data, C161 - Political
Data, C171 - Product &
Services Data, C181 -
Public Sector & Society
Data, C191 - Science
& Technology Data, C201
- Social Media, News &
Communication Data, C206 -
Sustainability Data, C211
- Transport & Logistics
Data, C221 - Web, IoT &
Device Data, C231 - Other
Data Categories ]

Accessing SAP Datasphere via the Command Line


72 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

<industries> Industry String values for each industry the data


is applicable to. Multiple values can be
specified.

[ All Industries, Energy


and Natural Ressources,
Energy and Natural
Ressources:Building
Products, Energy and
Natural
Ressources:Chemicals,
Energy and Natural
Ressources:Mill Products,
Energy and Natural
Ressources:Mining, Energy
and Natural Ressources:Oil
and Gas, Energy and
Natural
Ressources:Utilities,
Financial Services,
Financial
Services:Banking,
Financial
Services:Insurance,
Consumer Industries,
Consumer
Industries:Agribusiness,
Consumer
Industries:Consumer
Products, Consumer
Industries:Fashion,
Consumer Industries:Life
Sciences, Consumer
Industries:Retail,
Consumer
Industries:Wholesale
Distribution, Discrete
Industries, Discrete
Industries:Aerospace and
Defense, Discrete
Industries:Automotive,
Discrete Industries:High
Tech, Discrete

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 73
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

Industries:Industrial
Machinery and Components,
Service Industries,
Service
Industries:Airlines,
Service
Industries:Engineering,
Construction, and
Operations, Service
Industries:Media, Service
Industries:Professional
Services, Service
Industries:Railways,
Service Industries:Sports
& Entertainment, Service
Industries:Telecommunicati
ons, Service
Industries:Travel and
Transportation, Public
Services, Public
Services:Defense and
Security, Public
Services:Future Cities,
Public
Services:Healthcare,
Public Services:Higher
Education and Research,
Public Services:Public
Sector ]

Accessing SAP Datasphere via the Command Line


74 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

<sapApplications> SAP Application String values for each SAP Application


the data is applicable to. Multiple values
can be specified.

[ HR & People
Engagement, HR &
People Engagement:Employee
in HR and People
Engagements, HR &
People Engagement:Employee
Experience Management, HR
& People Engagement:Core
HR and Payroll, HR &
People Engagement:Talent
Management, HR &
People Engagement:HR
Analytics and Workforce
Planning, CRM and
Customer Experience,
CRM and Customer
Experience:Customer Data,
CRM and Customer
Experience:Marketing,
CRM and Customer
Experience:Commerce,
CRM and Customer
Experience:Sales, CRM
and Customer
Experience:Service, ERP
& Finance, ERP &
Finance:SAP S/4HANA, ERP
& Finance:ERP for Small
and Midsize Enterprises,
ERP & Finance:Financial
Planning and Analysis,
ERP & Finance:Accounting
and Financial Close,
ERP & Finance:Treasury
Management, ERP
& Finance:Accounts
Receivable, Billing &
Revenue Management, ERP
& Finance:Cybersecurity,

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 75
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

Governance, Risk
& Compliance,
Network & Spend
Management, Network &
Spend Management:Supplier
Managemetn, Network &
Spend Management:Strategic
Sourcing, Network & Spend
Management:Procurement,
Network & Spend
Management:Services
Procurement and Contingent
Workforce, Network &
Spend Management:Selling
and Fulfillment, Network
& Spend Management:Travel
and Expense, Business
Technology Plattform,
Business Technology
Plattform:Database and
Data Management,
Business Technology
Plattform:Application
Development and
Integration,
Business Technology
Plattform:Analytics,
Business Technology
Plattform:Intelligent
Technologies, Digital
Supply Chain, Digital
Supply Chain:Supply
Chain Planning, Digital
Supply Chain:Supply Chain
Logistics, Digital Supply
Chain:Manufacturing,
Digital Supply Chain:R&D /
Engineering, Digital
Supply Chain:Asset
Management, Experience
Management, Experience
Management:Brand

Accessing SAP Datasphere via the Command Line


76 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

Experience, Experience
Management:Customer
Experience, Experience
Management:Product
Experience, Experience
Management:Employee
Experience ]

<shipments> Data Shipment Specify the shipment types you are of-
fering. These shipment types are used
if a customer filters offerings for a dis-
tinct shipment type. It is particularly
important if the data provider has no
products listed yet as only the ship-
ment types given here are used for the
search.

Select one of the following shipment


types:

• Direct
The data is copied directly into the
space that the consumers select.
• External
The data is delivered by sharing
files outside SAP Datasphere.
• OpenSql
The consumers need to provide an
Open SQL Schema to you, using
the Data Inbox. Once activated, the
data is accessible through the Data
Builder and the provided schema
appears as a source.

<productArtifacts> Views Specify one or multiple views from


the given <space> that should be con-
tained in the data product. Selecting ta-
bles is not supported.

If <shipments> is set to Direct in


combination with the lifecycle status
Listed, this is a mandatory property.
For all other shipment types the prod-
uct artifacts have to be left out.

You can also specify filters to be applied


to the view.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 77
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

<dataDocumentation> Data Documentation Specify a file containing data documen-


tation.

String Array

<additionalDataDocumentation> Additional Data Documentation A Base64 encoded file containing addi-


tional data documentation.

Supported MIME types: pptx, ppt, doc,


htm, html, pdf, xls, xlsx.

<sampleBlobs> Sample Data


A .json file containing sample data.

<images> Image An image representing the data prod-


uct. It has to be Base64 encoded and of
the following MIME types: bmp, svg, gif,
jfif, jpe, jpeg, jpg, png, tif, tiff

<legalDocuments> Legal Description A Base64 encoded file containing le-


gal information. Supported MIME types:
pptx, ppt, doc, htm, html, pdf, xls, xlsx.

<termsOfUse> Terms & Conditions Written, unformatted description of the


product’s terms of use. Terms of use
are shown and confirmed by the cus-
tomer during product activation

<sizeCategory> Size Category This parameter is an information on


how many records can be approxi-
mately expected in the data set. It
should give a rough size estimation also
in terms of consumed data volume in
the target space.

S = Less than 1,000 records

M = Between 1,000 and 100,000 re-


cords

L = Between 100,000 and 1,000,000

XL = between 1,000,000 and


10,000,000 records

XXL = between 10,000,000 records


and 100,000,000 records

XXXL = more than 100,000,000 re-


cords

Accessing SAP Datasphere via the Command Line


78 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

<contractType> Contract Type Defines how access to the product is


managed/granted.

OnRequest is the mandatory con-


tract type for all products that
have shipment type OpenSql” or
ExternalDelivery.

Free“: Customer can activate the


product without any further authoriza-
tion by the Data Provider.

LicenseKey: The customer will need


a valid license to key to authorize the
product activation. The Data Provider
can create a license through the Data
Sharing Cockpit and give a customer
access through activation keys which
he can generate for this license. It's
also advised to specify the URL to the
external shop (<licenseKeyUrl>) to
purchase license keys, if available.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 79
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

<deliveryMode> Delivery Mode Controls if processes are activated that


allow pushing regular data updates to
customers of the given product:

• OneTime: The data set is static


and the customer should not ex-
pect updates on the data. Still the
customer can trigger a refresh of
the data if this should be neces-
sary for any reason.
• Full: The data set is periodically
refreshed. The refresh pattern is
described by the
<DeliveryPattern> and
<DeliveryPatternDescriptio
n>. The <DeliveryMode> is only
relevant if <ShipmentType> is set
to Direct.

 Note
If you create a data product in full
delivery using the CLI, you cannot
create a release with the CLI. Make
sure to manually create a release
in the Publishing Management sec-
tion of the Data Sharing Cockpit. In-
deed, a release is mandatory if you
want to list your data product for
instance.

<deliveryPattern> Delivery Pattern Provides information on the update


pattern of the data. Additionally,
more precise information (e.g. on
the time of the update or on the
weekday etc.) can be given in the
<DeliveryPatternDescription>.
This parameter is mandatory for
<DeliveryMode> = Full.

Possible values: <Daily>,


<Weekly>, <Biweekly>,
<Monthly><Quarterly>, <Yearly>,
<Other>

Accessing SAP Datasphere via the Command Line


80 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Data Product Pa-
Parameter rameter used in Data Sharing Cockpit Description

<deliveryPatternDescription> Delivery Pattern Description Free text that provides additional infor-
mation when exactly a customer can
expect an update of the product data.

Example: "Data is delivered on the 2nd


workday of a week at 7pm CET"

<contexts> Context Names of contexts in which the given


data product is visible.

For example, the following code snippet defines a new data product:

 Sample Code

{
"dataProviderProductID": "My_Data_Product",
"contentAggregatorProductID": "CW_4711",
"name": "Sales Sample Data for SAP",
"description": "Lorem Ipsum description of my Provider",
"space": "SAMPLE_SPACE",
"pricingModel": "OneTime",
"pricingDescription": "string",
"price": 599.99,
"pricePerMonth": 9.99,
"priceCurrencyCode": "string",
"licenseKeyUrl": "http://mysapdatalicenseshop.com",
"regionalCoverages": [
"Germany",
"France"
],
"dataCategories": [
"C001",
"C031"
],
"industries": [
"Financial Services",
"Energy and Natural Ressources"
],
"sapApplications": [
"HR & People Engagement",
"ERP & Finance"
],
"shipments": [
"OpenSql"
],
"productArtifacts": [
{
"name": "My_View",
"dataFilter": "country = 'france' and year = '2019'",
"columns": [
{
"name": "string"
}
]
}
],
"dataDocumentation": [
{
"name": "My_DataDocumentation_File.pdf",
"description": "My data documentation file",
"blobData": "string",

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 81
"mimeType": "doc"
}
],
"additionalDataDocumentation": [
{
"name": "My_Documentation_File.pdf",
"description": "My additional data documentation file",
"blobData": "string",
"mimeType": "doc"
}
],
"sampleBlobs": [
{
"name": "My_File.json",
"description": "My sample data",
"blobData": "string",
"mimeType": "json"
}
],
"images": [
{
"name": "My_Image_File.jpg",
"description": "My image file",
"blobData": "string",
"mimeType": "jpg"
}
],
"legalDocuments": [
{
"name": "My_Legal_File.pdf",
"description": "My legal document",
"blobData": "string",
"mimeType": "doc"
}
],
"termsOfUse": "The terms of use are complex.",
"sizeCategory": "S",
"contractType": "Free",
"deliveryMode": "OneTime",
"deliveryPattern": "Weekly",
"deliveryPatternDescription": "Data is delivered on the 2nd workday of a
week at 7pm CET",
"contexts": [
"My Private Context"
]
}

Use the .json file format to store the data product definition. It is needed for the upload which is part of the
create command for example.

You can find more information on creating data products in the Data Provider's Guide under Creating a Data
Product.

1.9 Manage Tasks and Task Chains via the Command Line

A collection of SAP Datasphere CLI commands that can be used to control and manage tasks and task chains.

The basic CLI command to manage tasks and task chains is datasphere tasks. Then, there are three
subcategories of task and task chain commands you can use. Consent, Application, and Logs.

Accessing SAP Datasphere via the Command Line


82 PUBLIC Accessing SAP Datasphere via the Command Line
Consent Commands

The following task consent commands are available:

• datasphere tasks consent get - retrieves information whether consent has been given or consent has
expired.
• datasphere tasks consent give - provides consent to perform tasks and task chains.
• datasphere tasks consent revoke - revokes consent to perform tasks and task chains.

Command Description

Returns the consent status, GIVEN or EXPIRED. When con-


datasphere tasks consent get sent was given, the command also returns the date when
user provided consent and when the consent will expire.

Provides consent to perform task chain runs. In verbose


datasphere tasks consent give mode, the command returns the following response codes:
201 (consent created), 400 (consent was already given), and
500 (Internal Server Error).

Revokes consent. In verbose mode, the command returns


datasphere tasks consent revoke the following response codes: 200 (consent successfully re-
voked), 404 (unable to find and revoke consent), and 500
(Internal Server Error).

Application Commands

The following task and task chain application command is available:

• datasphere tasks chains run - runs a specified task chain in a given space.

Command Description

Run a specified task chain (object technical name) in a given


datasphere tasks chains run space and returns the log ID of the given task chain object
--space <space-ID>
run.
--object <object>

Task Log Commands

The following log commands are available:

• datasphere tasks logs get - returns log information about a specific task chain run.
• datasphere tasks logs list - returns log information about all runs of a specific task chain.

Command Description

Returns log information given the log ID of a specific task


datasphere tasks logs get or task chain. An optional argument --info-level specifies
--space <space-ID>
the level of log detail you wish to display. The default
--log-id <log-ID>
[--info-level status | details] status option returns simple status information: running,
completed, or failed. The details option returns full de-
tails of status information for a given task chain, including
subtasks.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 83
Command Description

Returns log information for all runs of a specific task or task


datasphere tasks logs list chain (object technical name).
--space <space-ID>
--object <object>

1.10 Miscellaneous Options and Commands

These options are available for all or most datasphere commands used in the command line interface.

Indeed, only the command specific options are displayed in the SAP Datasphere command line interface. All
the generally available options are listed here.

Option Description

--verbose [optional] Print detailed log information to the console.

--options-file [optional] Enter a path to a .json file containing all of some of your datasphere op-
<file>.json
tions, listed using the full option names.

--host "<url>" Enter the URL of your SAP Datasphere tenant. You can copy the URL of any page in your
tenant. Alternatively, set a host value (see Set a Host Value to Identify Your SAP Datasphere
Tenant [page 5]).

--client-id "<id>" Enter the OAuth Client ID provided by your administrator.

 Note
The client ID must be encoded as a URI when passed as a parameter.

--secrets-file [optional] Enter a path to a .json file containing the following OAuth options, using the full
<file>.json option names

{
"client_id": "<client-id>",
"client_secret": "<client-secret>",
"authorization_url": "<authorization-url>",
"token_url": "<token-url>",
}

 Note
Secrets files use versions of the options with underscores instead of hyphens.

Passing this file with the tokens allows you to run any command without having first to log
in.

--access-token [optional] Enter the access token for interactive oauth session authentication.
"<token>"

--refresh-token [optional] Refresh the access token for interactive oauth session authentication.
"<token>"

Accessing SAP Datasphere via the Command Line


84 PUBLIC Accessing SAP Datasphere via the Command Line
Option Description

--code "<code>" [optional] Enter the code for oauth token retrieval.

--token-url "<url>" [optional] Enter the Token URL provided by your administrator.

--authorization-url [optional] Enter the Authorization URL provided by your administrator.


"<url>"

--passcode <code> [optional] If you are not logged into an OAuth client, you must provide a passcode that you
have obtained from your SAP Datasphere tenant.

You can include a passcode with your command using the --passcode parameter. If you
do not include the --passcode parameter, datasphere will prompt you to obtain a
passcode:

1. Enter y and datasphere will open the passcode page for your tenant.
2. If you are not already logged in, you must enter your username and password.
3. When you arrive at the passcode page, copy the temporary authentication code and
paste it into the command line.

 Note
If you are not logged into an OAuth client, you must enter a new passcode for each
command that you issue with datasphere.

--expires-in [optional] Enter the date when the interactive oauth session authentication expires.
"<expires>"

--output [optional] Enter a path to a .json file to write the output to.
<file>.json
If you do not include this option, the output will be printed to the command line.

--no-pretty [optional] Don't pretty-print the output.

The following additional commands are available:

Command Description

datasphere config cache init --host Download the file of available datasphere commands
"<url>" from the SAP Datasphere instance.

datasphere config cache clean Delete the local file of available datasphere commands.

datasphere --version Display the version of datasphere.

datasphere <command> --help --host Display help for the specified datasphere command.
"<url>"

datasphere config secrets show Display the parameters for the OAuth client you are logged
into.

datasphere config passcode-url --host Display the passcode url for the SAP Datasphere server.
"<url>"

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 85
Datasphere Config Command

The config command is a top level command that reveals all the CLI configuration-related commands such as
cache, secrets, host, and so on:

Command Description

cache Work with the local CLI cache.

host Configure host properties.

passcode-url [option] Display the passcode URL.

secrets Work with the locally stored secrets.

help [command] Display help for command.

1.11 Command Line Roles and Privileges

The command line interface requires the same privileges to perform actions as are needed to use the standard
graphical interface.

Command Requires Privileges (Permissions)… Contained in Standard Role

datasphere dbusers DW Administrator


Spaces (-RU-----)

datasphere marketplace Data Builder (CRUD----) DW Modeler

datasphere scoped-roles Role (CRUD----) DW Administrator

datasphere spaces • Create a space and set storage, DW Administrator


priority:
• Spaces (C------M)
• User (-R------)
• Update/ delete spaces:
• Spaces (-RUD---M)
• Update space users:
• Team (-RUD---M)
• Scoped Role User Assignment
(-------M)

datasphere tasks Data Warehouse Data Integration (-RU- DW Integrator


E---)

datasphere users User (CRUD---M) DW Administrator

Accessing SAP Datasphere via the Command Line


86 PUBLIC Accessing SAP Datasphere via the Command Line
Important Disclaimers and Legal Information

Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:

• Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your
agreements with SAP) to this:

• The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.

• SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.

• Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering an SAP-hosted Web site. By using
such links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this
information.

Videos Hosted on External Platforms


Some videos may point to third-party video hosting platforms. SAP cannot guarantee the future availability of videos stored on these platforms. Furthermore, any
advertisements or other content hosted on these platforms (for example, suggested videos or by navigating to other videos hosted on the same site), are not within
the control or responsibility of SAP.

Beta and Other Experimental Features


Experimental features are not part of the officially delivered scope that SAP guarantees for future releases. This means that experimental features may be changed by
SAP at any time for any reason without notice. Experimental features are not for productive use. You may not demonstrate, test, examine, evaluate or otherwise use
the experimental features in a live operating environment or with data that has not been sufficiently backed up.
The purpose of experimental features is to get feedback early on, allowing customers and partners to influence the future product accordingly. By providing your
feedback (e.g. in the SAP Community), you accept that intellectual property rights of the contributions or derivative works shall remain the exclusive property of SAP.

Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax
and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of
example code unless damages have been caused by SAP's gross negligence or willful misconduct.

Bias-Free Language
SAP supports a culture of diversity and inclusion. Whenever possible, we use unbiased language in our documentation to refer to people of all cultures, ethnicities,
genders, and abilities.

Accessing SAP Datasphere via the Command Line


Important Disclaimers and Legal Information PUBLIC 87
www.sap.com/contactsap

© 2023 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form


or for any purpose without the express permission of SAP SE or an SAP
affiliate company. The information contained herein may be changed
without prior notice.

Some software products marketed by SAP SE and its distributors


contain proprietary software components of other software vendors.
National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for


informational purposes only, without representation or warranty of any
kind, and SAP or its affiliated companies shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP or
SAP affiliate company products and services are those that are set forth
in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an
additional warranty.

SAP and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP
SE (or an SAP affiliate company) in Germany and other countries. All
other product and service names mentioned are the trademarks of their
respective companies.

Please see https://www.sap.com/about/legal/trademark.html for


additional trademark information and notices.

THE BEST RUN

You might also like