# UniFi

> Read UniFi Site Manager hosts, devices, sites, ISP metrics and SD-WAN configurations.

App · 9 actions. Web page: https://docs.lodol.com/docs/integrations/unifi

## Actions

### Get host

Get Host by ID.

**Inputs**

- Id (`id`, text, required): Unique identifier of the host

**Outputs**

- `data` (object): Uni Fi response data.

**Example output**

```json
{
  "data": {
    "data": {
      "hardwareId": "example",
      "id": "example",
      "ipAddress": "example",
      "isBlocked": false,
      "lastConnectionStateChange": "example",
      "latestBackupTime": "example",
      "owner": false,
      "registrationTime": "example",
      "reportedState": {},
      "type": "example",
      "userData": {}
    },
    "httpStatusCode": 1,
    "traceId": "example"
  }
}
```

### Get ISP metrics

Get ISP Metrics.

**Inputs**

- Type (`type`, text, required): Specifies whether metrics are returned using `5m` or `1h` intervals. One of: `5m`, `1h`.
- Begin timestamp (`beginTimestamp`, date and time): The earliest timestamp to retrieve data from (RFC3339 format)
- End timestamp (`endTimestamp`, date and time): The latest timestamp to retrieve data up to (RFC3339 format)
- Duration (`duration`, text): Specifies the time range of metrics to retrieve, starting from when the request is made. Supports `24h` for 5-minute metrics, and `7d` or `30d` for 1-hour metrics. This parameter **cannot** be used with `beginTimestamp` or `endTimestamp`. One of: `24h`, `7d`, `30d`.

**Outputs**

- `data` (object): Uni Fi response data.

**Example output**

```json
{
  "data": {
    "data": [],
    "httpStatusCode": 1,
    "traceId": "example"
  }
}
```

### Get SD-WAN configuration

Get SD-WAN Config by ID.

**Inputs**

- Id (`id`, text, required): Unique identifier of the SD-WAN configuration

**Outputs**

- `data` (object): Uni Fi response data.

**Example output**

```json
{
  "data": {
    "data": {
      "hubs": [],
      "id": "example",
      "name": "example",
      "settings": {
        "hubsInterconnect": false,
        "spokeStandardSettingsEnabled": false,
        "spokeStandardSettingsValues": {
          "primaryWan": "example",
          "wanFailover": false
        },
        "spokeToHubRouting": "custom",
        "spokeToHubTunnelsMode": "maxResiliency",
        "spokesAutoScaleAndNatEnabled": false,
        "spokesAutoScaleAndNatRange": "example",
        "spokesIsolate": false
      },
      "spokes": [],
      "type": "sdwan-hbsp",
      "variant": "distributed"
    },
    "httpStatusCode": 1,
    "traceId": "example"
  }
}
```

### Get SD-WAN configuration status

Get SD-WAN Config Status.

**Inputs**

- Id (`id`, text, required): Unique identifier of the SD-WAN configuration

**Outputs**

- `data` (object): Uni Fi response data.

**Example output**

```json
{
  "data": {
    "data": {
      "errors": [],
      "fingerprint": "example",
      "generateStatus": "OK",
      "hubs": [],
      "id": "example",
      "lastGeneratedAt": 1,
      "spokes": [],
      "updatedAt": 1,
      "warnings": []
    },
    "httpStatusCode": 1,
    "traceId": "example"
  }
}
```

### List devices

List Devices.

**Inputs**

- Host IDs[] (`hostIds`, list): List of host IDs to filter the results
- Time (`time`, date and time): Last processed timestamp of devices in RFC3339 format
- Page size (`pageSize`, number): Number of records in a page. From 1 to 100.
- Next token (`nextToken`, text): Token for pagination to retrieve the next set of results

**Outputs**

- `data` (object): Uni Fi response data.

**Example output**

```json
{
  "data": {
    "code": {},
    "data": [],
    "httpStatusCode": 1,
    "nextToken": "example",
    "traceId": "example"
  }
}
```

### List hosts

List Hosts.

**Inputs**

- Page size (`pageSize`, number): Number of records in a page. From 1 to 100.
- Next token (`nextToken`, text): Token for pagination to retrieve the next set of results

**Outputs**

- `data` (object): Uni Fi response data.

**Example output**

```json
{
  "data": {
    "code": {},
    "data": [],
    "httpStatusCode": 1,
    "nextToken": "example",
    "traceId": "example"
  }
}
```

### List SD-WAN configurations

List SD-WAN Configs.

**Inputs**: None.

**Outputs**

- `data` (object): Uni Fi response data.

**Example output**

```json
{
  "data": {
    "data": [],
    "httpStatusCode": 1,
    "traceId": "example"
  }
}
```

### List sites

List Sites.

**Inputs**

- Page size (`pageSize`, number): Number of records in a page. From 1 to 100.
- Next token (`nextToken`, text): Token for pagination to retrieve the next set of results

**Outputs**

- `data` (object): Uni Fi response data.

**Example output**

```json
{
  "data": {
    "code": {},
    "data": [],
    "httpStatusCode": 1,
    "nextToken": "example",
    "traceId": "example"
  }
}
```

### Query ISP metrics

Query ISP Metrics.

**Inputs**

- Type (`type`, text, required): Specifies whether metrics are returned using `5m` or `1h` intervals. One of: `5m`, `1h`.
- Site (`site_id`, text, required): Choose the site whose ISP metrics you want.
- Start (`beginTimestamp`, date and time): Start of the metric range.
- End (`endTimestamp`, date and time): End of the metric range.

**Outputs**

- `data` (object): Uni Fi response data.

**Example output**

```json
{
  "data": {
    "data": {
      "message": "example",
      "metrics": [],
      "status": "example"
    },
    "httpStatusCode": 1,
    "traceId": "example"
  }
}
```
