Exchanging Messages Through Secure Tunnel Protocols
The data format for message communication between the app and device based on the secure tunnel protocol is listed in the following table.
Parameter |
Type |
Description |
---|---|---|
operation_type |
String |
Explanation: Data type. Value range:
|
tunnel_service_type |
String |
Explanation: Service type corresponding to tunnel communication. Value range: ssh. |
request_id |
String |
Explanation: Session IDs of different data types. Constraint: The value must be unique in the current secure tunnel. |
data |
Object |
Explanation: Data to be transmitted. |
Example
- The platform notifies the application that the device is connected to the WebSocket.
{ "operation_type":"connect_tunnel" "tunnel_service_type": "ssh", "request_id":"xxx", "data": null }
- The application delivers the SSH channel connection parameters to the device.
{ "operation_type": "connect", "tunnel_service_type": "ssh", "request_id":"xxx", "data": { "username":"xxx", "password": "" } }
- The device reports a connection response to the application.
{ "operation_type":"connect_response" "tunnel_service_type": "ssh", "request_id":"xxx", "data": "xx" }
- The application delivers the SSH command to the device.
{ "operation_type":"command", "tunnel_service_type": "ssh", "request_id":"xxx", "data": "xxx" }
- The device reports the SSH command execution response to the application.
{ "operation_type":"command_response" "tunnel_service_type": "ssh", "request_id":"xxx", "data": null }
- When the platform disconnects the WebSocket connection, the platform sends data to the application.
{ "operation_type":"disconnect", "tunnel_service_type": "ssh", "request_id":"xxx", "data": { "status_code":"xxx", "status_msg":"xxx" } }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot