Updated on 2024-12-02 GMT+08:00

Platform Delivering Tunnel Information

Function

This API is used by the IoT platform to deliver secure tunnel information to the device. The device can use the information to establish a WebSocket connection with the platform. You can remotely log in to the device using the secure tunnel on the application side (remote SSH login service), and perform operations such as device configuration update, diagnosis, and O&M change.

Topic

Downstream: $oc/devices/{device_id}/sys/events/down

Parameters

Parameter

Mandatory/Optional

Type

Description

services

Optional

List<ServiceEvent>

Explanation:

List of services that an event is about.

ServiceEvent structure

Parameter

Mandatory/Optional

Type

Description

service_id

Mandatory

String

Explanation:

System field.

Value range:

Fixed at $tunnel_manager.

event_type

Mandatory

String

Explanation:

System field.

Value range:

Fixed at tunnel_notify.

event_time

Optional

String

Explanation:

Event time. UTC time format: yyyyMMdd'T'HHmmss'Z'.

paras

Mandatory

Object

Explanation:

Event parameters in JSON format.

paras structure

Parameter

Mandatory/Optional

Type

Description

tunnel_uri

Mandatory

String

Explanation:

Tunnel connection address.

tunnel_access_token

Mandatory

String

Explanation:

Tunnel access token.

expires_in

Mandatory

Integer

Explanation:

Validity period of a token.

Example

Topic: $oc/devices/{device_id}/sys/events/down
Data format:
{ 
    "services": [{ 
        "service_id": "$tunnel_manager", 
        "event_type": "tunnel_notify", 
        "event_time": "20151212T121212Z",
         "paras": { 
              "tunnel_uri": "wss://xxx/v5/iot/tunnels/{tunnel_id}/device-connect",
              "tunnel_access_token": "xxxx",
              "expires_in":86400
         } 
    }] 
}