-
Notifications
You must be signed in to change notification settings - Fork 0
Rest API
A Summary of rest api ----------------------------
URI(default) | Method | Description |
---|---|---|
/ | GET | redirect to /help |
/help | GET | show helpful messages |
/data | POST | put a data file |
/data/:token | GET | get a data file |
/data/:token | DELETE | delete a data file |
/group | POST | create a data group |
/group/:token | GET | get a information of data group |
/group/:token | DELETE | remove a data group |
A Detail of rest api ----------------------------
400 - Bad Request : The request was invalid or cannot be served.
404 – Not found : There is no URI.
500 - Internal Server Error : An unknown error occurs while a server is running.
...
A token is 512 bytes.
x
Content-Type: 'application/json'
{
"api_doc": "https://github.com/DrawML/cloud_dfs/wiki/Rest-API#drawml-cloud-rest-api",
"drawml_repo": "https://github.com/DrawML",
"who_are_we": "Stacker"
}
200 - OK : Everything is working.
x
Content-Type: 'multipart/form-data' if data type is 'binary'
Content-Type: 'application/json' if data type is 'text'
'data': <binary data> ('filename': <filename>)
'group_token': <a token for data group> // optional
{
"name": "the name of file",
"data": "text data",
"group_token": "a token for data group (optional)"
}
Content-Type: 'application/json'
{
"token": "token to data file"
}
201 - OK : New data file has been created.
422 - Unprocessable Entity : A server cannot create a data file.
If a system storage capability can't handle the size of a data file, a server can return 422 as a http status.
x
Content-Type: 'application/octet-stream' if data type is 'binary'
Content-Type: 'application/json' if data type is 'text'
Binary Data
{
"name": "name of data file",
"data": "string data of data file"
}
200 - OK : Everything is working.
404 - Not found : There is no data file whose token is :token.
x
x
x
204 - OK : A data file was successfully deleted.
404 - Not found : There is no data file whose token is :token.
x
'name': <the name of group to make>
Content-Type: 'application/json'
{
"token": "token to data file"
}
201 - OK : New data group has been created.
x
x
Content-Type: 'application/octet-stream' if data type is 'binary'
Content-Type: 'application/json' if data type is 'text'
{
"name": "name of data group",
"data_token_list": "a list of data tokens"
}
200 - OK : Everything is working.
404 - Not found : There is no data group whose token is :token.
x
x
x
204 - OK : A data group was successfully deleted.
404 - Not found : There is no data group whose token is :token.
x