Service layer message templates in a communications network
The concept of a service layer message template is introduced, which may be a request template or a response template. Message templates may be created and stored at the service layer. Each message template may contain a set of request or response parameters and their values. Once in place, an application can send a request to the service layer that does not include the request parameters contained in the message template (i.e. request template); instead, a message template identifier may be sent. Since request parameters are included in the message template and stored at the service layer, communication overhead between the service layer and the application (or another service layer) may be reduced.
1. A network apparatus comprising at least one processor and memory, the memory storing executable instructions that, when executed by the at least one processor, implement a service of a communications network, the service supporting service capabilities through a set of Application Programming Interfaces (APIs), and cause the service to:
store, in the memory, one or more message templates, each message template, of the one or more message templates, comprising one or more parameters associated with a message that may be received by the service from one or more devices on the communications network and having one or more parameters identifying one or more target resources that each message template applies to;
receive a request to create a new request message template, the request to create a new request message template comprising one or more parameters associated with a message that may be received by the service and one or more target resources that the message template applies to;
create the new request message template, the new request message template comprising corresponding one or more parameters, wherein the corresponding one or more parameters are based on the received one or more parameters;
generate an identifier associated with the new request message template;
store, in the memory, the new request message template associated with the identifier and the one or more target resources;
receive a first message targeting a resource of the network apparatus matching a target resource of the one or more target resources associated with the new request message template;
retrieve, from the memory in response to the first message, a stored message template associated with the resource targeted in the first message;
combine information in the received first message with one or more parameters in the retrieved stored message template to form a complete message;
process the complete message; and
send, in response to the first message, a response message.
2. The network apparatus recited in claim 1 , wherein the executable instructions further cause the service to:
create the new request message template, the new request message template comprising one or more parameters to be associated with a response to the first message, a response message template having an associated identifier;
provide to the device, or requesting that the device create its own copy of, the response message template along with its associated identifier; and wherein the response message comprises the identifier associated with the new request message template but not including the one or more parameters of the new request message template.
3. The network apparatus recited in claim 1 , wherein the executable instructions further cause the service to:
select a group of one or more devices on the network;
assign to the group of devices one of the stored message template identifiers to be used by the devices of the group when sending request messages to the service layer; and
send the assigned message template identifier to the group of devices.
4. The network apparatus recited in claim 1 , wherein the message received from the device is received from an application hosted by the device.
5. A method, comprising:
storing, in a memory of a service of a communications network, the service supporting service capabilities through a set of Application Programming Interfaces (APIs), one or more message templates each message template, of the one or more message templates comprising one or more parameters associated with a message that may be received by the service from one or more devices on the communications network and having one or more parameters identifying one or more target resources that each message template applies to;
receiving a request to create a new request message template, the request to create a new request message template comprising one or more parameters associated with a message that may be received by the service and one or more target resources that the message template applies to;
creating the new request message template, the new request message template comprising corresponding one or more parameters, wherein the corresponding one or more parameters are based on the received one or more parameters;
generating an identifier associated with the new request message template;
storing, in the memory, the new request message template in association with the identifier and the one or more target resources;
receiving, by the service, a first message targeting a resource of a network apparatus matching a target resource of the one or more target resources associated with the new request message template;
retrieving, by the service from the memory in response to the first message, a stored message template associated with the resource targeted in the first message;
combining, by the service, information in the received first message with one or more parameters in the retrieved stored message template to form a complete message;
processing, by the service layer entity, the complete message; and
sending, in response to the first message, a response message.
6. The method of claim 5 , further comprising:
creating, by the service, a new request message template, the new request message template comprising one or more parameters to be associated with a response to the first message, a response message template having an associated identifier;
providing, by the service to the device, or requesting that the device create its own copy of, the response message template along with its associated identifier; and wherein the response message comprises the identifier associated with the new request message template but not including the one or more parameters of the new request message template.
7. The method of claim 5 , further comprising:
selecting, by the service layer entity, a group of one or more devices on the network;
assigning, by the service layer entity to the group of devices, one of the stored message template identifiers to be used by the devices of the group when sending request messages to the service layer entity; and
sending, by the service layer entity, the assigned message template identifier to the group of devices.
8. The method of claim 5 , wherein the message received from the device is received from an application hosted by the device.
9. A device coupled to a communications network and comprising at least one processor and memory, the memory storing executable instructions that, when executed by the at least one processor, cause the device to:
create a request message comprising information and an identifier of a message template, of one or more message templates stored at a service of the communications network, the service supporting service capabilities through a set of Application Programming Interfaces (APIs), the stored message template comprising one or more parameters associated with the request message that may be received by the service and one or more target resources that the message template applies to, wherein the request message targets a resource matching a target resource of the one or more target resources associated with the message template;
send a request to create a new request message template, the request to create a new request message template comprising one or more parameters associated with a message which the message template is to represent and one or more target resources that the message template applies to, wherein the request causes a network apparatus to:
create the new request message template, the new request message template comprising corresponding one or more parameters, wherein the corresponding one or more parameters are based on the received one or more one or more parameters,
generate an identifier associated with the new request message template, and
store, in the memory, the new request message template in association with the identifier and the one or more target resources;
send the request message to the service, wherein the request message comprises the information and the identifier associated with the new request message template and targets a resource matching a target resource of the one or more target resources associated with the new request message template; and
receive, from the service, a response message.