Skip to content

Commit a566e70

Browse files
committed
feat(automation): onboard automation service
1 parent 768db4c commit a566e70

58 files changed

Lines changed: 20519 additions & 4 deletions

File tree

Some content is hidden

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

services/alb/src/main/java/cloud/stackit/sdk/alb/v2api/model/LoadbalancerOptionAccessControl.java

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,22 @@
3131
import java.util.Map;
3232
import java.util.Objects;
3333

34-
/** Use this option to limit the IP ranges that can use the Application Load Balancer. */
34+
/**
35+
* Use this option to limit the IP ranges that can use the Application Load Balancer. Only one of
36+
* `allowed_source_ranges` or `ip_block_list_name` may be set at the same time.
37+
*/
3538
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0")
3639
public class LoadbalancerOptionAccessControl {
3740
public static final String SERIALIZED_NAME_ALLOWED_SOURCE_RANGES = "allowedSourceRanges";
3841

3942
@SerializedName(SERIALIZED_NAME_ALLOWED_SOURCE_RANGES)
4043
@javax.annotation.Nullable private List<String> allowedSourceRanges = new ArrayList<>();
4144

45+
public static final String SERIALIZED_NAME_IP_BLOCK_LIST_NAME = "ipBlockListName";
46+
47+
@SerializedName(SERIALIZED_NAME_IP_BLOCK_LIST_NAME)
48+
@javax.annotation.Nullable private String ipBlockListName;
49+
4250
public LoadbalancerOptionAccessControl() {}
4351

4452
public LoadbalancerOptionAccessControl allowedSourceRanges(
@@ -57,7 +65,8 @@ public LoadbalancerOptionAccessControl addAllowedSourceRangesItem(
5765
}
5866

5967
/**
60-
* Application Load Balancer is accessible only from an IP address in this range
68+
* Application Load Balancer is accessible only from an IP address in this range. Mutually
69+
* exclusive with &#x60;ipBlockListName&#x60;.
6170
*
6271
* @return allowedSourceRanges
6372
*/
@@ -70,6 +79,27 @@ public void setAllowedSourceRanges(
7079
this.allowedSourceRanges = allowedSourceRanges;
7180
}
7281

82+
public LoadbalancerOptionAccessControl ipBlockListName(
83+
@javax.annotation.Nullable String ipBlockListName) {
84+
this.ipBlockListName = ipBlockListName;
85+
return this;
86+
}
87+
88+
/**
89+
* Reference to an IP block list by name. Traffic originating from any IP in the referenced list
90+
* is denied access to the Application Load Balancer. See \&quot;IP Lists API\&quot; for how to
91+
* manage IP block lists. Mutually exclusive with &#x60;allowedSourceRanges&#x60;.
92+
*
93+
* @return ipBlockListName
94+
*/
95+
@javax.annotation.Nullable public String getIpBlockListName() {
96+
return ipBlockListName;
97+
}
98+
99+
public void setIpBlockListName(@javax.annotation.Nullable String ipBlockListName) {
100+
this.ipBlockListName = ipBlockListName;
101+
}
102+
73103
/**
74104
* A container for additional, undeclared properties. This is a holder for any undeclared
75105
* properties as specified with the 'additionalProperties' keyword in the OAS document.
@@ -127,14 +157,16 @@ public boolean equals(Object o) {
127157
return Objects.equals(
128158
this.allowedSourceRanges,
129159
loadbalancerOptionAccessControl.allowedSourceRanges)
160+
&& Objects.equals(
161+
this.ipBlockListName, loadbalancerOptionAccessControl.ipBlockListName)
130162
&& Objects.equals(
131163
this.additionalProperties,
132164
loadbalancerOptionAccessControl.additionalProperties);
133165
}
134166

135167
@Override
136168
public int hashCode() {
137-
return Objects.hash(allowedSourceRanges, additionalProperties);
169+
return Objects.hash(allowedSourceRanges, ipBlockListName, additionalProperties);
138170
}
139171

140172
@Override
@@ -144,6 +176,7 @@ public String toString() {
144176
sb.append(" allowedSourceRanges: ")
145177
.append(toIndentedString(allowedSourceRanges))
146178
.append("\n");
179+
sb.append(" ipBlockListName: ").append(toIndentedString(ipBlockListName)).append("\n");
147180
sb.append(" additionalProperties: ")
148181
.append(toIndentedString(additionalProperties))
149182
.append("\n");
@@ -167,7 +200,8 @@ private String toIndentedString(Object o) {
167200

168201
static {
169202
// a set of all properties/fields (JSON key names)
170-
openapiFields = new HashSet<String>(Arrays.asList("allowedSourceRanges"));
203+
openapiFields =
204+
new HashSet<String>(Arrays.asList("allowedSourceRanges", "ipBlockListName"));
171205

172206
// a set of required properties/fields (JSON key names)
173207
openapiRequiredFields = new HashSet<String>(0);
@@ -202,6 +236,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
202236
"Expected the field `allowedSourceRanges` to be an array in the JSON string but got `%s`",
203237
jsonObj.get("allowedSourceRanges").toString()));
204238
}
239+
if ((jsonObj.get("ipBlockListName") != null && !jsonObj.get("ipBlockListName").isJsonNull())
240+
&& !jsonObj.get("ipBlockListName").isJsonPrimitive()) {
241+
throw new IllegalArgumentException(
242+
String.format(
243+
java.util.Locale.ROOT,
244+
"Expected the field `ipBlockListName` to be a primitive type in the JSON string but got `%s`",
245+
jsonObj.get("ipBlockListName").toString()));
246+
}
205247
}
206248

207249
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

services/automation/README.md

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

services/automation/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.8'
14+
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.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 Automation Service API
3+
* API endpoints for automation management .
4+
*
5+
* The version of the OpenAPI document: 1beta.0
6+
* Contact: support@stackit.de
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.automation.v1betaapi;
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)