Sharing

Resources related to sharing.

CIFS

The CIFS resource represents CIFS shares using samba.

List resource

GET /api/v1.0/sharing/cifs/

Returns a list of all CIFS shares.

Example request:

GET /api/v1.0/sharing/cifs/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "cifs_hostsallow": "",
          "cifs_name": "My Test Share",
          "cifs_home": false,
          "cifs_default_permissions": true,
          "cifs_guestok": false,
          "cifs_showhiddenfiles": false,
          "cifs_hostsdeny": "",
          "cifs_recyclebin": false,
          "cifs_auxsmbconf": "",
          "cifs_comment": "",
          "cifs_path": "/mnt/tank/MyShare",
          "cifs_ro": false,
          "cifs_guestonly": true,
          "id": 1,
          "cifs_browsable": true
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/sharing/cifs/

Creates a new CIFS share and returns the new CIFS share object.

Example request:

POST /api/v1.0/sharing/cifs/ HTTP/1.1
Content-Type: application/json

  {
          "cifs_name": "My Test Share",
          "cifs_path": "/mnt/tank/MyShare"
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "cifs_hostsallow": "",
          "cifs_name": "My Test Share",
          "cifs_home": false,
          "cifs_default_permissions": true,
          "cifs_guestok": false,
          "cifs_showhiddenfiles": false,
          "cifs_hostsdeny": "",
          "cifs_recyclebin": false,
          "cifs_auxsmbconf": "",
          "cifs_comment": "",
          "cifs_path": "/mnt/tank/MyShare",
          "cifs_ro": false,
          "cifs_guestonly": true,
          "id": 1,
  }
JSON Parameters:
 
  • cifs_name (string) – name of the share
  • cifs_home (string) – use this share as a special users home directory
  • cifs_path (string) – path to share
  • cifs_comment (string) – user comment
  • cifs_hostsallow (string) – explictly allowed hosts
  • cifs_hostsdeny (string) – explicitly denied hosts
  • cifs_auxsmbconf (string) – auxiliar parameters to append to smb.conf
  • cifs_default_permissions (string) – recursively set sane default windows permissions on share
  • cifs_guestok (boolean) – allow guests
  • cifs_guestonly (boolean) – only guests are allowed
  • cifs_showhiddenfiles (boolean) – show hidden files
  • cifs_recyclebin (boolean) – enable recycle bin
  • cifs_ro (boolean) – readonly share
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/sharing/cifs/(int: id)/

Update CIFS share id.

Example request:

PUT /api/v1.0/sharing/cifs/1/ HTTP/1.1
Content-Type: application/json

  {
          "cifs_guestok": true
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "cifs_hostsallow": "",
          "cifs_name": "My Test Share",
          "cifs_home": false,
          "cifs_default_permissions": true,
          "cifs_guestok": true,
          "cifs_showhiddenfiles": false,
          "cifs_hostsdeny": "",
          "cifs_recyclebin": false,
          "cifs_auxsmbconf": "",
          "cifs_comment": "",
          "cifs_path": "/mnt/tank/MyShare",
          "cifs_ro": false,
          "cifs_guestonly": true,
          "id": 1,
  }
JSON Parameters:
 
  • cifs_name (string) – name of the share
  • cifs_home (string) – use this share as a special users home directory
  • cifs_path (string) – path to share
  • cifs_comment (string) – user comment
  • cifs_hostsallow (string) – explictly allowed hosts
  • cifs_hostsdeny (string) – explicitly denied hosts
  • cifs_auxsmbconf (string) – auxiliar parameters to append to smb.conf
  • cifs_default_permissions (string) – recursively set sane default windows permissions on share
  • cifs_guestok (boolean) – allow guests
  • cifs_guestonly (boolean) – only guests are allowed
  • cifs_showhiddenfiles (boolean) – show hidden files
  • cifs_recyclebin (boolean) – enable recycle bin
  • cifs_ro (boolean) – readonly share
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/sharing/cifs/(int: id)/

Delete CIFS share id.

Example request:

DELETE /api/v1.0/sharing/cifs/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

NFS

The NFS resource represents NFS shares.

List resource

GET /api/v1.0/sharing/nfs/

Returns a list of all NFS shares.

Example request:

GET /api/v1.0/sharing/nfs/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "nfs_alldirs": false,
          "nfs_comment": "",
          "nfs_hosts": "",
          "nfs_mapall_group": "Group1",
          "nfs_mapall_user": "User1",
          "nfs_maproot_group': "",
          "nfs_maproot_user": "",
          "nfs_network": "192.168.1.0/24",
          "nfs_paths": ["/mnt/tank/shares"],
          "nfs_quiet": false,
          "nfs_ro": false,
          "nfs_security': []
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/sharing/nfs/

Creates a new NFS share and returns the new NFS share object.

Example request:

POST /api/v1.0/sharing/nfs/ HTTP/1.1
Content-Type: application/json

  {
          "nfs_comment": "My Test Share",
          "nfs_paths": ["/mnt/tank"],
          "nfs_security": "sys"
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "nfs_mapall_user": "",
          "nfs_maproot_group": "",
          "nfs_maproot_user": "",
          "nfs_network": "",
          "nfs_ro": false,
          "nfs_hosts": "",
          "nfs_alldirs": false,
          "nfs_mapall_group": "",
          "nfs_comment": "My Test Share",
          "nfs_paths": [
                  "/mnt/tank"
          ],
          "id": 1,
          "nfs_quiet": false
  }
JSON Parameters:
 
  • nfs_paths (list(string)) – paths to share
  • nfs_comment (string) – user comment
  • nfs_hosts (string) – allowed hosts or ip addresses
  • nfs_network (string) – allowed networks
  • nfs_maproot_user (string) – limit root to this user permissions
  • nfs_maproot_group (string) – limit root to this group permissions
  • nfs_mapall_user (string) – user used by all clients
  • nfs_mapall_group (string) – group used by all clients
  • nfs_alldirs (boolean) – allow mounting of any subdirectory
  • nfs_ro (boolean) – readonly share
  • nfs_quiet (boolean) – inhibit syslog warnings
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/sharing/nfs/(int: id)/

Update NFS share id.

Example request:

PUT /api/v1.0/sharing/nfs/1/ HTTP/1.1
Content-Type: application/json

  {
          "nfs_ro": true
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "nfs_mapall_user": "",
          "nfs_maproot_group": "",
          "nfs_maproot_user": "",
          "nfs_network": "",
          "nfs_ro": true,
          "nfs_hosts": "",
          "nfs_alldirs": false,
          "nfs_mapall_group": "",
          "nfs_comment": "My Test Share",
          "nfs_paths": [
                  "/mnt/tank"
          ],
          "id": 1,
          "nfs_quiet": false
  }
JSON Parameters:
 
  • nfs_paths (list(string)) – paths to share
  • nfs_comment (string) – user comment
  • nfs_hosts (string) – allowed hosts or ip addresses
  • nfs_network (string) – allowed networks
  • nfs_maproot_user (string) – limit root to this user permissions
  • nfs_maproot_group (string) – limit root to this group permissions
  • nfs_mapall_user (string) – user used by all clients
  • nfs_mapall_group (string) – group used by all clients
  • nfs_alldirs (boolean) – allow mounting of any subdirectory
  • nfs_ro (boolean) – readonly share
  • nfs_quiet (boolean) – inhibit syslog warnings
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/sharing/nfs/(int: id)/

Delete NFS share id.

Example request:

DELETE /api/v1.0/sharing/nfs/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

AFP

The AFP resource represents AFP shares.

List resource

GET /api/v1.0/sharing/afp/

Returns a list of all AFP shares.

Example request:

GET /api/v1.0/sharing/afp/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "afp_upriv": true,
          "id": 1,
          "afp_comment": "",
          "afp_fperm": "644",
          "afp_deny": "",
          "afp_nostat": false,
          "afp_name": "test share",
          "afp_nodev": false,
          "afp_rw": "",
          "afp_allow": "",
          "afp_dperm": "755",
          "afp_ro": "",
          "afp_sharepw": "",
          "afp_path": "/mnt/tank",
          "afp_timemachine": false,
          "afp_umask": "000",
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/sharing/afp/

Creates a new AFP share and returns the new AFP share object.

Example request:

POST /api/v1.0/sharing/afp/ HTTP/1.1
Content-Type: application/json

  {
          "afp_name": "My Test Share",
          "afp_path": "/mnt/tank"
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "afp_upriv": true,
          "id": 1,
          "afp_comment": "",
          "afp_fperm": "644",
          "afp_deny": "",
          "afp_nostat": false,
          "afp_name": "test share",
          "afp_nodev": false,
          "afp_rw": "",
          "afp_allow": "",
          "afp_dperm": "755",
          "afp_ro": "",
          "afp_sharepw": "",
          "afp_path": "/mnt/tank",
          "afp_timemachine": false,
          "afp_umask": "000",
  }
JSON Parameters:
 
  • afp_path (string) – paths to share
  • afp_name (string) – share name
  • afp_comment (string) – user comment
  • afp_fperm (string) – default file permission
  • afp_dperm (string) – default file permission
  • afp_allow (string) – users and groups allowed to access
  • afp_deny (string) – users or groups not allowed to access
  • afp_rw (string) – users and groups allowed to read and write
  • afp_ro (string) – users and groups allowed to read only
  • afp_sharepw (string) – password for the share
  • afp_umask (string) – default umask
  • afp_upriv (boolean) – use AFP3 unix privileges
  • afp_nostat (boolean) – don’t stat volume path when enumerating volumes list
  • afp_nodev (boolean) – always use 0 for device number
  • afp_timemachine (boolean) – enable Time Machine backups on this share
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/sharing/afp/(int: id)/

Update AFP share id.

Example request:

PUT /api/v1.0/sharing/afp/1/ HTTP/1.1
Content-Type: application/json

  {
          "afp_timemachine": true
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "afp_upriv": true,
          "id": 1,
          "afp_comment": "",
          "afp_fperm": "755",
          "afp_deny": "",
          "afp_nostat": false,
          "afp_name": "test share",
          "afp_nodev": false,
          "afp_rw": "",
          "afp_allow": "",
          "afp_dperm": "644",
          "afp_ro": "",
          "afp_sharepw": "",
          "afp_path": "/mnt/tank",
          "afp_timemachine": true,
          "afp_umask": "000",
  }
JSON Parameters:
 
  • afp_path (string) – paths to share
  • afp_name (string) – share name
  • afp_comment (string) – user comment
  • afp_fperm (string) – default file permission
  • afp_dperm (string) – default file permission
  • afp_allow (string) – users and groups allowed to access
  • afp_deny (string) – users or groups not allowed to access
  • afp_rw (string) – users and groups allowed to read and write
  • afp_ro (string) – users and groups allowed to read only
  • afp_sharepw (string) – password for the share
  • afp_umask (string) – default umask
  • afp_upriv (boolean) – use AFP3 unix privileges
  • afp_nostat (boolean) – don’t stat volume path when enumerating volumes list
  • afp_nodev (boolean) – always use 0 for device number
  • afp_timemachine (boolean) – enable Time Machine backups on this share
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/sharing/afp/(int: id)/

Delete AFP share id.

Example request:

DELETE /api/v1.0/sharing/afp/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error