# hetz-js

> library for the hetzner-cloud api

Latest version **1.1.2** (published 2020-03-17) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install hetz-js
pnpm add hetz-js
yarn add hetz-js
bun add hetz-js
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2020-03-17 |
| First published | 2020-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Marcel Drinkuth |
| Maintainers | unfield |
| Keywords | API, Hetzner, Cloud, Server |

## Links

- npm: https://www.npmjs.com/package/hetz-js
- Repository: https://github.com/Unfield/HetzJS
- Homepage: https://github.com/Unfield/HetzJS#readme
- Issues: https://github.com/Unfield/HetzJS/issues
- npm.io page: https://npm.io/package/hetz-js

## Dependencies (1)

- [request](https://npm.io/package/request.md) ^2.88.0

## Recent versions

- 1.1.2 (latest) — 2020-03-17
- 1.1.1 — 2020-02-25
- 1.0.2 — 2020-02-06

## README

# Hetz-JS

Hetz-JS is an Node.js library that communicates with the Hetzner-Cloud API to make things even more easy for you.

## Installation

You can install **Hetz-JS** with **NPM**

> npm install hetz-js

After you installed **Hetz-JS** you need to include it in your **Project**

    var HetzJS = require('hetz-js');

now you just need to register you **API-Key**. You can get an API-Key at [https://console.hetzner.cloud/](https://console.hetzner.cloud/)

    HetzJS.authenticate(YOUR API TOKEN);

## Usage

### Create

creates a Server

for ServerTypes visit Hetzner.com and look out for the prices-tab

    HetzJS.server().create({name: "YOUR SERVERNAME", server_type: "cx11", image: "ubuntu-18.04"}, (result) => {
        console.log(result);
    });

there are more buildData-Parameters for full documentation please visit [https://docs.hetzner.cloud/#servers-create-a-server](https://docs.hetzner.cloud/#servers-create-a-server)

### Delete

deletes the Server

    HetzJS.server("SERVERID").delete((result) => {
        console.log(result);
    });

### PowerOn

powers the Server on

    HetzJS.server("SERVERID").poweron((result) => {
        console.log(result);
    });

### Shutdown

powers the Server down

    HetzJS.server("SERVERID").shutdown((result) => {
        console.log(result);
    });

### Reboot

reboots the Server

    HetzJS.server("SERVERID").reboot((result) => {
        console.log(result);
    });

### ChangeName

changes the Servername visible in the Hetzner Interface

    HetzJS.server("SERVERID").changeName("SERVERNAME",(result) => {
        console.log(result);
    });

### reset Rootpassword

resets the Password for the Rootuser

    HetzJS.server("SERVERID").resetRootPassword((result) => {
        console.log(result);
    });

### Get

returns all Informations about the Server

    HetzJS.server("SERVERID").get((result) => {
        console.log(result);
    });

### Get All

returns all Servers

    HetzJS.server().getAll((result) => {
        console.log(result);
    });

### enable Rescue

enables the Rescue-Mode for the Server

    HetzJS.server("SERVERID").enableRescue((result) => {
        console.log(result);
    });

### disable Rescue

disables the Rescue-Mode for the Server

    HetzJS.server("SERVERID").disableRescue((result) => {
        console.log(result);
    });

### request Console

returns the Console

    HetzJS.server("SERVERID").requestConsole((result) => {
        console.log(result);
    });

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