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 Browser) or the UUID (found in all payloads or json representations) instead of the configuration ID.

The REST API for files 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 GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/files/<file-id> or <uuid>/permission'

Example response

Code Block
{
  "others": {
    "executable": true,
    "readable": true,
    "writable": true
  },
  "owner": "system",
  "_links": {
    "others": {
      "href": "/api/filesystem/files/26/permission/others"
    },
    "file": {
      "href": "/api/filesystem/files/26"
    },
    "owner": {
      "href": "/api/filesystem/files/26/permission/owner"
    },
    "self": {
      "href": "/api/filesystem/files/26/permission"
    },
    "groups": {
      "href": "/api/filesystem/files/26/permission/groups"
    }
  }

...

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

Example response

Code Block
 
{
  "_links": {
    "self": {
      "href": "/api/filesystem/files/26/permission/groups"
    },
    "permission": {
      "href": "/api/filesystem/files/26/permission"
    }
  },
  "_embedded": {
    "groups": [
      {
        "flags": {
          "executable": true,
          "readable": true,
          "writable": true
        },
        "name": "dasuser",
        "_links": {
          "self": {
            "href": "/api/filesystem/files/26/permission/groups/dasuser"
          },
          "permission": {
            "href": "/api/filesystem/files/26/permission"
          }
        }
      }
    ]
  }

...

URI syntax

Code Block
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/files/<file-id> or <uuid>/permission/owner"'

Verification

Check through a REST command or in the File Browser.

...

Sets permissions for groups created in Datameer. 

URI syntax

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

...

Check through a REST command or in the the File Browser.

Additional Information

The flag "fullResults" is optional and only useful when using this REST call for a workbook.

Anchor
changegrouppermissionfile
changegrouppermissionfile
Change the Group Permission for a File

...

URI syntax

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

Verification

Check through a REST command or in the File Browser.

Additional Information

The flag "fullResults" is optional and only useful when using this REST call for a workbook.

Anchor
changeotherspermissionfile
changeotherspermissionfile
Change the Others Permissions for a File

...

URI syntax

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

...

Check through a REST command or in the File Browser.

Additional Information

The flag "fullResults" is optional and only useful when using this REST call for a workbook.

Anchor
deletegrouppermissionfile
deletegrouppermissionfile
Delete Group Permission of a File

...

URI syntax

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

Verification

Check through a REST command or in the File Browser.