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. (warning) Make sure you read the HTTP status codes and interpret them together with the responses.

...

Returns a list of all the folders in the folder tree in Datameer.

URI syntax

Code Blocknoformat
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/root-folder'

...

Returns a list of the folder's content in Datameer.

URI syntax

Code Blocknoformat
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>'

...

Returns a list of the folder's permissions in Datameer.

URI syntax

Code Blocknoformat
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission'

...

Returns a list of the folder's group permissions in Datameer.

URI syntax

Code Blocknoformat
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission/groups'

...

Returns a list of the folder's permissions for others in Datameer.

URI syntax

Code Blocknoformat
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission/others

...

Returns a list of the folder's owners in Datameer.

URI syntax

Code Blocknoformat
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission/owner'

...

Changes the owner of folder in Datameer.

URI syntax

Code Blocknoformat
curl -u '<username>:<password>' -X PUT -H "Content-Type:application/json" -H "Accept: application/json"  -d "{owner:<username>}" "http://
<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id>/permission/owner"

...

Sets permissions for groups for a folder created in Datameer.

URI syntax

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

...

Changes permissions for groups for a folder created in Datameer.

URI syntax

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

...

Changes permissions for others for a folder in Datameer.

URI syntax

Code Blocknoformat
curl -u '<username>:<password>' -X PUT -H "Content-Type:application/json" -d '{executable:<false> or <true>,readable:<false> or <true>,writable:<false> or <true>}' http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission/others

...

Deletes the group permissions of a folder in Datameer.

URI syntax

Code Blocknoformat
curl -u '<username>:<password>' -X DELETE -H 'Content-Type:application/json' 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission/groups/<group>'

...

Downloads the folder and all its contents including sub folders and their contents. 

URI syntax

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

...

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

...

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

URI syntax

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

...

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

...

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

URI syntax

Code Blocknoformat
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'

...

Overwrite functions adhere to the user’s existing permission settings. If a user has the capability to overwrite Hadoop properties, they will be overwritten, otherwise not.

URI syntax

Code Blocknoformat
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'

...

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

...

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

URI syntax

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

...

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

URI syntax

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

...

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

...

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

URI syntax

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

...

Restores the permissions for a file or folder in Datameer.

URI syntax

Code Blocknoformat
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'

...

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

URI syntax

Code Blocknoformat
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 Blocknoformat
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'

...

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

URI syntax

Code Blocknoformat
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'

...

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

URI syntax

Code Blocknoformat
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'

...

  • Restore operation is aborted if the specified owner is unknown to Datameer unless the option substituteMissingUser is passed.
  • When 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 Blocknoformat
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'

...