Folder methods

20 views 0

Getting folder

PROPERTY VALUE
Synopsis GET /folder/{folderId}
Response Headers Content-Length, Content-Type
Response Status 200, 400, 404, 500

Example Request: get information about folder /01/100001/example.com

          GET /folder/%2F01%2F100001%2Fexample.com
          Host: {IP}
          Authorization: Basic xxxxxxxxxxxxxxxxxxx
          Accept: application/json

Example Response:

          HTTP/1.1 200 OK
          Content-Type: application/json
          Content-Length: nnn
          {
          "name" : "example.com",
          "permissions" : 710,
          "folderpath" : "/01/100001",
          "owner" : 100001,
          "group" : 100001,
          "type" : "Folder",
          "children" : []
          }

Listing children of the specific folder to a certain depth

PROPERTY VALUE
Synopsis GET /folder/children/{folderId}/{depth}
Response Headers Content-Length, Content-Type
Response Status 200, 400, 404, 500

Example Request: list children to the certain depth (of 4) of the folder /01/100001/example.com

          GET /folder/children/%2F01%2F100001%2Fexample.com/4
          Host: {IP}
          Authorization: Basic xxxxxxxxxxxxxxxxxxx
          Accept: application/json

Example Response:

          HTTP/1.1 200 OK
          Content-Type: application/json
          Content-Length: nnn
          {
          "name" : "example.com",
          "permissions" : 710,
          "folderpath" : "/01/100001",
          "owner" : 100001,
          "group" : 100001,
          "type" : "Folder",
          "children" :
            [
              {
              "name" : "public_html",
              "permissions" : 710,
              "folderpath" : "/01/100001/example.com",
              "owner" : 100001,
              "group" : 100001,
              "type" : "Folder",
              "children" : [...]
              },

              {
              "name" : "logs",
              "permissions" : 710,
              "folderpath" : "/01/100001/example.com",
              "owner" : 100001,
              "group" : 100001,
              "type" : "Folder",
              "children" : [...]
              }
            ]
          }

Deleting folder

PROPERTY VALUE
Synopsis DELETE /folder/{folderId}
Response Headers Content-Length, Content-Type
Response Status 200, 400, 404, 500

Example Request: delete folder /01/100001/example.com

          DELETE /folder/%2F01%2F100001%2Fexample.com
          Host: {IP}
          Authorization: Basic xxxxxxxxxxxxxxxxxxx
          Accept: application/json

Example Response:

          HTTP/1.1 200 OK
          Content-Type: application/json
          Content-Length: nnn

Adding folder

PROPERTY VALUE
Synopsis POST /folder
Response Headers Content-Length, Content-Type
Response Status 200, 400, 404, 409, 500

Example Request: add folder /01/100001/example.com

          POST /folder
          Host: {IP}
          Authorization: Basic xxxxxxxxxxxxxxxxxxx
          Accept: application/json
          {
          "name" : "100001",
          "permissions" : 710,
          "folderpath" : "/01/100001",
          "owner" : 100001,
          "group" : 100001,
          "type" : "Folder",
          }

Example Response:

          HTTP/1.1 200 OK
          Content-Type: application/json
          Content-Length: nnn

Modifying folder

PROPERTY VALUE
Synopsis PUT /folder/{folderId}
Response Headers Content-Length, Content-Type
Response Status 200, 400, 404, 500

Example Request: modify folder /01/100001/example.com

          GET /folder/%2F01%2F100001%2Fexample.com
          Host: {IP}
          Authorization: Basic xxxxxxxxxxxxxxxxxxx
          Accept: application/json
          {
          "name" : "example.com",
          "permissions" : 777,
          "folderpath" : "/01/100001",
          "owner" : 100001,
          "group" : 100001,
          "type" : "Folder",
          }

Example Response:

          HTTP/1.1 200 OK
          Content-Type: application/json
          Content-Length: nnn
          {
          "name" : "example.com",
          "permissions" : 777,
          "folderpath" : "/01/100001",
          "owner" : 100001,
          "group" : 100001,
          "type" : "Folder",
          }

Committing folder action

PROPERTY VALUE
Synopsis GET /folder/commit/{action}/{folderId}
Response Headers Content-Length, Content-Type
Response Status 200, 400, 404, 500
Action Previous action that was executed, values are: add, delete or modify.

Example Request: commit after delete action on folder /01/100001/example.com

          GET /folder/commit/delete/%2F01%2F100001%2Fexample.com
          Host: {IP}
          Authorization: Basic xxxxxxxxxxxxxxxxxxx
          Accept: application/json

Example Response:

          HTTP/1.1 200 OK
          Content-Type: application/json
          Content-Length: nnn

Rollback folder actions

PROPERTY VALUE
Synopsis GET /folder/rollback/{action}/{folderId}
Response Headers Content-Length, Content-Type
Response Status 200, 400, 404, 500
Action Previous action that was executed, values are: add, delete or modify.

Example Request: rollback after delete action on folder /01/100001/example.com

          GET /folder/rollback/delete/%2F01%2F100001%2Fexample.com
          Host: {IP}
          Authorization: Basic xxxxxxxxxxxxxxxxxxx
          Accept: application/json

Example Response:

          HTTP/1.1 200 OK
          Content-Type: application/json
          Content-Length: nnn

Was this helpful?