Managing Packages via the Command Line
You can use the datasphere command line interface to add required packages and objects to a package and to export the package to the Content Network.
Prerequisites
-
A global role that grants you the following privileges:
-
Data Warehouse General (-R------) - To access SAP Datasphere.
-
Lifecycle (-R---MS-) - To use the Transport apps.
-
-
A scoped role that grants you access to a space with the following privileges:
-
Spaces (-RU-----) - To update your spaces and their properties.
-
Space Files (CRUD----) - To create, read, update, and delete objects in your spaces.
-
Data Warehouse Data Builder (-RU-----) - To view and update Data Builder objects (and any other relevant object privileges to allow you to update other types of objects contained in the package).
-
-
Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line Interface).
-
Log in to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client).
datasphere objects packages
List, Read, Create, Update, and Delete Packages
Specify the Contents of a Package
A package must specify its required packages and the objects it contains, as well as Content Network metadata.
{
"repositoryPackages": {
"My_Package": {
"requires": [
"Required_Package_1",
"Required_Package_2"
],
"_kind": "repositoryPackage",
"_packageProperties": {
"@EndUserText.label": "My Package",
"purpose": "Demo Package",
"contentDelivery": {
"category": "myContent",
"semantic_version": "0.0.1"
}
}
}
},"repositoryPackagesAttachedObjects": {
"My_Package":[
{
"technicalName": "My_Table"
},
{
"technicalName": "My_View"
},
{
"technicalName": "My_Analytic_Model"
},
]
}
Complete your package definition as follows:
|
requires |
Specify the list of technical names of any packages that contain objects that the objects you add to your package depend on as part of their lineage. |
|
_kind |
Must be set to repositoryPackage. |
|
@EndUserText.label |
Enter a descriptive name to help users identify the package. |
|
purpose |
Provide a business purpose for the package. |
|
category |
Must be set to myContent. |
|
semantic_version |
Enter the version number of the package in the format 1.0.0 (major version, minor version, patch number). You can re-export your package with the same version number to overwrite the current exported version or change the version to export a package update. The version number must always go up and never down. |
|
repositoryPackagesAttachedObjects |
Specify the objects contained in the package as an array of JSON objects in the following format: {
"technicalName": "My_Table"
}
|
Export Packages
You can export a package to the Content Network object and optionally write it to a file.
datasphere objects packages export
--space <id>
--technical-name <name>
[--allow-overwrite]
|
Parameter |
Description |
|---|---|
|
--space <id> |
Enter the Space ID of the space. |
|
--technical-name <name> |
Enter the Technical Name of the package. |
|
--allow-overwrite |
[optional] Use this option to specify that you want to overwrite the existing version of the package with the same semantic version number. To create a new version of the package, specify a higher semantic version number. If you do not specify this option and have not increased the semantic version number, then your export will fail. |
datasphere objects packages export --space MySpace --technical-name My_Package