Skip to content

Commit 4429ab6

Browse files
Generate loadbalancer
1 parent dd5427f commit 4429ab6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+16539
-0
lines changed

services/loadbalancer/README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# STACKIT Java SDK for STACKIT Load Balancer API
2+
3+
- API version: 2.0.0
4+
5+
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.
6+
7+
For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
8+
9+
10+
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.
11+
12+
## Installation from Maven Central (recommended)
13+
14+
The release artifacts for this SDK submodule are available on [Maven Central](https://central.sonatype.com/artifact/cloud.stackit.sdk/loadbalancer).
15+
16+
### Maven users
17+
18+
Add this dependency to your project's POM:
19+
20+
```xml
21+
<dependency>
22+
<groupId>cloud.stackit.sdk</groupId>
23+
<artifactId>loadbalancer</artifactId>
24+
<version><SDK_VERSION></version>
25+
<scope>compile</scope>
26+
</dependency>
27+
```
28+
29+
### Gradle users
30+
31+
Add this dependency to your project's build file:
32+
33+
```groovy
34+
repositories {
35+
mavenCentral()
36+
}
37+
38+
dependencies {
39+
implementation "cloud.stackit.sdk:loadbalancer:<SDK_VERSION>"
40+
}
41+
```
42+
43+
## Installation from local build
44+
45+
Building the API client library requires:
46+
1. Java SDK (version 11 to 21 should be supported) installed on your system
47+
48+
To install the API client library to your local Maven repository, simply execute:
49+
50+
```shell
51+
./gradlew services:loadbalancer:publishToMavenLocal
52+
```
53+
54+
### Maven users
55+
56+
Add this dependency to your project's POM:
57+
58+
```xml
59+
<dependency>
60+
<groupId>cloud.stackit.sdk</groupId>
61+
<artifactId>loadbalancer</artifactId>
62+
<version><SDK_VERSION></version>
63+
<scope>compile</scope>
64+
</dependency>
65+
```
66+
67+
### Gradle users
68+
69+
Add this dependency to your project's build file:
70+
71+
```groovy
72+
repositories {
73+
mavenLocal()
74+
}
75+
76+
dependencies {
77+
implementation "cloud.stackit.sdk:loadbalancer:<SDK_VERSION>"
78+
}
79+
```
80+
81+
## Getting Started
82+
83+
See the [loadbalancer examples](https://github.com/stackitcloud/stackit-sdk-java/tree/main/examples/loadbalancer/src/main/java/cloud/stackit/sdk/loadbalancer/examples).
84+
85+
## Recommendation
86+
87+
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.

services/loadbalancer/build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
ext {
3+
jakarta_annotation_version = "1.3.5"
4+
}
5+
6+
dependencies {
7+
implementation "com.google.code.findbugs:jsr305:3.0.2"
8+
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
9+
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
10+
implementation 'com.google.code.gson:gson:2.9.1'
11+
implementation 'io.gsonfire:gson-fire:1.9.0'
12+
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
13+
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
14+
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0'
15+
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
16+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
17+
testImplementation 'org.mockito:mockito-core:3.12.4'
18+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
19+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* STACKIT Load Balancer API
3+
* 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.
4+
*
5+
* The version of the OpenAPI document: 2.0.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
package cloud.stackit.sdk.loadbalancer;
14+
15+
import cloud.stackit.sdk.core.exception.ApiException;
16+
import java.util.List;
17+
import java.util.Map;
18+
19+
/**
20+
* Callback for asynchronous API call.
21+
*
22+
* @param <T> The return type
23+
*/
24+
public interface ApiCallback<T> {
25+
/**
26+
* This is called when the API call fails.
27+
*
28+
* @param e The exception causing the failure
29+
* @param statusCode Status code of the response if available, otherwise it would be 0
30+
* @param responseHeaders Headers of the response if available, otherwise it would be null
31+
*/
32+
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);
33+
34+
/**
35+
* This is called when the API call succeeded.
36+
*
37+
* @param result The result deserialized from response
38+
* @param statusCode Status code of the response
39+
* @param responseHeaders Headers of the response
40+
*/
41+
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);
42+
43+
/**
44+
* This is called when the API upload processing.
45+
*
46+
* @param bytesWritten bytes Written
47+
* @param contentLength content length of request body
48+
* @param done write end
49+
*/
50+
void onUploadProgress(long bytesWritten, long contentLength, boolean done);
51+
52+
/**
53+
* This is called when the API download processing.
54+
*
55+
* @param bytesRead bytes Read
56+
* @param contentLength content length of the response
57+
* @param done Read end
58+
*/
59+
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
60+
}

0 commit comments

Comments
 (0)