LogoLogo
Thinger.io
  • IOTMP
    • Protocol
    • Message Structure
      • Message Header
      • Message Body
    • Messages
      • Ok
      • Error
      • Connect
      • Disconnect
      • Keep Alive
      • Run Resource
      • Describe Resources
      • Resource Streams
        • Start Stream
        • Stop Stream
        • Stream Data
    • Definitions
  • Thinger.io IOTMP
    • Features
      • REST API
      • Remote Desktop
      • Remote Proxies
      • Remote Webservices
      • Remote Terminal
      • Remote Filesystem
      • MQTT Interoperability
    • Implemenation
      • Messages
        • Connect
    • SDKs
      • Linux IOTMP
      • Arduino IOTMP
      • NodeJS IOTMP
      • Web IOTMP
      • Python SDK
Powered by GitBook
On this page
  • Request
  • Header
  • Body
  • Response (All Resources)
  • Ok
  • Error
  • Response (Single Resource)
  • Ok
  • Error

Was this helpful?

Edit on GitHub
  1. IOTMP
  2. Messages

Describe Resources

Message to discover available resources in endpoints

Last updated 2 years ago

Was this helpful?

This message enables discovering remote defined both in client and server. Resources can be defined dynamically by clients and servers. As described in the 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

Field
Value
Description

Message Type

0x07

Describe Resources

Message Size

Remaining Message Length

Body

Name
Field
Type
Mandatory
Description

Stream Id

0x01

varint

Parameters

0x02

any

Params

Resource

0x03

any

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

{
  "relay": {
    "fn": 2
    "id": 0
  },
  "temperature": {
    "fn": 3
    "id": 1
  },
  "reset" : {
    "fn": 1,
    "st": false,
    "id": 2
}

In such document each key represents the resource name

Describe Field
Key
Value
Mandatory
Description

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

{
  "in": true
}
{
  "out": 22.33
}  
{
  "in": 0
  "out": 25
}

Error

The resource cannot be described, i.e, it does not exists.

.

. It should be a string or a resource identifier. If not sent, the target endpoint should report all available resources.

If the request succeed, the remote endpoint should return an with the following payload:

If the request succeed, the remote endpoint should return an with the following payload:

Ok Message
Ok Message
resources
resources
varint
Stream identifier
Resource identifier