Updated on 2023-02-16 GMT+08:00

Platform Notifying a Gateway of Child Device Deletion

Function

This API is used by the platform to notify a gateway of the information about a deleted child device.

Topic

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

Parameters

Parameter

Mandatory or Optional

Type

Description

object_device_id

Optional

String

Indicates the device that the event is about. If this parameter is not carried, the device specified in the topic is considered to be the device involved.

services

Optional

List<ServiceEvent>

Indicates a list of services that the event is about.

ServiceEvent structure

Parameter

Mandatory or Optional

Type

Description

service_id

Mandatory

String

System field. The value is fixed to $sub_device_manager.

event_type

Mandatory

String

System field. The value is fixed to delete_sub_device_notify.

event_time

Optional

String

Indicates the time when the event occurs.

paras

Mandatory

Object

Indicates the event parameters in JSON format.

paras structure

Parameter

Mandatory or Optional

Type

Description

devices

Mandatory

List<DeviceInfo>

Indicates the device list.

version

Mandatory

Long

Indicates the version of the child device information.

DeviceInfo structure

Parameter

Mandatory or Optional

Type

Description

parent_device_id

Mandatory

String

Identifies the parent device.

node_id

Optional

String

Indicates the node ID.

device_id

Mandatory

String

Identifies a device.

Example

Topic: $oc/devices/{device_id}/sys/events/down 
Data format:
{
	"object_device_id": "{object_device_id}",
	"services": [{
		"service_id": "$sub_device_manager",
		"event_type": "delete_sub_device_notify",
		"event_time": "20151212T121212Z",
		"paras": {
			"devices": [{
				"parent_device_id": "c6b39067b0325db34663d3ef421a42f6_12345678",
				"node_id": "subdevice11",
				"device_id": "2bb4ddba-fb56-4566-8577-063ad2f5a6cc"
			}],
			"version": 1
		}
	}]
}