11# SoftLayer API Client for Java
22
3- ![ Java CI] ( https://github.com/softlayer/softlayer-java/workflows/Java%20CI /badge.svg )
3+ [ ![ Java CI] ( https://github.com/softlayer/softlayer-java/actions/ workflows/maven.yml /badge.svg )] ( https://github.com/softlayer/softlayer-java/actions/workflows/maven.yml )
44[ ![ Maven Central] ( https://img.shields.io/maven-central/v/com.softlayer.api/softlayer-api-client )] ( https://search.maven.org/artifact/com.softlayer.api/softlayer-api-client )
55[ ![ Javadocs] ( https://www.javadoc.io/badge/com.softlayer.api/softlayer-api-client.svg )] ( https://www.javadoc.io/doc/com.softlayer.api/softlayer-api-client )
66
77## Introduction
88
9- This library provides a JVM client for the [ SoftLayer API] ( http ://sldn.softlayer.com/article/SoftLayer-API-Overview ) . It
9+ This library provides a JVM client for the [ SoftLayer API] ( https ://sldn.softlayer.com/article/getting-started/ ) . It
1010has code generated and compiled via Maven. The client can work with any Java 8+ runtime. It uses the code generation
1111project in ` gen/ ` to generate the service and type related code. Although likely to work in resource-constrained
1212environments (i.e. Android, J2ME, etc), using this is not recommended; Use the
13- [ REST] ( http ://sldn.softlayer.com/article/REST ) API instead.
13+ [ REST] ( https ://sldn.softlayer.com/article/rest/ ) API instead.
1414
1515By default the HTTP client is the Java ` HttpUrlConnection ` and the JSON marshalling is done by
16- [ Gson] ( https://code.google. com/p/ google-gson/ ) . Both of these pieces can be exchanged for alternative implementations
16+ [ Gson] ( https://github. com/google/gson ) . Both of these pieces can be exchanged for alternative implementations
1717(see below).
1818
1919The ` examples/ ` project has sample uses of the API. It can be executed from Maven while inside the ` examples/ ` folder
@@ -40,20 +40,20 @@ additions to the SoftLayer API.
4040<dependency >
4141 <groupId >com.softlayer.api</groupId >
4242 <artifactId >softlayer-api-client</artifactId >
43- <version >0.3.2 </version >
43+ <version >0.3.3 </version >
4444</dependency >
4545```
4646
4747### Gradle
4848
4949``` groovy
50- implementation 'com.softlayer.api:softlayer-api-client:0.3.2 '
50+ implementation 'com.softlayer.api:softlayer-api-client:0.3.3 '
5151```
5252
5353### Kotlin
5454
5555``` kotlin
56- compile(" com.softlayer.api:softlayer-api-client:0.3.2 " )
56+ compile(" com.softlayer.api:softlayer-api-client:0.3.3 " )
5757```
5858
5959### Creating a Client
@@ -74,21 +74,23 @@ ApiClient client = new RestApiClient().withCredentials(myUser, myApiKey);
7474```
7575
7676#### Access Token
77- Information on how to get a temoprary api token can be found on the SLDN [ Authenticating to the SoftLayer API] ( https://sldn.softlayer.com/article/authenticating-softlayer-api/#temp-token ) article.
77+ Information on how to get a temoprary api token can be found on the SLDN
78+ [ Authenticating to the SoftLayer API] ( https://sldn.softlayer.com/article/authenticating-softlayer-api/#temp-token )
79+ article.
7880
7981``` java
8082import com.softlayer.api.* ;
81- ApiClient client = new RestApiClient (). withBearerToken(" qqqqwwwweeeaaassddd.... " );
83+ ApiClient client = new RestApiClient (). withBearerToken(myBearerToken );
8284```
8385
8486If the end point isn't at the normal SoftLayer API, you can provide the prefix to the constructor of the
85- ` RestApiClient ` . By default it is set to the public API endpoint, ` https://api.softlayer.com/rest/v3.1/ ` .
87+ ` RestApiClient ` . By default, it is set to the public API endpoint, ` https://api.softlayer.com/rest/v3.1/ ` .
8688
8789If you are using the classic infrastructure private network, you can communicate with the API over that network by using the service URL instead:
8890
8991``` java
9092ApiClient client = new RestApiClient (RestApiClient . BASE_SERVICE_URL )
91- .withCredentials(" my user " , " my api key " );
93+ .withCredentials(myUser, myApiKey );
9294```
9395
9496### Making API Calls
@@ -170,7 +172,7 @@ for (Vlan vlan : service.getObject().getNetworkVlans()) {
170172
171173All values of a type can be masked upon. If a value represents a primitive or collection of primitives, the same mask
172174it is called on is returned. Otherwise the mask of the other type is given. These translate into SoftLayer's
173- [ string-based object mask format] ( http ://sldn.softlayer.com/article/Object-Masks ) . A string or an instance of a mask
175+ [ string-based object mask format] ( https ://sldn.softlayer.com/article/object-masks/ ) . A string or an instance of a mask
174176can be given directly by calling ` setMask ` on the service. Note, when object masks are added on a service object, they
175177will be sent with every service call unless removed via ` clearMask ` or overwritten via ` withNewMask ` or ` setMask ` .
176178
0 commit comments