V2.1 Remove Sub-Device

Remove sub-devices from the gateway (remove the topological relationship).


This API is available in EnOS 2.1.0 and above.

Operation Permissions


Before invoking this API, ensure that the service account has been authorized the policy that includes the following service(s) and action permission(s). For how to authorize the service account, see Managing Service Accounts.


Required Service

Required Operation Permission

Device Management Service

Full Access

Request Format

POST https://{apigw-address}/connect-service/v2.1/device-topos?action=removeSubDevice

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

orgId

Query

Mandatory

String

The organization ID which the asset belongs to. How to get orgId>>

Request Parameters (Body)

Name

Mandatory/Optional

Data Type

Description

gateway

Mandatory

DeviceIdentfier Struct

Information of the gateway to remove the sub-device from. For details, see DeviceIdentfier Struct.

subDevices

Mandatory

Array of DeviceIdentfier Structs

The list of the sub-devices to be removed from the specified getaway. For details, see DeviceIdentfier Struct.

DeviceIdentifier Struct

Note: Use either the (assetId) or (productKey + deviceKey) for the following.

Name

Data Type

Description

assetId

String

The asset ID. How to get assetId>>

productKey

String

The product key. To be used with deviceKey .

deviceKey

String

The device key. To be used with productKey .

Error Codes

Code

Message

Description

11738

Not Gateway

The device specified in gateway is not a gateway.

11795

Invalid arguments

One or multiple parameters are invalid.

Samples

Request Sample

url: https://{apigw-address}/connect-service/v2.1/device-topos?action=remove&orgId=yourOrgId
method: POST
requestBody:
{
  "subDevices":[
    {
      "assetId":"gVRwKQ3C"
    }
  ],
  "gateway":{
    "assetId":"J1Rqyaqz"
  }
}

Return Sample

{
  "code":0,
  "msg":"OK",
  "requestId":"ea6608bb-b8cb-46f3-a836-ee24ea9a028c",
  "data":null
}

SDK Samples


You can access the SDK samples for Connection Service on GitHub: