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.
caution
Replace [SENSR version]
with exact version you are using. But please make sure to use it upto minor version.
For example, if the version is 2.4.9, then 2.4.
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
~/seoulrobotics/projects
. 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=/home/my-folder'
** Respond **
No projects found under "/home/my-folder".
/[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
~/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
~/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=/home/my-folder&name=project-that-does-not-exist'
** Respond **
Failed to open "project-that-does-not-exist".