Get a list of parents for specified list of child devices

Resource Name: /api/v1/device/getParents

Request Method: POST

Request Parameters:

Element

Type

Description

Domain
optional

string

Domain ID. Always use default 0.

children
Mandatory

list of strings

List of device tree names. To get a device tree name, use GET /devices method from the device-setup-controller. Multiple values are separated by commas (,).

Response Parameters

Element

Type

Description

childrenDevicesNames   List of child device names objects.
originalName string Display name of the entity.
treeName string

Tree name of the entity.

managementDevice boolean

Indicates whether the child device has a parent or not:

  • true: Child device has no parent device

  • false: Child device has parent device

parentDeviceNames   List of parent device names objects. Displayed when value of managementDevice = false.
originalName string Display name of the entity.
treeName string

Tree name of the entity.

Response:

Code

Description

200

OK

401

Unauthorized session

404 Unknown device

Request cURL examples

curl -X POST "https://<localhost>/afa/api/v1/device/getParents" -H "accept: */*" -H "Content-Type: application/json" -d "[ \"10_20_106_1_Lieberman_Misezhnikov\"]"

Response examples 1

[
  {
    "childrenDevicesNames": [
      {
        "originalName": "Misezhnikov",
        "treeName": "10_20_106_1_Lieberman_Misezhnikov"
      }
    ],
    "parentDeviceNames": {
      "originalName": "Lieberman",
      "treeName": "Lieberman"
    },
    "managementDevice": false
  }
]

Response examples 2

[
  {
    "childrenDevicesNames": [
      {
        "originalName": "10_20_106_1",
        "treeName": "10_20_106_1"
      }
    ],
    "managementDevice": true
  }
]