-
Notifications
You must be signed in to change notification settings - Fork 19
Wrp.CRUD
Weston Schmidt edited this page Aug 8, 2018
·
3 revisions
Create Retrieve Update Delete Message Types
These messages are designed to be used for simple RESTful for CRUD transactions.
{
"msg_type": 5,
"source": "dns:my-great-service.com",
"dest": "mac:112233445566/device-service/path/more/path/extra-parameters",
"content_type": "",
"accept": "",
"transaction_uuid": "",
"status": 200,
"rdr": 0,
"partner_ids": [
"foo"
],
"headers": [
"header1: super cool"
],
"metadata": {
"/favorite-color": "red"
},
"spans": [],
"include_spans": true,
"path": "",
"payload": ""
}
MsgPack/Json Name | HTTP Header Name | Required | Description |
---|---|---|---|
msg_type |
X-Xmidt-Message-Type |
required | The message type for the CRUD interface. For Msgack: 5 = Create, 6 = Retrieve, 7 = Update, 8 = Delete. For HTTP headers: Create , Retrieve , Update , Delete
|
source |
X-Xmidt-Source |
required | The device_id name of the device originating the request or response. |
dest |
X-Xmidt-Dest |
required | The device_id name of the target device of the request or response. |
transaction_uuid |
X-Xmidt-Transaction-Uuid |
required | The transaction key for the request and response. The requester may have several outstanding transactions, but must ensure that each transaction is unique per destination. This SHOULD be a UUID, but the web router SHALL NOT validate this data. The web router SHALL treat this data as opaque. |
content_type |
X-Xmidt-Source |
optional | The media type of the payload. |
accept |
X-Xmidt-Accept |
optional | The media type accepted in the response. |
status |
X-Xmidt-Status |
optional | The response status from the originating service. Not included in the during the request. |
rdr |
X-Xmidt-Rdr |
optional | The request delivery response is the delivery result of the previous (implied request) message with a matching transaction_uuid . |
partner_ids |
X-Xmidt-Partner-Ids |
optional | The list of partner ids the message is meant to target. If the item is missing and the device has a partner id or the device does not find a match, the request shall be disregarded & a response with status of 403 sent back to the sender. |
headers |
X-Xmidt-Headers |
optional | The headers associated with the payload. |
metadata |
X-Xmidt-Metadata |
optional | The map of name/value pairs used by consumers of WRP messages for filtering & other purposes. |
spans |
X-Xmidt-Spans |
optional | An array of arrays of timing values as a list in the format: "name", "start time", "duration" |
include_spans |
n/a | optional | If the timing values should be included in the response. |
payload |
n/a | optional | The MsgPack bin format packed data. |
path |
X-Xmidt-Path |
optional | The path to which to apply the payload. |
Method | Request | Response |
---|---|---|
Create | Data for the new object | Resulting object |
Retrieve | ignored | Requested object |
Update | Data to update | Ignored |
Delete | Ignored | Ignored |
Code | Description |
---|---|
0 | Delivered |
TBD | The rest are TBD today. |