Describe Resources
Message to discover available resources in endpoints
This message enables discovering remote resources defined both in client and server. Resources can be defined dynamically by clients and servers. As described in the resources definition, a resource is basically like a function that can be executed like in RPC (Remote Procedure Call). As a "function" it can receive parameters, inputs, and provide an output.
This message allows discovering such resources, like its names, function type, if they support streaming, required parameters, etc.
Request
Header
Message Type
0x07
Describe Resources
Body
Parameters
0x02
Params
Resource
0x03
Resource identifier. It should be a string or a resource identifier. If not sent, the target endpoint should report all available resources.
If not resource is specified, the target endpoint should list all available resources.
Response (All Resources)
If no resource is specified while sending the Describe Resources message, the target endpoint should list all available resources,
Ok
If the request succeed, the remote endpoint should return an Ok Message with the following payload:
In such document each key represents the resource name
Function Type
fn
1 : function without parameters
2 : function with input
3: function with output
4: function with input and output
Provides information about the function type, i.e., if it requires and input, provides an output, none, or both of them.
Parameters
pr
true: requires parameters
false: no parameters required
Determines if the resource requires parameters to be executed. By default, if not specified, the resource does not require parameters to be executed.
Stream
st
true: support Stream
false: no stream support
Determines if the resource can be used with the Streams functionality. By default, if not specified, the stream support is enabled.
Resource identifier
id
varint
An alternative numeric resource identifier, instead of a name, that can be used to call this resource.
Error
The resources cannot be described, i.e., no support for describing resources.
Response (Single Resource)
If a resource is specified while sending the Describe Resources message, the target endpoint should reply with the resource details.
Ok
If the request succeed, the remote endpoint should return an Ok Message with the following payload:
Error
The resource cannot be described, i.e, it does not exists.
Last updated