REST API provides a powerful and simple Web services API for interacting with Intel(R) IoT Services Orchestration Layer. The API consist of two groups:
Currently, all of API using the standard POST HTTP method.
| API | URL |
|---|---|
DevFrontEnd |
http://<host>:8080/apis/dev |
UserFrontEnd |
http://<host>:3000/apis/user |
Fetch the list of apps.
Request URL:
http://localhost:8080/apis/dev
Requst body:
{"api":"app.list","params":[]}[{
"name":"A4","id":"HOPE_APP_184c1560","description":"A4 XXX",
"graphs":[{
"id":"GRAPH_0014b930","name":"G1","description":""
},{
"id":"GRAPH_4058fec0","name":"ox","description":""
}],
"uis":[{
"id":"UI_1bb298f0","name":"U1","description":""
}],
},{
"name":"A1","id":"HOPE_APP_27598be0","description":"",
"graphs":[],"uis":[]
}]Description
Get the list of app.
Applicability
Request
{"api":"app.list","params":[]}Response
[ Array of app_info ]Description
Get a list of app that given in array of app_id.
Applicability
Request
{"api":"app.get","params":[ Array of app_id ]}Response
[ Array of app_info ]Description
Get widget data cached in server.
Applicability
Request
{
"api":"app.get_widget_data",
"params":[{
"app": app_id,
"widget": widget_id,
}]
}Response
[ Array of widget data ]Description
Post the data to server, this data will be consumed by workflow engine.
Applicability
Request
{
"api":"app.send_widget_data",
"params":[{
"app": app_id,
"widget": widget_id,
"data": data
}]
}Response
N/A
Description
Create and return an app.
Applicability
Request
{
"api":"app.create",
"params":[{
"name": app_name,
"description": app_desc
}]Response
{ app_info }Description
Update the app information.
Applicability
Request
{
"api":"app.update",
"params":[{
"app": app_id,
"props": {...}
}]Response
{command log}Description
Delete one app on the server, this operation will also automatically delete all
workflows and UI belong it.
Applicability
Request
{
"api":"app.remove",
"params":[{ "app": app_id }]Response
{command log}Description
Create a new workflow.
Applicability
Request
{
"api":"app.create_graph",
"params":[{
"app": app_id,
"graph": graph_info
}]Response
{command log}Description
Create a new UI.
Applicability
Request
{
"api":"app.create_ui",
"params":[{
"app": app_id,
"ui": ui_info
}]Response
{command log}Applicability
Description
Get a list of workflow that given in array of graph_id.
Request
{"api":"graph.get","params":[ Array of graph_id ]}Response
[ Array of graph_info ]Description
Update one graph.
Request
{
"api":"graph.update",
"params":[ graph_info ]Response
{command log}Description
Delete workflows on the server.
Request
{
"api":"graph.remove",
"params":[ Array of graph_id ]Response
{command log}Description
Start workflows on the server.
Request
{
"api":"graph.start",
"params":[ Array of graph_id ]Response
{}Description
Stop workflows on the server.
Request
{
"api":"graph.stop",
"params":[ Array of graph_id ]Response
{}Description
Get the status of workflows, valid status is "Non-exist", "Working", "Paused", "Stopped"
or "Idle".
Request
{
"api":"graph.status",
"params":[ Array of graph_id ]Response
[ Array of {
"graph": graph_id,
"status": status
}]Description
Get the tracing data of workflows.
Request
{
"api":"graph.trace",
"params":[ Array of graph_id ]Response
[ Array of {
"id": graph_id,
"trace": [ Array of records ]
}]Description
Get a list of UI that given in array of ui_id.
Applicability
Request
{"api":"ui.get","params":[ Array of ui_id ]}Response
[ Array of ui_info ]Description
Update one UI.
Applicability
Request
{
"api":"ui.update",
"params":[ ui_info ]Response
{command log}Description
Delete workflows on the server.
Applicability
Request
{
"api":"ui.remove",
"params":[ Array of ui_id ]Response
{command log}Applicability
Description
Get the list of all available spec bundle.
Request
{"api":"spec_bundle.list","params":[]}Response
[ Array of spec_bundle_info ]Description
Get the list of spec bundle that given in array of spec_bundle_id.
Request
{"api":"spec_bundle.get","params":[ Array of spec_bundle_id ]}Response
[ Array of spec_bundle_info ]Description
Get the list of spec bundle that includes spec in array of spec_id.
Request
{"api":"spec_bundle.get_for_specs","params":[ Array of spec_id ]}Response
[ Array of spec_bundle_info ]Description
Get the brief list of all available Hub.
Applicability
Request
{"api":"hub.list","params":[]}Response
[ Array of {
"id": hub_id,
"name": hub_name,
"description": hub_desc
}]Description
Get a list of Hub given in array of hub_id.
Applicability
Request
{"api":"hub.get","params":[ Array of hub_id ]}Response
[ Array of hub_info]Description
Create a new thing on the Hub.
Applicability
Request
{
"api":"hub.create_thing",
"params":[{
"hub": hub_id,
"thing": {
"type": "hope_thing",
"name": thing_name,
"description": thing_desc
}
}]
}Response
{
"id": thing_id,
"name": thing_name,
"type": "hope_thing"
}Applicability
Description
Update the thing information.
Request
{
"api":"thing.update",
"params":[{
"id": thing_id,
...
}]Response
{}Description
Delete things on the server, this operation will also automatically delete all
services belong it.
Request
{
"api":"thing.remove",
"params":[[ thing_id ]]Response
N/A
Description
Create a new service on the Thing.
Request
{
"api":"thing.create_service",
"params":[{
"thing": thing_id,
"service": {
"type": "hope_service",
"spec": spec_id or spec,
"name": service_name,
"description": service_desc
}
}]
}Response
{
"id": service_id,
"name": service_name,
"type": "hope_service"
}Applicability
Description
Update the service information.
Request
{
"api":"service.update",
"params":[{
"id": service_id,
...
}]Response
{}Description
Delete services on the server, this operation will also automatically delete all codes
for it.
Request
{
"api":"service.remove",
"params":[[ service_id ]]Response
N/A
Description
Get a list of file that service had and/or expected for.
Request
{
"api":"service.list_files",
"params":[ service_id ]Response
{
"expected": [ Array of filename ],
"existing": [ Array of filename ]
}Description
Read a service file.
Request
{
"api":"service.read_file",
"params":[{
"service_id": service_id,
"file_path": file_path
}]Response
{
"content": String of file content
}Description
Write a service file.
Request
{
"api":"service.write_file",
"params":[{
"service_id": service_id,
"file_path": file_path,
"content": String of file content
}]Response
{
service_brief_object
}Description
Delete a service file.
Request
{
"api":"service.remove_file",
"params":[{
"service_id": service_id,
"file_path": file_path
}]Response
{
service_brief_object
}