# Devices

## Document

| Property                | Type            | Contract | Description                                                                                |
| ----------------------- | --------------- | -------- | ------------------------------------------------------------------------------------------ |
| `_meta`                 | `object`        | required | [See documents](https://docs.vedicium.io/myluxura/overview/documents#metadata-of-document) |
| `app`                   | `string`        | required | Device's app                                                                               |
| `type`                  | `string`        | required | Type of Device                                                                             |
| `version`               | `integer`       | required | Version of device                                                                          |
| `serial`                | `string`        | required | Serial of device                                                                           |
| `serialnumber`          | `integer`       | required | Serial number of device                                                                    |
| `equipment_guid`        | `string`        | optional | Guid of equipment document linked to device                                                |
| `hardware.model`        | `string`        | required | Hardware model of device                                                                   |
| `hardware.revision`     | `string`        | required | Hardware revision of device                                                                |
| `hardware.serial`       | `string`        | required | Serial number of hardware of device                                                        |
| `hardware.macAddresses` | `Array<string>` | optional | Mac addresses of device                                                                    |
| `software`              | `string`        | required | Software & version of device                                                               |
| `last_ping`             | `integer`       | optional | Timestamp in milliseconds of last ping of device                                           |
| `network.remote_ip`     | `string`        | optional | Remote IP address of device                                                                |
| `network.local_ip`      | `Array<string>` | optional | Local IP addresses of device                                                               |
| `network.interfaces`    | `Array<object>` | optional | Network interfaces of device and their states                                              |
| `access_point.ssid`     | `string`        | required | Access Point SSID of device                                                                |
| `access_point.psk`      | `string`        | required | Access Point PSK of device                                                                 |

## Get device linked to equipment

<mark style="color:blue;">`GET`</mark> `https://api.v2.myluxura.com/v2/equipment/:guid/device`

This endpoint will return the equipment's device documents by guid.

#### Path Parameters

| Name | Type   | Description          |
| ---- | ------ | -------------------- |
| guid | string | Guid of the document |

#### Query Parameters

| Name    | Type   | Description                                    |
| ------- | ------ | ---------------------------------------------- |
| company | string | Guid of the company you're acting on behalf of |

#### Headers

| Name          | Type   | Description                          |
| ------------- | ------ | ------------------------------------ |
| Authorization | string | Authentication token (type 'Bearer') |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "_meta": {
    "index": "devices",
    "guid": "<guid>",
    "created": 1615900124750,
    "updated": 1622562386269,
    "removed": 0,
    "expiry": 0,
    "created_by": {
      "host": "myluxura-api",
      "resource": {}
    }
  },
  "app": "myluxura",
  "type": "MYLUXURA_MODULE",
  "version": 1,
  "serial": "ML7E5110000000000",
  "serialnumber": 0,
  "equipment_guid": "<guid>",
  "hardware": {
    "model": "<model>",
    "revision": "<revision>",
    "serial": "<serial>",
    "macAddresses": [
      "eth0@<address>"
    ]
  },
  "software": "myluxura-module@0.0.0",
  "last_ping": 1622562386205,
  "network": {
    "remote_ip": "192.168.0.0",
    "local_ip": [
      "192.168.0.0",
      "10.42.0.1"
    ],
    "interfaces": [
      {
        "interface": "eth0",
        "state": 100,
        "address": "192.168.0.0",
        "address_ipv6": "0000:0000:0000:0000:0000:0000:0000:0000"
      },
      {
        "interface": "wlan0",
        "state": 100,
        "mode": 3,
        "address": "10.42.0.1",
        "address_ipv6": "0000:0000:0000:0000:0000:0000:0000:0000",
        "ssid": "MLM-XXXXXX",
        "strength": 0
      }
    ]
  },
  "access_point": {
    "ssid": "MLM-XXXXXX",
    "psk": "xxxxxxxx"
  }
}
```

{% endtab %}
{% endtabs %}
