-
Notifications
You must be signed in to change notification settings - Fork 17
New CDD API #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New CDD API #172
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,6 +277,56 @@ _Even if this version is increased, the API remains backward compatible. | |
It just help backends development to identify if new features are | ||
present in a gateway._ | ||
|
||
#### Set configuration data item | ||
|
||
Only processed if CONFIGURATION_DATA_V1 feature flag is set on the gateway. | ||
|
||
- **Request:** | ||
|
||
> **topic:** gw-request/set_configuration_data_item/*\<gw-id\>/\<sink-id\>* | ||
> | ||
> **content:** [GenericMessage][message_GenericMessage].[WirepasMessage][message_WirepasMessage].SetConfigurationDataItemReq | ||
|
||
- **Response:** | ||
|
||
> **topics:** gw-response/set_configuration_data_item/*\<gw-id\>/\<sink-id\>* | ||
> | ||
> **content:** [GenericMessage][message_GenericMessage].[WirepasMessage][message_WirepasMessage].SetConfigurationDataItemResp | ||
> | ||
> **possible errors:** | ||
> - INVALID_ROLE: Node is not a sink. | ||
> - SINK_OUT_OF_MEMORY: Payload is too large or maximum number of items is reached. | ||
> - INVALID_DEST_ENDPOINT: Endpoint is too large (it should be a 16 bit unsigned integer). | ||
> - INVALID_DATA_PAYLOAD: Payload is rejected for this endpoint by the sink. | ||
> - INVALID_SINK_ID: Invalid sink id in the request header. | ||
|
||
:warning: | ||
|
||
_Successfully setting an item must be treated as a configuration change on the | ||
sink, meaning that the gateway must report the new complete configuration data | ||
content by generating a new [StatusEvent][message_StatusEvent] message._ | ||
|
||
#### Get configuration data item | ||
|
||
Only processed if CONFIGURATION_DATA_V1 feature flag is set on the gateway. | ||
|
||
- **Request:** | ||
|
||
> **topic:** gw-request/get_configuration_data_item/*\<gw-id\>/\<sink-id\>* | ||
> | ||
> **content:** [GenericMessage][message_GenericMessage].[WirepasMessage][message_WirepasMessage].GetConfigurationDataItemReq | ||
|
||
- **Response:** | ||
|
||
> **topics:** gw-response/get_configuration_data_item/*\<gw-id\>/\<sink-id\>* | ||
> | ||
> **content:** [GenericMessage][message_GenericMessage].[WirepasMessage][message_WirepasMessage].GetConfigurationDataItemResp | ||
> | ||
> **possible errors:** | ||
> - INVALID_DEST_ENDPOINT: Endpoint is too large (it should be a 16 bit unsigned integer). | ||
> - INVALID_PARAM: No item found with the given endpoint. | ||
> - INVALID_SINK_ID: Invalid sink id in the request header. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose having nodes with non-sink role connected as sinks to the gateway is not a supported scenario, so no need to define what happens if the CDC contents change on such a system? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess not for that specific case. However, I do think that either the naming of the topic or alternative this documentation would need to be tuned somehow to explain what does these actually configure. Now the topic name is very close to This is anyways mesh level CDD content item, so I wonder should these be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this is a tricky one, we decided to use naming that is consistent with DECT-2020 specification (page 59), but I agree on it's own the naming is not very self explanatory in this interface. |
||
### Data module | ||
|
||
--- | ||
|
@@ -518,6 +568,9 @@ definition) | |
|
||
gw-request/otap_set_target_scratchpad/<gw-id>/<sink-id> | ||
|
||
gw-request/set_configuration_data_item/<gw-id>/<sink-id> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now thinking of it, I do think that we should probably have similar get API for this. Then it would be more analogical with other setter type of API methods (you can read all of those with corresponding get method). While that is to some extent available at the moment as well, there is just extra overhead if we would need to query whole sink configs if some backend component is just interested on its own appconfig type of application configuration etc. |
||
|
||
gw-request/get_configuration_data_item/<gw-id>/<sink-id> | ||
``` | ||
|
||
*Response* from a gateway to a backend: | ||
|
@@ -538,6 +591,10 @@ definition) | |
gw-response/otap_process_scratchpad/<gw-id>/<sink-id> | ||
|
||
gw-response/otap_set_target_scratchpad/<gw-id>/<sink-id> | ||
|
||
gw-response/set_configuration_data_item/<gw-id>/<sink-id> | ||
|
||
gw-response/get_configuration_data_item/<gw-id>/<sink-id> | ||
``` | ||
|
||
*Asynchronous* event from a gateway: | ||
|
@@ -591,4 +648,13 @@ definition) | |
|
||
[message_SetScratchpadTargetAndActionResp]: https://github.com/wirepas/backend-apis/blob/77d83cc91ccfede5e457a488f0611f1fed342585/gateway_to_backend/protocol_buffers_files/otap_message.proto#L54-L56 | ||
|
||
<!-- TODO update links and take them into use once they are available in the master branch --> | ||
<!-- [message_SetConfigurationDataItemReq]: --> | ||
<!----> | ||
<!-- [message_SetConfigurationDataItemResp]: --> | ||
<!----> | ||
<!-- [message_GetConfigurationDataItemReq]: --> | ||
<!----> | ||
<!-- [message_GetConfigurationDataItemResp]: --> | ||
|
||
[protobuf_homepage]: https://developers.google.com/protocol-buffers |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,11 @@ message NetworkKeys { | |
required bytes authentication = 2; | ||
} | ||
|
||
message ConfigurationDataItem { | ||
required uint32 endpoint = 1; | ||
required bytes payload = 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the payload length be given as parameter here as well? Or is that something that we can expect to be achievable (in all the relevant client libraries / languages) via the payload itself? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bytes proto type holds the length already, it should be possible to obtain it from the libraries |
||
} | ||
|
||
message SinkReadConfig { | ||
// Local id to uniquely identify a sink on gateway | ||
required string sink_id = 1; | ||
|
@@ -72,6 +77,9 @@ message SinkReadConfig { | |
optional ScratchpadInfo processed_scratchpad = 21; | ||
optional uint32 firmware_area_id = 22; | ||
optional TargetScratchpadAndAction target_and_action = 23; // Unset if sink doesn't support it | ||
|
||
// Only present if CDD_API feature flag is set | ||
repeated ConfigurationDataItem configuration_data_content = 24; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, what is included in this? Based on the initial discussion, I thought that we agreed that this kind of "listing" all is a bit questionable. There might be different backends managing different items in the overall CDD list. Should we allow all backends to read all, or should be per request (i.e. one can ask for the endpoints of interest and receives only those). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of the items would be included here, and there is no possibility of requesting to read a single item. This means all of the information related to CDC would be already available in the status event messages. Maybe @GwendalRaoul can tell more about the reasoning behind having only a list based on his experience? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeap, I was mainly raising the point that this is not exactly according to the (initial) discussion. In case of CDD there will be multiple masters for the managed data and I would think that it would make sense to try to not mix those. If we want to have it in status message, then I guess everything needs to be listed there. I'm not against lists as such, those would be beneficial in any case (meaning also with the "list of endpoints" case), but just wanted to raise the concern on "coupling" all the CDD items. |
||
} | ||
|
||
message SinkNewConfig { | ||
|
@@ -118,6 +126,8 @@ message GatewayInfo { | |
// it must be sent as chunk. If not set, it means that | ||
// scratchpad can be sent in a single request | ||
optional uint32 max_scratchpad_size = 5; | ||
|
||
repeated GatewayFeature gw_features = 6; | ||
} | ||
|
||
/* | ||
|
@@ -146,6 +156,8 @@ message GatewayInfo { | |
|
||
// See GatewayInfo for details of this field | ||
optional uint32 max_scratchpad_size = 7; | ||
|
||
repeated GatewayFeature gw_features = 8; | ||
} | ||
|
||
message GetConfigsReq { | ||
|
@@ -180,3 +192,26 @@ message GetGwInfoResp { | |
|
||
required GatewayInfo info = 2; | ||
} | ||
|
||
message SetConfigurationDataItemReq { | ||
required RequestHeader header = 1; | ||
|
||
// 0-length payloads are used to clear an entry | ||
required ConfigurationDataItem configuration_data_item = 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder whether this should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's repeated, I think we would need to send all of the CDC items in the reply. Since they would be set one by one on the sink, some of the sets might be successful and some not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right indeed, this is tricky part as each item might be handled in the end by different entity in the sink and naturally there is no "transactionality" with these. I guess it is not too big of a drawback, but maybe something to worth discussing with wider audience as well next week. |
||
} | ||
|
||
message SetConfigurationDataItemResp { | ||
required ResponseHeader header = 1; | ||
} | ||
|
||
message GetConfigurationDataItemReq { | ||
required RequestHeader header = 1; | ||
|
||
required uint32 endpoint = 2; | ||
} | ||
|
||
message GetConfigurationDataItemResp { | ||
required ResponseHeader header = 1; | ||
|
||
optional ConfigurationDataItem configuration_data_item = 2; | ||
} |
Uh oh!
There was an error while loading. Please reload this page.