Menu

Ping, Power & Processors: Announcing our Acquisition by Equinix. Read more on our blog.

Java

Packet Java API Client Banner

Welcome to Packet Java API Client.

Lightweight Java client library for accessing Packet REST APIs with project based (JVM hosted languages) on Java, Groovy, Scala, Clojure, etc.

For more information about our API endpoints, please visit our API Documentation.

Installation

Packet API Java Client is available in Maven Central Repo.

Maven dependency

<dependency>
    <groupId>net.packet</groupId>
    <artifactId>java-client</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle/Grails dependency

compile 'net.packet:java-client:1.0.0'

Groovy Grape

@Grapes(
@Grab(group='net.packet', module='java-client', version='1.0.0')
)

Scala SBT

libraryDependencies += "net.packet" % "java-client" % "1.0.0"

Note: For Android projects, kindly include the httpclient-android library explicitly in your project dependencies.

Usage

// Passing authToken and version
Packet apiClient = new PacketClient("authToken", "1");

// Passing authToken, version and HTTP Client. Create a http client with custom settings
CloseableHttpClient httpClient = HttpClients.createDefault();
Packet apiClient = new PacketClient("authToken", "1", httpClient);

Routes & Methods

For more information on available router and methods, please visit Packet Java CLI public repo.