[go: up one dir, main page]

0% found this document useful (0 votes)
68 views132 pages

DWC Accessing DWC Via Command Line

The document provides a comprehensive guide on accessing SAP Datasphere via the command line interface (CLI), including installation, configuration, and command usage. It details the necessary prerequisites, commands available for managing users, roles, spaces, and data marketplace, as well as instructions for logging in using OAuth. The CLI has been renamed from 'dwc' to 'datasphere', and users are encouraged to utilize the new command for their operations.

Uploaded by

mukesh.mkms
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views132 pages

DWC Accessing DWC Via Command Line

The document provides a comprehensive guide on accessing SAP Datasphere via the command line interface (CLI), including installation, configuration, and command usage. It details the necessary prerequisites, commands available for managing users, roles, spaces, and data marketplace, as well as instructions for logging in using OAuth. The CLI has been renamed from 'dwc' to 'datasphere', and users are encouraged to utilize the new command for their operations.

Uploaded by

mukesh.mkms
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 132

PUBLIC

Document Version: 2024.22 – 2024-10-22

Accessing SAP Datasphere via the Command Line


© 2024 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 Installing and Configuring the Command Line Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Install or Update the SAP Datasphere Command Line Interface. . . . . . . . . . . . . . . . . . . . . . . . . . 4
Set a Host Value to Identify Your SAP Datasphere Tenant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Log into the Command Line Interface via an OAuth Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Miscellaneous Options and Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Command Line Roles and Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.2 Manage User Access via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Manage Global Roles via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Manage Scoped Roles via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Manage Users via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.3 Manage Spaces via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Manage Space Users via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Reset Database User Passwords via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
The Space Definition File Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Manage Space Priorities and Statement Limits via the Command Line. . . . . . . . . . . . . . . . . . . . 43
1.4 Manage Modeling Objects via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Creating and Updating Modeling Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
1.5 Manage the Data Marketplace via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Manage Data Marketplace Data Providers via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . 58
Manage Data Marketplace Data Products via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . 77
Manage Data Marketplace Licenses via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Manage Data Marketplace Releases via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Manage Data Marketplace Contexts via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . 117
1.6 Manage Tasks and Task Chains via the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

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 has been 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 .

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 34]).

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

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 58]) and data
products (see Manage Data Marketplace Data Products via the Command Line [page 77]).

datasphere objects Users with the DW Modeler role (or equivalent privileges) can list, read, and delete modeling
objects (see Manage Modeling Objects via the Command Line [page 46]).

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 16]).

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 26]).

datasphere workload Users with the DW Administrator role (or equivalent privileges) can set space priorities and
statement limits for spaces. (see Manage Space Priorities and Statement Limits via the
Command Line [page 43]).

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 129]).

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

 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 Installing and Configuring the Command Line Interface

The command line interface, datasphere must be installed and configured before you can use it to access
your SAP Datasphere tenant.

The following pages help you get started:

• 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]).
• To simplify issuing commands, you can set the host value to identify the SAP Datasphere tenant you are
currently working with (see Set a Host Value to Identify Your SAP Datasphere Tenant [page 5].
• The commands you are allowed to issue depend on the SAP Datasphere roles that you have (see
Command Line Roles and Privileges [page 12].
• In addition to the command-specific options listed, there are general options that can be used with any
command (see Miscellaneous Options and Commands [page 10]).

1.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 has been 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 and <=21


• npm version >= 8 and <=10

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 .

Accessing SAP Datasphere via the Command Line


4 PUBLIC Accessing SAP Datasphere via the Command Line
 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.

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.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 has been 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


Accessing SAP Datasphere via the Command Line PUBLIC 5
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

1.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 has been 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.

Accessing SAP Datasphere via the Command Line


6 PUBLIC Accessing SAP Datasphere via 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.

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.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 7
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:

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",
...
}

Accessing SAP Datasphere via the Command Line


8 PUBLIC Accessing SAP Datasphere via the Command Line
]

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.

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").

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 9
1.1.4 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 .json [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>"

--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>"

Accessing SAP Datasphere via the Command Line


10 PUBLIC Accessing SAP Datasphere via the Command Line
Option Description

--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 11
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.1.5 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

DW Modeler
datasphere objects • Data Builder (CRUD----)
• Data Warehouse Business Entity
(CRUD----)
• Data Warehouse Fact Model
(CRUD----)
• Data Warehouse Consumption
Model (CRUD----)
• Data Warehouse Authorization
Scenario (CRUD----)

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

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


datasphere workload
priority:
• Spaces (C------M)
• User (-R------)

Accessing SAP Datasphere via the Command Line


12 PUBLIC Accessing SAP Datasphere via the Command Line
Command Requires Privileges (Permissions)… Contained in Standard Role

datasphere spaces • Update/delete spaces: DW Administrator and DW Space


Administrator
• 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

1.2 Manage User Access via the Command Line

You can use the datasphere command line interface to manage users and roles.

Users with the DW Administrator role (or equivalent privileges) can manage:

Objects Command

Global roles datasphere global-roles

See Manage Global Roles via the Command Line [page 13].

Scoped Roles datasphere scoped-roles

See Manage Scoped Roles via the Command Line [page


16].

Users datasphere users

See Manage Users via the Command Line [page 23].

1.2.1 Manage Global Roles via the Command Line

Users with a DW Administrator role (or with equivalent privileges) can list and read global roles and add users to
and remove users from them via the command line.

This topic contains the following sections:

• Working with Global Roles on the Command Line [page 14]


• List Global Roles [page 14]
• List Users in a Global Role [page 14]
• Add Users to Global Roles [page 15]
• Remove Users from Global Roles [page 15]

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 13
Working with Global Roles on the Command Line

To work with global 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]).
• Log in 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
12]).

To browse the available commands, enter the following and press Return :

datasphere global-roles

 Note

You cannot create or delete global roles via the command line.

For general information about working with global roles in SAP Datasphere , see Assign Users to a Role.

List Global Roles

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

Enter the following command and press Return :

datasphere global-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.

List Users in a Global Role

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

datasphere global-roles users list


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

Complete the parameters as follows:

Accessing SAP Datasphere via the Command Line


14 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--role <id> Enter the ID of a global role.

--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 write the list of users added to the global role Custom_Administrator to the file
admins.json , enter the following command and press Return :

datasphere global-roles users list --role Custom_Administrator --output


admins.json

Add Users to Global Roles

You can add users to a global role.

Enter the following command and press Return :

datasphere global-roles users add


--role <ID>
--users <userID[,userID...]>

Complete the parameters as follows:

Parameter Description

--role <id> Enter the ID of a global role.

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


<userID[,userID...
]>

For example, to add the users AADAMS and SSMITH to the global role Custom_Administrator, enter the
following command and press Return :

datasphere global-roles users add --role Custom_Administrator --users


AADAMS,SSMITH

Remove Users from Global Roles

You can remove users from a global role.

Enter the following command and press Return :

datasphere global-roles users remove


--role <ID>
--users <userID[,userID...]>

Complete the parameters as follows:

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 15
Parameter Description

--role <id> Enter the ID of a global role.

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


<userID[,userID...
]>

For example, to remove the users AADAMS and SSMITH from the global role Custom_Administrator, enter
the following command and press Return :

datasphere global-roles users remove --role Custom_Administrator --users


AADAMS,SSMITH

1.2.2 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 16]


• List Scoped Roles [page 17]
• Read Scoped Roles [page 17]
• Create Scoped Roles [page 18]
• Update Scoped Roles [page 18]
• Add Spaces to Scoped Roles [page 19]
• Add Users to Scoped Roles [page 20]
• Remove Users from Scoped Roles [page 21]
• Remove Scopes from Scoped Roles [page 22]
• Delete Scoped Roles [page 22]

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]).
• Log in 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
12]).

To browse the available commands, enter the following and press Return :

datasphere scoped-roles

Accessing SAP Datasphere via the Command Line


16 PUBLIC Accessing SAP Datasphere via the Command Line
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.

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.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 17
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.

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:

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": "<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:

{
"name": "Sales_Modeler",
"description": "Modeler for Sales spaces",
"inheritance": "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.

Accessing SAP Datasphere via the Command Line


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

datasphere scoped-roles update


--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.

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

{
"description": "<Description>",
"inheritance":
"<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 add


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

Complete the parameters as follows:

Parameter Description

--role <id> Enter the ID of a scoped role.

--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 add --role Sales_Modeler --scopes


SALES_EU,SALES_US

Accessing SAP Datasphere via the Command Line


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

You can add users to a scoped role (and specify the spaces they will be given access to) by providing a
definition in a JSON file or an input string.

 Note

You must add your spaces first, before you can add users to them (see Add Spaces to Scoped Roles [page
19]).

Enter the following command and press Return :

datasphere scoped-roles users add


--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.

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

[
{
"id": "<userID>",
"scopes": ["<spaceID>","<spaceID>"]
},
{
"id": "<userID>",
"scopes": ["<spaceID>","<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 add --role Sales_Modeler --file-path add.json

Where the file add.json contains the following:

[
{
"id": "BBAXTER",
"scopes": ["SALES_EU", "SALES_US"]
},
{
"id": "JJONES",
"scopes": ["SALES_EU", "SALES_US"]
}
]

Accessing SAP Datasphere via the Command Line


20 PUBLIC Accessing SAP Datasphere via the Command Line
 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 31] ).

Remove Users from Scoped Roles

Enter the following command and press Return :

datasphere scoped-roles users remove


--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.

--file-path [optional] Enter a path to a file with a .json extension containing the list of users to
<file>.json
remove and the spaces to remove them from:

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

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

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

datasphere scoped-roles users remove --role Sales_Modeler --file-path remove.json

Where the file remove.json contains the following:

[
{
"id": "BBAXTER",
"scopes": ["SALES_EU"]
},
{
"id": "JJONES",
"scopes": ["SALES_EU"]
}
]

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 21
 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 33]).

Remove Scopes from Scoped Roles

You can remove scopes from a scoped role.

Enter the following command and press Return :

datasphere scoped-roles scopes remove


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

Complete the parameters as follows:

Parameter Description

--role <id> Enter the ID of a scoped role.

--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 remove --role 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:

Parameter Description

--role <id> Enter the ID of a scoped role.

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

Accessing SAP Datasphere via the Command Line


22 PUBLIC Accessing SAP Datasphere via the Command Line
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 Sales_Modeler --force

1.2.3 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 23]


• List Users [page 23]
• Create Users [page 24]
• Update Users [page 25]
• Delete Users [page 25]

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]).
• Log in 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
12]).

To browse the available commands, enter 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 users 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:

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 23
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>'

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",

Accessing SAP Datasphere via the Command Line


24 PUBLIC Accessing SAP Datasphere via the Command Line
"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:

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:

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 25
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.3 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 26]


• List Spaces [page 27]
• Read a Space [page 27]
• Create or Update a Space [page 28]
• Delete a Space [page 29]

 Note

The SAP Datasphere command line interface module has been renamed from dwc to datasphere. The
command dwc has been 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]).
• Log in 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) to create spaces or a role of DW Space
Administrator (or equivalent privileges) in a space to modify it (see Command Line Roles and Privileges
[page 12]).

To browse the available commands, enter the following and press Return :

datasphere spaces

For general information about working with spaces, see Creating Spaces and Allocating Storage and Managing
Your Space.

Accessing SAP Datasphere via the Command Line


26 PUBLIC Accessing SAP Datasphere via the Command Line
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 27
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.

 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 objects commands, which support a wider selection of object types (see
Manage Modeling Objects via the Command Line [page 46]).
• 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 35]).

Accessing SAP Datasphere via the Command Line


28 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>

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 29
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.

 Caution

When you delete a space, the space (along with its content and data) is permanently deleted from the
database and cannot be recovered.

1.3.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 30]


• Update Users [page 25]
• Add Users to a Space [page 31]
• Update Space Users [page 32]
• Remove Users from a Space [page 33]

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]).
• Log in 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 12]).

To browse the available commands, enter the following and press Return :

datasphere spaces users

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

Accessing SAP Datasphere via the Command Line


30 PUBLIC Accessing SAP Datasphere via the Command Line
List Space Users

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

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 31
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>",
"roles": "<RoleID[,RoleID...]>"
},
{
"id": "<UserID>",
"roles": "<RoleID[,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",
"roles": ["Sales_Admin","Sales_Modeler"]
},
{
"id": "JJONES",
"roles": ["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


32 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": ["Sales_Modeler","Sales_Integrator"]
},
{
"id": "JJONES",
"roles": ["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 33
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 in the
SALES_US space, 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": "Sales_Modeler"
},
{
"id": "BBAXTER",
"role": "Sales_Integrator"
}
]

1.3.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 ".json
[--force-definition-deployment]
[--enforce-database-user-deletion]<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:

Accessing SAP Datasphere via the Command Line


34 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

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

--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
35]).

1.3.3 The Space Definition File Format

Space properties are set and retrieved in the space definition file format and stored as a .json file. A space
definition file must not exceed 25MB.

• Space Properties [page 35]


• Members [page 39]
• Database Users [page 39]
• HDI Containers [page 41]
• Table, View, and Data Access Control Definitions [page 42]

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>,
"longDescription": "<Space_Description>",
"priority": <value>,
"injection": {
"dppRead": {
"retentionPeriod": <days>,
"isAuditPolicyActive": true|false

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 35
},
"dppChange": {
"retentionPeriod": <days>,
"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.

 Caution

The following workload management parameters are deprecated and may be removed in future releases:

• priority
• workloadClass.totalStatementMemoryLimit.value
• workloadClass.totalStatementMemoryLimit.unit
• workloadClass.totalStatementThreadLimit.value
• workloadClass.totalStatementThreadLimit.unit

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>

Accessing SAP Datasphere via the Command Line


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

assignedStorage Disk (GB) Enter the amount of storage allocated to the space in bytes. You can en-
ter any value between 100000000 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 Memory (GB) Enter the amount of ram allocated to the space in bytes. You can enter
any value between 100000000 bytes (100MB) and the total storage
size available in the tenant.

Default value: 1000000000 bytes (1GB)

longDescription Description Enter a description for the space. Can contain a maximum of 4 000
characters.

priority Space Priority [deprecated] 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 39].

dbusers Database Users See Database Users [page 39].

hdicontainers HDI Containers See HDI Containers [page 41].

Accessing SAP Datasphere via the Command Line


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

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

workloadClass.t Default values: 0, Gigabyte


otalStatementMe
moryLimit.unit

Total Statement [deprecated] Enter the maximum number (or percentage) of threads
workloadClass.t
that statements running concurrently in the space can consume. You can
otalStatementTh Thread Limit
enter any value or percentage between 0 (no limit) and the total number
readLimit.value Threads/% of 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"
}
}
}

 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
}
}
}

Accessing SAP Datasphere via the Command Line


38 PUBLIC Accessing SAP Datasphere via the Command Line
 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

See Manage Space Users via the Command Line [page 30].

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.

Accessing SAP Datasphere via the Command Line


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

<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).

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,

Accessing SAP Datasphere via the Command Line


40 PUBLIC Accessing SAP Datasphere via the Command Line
"isAuditPolicyActive": true
}
}
},
"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 (see Reset Database User Passwords via the Command Line [page 34]).

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 41
}
}

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.

 Note

You can also use the objects commands, which support a wider selection of object types, to read and
write objects to your space (see Manage Modeling Objects via the Command Line [page 46]).

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 --definitions
option (see Read a Space [page 27]).

Accessing SAP Datasphere via the Command Line


42 PUBLIC Accessing SAP Datasphere via the Command Line
1.3.4 Manage Space Priorities and Statement Limits via the
Command Line

You can use the SAP Datasphere datasphere command line interface to set space priorities and statement
limits for spaces.

Working with Space Priorities and Statement Limits on the Command Line

To work with space priorities and statement limits on the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Log in 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
12]).

To browse the available commands, enter the following and press Return :

datasphere workload

For general information about space priorities and statement limits, see Set Priorities and Statement Limits for
Spaces.

List Space Priorities and Statement Limits for Spaces

To list space priorities and statement limits for spaces available on the tenant, enter the following command
and press Return :

datasphere workload list


[--host "url"]
[--output file.json]To list space priorities and statement limits for spaces
available
on the tenant, enter the following command and press

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.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 43
Update Space Priorities and Statement Limits for Spaces

To update space priorities and statement limits for spaces available on the tenant, enter the following
command and press Return :

datasphere workload update


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

Complete the parameters as follows:

Parameter Description

--file-path Enter a path to a file with a .json extension containing the list of space properties to
<file>.json update.

{
"assignment": "SPACE",
"workloadClasses": [
{
"spaceId": "<SpaceID>",
"priority": <PriorityNumber>,
"workloadType": "<WorkloadType>",
"totalStatementThreadLimit": <Value>,
"totalStatementThreadLimitUnit": "Counter|
Percent",
"totalStatementMemoryLimit": <Value>,
"totalStatementMemoryLimitUnit": "Gigabyte|
Percent"
}
]
}

In this example, you set the following priorities and statements limits to 2 spaces:

• Set the space SALES_EU the space priority from 1 to 2 and change the workload type from custom to
default.
• Set the space SALES_US the space priority from 5 to 8 and change the workload type from default
to custom, with the totalStatementThreadLimit parameter to 50%, and the totalStatementMemoryLimit
parameter to 80%.

Enter the following command and press Return :

datasphere workload update --file-path update.json

Where the file update.json contains the following:

{
"assignment": "SPACE",
"workloadClasses": [
{
"spaceId": "SALES_EU",
"priority": 2,
"workloadType": "default",
},
{
"spaceId": "SALES_US",
"priority": 8,
"workloadType": "custom",
"totalStatementThreadLimit": 50,
"totalStatementThreadLimitUnit": "Percent",

Accessing SAP Datasphere via the Command Line


44 PUBLIC Accessing SAP Datasphere via the Command Line
"totalStatementMemoryLimit": 80,
"totalStatementMemoryLimitUnit": "Percent"
},
]
}

The Workload Management File Format

The space priorities and statement limits for spaces are set and retrieved in the space workload management
definition file format and stored as a .json file.

You can set any space priority and statement limits properties using the following syntax:

{
"assignment": "SPACE",
"workloadClasses": [
{
"spaceId": "<SpaceID>",
"priority": <PriorityNumber>,
"workloadType": "<WorkloadType>",
"totalStatementThreadLimit": <Value>,
"totalStatementThreadLimitUnit": "Counter|Percent",
"totalStatementMemoryLimit": <Value>,
"totalStatementMemoryLimitUnit": "Gigabyte|Percent"
}
{
"spaceId": "<SpaceID>",
"priority": <PriorityNumber>,
"workloadType": "<WorkloadType>",
"totalStatementThreadLimit": <Value>,
"totalStatementThreadLimitUnit": "Counter|Percent",
"totalStatementMemoryLimit": <Value>,
"totalStatementMemoryLimitUnit": "Gigabyte|Percent"
}
]
}

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).

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

Accessing SAP Datasphere via the Command Line


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

workloadType Total Statement Mem- Choose between:

ory Limit • default - The default configuration provides generous resource


limits, while preventing any single space from overloading the sys-
tem.
• custom - The custom configuration enables you to specify the
value for statement limits to set maximum total thread and mem-
ory limits that statements running concurrently in the space can
consume.

Default value: default

totalStatementM Total Statement Mem- If you've chosen custom for the workloadType, you can set these pa-
rameters. Enter the maximum number (or percentage) of GBs of mem-
emoryLimit ory Limit
ory that statements running concurrently in the space can consume. You
totalStatementM GB/% can enter any value or percentage between 0 (no limit) and the total
amount of memory available in your tenant.
emoryLimitUnit
Default values: 0, Gigabyte

totalStatementT Total Statement If you've chosen custom for the workloadType, you can set these
parameters. Enter the maximum number (or percentage) of threads that
hreadLimit Thread Limit
statements running concurrently in the space can consume. You can
totalStatementT Threads/% enter any value or percentage between 0 (no limit) and the total number
of threads available in your tenant.
hreadLimitUnit
Default values: 70, Percent

1.4 Manage Modeling Objects via the Command Line


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

This topic contains the following sections:

• Working with Modeling Objects on the Command Line [page 46]


• List Objects in a Space [page 48]
• Read Objects [page 51]
• Create Objects [page 52]
• Update Objects [page 53]
• Delete Objects [page 53]

Working with Modeling Objects on the Command Line

To work with modeling objects on the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).

Accessing SAP Datasphere via the Command Line


46 PUBLIC Accessing SAP Datasphere via the Command Line
• Log in 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 12]).

To browse the available commands, enter the following and press Return :

datasphere objects <object-type>

The following object types are available:

Object Type Documentation

remote-tables Importing Tables and Views from Sources

local-tables Creating a Local Table

views Creating a Graphical View

Creating an SQL View

 Note
Both types of views are accessible via the views command.

intelligent-lookups Creating an Intelligent Lookup

er-models Creating an Entity-Relationship Model

types These objects cannot be created manually in SAP Datasphere, but may be imported as
necessary along with remote tables or content packages.
contexts

data-flows Creating a Data Flow

replication-flows Creating a Replication Flow

transformation- Creating a Transformation Flow


flows

task-chains Creating a Task Chain

analytic-models Creating an Analytic Model

business-entities Creating a Business Entity

fact-models Creating a Fact Model

consumption-models Creating a Consumption Model

data-access- Securing Data with Data Access Controls


controls

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 47
 Note

You cannot manage connections, folders, or packages, and you cannot assign modeling objects to folders
or packages with the create and update commands.

List Objects in a Space

You can list all the objects of a particular type in a space and optionally write the output to a file.

Enter the following command and press Return :

datasphere objects <object-type> list


--space id
[--technical-names <name>[,...]]
[--output <file>.json]
[--select "<property[,...]>"]
[--filter "<property operator value>[ and|or ...]"]
[--top <n>]
[--skip <n>]

Complete the parameters as follows:

Parameter Description

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

--technical-names [optional] Specify the objects to include in your list by technical name, separated by com-
<name>[,...] mas.

--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.

--select [optional] Specify the properties to include in your list, separated by commas, from among
"<property>[,...]" the following:

• technicalName
• businessName
• type
• semanticUsage
• status
• createdOn
• changedOn
• deployedOn
• createdBy
• changedBy
• defaultFileName - The .json filename is calculated by combining the
technicalName and the type and has a maximum length of 250 characters.

Default: technicalName

Accessing SAP Datasphere via the Command Line


48 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--filter "<property [optional] Specify a filter condition using the standard OData filter syntax. You can use the
operator following comparison operators:
value>[ and| • eq - Equal to
or ...]"
• ne - Not equal to
• gt - Greater than
• lt - Less than
• ge - Greater than or equal to
• le - Less than or equal to

Dates must be entered in the format 'YYYY-MM-DD'.

You can combine filter conditions using the and and or keywords and control priority by
grouping conditions with parentheses.

For example, to list only objects that were deployed after 31 December 2022, and have a
semantic usage of Fact or Dimension, enter

--filter "deployedOn gt '2022-12-31' and (semanticUsage eq


Fact or semanticUsage eq Dimension)"

--top <n> [optional] List only the first <n> objects, up to a maximum of 200.

Default: 25

--skip <n> [optional] Skip the first <n> objects.

For example, to list all the views in space MySpace showing their technical and business names as well as their
semantic usage and status and write them to a file, enter:

datasphere objects views list --space MySpace --select


"technicalName,businessName,semanticUsage,status" --output MySpaceViews.json

You can filter lists on the following properties:

Property Description

Enter an object name. You must use single or double quotes if the name contains spaces.
technicalName
For example, to list only the objects with technical name Table_1 and Table_2, enter:
businessName
--filter "technicalName eq Table_1 or technicalName eq
Table_2"

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 49
Property Description

type Enter a valid object type:

• LocalTable
• RemoteTable
• View
• IntelligentLookup
• ReplicationFlow
• TransformationFlow
• DataFlow
• TaskChain
• ERModel
• AnalyticModel
• DataAccessControl
• BusinessEntity
• FactModel
• ConsumptionModel
• Folder

lFor example, to list only views, enter:

--filter "type eq View"

semanticUsage Enter a valid semantic usage:

• Fact
• RelationalDataset
• Dimension
• Hierarchy
• HierarchyWithDirectory
• Text
• AnalyticalDataset

For example, to list only objects with a semantic usage of Dimension, enter:

--filter "semanticUsage eq Dimension"

status Enter a valid status:

• NotDeployed
• Deployed
• ChangesToDeploy
• DesignTimeError
• DesignTimeError
• PendingDeployment

For example, to list only objects with a status of Deployed, enter:

--filter "status eq Deployed"

Accessing SAP Datasphere via the Command Line


50 PUBLIC Accessing SAP Datasphere via the Command Line
Property Description

createdOn Enter a date in the format 'YYYY-MM-DD'.

For example, to list only objects deployed after 31 December 2022, enter:
changedOn

deployedOn --filter "deployedOn gt '2022-12-31'"

Enter a valid username.


createdBy
For example, to list only objects last changed by Lisa, enter:
changedBy
--filter "changedBy eq Lisa"

Read Objects

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

Enter the following command and press Return :

datasphere objects <object-type> read


--space <id>
--technical-name <name>
[--output <file>.json]
[--accept <format>]

Complete the parameters as follows:

Parameter Description

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

--technical-name Enter the Technical Name of the object.


<name>

--output [optional] Enter a path to a .json file to write the output to.
<file>.json
Enter the option without any value (--output) to write the output to a file with the
defaultFileName for the object.

If you do not include this option, the output will be printed to the command line.

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

• application/vnd.sap.datasphere.object.content+json - [default]
Most complete definition of the object, which may include undeployed design-time
changes and unresolved associations (following import of the object).
• application/vnd.sap.datasphere.object.content.design-
time+json - Current design-time version of the object, which
may include undeployed changes, but excludes any unresolved associations.
• application/vnd.sap.datasphere.object.content.run-
time+json - Current run-time version of the ob-
ject, which excludes any undeployed design-time changes.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 51
For example, to read the definition of the remote table MyTable in space MySpace and write it to the default file
name, enter:

datasphere objects remote-tables read --space MySpace --technical-name MyTable


--output

Create Objects

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

 Note

For information about obtaining the JSON syntax for your object and other considerations when using the
create and update commands, see Creating and Updating Modeling Objects [page 54].

Enter the following command and press Return :

datasphere objects <object-type> create


--space id
--technical-name <name>
--file-path <name>.json|--input '<stringified-json>'
[--custom-validation-options <option[,option]>]
[--save-anyway]
[--no-deploy]

Complete the parameters as follows:

Parameter Description

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

--technical-name Enter the Technical Name of the object.


<name>

--file-path <name> [optional] Enter a path to a file with a .json extension containing your object definition.

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

--custom- [optional] Provide a comma-separated list of custom validation options:


validation-options • allowRevertReleaseState:true - Allows users with the Spaces.Update privi-
<option[,option]> lege (included in the DW Space Administrator role) to override warnings and import
objects with invalid release states (see Releasing Stable Views for Consumption).

--save-anyway [optional] Save the object, even if there are validation warnings.

--no-deploy [optional] Do not deploy the object after saving.

For example, to create a new local table in space MySpace, enter:

datasphere objects local-tables create --space MySpace --technical-name MyTable


--file-path MyTableDefn.json

Accessing SAP Datasphere via the Command Line


52 PUBLIC Accessing SAP Datasphere via the Command Line
Update Objects

You can update an object by providing a new definition in a JSON file or an input string.

 Note

For information about obtaining the JSON syntax for your object and other considerations when using the
create and update commands, see Creating and Updating Modeling Objects [page 54].

Enter the following command and press Return :

datasphere objects <object-type> update


--space id
--technical-name <name>
--file-path <name>.json|--input '<stringified-json>'
[--custom-validation-options <option[,option]>]
[--save-anyway]
[--no-deploy]

Complete the parameters as follows:

Parameter Description

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

--technical-name Enter the Technical Name of the object.


<name>

--file-path <name> [optional] Enter a path to a file with a .json extension containing your object definition.

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

--custom- [optional] Provide a comma-separated list of custom validation options:


validation-options • allowRevertReleaseState:true - Allows users with the Spaces.Update privi-
<option[,option]> lege (included in the DW Space Administrator role) to override warnings and import
objects with invalid release states (see Releasing Stable Views for Consumption).

--save-anyway [optional] Save the object, even if there are validation warnings.

--no-deploy [optional] Do not deploy the object after saving.

For example, to update the MyTable local table, enter:

datasphere objects local-tables update --space MySpace --technical-name MyTable


--file-path MyTableDefn.json

Delete Objects

You can delete an object.

Enter the following command and press Return :

datasphere objects <object-type> delete

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 53
--space id
--technical-name <name>
[--delete-anyway]
[--force]

Complete the parameters as follows:

Parameter Description

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

--technical-name Enter the Technical Name of the object.


<name>

--delete-anyway [optional] Delete the object, even if other objects depend on it.

--force [optional] Suppress the Confirm Deletion dialog and delete the object without confirmation.

For example, to delete the local table MyTable in space MySpace, and suppress the Confirm Deletion dialog,
enter:

datasphere objects local-tables delete --space MySpace --technical-name MyTable


--force

1.4.1 Creating and Updating Modeling Objects

When creating or updating modeling objects, you must respect dependencies between objects and understand
the syntax of the object description files.

This topic contains the following sections:

• Object Dependencies [page 54]


• Object Definition Syntax [page 56]
• Modifying Sharing [page 56]
• Modifying Metadata Translations [page 57]
• Modifying Generated Objects [page 57]

Object Dependencies

When creating (see Create Objects [page 52]) or updating (Update Objects [page 53]) objects, any sources or
other objects that your object depends on must already be present in the space, or your action will fail.

For example, if View_A has two tables (Table_B and Table_C) and another view (View_D) as its sources, then
these three objects must all be present in the space before you can create View_A.

The dependencies between object types are as follows:

Accessing SAP Datasphere via the Command Line


54 PUBLIC Accessing SAP Datasphere via the Command Line
Object Type Dependencies

Remote Tables A remote table depends on its connection.

See Import Remote Ta-


bles.

Local Tables A local table does not have dependencies on any other objects.

See Creating a Local


Table.

Flows A data flow, replication flow, or transformation flow depends on all its sources and its target tables.

See Creating a Data


Flow, Creating a Rep-
lication Flow, and Cre-
ating a Transformation
Flow.

Views A view depends on all its sources and any used data access controls.

See Creating a Graphi-


cal View and Creating
an SQL View.

Intelligent Lookups An intelligent lookup depends on its input and lookup entities.

See Creating an Intelli-


gent Lookup.

Analytic Models An analytic model depends on its fact and dimension sources.

See Creating an Ana-


lytic Model.

E/R Models An E/R model depends on the objects that it visualizes.

See Creating an Entity-


Relationship Model.

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.
See Securing Data with
Data Access Controls.

Task Chains A task chain depends on all the objects that it automates.

See Creating a Task


Chain.

Business Entities / A business entity depends on its source data entity and any authorization scenarios.
Business Entity Ver-
sions

See Creating a Busi-


ness Entity.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 55
Object Type Dependencies

Fact Models A fact model depends on all its source fact models and business entities.

See Creating a Fact


Model.

Consumption Models A consumption model depends on all its source fact models and business entities.

See Creating a Con-


sumption Model.

Authorization Scenar- An authorization scenario depends on its data access control.


ios

See Creating an Au-


thorization Scenario.

 Note

You cannot manage connections, folders, or packages, and you cannot assign modeling objects to folders
or packages with the create and update commands.

Object Definition Syntax

You can obtain detailed information about object syntax by reading an appropriate object from your space. The
principle sections are:

Section Description

definitions Contains the structure and core metadata of the object.

editorSettings Contains information about the editor associated with the object including, in the case of graphical
objects, a serialization of the diagram.

sharing [tables and views] Contains a list of the spaces to which the object is shared (see Modifying
Sharing [page 56]).

i18n Contains translations of metadata grouped by language (see Modifying Metadata Translations
[page 57]).

Modifying Sharing

Local tables, remote tables, and views can be shared from their space to other spaces, in which they can be
used as sources for flows and views (see Sharing Tables and Views to Other Spaces).

The sharing section lists the spaces to which the entity is shared. You can modify this section to add or
remove spaces to which the table or viewed is shared.

In this example, the object, a local table, is shared to two spaces, SALES_EU and SALES_US:

"sharing": {

Accessing SAP Datasphere via the Command Line


56 PUBLIC Accessing SAP Datasphere via the Command Line
"LocalTable":[
"targetSpaces": [
"SALES_EU",
"SALES_US"
]
]
}

Modifying Metadata Translations

Business names in your exposed objects can be translated to support display languages in SAP Analytics
Cloud (see Translating Metadata for SAP Analytics Cloud).

The i18n section contains translations of the model or entity business name, and the business names of its
measures and attributes, grouped by language. You can modify this section to edit translations, or add or
remove languages and their translations.

In this example, the local table's business name, and the business name of its two attributes are provided in
English and French:

"i18n": {
"en":[
"LocalTable@ENDUSERTEXT.LABEL": "Departments",
"LocalTable#ID@ENDUSERTEXT.LABEL": "Department ID",
"LocalTable#ID@ENDUSERTEXT.LABEL": "Department Name"
],
"fr":[
"LocalTable@ENDUSERTEXT.LABEL": "Départements",
"LocalTable#ID@ENDUSERTEXT.LABEL": "Numéro de département",
"LocalTable#ID@ENDUSERTEXT.LABEL": "Nom du département"
]
}

Modifying Generated Objects

Certain objects can be generated in SAP Datasphere. These objects can be modified in only limited ways::

• Time Dimensions (see Create Time Data and Dimensions)


You can only modify business names and values in the timesettings section.
• Currency Conversion Objects (see Enabling Currency Conversion with TCUR* Tables and Views).
Only modifications to the business names of these objects are supported.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 57
1.5 Manage the Data Marketplace via the Command Line
You can use the SAP Datasphere command line interface, datasphere, to manage the Data Marketplace.

 Note

The SAP Datasphere command line interface module has been renamed from dwc to datasphere. The
command dwc has been 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 .

This chapter contains the following topics:

• Manage Data Marketplace Data Providers via the Command Line [page 58]
• Manage Data Marketplace Data Products via the Command Line [page 77]
• Manage Data Marketplace Licenses via the Command Line [page 104]
• Manage Data Marketplace Releases via the Command Line [page 112]
• Manage Data Marketplace Contexts via the Command Line [page 117]

1.5.1 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 has been 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 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 59]


• datasphere marketplace providers read [page 59]
• datasphere marketplace providers create [page 60]
• datasphere marketplace providers overwrite [page 60]
• datasphere marketplace providers update [page 61]

Working with Data Providers on the Command Line

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

Accessing SAP Datasphere via the Command Line


58 PUBLIC Accessing SAP Datasphere via the Command Line
• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Log in 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 12]).

To browse the available commands, enter 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

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

--accept <accept> Format to return the content in.

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

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

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 59
Parameter Description

--provider-identifier <provider- Provider identifier.


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 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 64] 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

<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

Accessing SAP Datasphere via the Command Line


60 PUBLIC Accessing SAP Datasphere via the Command Line
 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

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


data provider definition.

Alternative: --file-path Filename.json

--provider-identifier <provider- Provider identifier.


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

<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 61
Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

marketplace providers keys generate

Generates activation keys for a specified data provider.

datasphere marketplace providers keys generate

Parameter Description

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

application/vnd.sap.marketplace.providers.generate-
keys+json (default)

--provider-identifier <provider- Provider identifier.


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


62 PUBLIC Accessing SAP Datasphere via the Command Line
marketplace providers keys list

Returns a list of all the existing activation keys for a specified data provider.

datasphere marketplace providers keys list

Parameter Description

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

application/vnd.sap.marketplace.providers.provider-
keys+json (default)

--provider-identifier <provider- Provider identifier.


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" ]”

marketplace providers keys delete

Deletes activation keys for a specified data provider.

datasphere marketplace providers keys delete

Parameter Description

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

application/vnd.sap.marketplace.providers.provider-
keys.mass-delete+json (default)

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 63
Parameter Description

--provider-identifier <provider- Provider identifier.


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.5.1.1 The Data Provider Definition File Format

The properties of a data provider definition are set and retrieved in the data provider 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 58]) 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": [
"<string>",

Accessing SAP Datasphere via the Command Line


64 PUBLIC Accessing SAP Datasphere via the Command Line
"<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


Accessing SAP Datasphere via the Command Line PUBLIC 65
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


66 PUBLIC Accessing SAP Datasphere via the Command Line
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


Accessing SAP Datasphere via the Command Line PUBLIC 67
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


68 PUBLIC Accessing SAP Datasphere via the Command Line
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


Accessing SAP Datasphere via the Command Line PUBLIC 69
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


70 PUBLIC Accessing SAP Datasphere via the Command Line
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


Accessing SAP Datasphere via the Command Line PUBLIC 71
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


72 PUBLIC Accessing SAP Datasphere via the Command Line
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


Accessing SAP Datasphere via the Command Line PUBLIC 73
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


74 PUBLIC Accessing SAP Datasphere via the Command Line
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


Accessing SAP Datasphere via the Command Line PUBLIC 75
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


76 PUBLIC Accessing SAP Datasphere via the Command Line
"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.5.2 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 has been 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 78]


• datasphere marketplace products list [page 78]
• datasphere marketplace products read [page 79]
• datasphere marketplace products create [page 79]
• datasphere marketplace products overwrite [page 79]
• datasphere marketplace products update [page 80]
• datasphere marketplace products change-lifecycle-status [page 80]
• datasphere marketplace products delete [page 80]
• datasphere marketplace products-by-provider list [page 81]

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 77
• datasphere marketplace products-by-provider read [page 81]
• datasphere marketplace products-by-provider create [page 82]
• datasphere marketplace products-by-provider delete [page 83]
• datasphere marketplace products-by-provider overwrite [page 84]
• datasphere marketplace products-by-provider update [page 84]
• datasphere marketplace products-by-provider change-lifecycle-status [page 85]

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]).
• Log in 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 12]).

To browse the available commands, enter 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

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

--accept <accept> Format to return the content in.

Choices:

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

Accessing SAP Datasphere via the Command Line


78 PUBLIC Accessing SAP Datasphere via the Command Line
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

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

--data-product-uuid <data-product-uuid> Data product UUID (optional).

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 86] 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.

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

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


data product definition.

Alternative: --file-path Filename.json

--data-product-uuid <data-product-uuid> Data product UUID (optional).

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.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 79
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

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


data product definition.

Alternative: --file-path Filename.json

--data-product-uuid <data-product-uuid> Data product UUID (optional).

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

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

--data-product-uuid <data-product-uuid> Data product UUID (optional).

--lifecycle-status <lifecycle-status> New lifecycle status.

datasphere marketplace products delete

Deletes an existing data product.

datasphere marketplace products delete

Accessing SAP Datasphere via the Command Line


80 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--data-product-uuid <data-product-uuid> Data product UUID (optional).

Confirm the intention to delete the data product.

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

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

--accept <accept> Format to return the content in.

Choices:

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

--provider-identifier <provider- Provider identifier.


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

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 81
Parameter Description

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

--data-product-uuid <data-product-uuid> Data product UUID (optional).

--provider-identifier <provider- Provider identifier.


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

Creates a new data product for a specified data provider 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 86] for
more information.

datasphere marketplace products-by-provider 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.

Parameter Description

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


data product definition.

Alternative: --file-path Filename.json

Accessing SAP Datasphere via the Command Line


82 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--provider-identifier <provider- Provider identifier.


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 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

--data-product-uuid <data-product-uuid> Data product UUID (optional).

--lifecycle-status <lifecycle-status> New lifecycle status.

--provider-identifier <provider- Provider identifier.


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


Accessing SAP Datasphere via the Command Line PUBLIC 83
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

--data-product-uuid <data-product-uuid> Data product UUID (optional).

--provider-identifier <provider- Provider identifier.


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

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


data product definition.

Alternative: --file-path Filename.json

--data-product-uuid <data-product-uuid> Data product UUID (optional).

Accessing SAP Datasphere via the Command Line


84 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--provider-identifier <provider- Provider identifier.


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

Then specify the data products UUID.

Parameter Description

--data-product-uuid <data-product-uuid> Data product UUID (optional).

--lifecycle-status <lifecycle-status> New lifecycle status.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 85
Parameter Description

--provider-identifier <provider- Provider identifier.


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.5.2.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 77]) 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": [
"<string>",

Accessing SAP Datasphere via the Command Line


86 PUBLIC Accessing SAP Datasphere via the Command Line
"<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": [
"<string>",

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 87
"<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. The user who calls
the API must have access 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


88 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 89
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


90 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 91
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


92 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 93
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


94 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 95
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


96 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 97
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


98 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 99
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


100 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 101
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


102 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 103
"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.5.3 Manage Data Marketplace Licenses via the Command


Line
You can use the SAP Datasphere command line interface, datasphere, to create and manage Data
Marketplace licenses in the data sharing cockpit.

Manage your licenses and generate activation keys for consumers to ensure compliant access to your data
products. For more information about Data Marketplace licenses, see Managing Licenses.

Accessing SAP Datasphere via the Command Line


104 PUBLIC Accessing SAP Datasphere via the Command Line
To manage licenses with the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Log in 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 12]).

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

• datasphere marketplace licenses-by-provider list [page 105]


• datasphere marketplace licenses-by-provider create [page 105]
• datasphere marketplace licenses-by-provider read [page 106]
• datasphere marketplace licenses-by-provider update [page 106]
• datasphere marketplace licenses-by-provider overwrite [page 106]
• datasphere marketplace licenses-by-provider delete [page 107]
• datasphere marketplace licenses-by-provider change-lifecycle-status [page 107]
• datasphere marketplace licenses-by-provider keys list [page 107]
• datasphere marketplace licenses-by-provider keys generate [page 108]
• datasphere marketplace licenses-by-provider keys delete [page 108]
• datasphere marketplace licenses-by-provider mass delete keys [page 109]
• marketplace licenses-by-provider products add [page 109]
• marketplace licenses-by-provider products delete [page 110]

datasphere marketplace licenses-by-provider list

Returns a simplified list of all the licenses available for your data provider profile.

datasphere marketplace licenses-by-provider list

Parameter Description

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

datasphere marketplace licenses-by-provider create

Creates a new license.

datasphere marketplace licenses-by-provider create

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

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 105
Parameter Description

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

datasphere marketplace licenses-by-provider read

Lists the properties of a license. You must specify the license UUID.

datasphere marketplace licenses-by-provider read

Parameter Description

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

--license <license> License UUID.

datasphere marketplace licenses-by-provider update

Updates properties of a specified license.

datasphere marketplace licenses-by-provider update

You must specify the license UUID.

Parameter Description

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

--license <license> License UUID.

datasphere marketplace licenses-by-provider overwrite

Overwrites all the properties of a specified license.

datasphere marketplace licenses-by-provider overwrite

Parameter Description

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

--license <license> License UUID.

Accessing SAP Datasphere via the Command Line


106 PUBLIC Accessing SAP Datasphere via the Command Line
 Note

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

datasphere marketplace licenses-by-provider delete

Deletes an existing license.

datasphere marketplace licenses-by-provider delete

Parameter Description

--license <license> License UUID.

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

Changes the lifecycle status of a license from Draft to Active, or vice versa. A newly created license is
automatically set to status Draft.

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

Select the Active (or Draft) status, then specify the license UUID.

Parameter Description

--license <license> License UUID.

--lifecycle-status <lifecycle-status> New lifecycle status.

datasphere marketplace licenses-by-provider keys list

Returns a list of all the existing activation keys for a specified license.

datasphere marketplace licenses-by-provider keys list

Parameter Description

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

--license <license> License UUID.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 107
Parameter Description

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

application/vnd.sap.marketplace.licenses.keys+json (de-
fault)

datasphere marketplace licenses-by-provider keys generate

Generates activation keys for a specified license.

datasphere marketplace licenses-by-provider keys generate

Parameter Description

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

--license <license> License UUID.

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

application/vnd.sap.marketplace.licenses.generate-
keys+json (default)

--number <number> Number of activation keys to be generated.

datasphere marketplace licenses-by-provider keys delete

Deletes an activation key from a specified license.

datasphere marketplace licenses-by-provider keys delete

Parameter Description

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

--license <license> License UUID.

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

application/vnd.sap.marketplace.licenses.keys.mass-de-
lete+json (default)

--key <key> License key UUID.

Accessing SAP Datasphere via the Command Line


108 PUBLIC Accessing SAP Datasphere via the Command Line
datasphere marketplace licenses-by-provider mass delete keys

Deletes all the activation keys from a license.

datasphere marketplace licenses-by-provider mass-delete-keys

Parameter Description

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

--license <license> License UUID.

--provider-identifier <provider- Provider identifier.


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" ]”

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

marketplace licenses-by-provider products add

Add data products to a license.

Parameter Description

--license <license> License UUID.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 109
Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

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

application/vnd.sap.marketplace.licenses.products+json
(default)

marketplace licenses-by-provider products delete

Remove data products from a license.

Parameter Description

--license <license> License UUID.

--provider-identifier <provider- Provider identifier.


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" ]”

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

application/vnd.sap.marketplace.licenses.products.mass-
delete+json (default)

Accessing SAP Datasphere via the Command Line


110 PUBLIC Accessing SAP Datasphere via the Command Line
1.5.3.1 The License Definition File Format

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

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

License Properties

Users with the DW Modeler role can create licenses and set any license properties (see Manage Data
Marketplace Licenses via the Command Line [page 104]) using the following syntax:

 Sample Code

{
"providerUUID": "<string>",
"reference": "<string>",
"company": "<string>",
"domains": ["<string>", "<string>", ...],
"validUntil": "<string>",
"scope": ["<string>", "<string>", ...]
}

Parameters are set as follow:

Mapped Name of License Parameter


Technical Parameter used in Data Sharing Cockpit Description

<providerUUID> Data Provider Enter the unique identifier (UUID) of the


data provider (string in UUID format).

<reference> Reference Enter a descriptive name, a contract


number, or any other reference infor-
mation (string).

<company> Company Enter the name of the company that is


going to use the license (string).

<domains> Domains Enter one or more domains to restrict


the validity of the license (array of
strings, each string representing a do-
main).

<validUntil> Valid Until Enter the last day of the validity of the
license (string in date-time format).

<scope> License Scope Select the data products that you want
to include in the license scope (array
of strings, each string representing a
product UUID to be included in the li-
cense scope).

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 111
For example, the following code snippet defines a new license:

 Sample Code

{
"providerUUID": "66c9b1e6-1d84-4f1d-8f98-1c1e26f54b8d",
"reference": “Example Reference",
"company": "Example Company",
"domains": ["example.com", "anotherexample.com"],
"validUntil": "2023-02-16T16:20:20.698Z",
"scope": ["dcccaddb-e343-4830-b0e3-8a0233309c24", "77d0a15d-a68b-4e6d-
b7ea-262b16b03cce"]
}

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

You can find more information on licenses in the Data Provider's Guide under Managing Licenses.

1.5.4 Manage Data Marketplace Releases via the Command


Line

You can use the SAP Datasphere command line interface, datasphere, to publish and manage Data
Marketplace data product releases.

The publishing management within Data Marketplace allows controlled data updates and shipment of these
updates to your consumers. For each data product update, you create a new release. For more information
about Data Marketplace releases, see Publishing New Releases.

To manage releases with the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Log in 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 12]).

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

• datasphere marketplace releases list [page 113]


• datasphere marketplace releases create [page 113]
• datasphere marketplace releases read [page 113]
• datasphere marketplace releases update [page 114]
• datasphere marketplace releases overwrite [page 114]
• datasphere marketplace releases delete [page 114]
• datasphere marketplace releases publish [page 115]
• datasphere marketplace releases lock [page 115]
• datasphere marketplace releases unlock [page 115]
• datasphere marketplace releases lock-all [page 115]

Accessing SAP Datasphere via the Command Line


112 PUBLIC Accessing SAP Datasphere via the Command Line
• datasphere marketplace releases unlock-all [page 116]

datasphere marketplace releases list

Returns a simplified list of all the releases of a data product.

datasphere marketplace releases list

Parameter Description

--data-product-uuid <data-product-uuid> Data product UUID (optional).

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

datasphere marketplace releases create

Creates a new release.

datasphere marketplace releases create

Parameter Description

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

--data-product-uuid <data-product-uuid> Data product UUID (optional).

datasphere marketplace releases read

Lists the properties of a release. You must specify the release UUID.

datasphere marketplace releases read

Parameter Description

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

--data-product-uuid <data-product-uuid> Data product UUID (optional).

--release <release> Release UUID.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 113
datasphere marketplace releases update

Updates properties of a specified release for a data product.

datasphere marketplace releases update

You must specify the data product UUID and the release UUID.

Parameter Description

--data-product-uuid <data-product-uuid> Data product UUID (optional).

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

--release <release> Release UUID.

datasphere marketplace releases overwrite

Overwrites all the properties of a specified release.

datasphere marketplace releases overwrite

Parameter Description

--data-product-uuid <data-product-uuid> Data product UUID (optional).

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

--release <release> Release UUID.

 Note

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

datasphere marketplace releases delete

Deletes an existing release.

datasphere marketplace releases delete

Parameter Description

--release <release> Release UUID.

--data-product-uuid <data-product-uuid> Data product UUID (optional).

Accessing SAP Datasphere via the Command Line


114 PUBLIC Accessing SAP Datasphere via the Command Line
datasphere marketplace releases publish

Publishes a release to make data product updates available to the consumers.

datasphere marketplace releases publish

Parameter Description

--release <release> Release UUID.

--data-product-uuid <data-product-uuid> Data product UUID (optional).

datasphere marketplace releases lock

Locks a certain release of a data product.

datasphere marketplace releases lock

Parameter Description

--release <release> Release UUID.

--data-product-uuid <data-product-uuid> Data product UUID (optional).

datasphere marketplace releases unlock

Unlocks a certain release of a data product.

datasphere marketplace releases unlock

Parameter Description

--release <release> Release UUID.

--data-product-uuid <data-product-uuid> Data product UUID (optional).

datasphere marketplace releases lock-all

Locks all the releases of a data product.

datasphere marketplace releases lock-all

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 115
Parameter Description

--data-product-uuid <data-product-uuid> Data product UUID (optional).

datasphere marketplace releases unlock-all

Unlocks all the releases of a data product.

datasphere marketplace releases unlock-all

Parameter Description

--data-product-uuid <data-product-uuid> Data product UUID (optional).

1.5.4.1 The Release Definition File Format

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

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

Release Properties

Users with the DW Modeler role can create releases and set any release properties (see Manage Data
Marketplace Releases via the Command Line [page 112]) using the following syntax:

 Sample Code

{
"dataContained": "<string>",
"comment": "<string>",
"from": "<string>",
"to": "<string>",
"isLocked": "<boolean>",
"isPublished": "<boolean>"
}

Parameters are set as follow:

Mapped Name of Release Parameter


Technical Parameter used in Data Sharing Cockpit Description

<dataContained> Data Contained Enter a description of the data con-


tained in the release (string).

Accessing SAP Datasphere via the Command Line


116 PUBLIC Accessing SAP Datasphere via the Command Line
Mapped Name of Release Parameter
Technical Parameter used in Data Sharing Cockpit Description

<comment> Comment Enter a comment for the release


(string).

<from> Date Range Enter the start date of the release


(string in date-time format).

<to> Date Range Enter the end date of the release (string
in date-time format).

<isLocked> Locked Indicate if the release is locked or not


(boolean).

<isPublished> Indicate if the release is published or


not (boolean).

For example, the following code snippet defines a new release:

 Sample Code

{
"dataContained": "Data Contained Description",
"comment": "Release Comment",
"from": "2023-02-16T16:20:20.698Z",
"to": "2023-02-16T16:20:20.698Z",
"isLocked": false,
"isPublished": false
}

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

You can find more information on releases in the Data Provider's Guide under Publishing New Releases.

1.5.5 Manage Data Marketplace Contexts via the Command


Line

You can use the SAP Datasphere command line interface, datasphere, to create and manage Data
Marketplace contexts.

Use contexts to realize private or internal data marketplaces by restricting the visibility of your data provider
profile and your data products to selected users only. For more information about Data Marketplace contexts,
see Using Contexts to Realize Public, Private, and Internal Data Marketplaces.

To manage contexts with the command line, you must:

• Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line
Interface [page 4]).
• Log in to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client [page
6]).

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 117
• Have a role of DW Modeler or equivalent privileges (see Command Line Roles and Privileges [page 12]).

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

• datasphere marketplace contexts-by-provider list [page 118]


• datasphere marketplace contexts-by-provider create [page 119]
• datasphere marketplace contexts-by-provider read [page 120]
• datasphere marketplace contexts-by-provider update [page 120]
• datasphere marketplace contexts-by-provider overwrite [page 121]
• datasphere marketplace contexts-by-provider delete [page 122]
• datasphere marketplace contexts-by-provider change-lifecycle-status [page 122]
• datasphere marketplace contexts-by-provider join [page 123]
• datasphere marketplace contexts-by-provider leave [page 124]
• datasphere marketplace contexts-by-provider keys list [page 124]
• datasphere marketplace contexts-by-provider keys generate [page 125]
• datasphere marketplace contexts-by-provider keys delete [page 126]
• datasphere marketplace contexts-by-provider keys mass-delete [page 126]

datasphere marketplace contexts-by-provider list

Returns a list of contexts for a data provider.

datasphere marketplace contexts-by-provider list

Parameter Description

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

--accept <accept> Format to return the content in.

Choices:

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

Accessing SAP Datasphere via the Command Line


118 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--provider-identifier <provider- Provider identifier.


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 contexts-by-provider create

Creates a new context for a specified data provider.

datasphere marketplace contexts-by-provider create

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

The new context is created in status Draft. You can activate the context with the command datasphere
marketplace context-by-provider change-lifecycle-status.

Parameter Description

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

--provider-identifier <provider- Provider identifier.


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


Accessing SAP Datasphere via the Command Line PUBLIC 119
datasphere marketplace contexts-by-provider read

Lists the properties of a context for a specific data provider. You must specify the context UUID and the data
provider UUID.

datasphere marketplace contexts-by-provider read

Parameter Description

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

--context <context> Context UUID.

--provider-identifier <provider- Provider identifier.


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 contexts-by-provider update

Updates selected properties of a specified context.

datasphere marketplace contexts-by-provider update

Parameter Description

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

Accessing SAP Datasphere via the Command Line


120 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

--context <context> Context UUID.

datasphere marketplace contexts-by-provider overwrite

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

datasphere marketplace contexts-by-provider overwrite

Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

--context <context> Context UUID.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 121
datasphere marketplace contexts-by-provider delete

Deletes an existing context of a specified data provider.

datasphere marketplace contexts-by-provider delete

Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

--context <context> Context UUID.

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

Changes the lifecycle status of a context to Active. A newly created context is automatically set to status Draft:
before consumers can use their activation keys to join a context in the Data Marketplace, you have to activate
the context.

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

Accessing SAP Datasphere via the Command Line


122 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

--context <context> Context UUID.

--lifecycle-status <lifecycle-status> New lifecycle status.

datasphere marketplace contexts-by-provider join

With this command you join an existing context. After joining you can see all data products listed in this
context.

datasphere marketplace contexts-by-provider join

Parameter Description

--provider-identifier <provider- Provider identifier.


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


Accessing SAP Datasphere via the Command Line PUBLIC 123
datasphere marketplace contexts-by-provider leave

With this command you leave a context. If you leave a context, you won't be able to see the data products listed
in this context anymore.

datasphere marketplace contexts-by-provider leave

Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

--context <context> Context UUID.

datasphere marketplace contexts-by-provider keys list

Returns a list of all the existing activation keys for a specified context.

datasphere marketplace contexts-by-provider keys list

Accessing SAP Datasphere via the Command Line


124 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

--context <context> Context UUID.

datasphere marketplace contexts-by-provider keys generate

Generates activation keys for a specified context.

datasphere marketplace contexts-by-provider keys generate

Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

--context <context> Context UUID.

--number <number> Number of activation keys to be generated.

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 125
datasphere marketplace contexts-by-provider keys delete

Deletes an activation key from a specified context.

datasphere marketplace contexts-by-provider keys delete

Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

--context <context> Context UUID.

--key <key> Context key UUID.

datasphere marketplace contexts-by-provider keys mass-delete

Deletes all the activation keys from a context.

datasphere marketplace contexts-by-provider keys mass-delete

Accessing SAP Datasphere via the Command Line


126 PUBLIC Accessing SAP Datasphere via the Command Line
Parameter Description

--provider-identifier <provider- Provider identifier.


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" ]”

--context <context> Context UUID.

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

application/vnd.sap.marketplace.contexts.mass-de-
lete+json (default)

1.5.5.1 The Context Definition File Format

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

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

Context Properties

Users with the DW Modeler role can create contexts and set any context properties (see Manage Data
Marketplace Contexts via the Command Line [page 117]) using the following syntax:

 Sample Code

{
"contextOwnerUUID": "<string>",
"contextUUID": "<string>",
"contextType": "<string>",
"contextName": "<string>",
"description": "<string>",
"logo": {
"name": "<string>",
"blobData": "<string>",
"mimeType": "<string>"
},
"status": "<string>",
"domains": ["<string>", "<string>", ...],

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 127
}

Parameters are set as follow:

Mapped Name of License Parameter


Technical Parameter used in Data Sharing Cockpit Description

<contextOwnerUUID> Enter the unique identifier of the con-


text owner (string in UUID format).

<contextUUID> Enter the unique identifier of the con-


text (string in UUID format).

<contextType> Type Select one of the following types


(string):

• Public Data Marketplace:


<PublicDataMarketplace>
• Data Shop: <DataShop>
• Private Data Products:
<PrivateDataProducts>
• Private Data Exchange:
<PrivateDataExchange>
• Internal Data Marketplace:
<InternalDataMarketPlace>

<contextName> Name Enter a unique name for the context


(string).

<description> Description Enter a description for the context


(string).

<logo> Define the logo of the context. It is an


object with the following properties:

• <name>: the file name of the


image, including its extension
(string).
• <blobData>: the Base64 encoded
data of the image (string).
• <mimeType> the MIME type
of the image (string). Possible
values: <image/jpeg>, <image/
png>, <image/bmp>, <image/
gif>, <image/svg+xml>,
<image/tiff>.

<status> Define the status of the con-


text (string): <Draft>, <Active>,
<Expired>.

<domains> Domains Enter one or more domains (array of


strings, each string representing a do-
main).

Accessing SAP Datasphere via the Command Line


128 PUBLIC Accessing SAP Datasphere via the Command Line
For example, the following code snippet defines a new context:

 Sample Code

{
"contextOwnerUUID": "66c9b1e6-1d84-4f1d-8f98-1c1e26f54b8d",
"contextUUID": "b7e4e6a3-4e1c-4e8f-a7a8-6e1e26f54b8d",
"contextType": "PrivateDataExchange",
"contextName": "My Context",
"description": "My Context Description",
“logo”: {
“name”:”My_file.jpg”,
“blobData”: ”YXNkYXNkYXNkc2RhZA==",
“mimeType”:”image/jpeg”
},
"status": "Draft",
"domains": ["example.com", "anotherexample.com"]
}

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

You can find more information on contexts in the Data Provider's Guide under Using Contexts to Realize Public,
Private, and Internal Data Marketplaces.

1.6 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.

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).

Accessing SAP Datasphere via the Command Line


Accessing SAP Datasphere via the Command Line PUBLIC 129
Command Description

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.

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>

Accessing SAP Datasphere via the Command Line


130 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 131
www.sap.com/contactsap

© 2024 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