A Property is a set of between 1 and 4 double values, which may or not be associated to properties. Properties can also support frames and/or timestamps, just like properties, but cannot be locked and have no transformations.
Properties are meant to be interacted with by individual devices, and these changes will be streamed to other devices via the Events API. In addition, Create and Update messages sent to the HTTP API are converted to events and streamed out to registered devices.
POST
/v1/property/
¶Create a new property.
Request Headers: | |
---|---|
|
|
Status Codes: |
|
POST /v1/property HTTP/1.1
Host: localhost:8768
Content-Type: application/json
{
"properties":[
{
"key":"12345",
"name":"testName",
"parent":"testParent",
"asset_sub_id":"testAssetSubId",
"scene":"testScene",
"frame":1,
"timestamp":123456789,
"values":[
{
"value":100,
"left_type":"vector",
"left_x":10,
"left_y":5,
"right_type":"free",
"right_x":4,
"right_y":3
}
]
}
]
}
curl -i -X POST http://localhost:8768/v1/property -H 'Content-Type: application/json' --data-raw '{"properties": [{"name": "testName", "parent": "testParent", "timestamp": 123456789, "frame": 1, "scene": "testScene", "values": [{"left_type": "vector", "value": 100, "left_x": 10, "left_y": 5, "right_x": 4, "right_y": 3, "right_type": "free"}], "asset_sub_id": "testAssetSubId", "key": "12345"}]}'
wget -S -O- http://localhost:8768/v1/property --header='Content-Type: application/json' --post-data='{"properties": [{"name": "testName", "parent": "testParent", "timestamp": 123456789, "frame": 1, "scene": "testScene", "values": [{"left_type": "vector", "value": 100, "left_x": 10, "left_y": 5, "right_x": 4, "right_y": 3, "right_type": "free"}], "asset_sub_id": "testAssetSubId", "key": "12345"}]}'
echo '{
"properties": [
{
"asset_sub_id": "testAssetSubId",
"frame": 1,
"key": "12345",
"name": "testName",
"parent": "testParent",
"scene": "testScene",
"timestamp": 123456789,
"values": [
{
"left_type": "vector",
"left_x": 10,
"left_y": 5,
"right_type": "free",
"right_x": 4,
"right_y": 3,
"value": 100
}
]
}
]
}' | http POST http://localhost:8768/v1/property Content-Type:application/json
requests.post('http://localhost:8768/v1/property', headers={'Content-Type': 'application/json'}, json={'properties': [{'name': 'testName', 'parent': 'testParent', 'timestamp': 123456789, 'frame': 1, 'scene': 'testScene', 'values': [{'left_type': 'vector', 'value': 100, 'left_x': 10, 'left_y': 5, 'right_x': 4, 'right_y': 3, 'right_type': 'free'}], 'asset_sub_id': 'testAssetSubId', 'key': '12345'}]})
HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property
Content-Type: application/json
{
"num_records":1,
"objects":[{"key":"jklmnop"}]
}
POST
/v1/property/{property_key}
¶Update an existing property.
Request Headers: | |
---|---|
|
|
Status Codes: |
|
POST /v1/property/{key} HTTP/1.1
Host: localhost:8768
Content-Type: application/json
{
"properties":[
{
"name":"anotherName",
"parent":"anotherParent"
}
]
}
curl -i -X POST 'http://localhost:8768/v1/property/{key}' -H 'Content-Type: application/json' --data-raw '{"properties": [{"name": "anotherName", "parent": "anotherParent"}]}'
wget -S -O- 'http://localhost:8768/v1/property/{key}' --header='Content-Type: application/json' --post-data='{"properties": [{"name": "anotherName", "parent": "anotherParent"}]}'
echo '{
"properties": [
{
"name": "anotherName",
"parent": "anotherParent"
}
]
}' | http POST 'http://localhost:8768/v1/property/{key}' Content-Type:application/json
requests.post('http://localhost:8768/v1/property/{key}', headers={'Content-Type': 'application/json'}, json={'properties': [{'name': 'anotherName', 'parent': 'anotherParent'}]})
HTTP/1.1 200 OK
Location: http://localhost:5885/v1/property/{key}
Content-Type: application/json
{
"num_records":1,
"properties":[{"key":"jklmnop"}]
}
GET
/v1/property/
(property_key)¶Get property details in JSON Format.
Status Codes: |
|
---|
GET /v1/property/{key} HTTP/1.1
Host: localhost:8768
curl -i 'http://localhost:8768/v1/property/{key}'
wget -S -O- 'http://localhost:8768/v1/property/{key}'
http 'http://localhost:8768/v1/property/{key}'
requests.get('http://localhost:8768/v1/property/{key}')
HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property/{key}
Content-Type: application/json
{
"msg_type": 10,
"err_code": 100,
"num_records": 1,
"properties": [
{
"name": "testName",
"parent": "testParent",
"asset_sub_id": "testAssetSubId",
"scene": "testScene",
"frame": 1,
"timestamp": 123456789,
"values": [
{
"value": 100,
"left_type": "vector",
"left_x": 10,
"left_y": 5,
"right_type": "free",
"right_x": 4,
"right_y": 3
}
]
}
]
}
DELETE
/v1/property/
(property_key)¶Delete an property.
Status Codes: |
|
---|
DELETE /v1/property/{key} HTTP/1.1
Host: localhost:8768
curl -i -X DELETE 'http://localhost:8768/v1/property/{key}'
wget -S -O- --method=DELETE 'http://localhost:8768/v1/property/{key}'
http DELETE 'http://localhost:8768/v1/property/{key}'
requests.delete('http://localhost:8768/v1/property/{key}')
GET
/v1/property/query
¶Query for properties which match the input JSON. This will only return as many records as specified in the field ‘num_records’.
Status Codes: |
|
---|
POST /v1/property/query HTTP/1.1
Host: localhost:5885
Content-Type: application/json
{
"properties":[
{
"name":"test"
}
]
}
curl -i -X POST http://localhost:5885/v1/property/query -H 'Content-Type: application/json' --data-raw '{"properties": [{"name": "test"}]}'
wget -S -O- http://localhost:5885/v1/property/query --header='Content-Type: application/json' --post-data='{"properties": [{"name": "test"}]}'
echo '{
"properties": [
{
"name": "test"
}
]
}' | http POST http://localhost:5885/v1/property/query Content-Type:application/json
requests.post('http://localhost:5885/v1/property/query', headers={'Content-Type': 'application/json'}, json={'properties': [{'name': 'test'}]})
HTTP/1.1 200 OK
Location: http://localhost:5885/v1/property/query
Content-Type: application/json
{
"msg_type": 10,
"err_code": 100,
"num_records": 1,
"properties": [
{
"name": "testName",
"parent": "testParent",
"asset_sub_id": "testAssetSubId",
"scene": "testScene",
"frame": 1,
"timestamp": 123456789,
"values": [
{
"value": 100,
"left_type": "vector",
"left_x": 10,
"left_y": 5,
"right_type": "free",
"right_x": 4,
"right_y": 3
}
]
}
]
}