Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Release (2025-MM-DD)
- `loadbalancer`: [v0.1.0](services/loadbalancer/CHANGELOG.md#v010)
- Initial onboarding of STACKIT Java SDK for Load balancer service
- `objectstorage`: [v0.1.0](services/objectstorage/CHANGELOG.md#v010)
- Initial onboarding of STACKIT Java SDK for Object storage service

Expand Down
6 changes: 6 additions & 0 deletions examples/loadbalancer/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies {
implementation project (':services:loadbalancer')
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
}

ext.mainClassName = 'cloud.stackit.sdk.loadbalancer.examples.LoadBalancerExample'

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions services/loadbalancer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## v0.1.0
- Initial onboarding of STACKIT Java SDK for Load balancer service
87 changes: 87 additions & 0 deletions services/loadbalancer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# STACKIT Java SDK for STACKIT Load Balancer API

- API version: 2.0.0

This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes.

For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.


This package is part of the STACKIT Java SDK. For additional information, please visit the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-java) of the SDK.

## Installation from Maven Central (recommended)

The release artifacts for this SDK submodule are available on [Maven Central](https://central.sonatype.com/artifact/cloud.stackit.sdk/loadbalancer).

### Maven users

Add this dependency to your project's POM:

```xml
<dependency>
<groupId>cloud.stackit.sdk</groupId>
<artifactId>loadbalancer</artifactId>
<version><SDK_VERSION></version>
<scope>compile</scope>
</dependency>
```

### Gradle users

Add this dependency to your project's build file:

```groovy
repositories {
mavenCentral()
}

dependencies {
implementation "cloud.stackit.sdk:loadbalancer:<SDK_VERSION>"
}
```

## Installation from local build

Building the API client library requires:
1. Java SDK (version 11 to 21 should be supported) installed on your system

To install the API client library to your local Maven repository, simply execute:

```shell
./gradlew services:loadbalancer:publishToMavenLocal
```

### Maven users

Add this dependency to your project's POM:

```xml
<dependency>
<groupId>cloud.stackit.sdk</groupId>
<artifactId>loadbalancer</artifactId>
<version><SDK_VERSION></version>
<scope>compile</scope>
</dependency>
```

### Gradle users

Add this dependency to your project's build file:

```groovy
repositories {
mavenLocal()
}

dependencies {
implementation "cloud.stackit.sdk:loadbalancer:<SDK_VERSION>"
}
```

## Getting Started

See the [loadbalancer examples](https://github.com/stackitcloud/stackit-sdk-java/tree/main/examples/loadbalancer/src/main/java/cloud/stackit/sdk/loadbalancer/examples).

## Recommendation

It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
1 change: 1 addition & 0 deletions services/loadbalancer/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
19 changes: 19 additions & 0 deletions services/loadbalancer/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

ext {
jakarta_annotation_version = "1.3.5"
}

dependencies {
implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0'
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.mockito:mockito-core:3.12.4'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* STACKIT Load Balancer API
* This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
*
* The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package cloud.stackit.sdk.loadbalancer;

import cloud.stackit.sdk.core.exception.ApiException;
import java.util.List;
import java.util.Map;

/**
* Callback for asynchronous API call.
*
* @param <T> The return type
*/
public interface ApiCallback<T> {
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);

/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);

/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);

/**
* This is called when the API download processing.
*
* @param bytesRead bytes Read
* @param contentLength content length of the response
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
}
Loading