This blog post is part of a series of blogs I published about @sap/datasphere-cli. Find all blog posts related to this topic in my overview blog post here.
The Node.js-based Command-Line Interface (CLI) for SAP Datasphere, @sap/datasphere-cli hosted on npmjs.com, allows you to interact with your SAP Datasphere tenant from the terminal or command line. With version 2022.02 of the CLI you can create, read, update and delete definitions for tables and views in your spaces in your SAP Datasphere tenant.
This blog is part of a blog post series about the Command-Line Interface (CLI) for SAP Datasphere. Find the full overview of all available blogs in the overview blog post here.
$ datasphere -H https://datasphere-my-example-company.eu10.hcs.cloud.sap/ -h
Usage: datasphere [options] [command]
Command-Line Interface for SAP Datasphere.
Options:
-v, --version output the current version
-H, --host <host> specifies the url host where the tenant is hosted
-h, --help display help for command
Commands:
cache work with the local CLI cache
passcode-url [options] print the passcode url
help [command] display help for command
$ datasphere cache init -H https://datasphere-my-example-company.eu10.hcs.cloud.sap/
✔ Do you want to retrieve a temporary authentication code from https://datasphere-my-example-company.authentication.eu10.hana.ondemand.com/passcode? … yes
✔ Enter your temporary authentication code: … **********
$ datasphere -H https://datasphere-my-example-company.eu10.hcs.cloud.sap/ -h
Usage: datasphere [options] [command]
Command-Line Interface for SAP Datasphere.
Options:
-v, --version output the current version
-H, --host <host> specifies the url host where the tenant is hosted
-h, --help display help for command
Commands:
cache work with the local CLI cache
spaces [options] manage and orchestrate spaces
passcode-url [options] print the passcode url
help [command] display help for command
$ datasphere spaces read -H https://datasphere-my-example-company.eu10.hcs.cloud.sap/ -h
Usage: datasphere spaces read [options]
fetch space details for a specified space
Options:
-o, --output <output> specifies the file to store the output of the command
-S, --space <space> space ID
-n, --no-space-definition read space definition
-D, --definitions [definitions] read definitions
-V, --verbose print detailed log information to console (optional)
-H, --host <host> specifies the url host where the tenant is hosted
-p, --passcode <passcode> passcode for interactive session authentication (optional)
-h, --help display help for command
$ datasphere spaces read -H https://datasphere-my-example-company.eu10.hcs.cloud.sap/ -S MYSPACE -D -p somepassword
{
"MYSPACE": {
"spaceDefinition": {
...
},
"definitions": {
"some_table": {
"@EndUserText.label": "some table",
"kind": "entity",
"elements": {
...
}
},
"some_other_table": {
"@EndUserText.label": "some other table",
"kind": "entity",
"elements": {
...
}
},
"another_table": {
"@EndUserText.label": "another table",
"kind": "entity",
"elements": {
...
}
}
}
}
}
$ datasphere spaces read -H https://datasphere-my-example-company.eu10.hcs.cloud.sap/ -S MYSPACE -D some_table,another_table -p somepassword
{
"MYSPACE": {
"spaceDefinition": {
...
},
"definitions": {
"some_table": {
"@EndUserText.label": "some table",
"kind": "entity",
"elements": {
...
}
},
"another_table": {
"@EndUserText.label": "another table",
"kind": "entity",
"elements": {
...
}
}
}
}
}
$ datasphere spaces create -H https://datasphere-my-example-company.eu10.hcs.cloud.sap/ -f path/to/file.json
$ datasphere spaces delete -H https://datasphere-my-example-company.eu10.hcs.cloud.sap/ -S MYSPACE -p somepasscode
✔ Do you really want to delete space MYSPACE? … yes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |