V2.5 Create DPS Device


Create DPS devices.


This API is only available if 2.4 Cumulative Update 2 has been applied to your environment.

Prerequisites

Ensure that the device group and registration group for the DPS device are both created in the EnOS Management Console.

Request Format

POST https://{apigw-address}/dps-service/v2.5/pvs/device?action=create

Request Parameters (URI)

Name Location (Path/Query) Required/Optional Data Type Description
orgId Query Required String The organization ID which the device belongs to. How to get orgId>>

Request Parameters (Body)

Name Required/Optional Data Type Description
groupId Required String The registration group ID.
count Required Integer The number of devices to create.
desc Optional String The device description.
batchTag Optional StringI18n The device creation batch tag. Internationalized name representation >>
deviceData Optional Map (Key is of String type and the Value is of Integer, String, Enum or Date type) The device master data. The Key is the identifier of the master data and the value must correspond to the data type pf the master data. Ensure that you have created the master data or use the built-in master data.

Response Parameters

Name Data Type Description
data String Array The list of serial numbers of devices that were successfully created.

Error Codes

Code Message Description
99400 Invalid Argument groupId:groupId is missing Registration group ID is blank or invalid.
99400 Invalid Argument count:count is missing The number of devices to create is blank.
99400 count of PvsDeviceCreateInfo must between 1 to 1000000 The number of devices to create is invalid.
35404 Group not found The registration group does not exist.
35601 DeviceSn duplicated The device serial number already exists.

Samples

Request Sample

url: https://{apigw-address}/dps-service/v2.5/pvs/device?action=create&orgId=yourOrgId
method: POST
requestBody:
{
    "groupId": "yourGroupId",
    "count": 1,
    "desc": "description",
    "batchTag": {
        "defaultValue": "123"
    },
    "deviceData": {
      "deviceSn": "yourDeviceSn"
    }
}

Return Sample

{
  "code": 0,
  "msg": "OK",
  "requestId": "6e13b720-20d8-4ab1-8f34-060f89e569ed",
  "data": [
    "yourDeviceSn"
  ]
}