Project
note
This resource provides convenient interfaces to interact with SENSR projects, such as creating or loading existing projects. Detailed behavior of each command is described below.
GET
/[SENSR version]/commands/project/list
Return all available projects in
path
.- Parameters
- path : Path for where to search for SENSR projects. If not specified then SENSR will use the default project path
/root/seoulrobotics/projects
which is mounted to/opt/seoulrobotics/projects
in the local machine. This needs to be an absolute path.
- path : Path for where to search for SENSR projects. If not specified then SENSR will use the default project path
- Return code
- 200 OK
- 400 BAD REQ
Example
$ curl -X GET 'http://localhost:9080/[SENSR version]/commands/project/list'
** Respond **
[
"project_1",
"project_2",
"project_3"
]
$ curl -X GET 'http://localhost:9080/[SENSR version]/commands/project/list?path=/root/seoulrobotics/projects'
** Respond **
No projects found under "/root/seoulrobotics/projects".
/[SENSR version]/commands/project
Return information about the currently open project.
- Parameters
- N/A
- Return code
- 200 OK
- 400 BAD REQ
Example
$ curl -X GET 'http://localhost:9080/[SENSR version]/commands/project'
** Respond **
{
"project_name": "my_project"
}
PUT
/[SENSR version]/commands/project
Create a new project. If another SENSR project is open it will close and
- Parameters
- path : Path where the project will be created. If not specified then the default path
/root/seoulrobotics/projects
will be used. - name : The name of the new project.
- path : Path where the project will be created. If not specified then the default path
- Return code
- 200 OK
- 400 BAD REQ
- 500 INTERNAL SERVER ERR
Example
$ curl -X PUT 'http://localhost:9080/[SENSR version]/commands/project?name=my-new-project'
** Respond **
Successfully created project "my-new-project".
POST
/[SENSR version]/commands/project
Load an existing project. If the project does not exist SENSR will return an error.
- Parameters
- path : Parent path of the project located. If not specified then the default path
/root/seoulrobotics/projects
will be used. - name : Name of the project.
- path : Parent path of the project located. If not specified then the default path
- Return code
- 200 OK
- 400 BAD REQ
- 500 INTERNAL SERVER ERR
Example
$ curl -X POST 'http://localhost:9080/[SENSR version]/commands/project?name=my-project'
** Respond **
Successfully opened "my-project".
$ curl -X POST 'http://localhost:9080/[SENSR version]/commands/project?path=/root/seoulrobotics/projects&name=project-that-does-not-exist'
** Respond **
Failed to open "project-that-does-not-exist".