# synlink-pdu

> SynLink HTTP(S) API Wrapper

Latest version **1.1.2** (published 2021-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install synlink-pdu
pnpm add synlink-pdu
yarn add synlink-pdu
bun add synlink-pdu
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2021-11-17 |
| First published | 2021-11-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Synaccess Support |
| Maintainers | synaccess-llc |
| Keywords | pdu, api, synlink, synaccess |

## Links

- npm: https://www.npmjs.com/package/synlink-pdu
- Repository: https://github.com/synaccess/SynLink-PDU-NodeJS-API
- Homepage: https://github.com/synaccess/SynLink-PDU-NodeJS-API#readme
- Issues: https://github.com/synaccess/SynLink-PDU-NodeJS-API/issues
- npm.io page: https://npm.io/package/synlink-pdu

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.24.0

## Recent versions

- 1.1.2 (latest) — 2021-11-17
- 1.1.1 — 2021-11-17
- 1.1.0 — 2021-11-17
- 1.0.0 — 2021-11-17

## README

# NodeJS SynLink PDU API Wrapper

The SynLink PDU API Wrapper for NodeJS provides convenient access to the SynLInk HTTP API from applications written in server-side JavaScript.

## Documentation

See the [SynLink API Documentation](https://synaccess.com/support/webapi) 

## Requirements

Node 8, 10 or higher

## Installation
Install the package with: 

```sh
npm install synlink-pdu --save
# or
yarn add synlink-pdu
```

## Usage

Each request requires a `pduConfiguration` object:

[How to generate a PAT (Personal Access Token)](https://synaccess.com/support/webapi#personal-access-token-based)

```js
const SynLinkPDU = require("synlink-pdu");
const pduConfiguration = {
  ip: "http://192.168.1.100",
  pat: "mr0dGGdFKKyBzbIgBlA"
};

SynLinkPDU.get_outlets(pduConfiguration, (error, data) => {
  if (error) {
    // error occurred:
    console.log(error);
  } else {
    console.log(data);
  }
})

```

### Get Device Information

[Device API Information](https://synaccess.com/support/webapi#get-device-info)

```js
SynLinkPDU.get_device(pduConfiguration, (error, data) => {
  if (error) {
    // error occurred:
    console.log(error);
  } else {
    console.log(data);
  }
})
```

### Get Outlet Information
[Outlet API Information](https://synaccess.com/support/webapi#outlets)
```js
SynLinkPDU.get_outlets(pduConfiguration, (error, data) => {
  if (error) {
    // error occurred:
    console.log(error);
  } else {
    console.log(data);
  }
})
```

## Get Circuit/Bank Information
[Bank API Information](https://synaccess.com/support/webapi#banks)
```js
SynLinkPDU.get_banks(pduConfiguration, (error, data) => {
  if (error) {
    // error occurred:
    console.log(error);
  } else {
    console.log(data);
  }
})
```

## Get Inlet Information
[Inlet API Information](https://synaccess.com/support/webapi#inlets)
```js
SynLinkPDU.get_inlets(pduConfiguration, (error, data) => {
  if (error) {
    // error occurred:
    console.log(error);
  } else {
    console.log(data);
  }
})
```

## Modify Outlet Information
[Modify Outlet API Information](https://synaccess.com/support/webapi#modify-outlet)
```js
SynLinkPDU.set_outlets(pduConfiguration, {
  id: "1-2001399", // can be outlet ID or outlet index
  state: "ON"
},
(error, data) => {
  if (error) {
    // error occurred:
    console.log(error);
  } else {
    console.log(data);
  }
})
```

---
_Source: https://npm.io/package/synlink-pdu · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
