Get the 1&1 Java Cloud Server SDK

Table of Contents

Introduction

The 1&1 Java SDK is a Java library designed for interaction with the 1&1 Cloud platform over the Cloud Server REST API. This allows you to automate many of the tasks which are otherwise available through the Cloud Panel UI.

Features

The 1&1 Java SDK allows you to list and retrieve information about servers, including their hardware, IP addresses, load balancers, private networks, and more. You can create and delete servers, as well as reconfigure them. Hard drives, virtual DVD units, firewall policies, load balancers, and IP addresses can all be added or removed through the API.

The API also allows you to manage server operations. Servers can be added to or removed from private networks. Snapshots can be created, restored, or removed. Images can be created, updated, and deleted. Shared storages, firewall policies, load balancers, IP addresses, private networks, VPNs, monitoring policies, logs, usage, and appliances can all be managed through the API. Users and roles can be added, deleted, and managed, as well.

Supported Versions

The 1&1 Java SDK is designed for Java 8.

Getting Started

Before you begin you will need to have signed up for a 1&1 account. The credentials you create during sign-up will be used to authenticate against the API.

You will also need to install the Java language tools. Find the install package and instructions on the official Oracle Java website. Make sure to follow the setup instructions.

Installation

The official Java library is available from the 1&1 GitHub account found here.

Authentication

Set the authentication token and create the API client:

oneandoneApi.setToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

locate the OneAndOneAPIBase class and inside it locate the urlBase and set it to the URL as follows

private String urlBase = "https://url";

Or you can use the root\config.properties file and set both the URL and the token

apiurl=https://url
apikey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Comments