Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

Unlike other REST APIs, these use the file ID (found in the File Browser) or the UUID (found in all payloads or json representations) instead of the configuration ID.

The REST API for folders follows the best practices for RESTful API design. Ensure you read the HTTP status codes and interpret them together with the responses.

...

Code Block
curl -u '<username>:<password>' -X POST -H  'Content-Type:application/json' -d '{name="<group>\",flags:{executable:<true> or <false>,readable:<true> or <false>,writable:<true> or <false>}}' 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission/groups'

Verification

Check through rest command or in the browser.

...

Backup-ignoreDependencies

Allows for backing up a project where the data sources (for example) are not contained within the same folder as the rest of the project.

URI syntax

Code Block
curl -u <username>:<password> -X GET -o <name>.zip 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<file-id>/backup?ignoreMissingDependencies'

Backup-Skip

Disregards entities where dependencies are contained outside of the folder to backup, these files aren't written to the zip file.

URI syntax

Code Block
curl -u <username>:<password> -X GET -o <name>.zip 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<file-id>/backup?skipFilesWithMissingDependencies'


Download a Specific File from a Folder as a ZIP

Available as of Datameer 7.2.6

Request method - POST

Description

Downloads a specific file from a folder. 

Preparation 

Panel

To download a specific file from a folder, you need to create and save a JSON file that is used to locate the file you want to download.

JSON example using the file path:

Panel
{
  "ids": [
    "/path/to.wbk"
  ]
}
JSON example using the file-id:
Panel
{
  "ids": [
    23
  ]
}
JSON example using the uuid:
Panel
{
  "ids": [
    "17c8d988-d771-435f-a381-31bba6fba34d"
  ]
}

URI syntax

Code Block
curl -u <username>:<password> -X POST --data-binary @<pathToJsonFile> -H 'Content-Type: application/json' 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>|<file-id>|<UUID>/backup' -o <name>.zip
Info

To find a folder using the path, the path needs to be URL encoded, (e.g., use  %2F  for a  /  and  %20  for a  ' '  (space).)

Verification

The ZIP file downloaded is located in the directory the REST call was given. 


Anchor
migrate_zip
migrate_zip
Migrate/Restore a Folder from a ZIP

Request method - PUT


Description

Uploads the folder and all its contents including sub-folders and their contents. 

URI syntax

Code Block
languagebash
curl -u <username>:<password> -X PUT --data-binary @<pathToZipFile> -H 'Content-Type: application/zip' 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<file-id>/restore'
Info

To find a folder using the path, the path needs to be URL encoded, (e.g., use  %2F  for a  /  and  %20  for a  ' '  (space).)

Verification

The ZIP file downloaded is located in the directory the REST call was given. 

Restrictions & notes

  • When creating a backup, all dependencies need to be located within the folder being backed up. If the dependencies aren't in the folder, an error occurs.
  • Within the zip file, all JSONs must use Datameer specific endings, (e.g., .imp, .dst, NOT .json)
  • If the contents of the zip file are present in the target system (in the target location), the restore action fails.
  • When restoring the contents of a zip file, the uploader becomes the OWNER of the files with default permissions.
  • If a folder is specified by folder path and the folder doesn't exist, then the folder is created regarding the users capabilities and permissions.

Advanced parameters

Restore-Overwrite

Replaces and overwrite files that might be located within the target folder in the target system. Existing configurations with downstream dependencies can't be overwritten.

URI syntax

Code Block
curl -u <username>:<password> -X PUT --data-binary @<pathToZipFile> -H 'Content-Type: application/zip' 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<file-id>/restore?overwrite'

Note

Restore-Overwrite doesn't append an existing configuration. The configuration being overwritten is deleted with the new configuration added in its place.

Restore-Skip

If the dependencies of a file can't be resolved, the file is ignored and the REST response includes the skipped files.

URI syntax

Code Block
curl -u <username>:<password> -X PUT --data-binary @<pathToZipFile> -H 'Content-Type: application/zip' 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<file-id>/restore?skipFilesWithMissingDependencies'

Anchor
backup
backup
Back Up File or Folder with Permissions

Request method - GET

Description

Backup includes the data permissions for each backed up workbook file in the zip file.

URI syntax

Code Block
curl -u <username>:<password> -X GET -o <name>.zip 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/backup?includeDataPermissions'

Restrictions & notes

  • Ignored if something else other than a workbook is backed up (or restored).

Anchor
backup_group
backup_group
Back Up File or Folder with Group Permissions

Request method - GET

Description

Backup includes the group permissions for each backed up file and folder in a zip file.

URI syntax

Code Block
curl -u <username>:<password> -X GET -o <name>.zip 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/backup?includeGroupPermissions'

Anchor
backup_sharing
backup_sharing
Back Up File or Folder with File Sharing

Request method - GET

Description

Backup includes the sharing option for each backed up file and folder in the zip file. This includes permission of others and public sharing of an infographic.

URI syntax

Code Block
curl -u <username>:<password> -X GET -o <name>.zip 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/backup?includeOwner'

Anchor
backup_owner
backup_owner
Back Up File or Folder with Owners

Request method - GET

Description

Backup includes the owner for each backed up file and folder in the zip file.

URI syntax

Code Block
curl -u <username>:<password> -X GET -o <name>.zip 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/backup?includeSharing'

Anchor
restore
restore
Restore File or Folder Permissions

Request method - PUT

Description

Restores the permissions for a file or folder in Datameer.

URI syntax

Code Block
curl -u <username>:<password> -X PUT --data-binary @<pathToZipFile> -H 'Content-Type: application/zip' 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/restore?includeDataPermissions'

Restrictions & notes

  • Restores the data permissions of a workbook and restores also read permissions for others.

Anchor
restore_group
restore_group
Restore File or Folder Group Permissions

Request method - PUT

Description

Restores each file or folder with the group permissions specified in the zip file.

URI syntax

Code Block
curl -u <username>:<password> -X PUT --data-binary @<pathToZipFile> -H 'Content-Type: application/zip' 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/restore?includeGroupPermissions'

Advanced parameters

IgnoreUnknownGroups

Restores group permissions and skips unknown groups. 

URI syntax

Code Block
curl -u <username>:<password> -X PUT --data-binary @<pathToZipFile> -H 'Content-Type: application/zip' 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/restore?includeGroupPermissions&ignoreUnknownGroups'

Note

  • This option takes effect only when includeGroupPermissions or includeDataPermissions is set.
  • Unknown groups are skipped. When unknown groups are found and not set to skip, the restore operation fails.

Anchor
restore_sharing
restore_sharing
Restore File or Folder with File Sharing

Request method - PUT

Description

Restores each file or folder with the sharing options specified in the zip file.

URI syntax

Code Block
curl -u <username>:<password> -X PUT --data-binary @<pathToZipFile> -H 'Content-Type: application/zip' 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/restore?includeSharing'

Anchor
restore_owner
restore_owner
Restore File or Folder with Owners

Request method - PUT

Description

Restores each file or folder with the owner specified in the zip file.

URI syntax

Code Block
curl -u <username>:<password> -X PUT --data-binary @<pathToZipFile> -H 'Content-Type: application/zip''http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/restore?includeOwner'

Restrictions & notes

  • Restores operation is aborted if the specified owner is unknown to Datameer unless option substituteMissingUser is passed.
  • If option substituteMissingUser is passed, unknown owners are substituted by the caller.

Advanced parameters

substituteMissingUser

Restore owners of files by substituting unknown users with the caller. 

URI syntax

Code Block
curl -u <username>:<password> -X PUT --data-binary @<pathToZipFile> -H 'Content-Type: application/zip' 'http://<datameerServer>:<port>/api/filesystem/folders/<folderPath>||<UUID>||<fileID>/restore?includeOwner&substituteMissingUser'

Note

  • Only takes affect when includeOwner is specified.
  • If the user specified in the backup file isn't present in the target system, the owner is set to the restoring user.