Skip to content
Open
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
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## Release (2025-xx-xx)
- `iaas`: [v1.0.0](services/iaas/CHANGELOG.md#v100)
- **Breaking Change:** The region must be passed as a parameter to any region-specific request.
- **Feature:** Add new methods to manage routing tables: `addRoutingTableToArea`, `deleteRoutingTableFromArea`, `getRoutingTableOfArea`, `listRoutingTablesOfArea`, `updateRoutingTableOfArea`
- **Feature:** Add new methods to manage routes in routing tables: `addRoutesToRoutingTable`, `deleteRouteFromRoutingTable`, `getRouteOfRoutingTable`, `listRoutesOfRoutingTable`, `updateRouteOfRoutingTable`
- **Breaking Change:** Add new method to manage network area regions: `createNetworkAreaRegion`, `deleteNetworkAreaRegion`, `getNetworkAreaRegion`, `listNetworkAreaRegions`, `updateNetworkAreaRegion`
- **Feature:** Add new field `Encrypted` to `Backup` model, which indicates if a backup is encrypted
- **Feature:** Add new field `ImportProgress` to `Image` model, which indicates the import progress of an image
- **Breaking Change:** Remove field `addressFamily` in `CreateNetworkAreaPayload` model
- **Breaking Change:** `Network` model has changed:
- Rename `networkId` to `id`
- Rename `state` to `status`
- Move fields `gateway`, `nameservers`, `prefixes` and `publicIp` to new model `NetworkIPv4`, and can be accessed in the new field `ipv4`
- Move fields `gatewayv6`, `nameserversv6` and `prefixesv6` to new model `NetworkIPv6`, and can be accessed in the new field `ipv6`
- Add new field `routingTabledId`
- **Breaking Change:** `NetworkArea` model has changed:
- Rename `areaId` to `id`
- Remove field `ipv4`
- **Breaking Change:** Rename `networkRangeId` to `id` in `NetworkRange` model
- **Breaking Change:** `CreateServerPayload` model has changed:
- Model `CreateServerPayloadBootVolume` of `BootVolume` property changed to `ServerBootVolume`
- Property `Networking` in `CreateServerPayload` is required now

## Release (2025-10-29)
- `core`:
- [v0.4.0](core/CHANGELOG.md#v040)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ public static void main(String[] args) throws IOException {
}
UUID projectId = UUID.fromString(projectIdString);

// specify which region should be queried
String region = "eu01";

try {
/* list all servers */
ServerListResponse servers = iaasApi.listServers(projectId, false, null);
ServerListResponse servers = iaasApi.listServers(projectId, region, false, null);
System.out.println("\nAvailable servers: ");
for (Server server : servers.getItems()) {
System.out.println("* " + server.getId() + " | " + server.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public static void main(String[] args) throws IOException {
}
UUID projectId = UUID.fromString(projectIdString);

String region = "eu01";

try {
/*
* ///////////////////////////////////////////////////////
Expand All @@ -49,38 +51,40 @@ public static void main(String[] args) throws IOException {
Network newNetwork =
iaasApi.createNetwork(
projectId,
region,
new CreateNetworkPayload()
.name("java-sdk-example-network-01")
.dhcp(true)
.routed(false)
.labels(Collections.singletonMap("some-network-label", "bar"))
.addressFamily(
new CreateNetworkAddressFamily()
.ipv4(
new CreateNetworkIPv4Body()
.addNameserversItem(
"8.8.8.8"))));

.ipv4(
new CreateNetworkIPv4(
new CreateNetworkIPv4WithPrefixLength()
.addNameserversItem("8.8.8.8")
.prefixLength(24L))));
/* update the network we just created */
iaasApi.partialUpdateNetwork(
projectId,
newNetwork.getNetworkId(),
region,
newNetwork.getId(),
new PartialUpdateNetworkPayload()
.dhcp(false)
.labels(Collections.singletonMap("some-network-label", "bar-updated")));

/* fetch the network we just created */
Network fetchedNetwork = iaasApi.getNetwork(projectId, newNetwork.getNetworkId());
Network fetchedNetwork = iaasApi.getNetwork(projectId, region, newNetwork.getId());
System.out.println("\nFetched network: ");
System.out.println("* Network name: " + fetchedNetwork.getName());
System.out.println("* Id: " + fetchedNetwork.getNetworkId());
System.out.println("* Id: " + fetchedNetwork.getId());
System.out.println(
"* DHCP: " + (Boolean.TRUE.equals(fetchedNetwork.getDhcp()) ? "YES" : "NO"));
System.out.println("* Gateway: " + fetchedNetwork.getGateway());
System.out.println("* Public IP: " + fetchedNetwork.getPublicIp());
if (fetchedNetwork.getIpv4() != null) {
System.out.println("* Gateway: " + fetchedNetwork.getIpv4().getGateway());
System.out.println("* Public IP: " + fetchedNetwork.getIpv4().getPublicIp());
}

/* list all available networks in the project */
NetworkListResponse networks = iaasApi.listNetworks(projectId, null);
NetworkListResponse networks = iaasApi.listNetworks(projectId, region, null);
System.out.println("\nAvailable networks: ");
for (Network network : networks.getItems()) {
System.out.println("* " + network.getName());
Expand All @@ -93,7 +97,7 @@ public static void main(String[] args) throws IOException {
* */

/* list all available images */
ImageListResponse images = iaasApi.listImages(projectId, false, null);
ImageListResponse images = iaasApi.listImages(projectId, region, false, null);
System.out.println("\nAvailable images: ");
for (Image image : images.getItems()) {
System.out.println(image.getId() + " | " + image.getName());
Expand All @@ -105,7 +109,7 @@ public static void main(String[] args) throws IOException {
.get(0)
.getId(); // we just use a random image id in our example
assert imageId != null;
Image fetchedImage = iaasApi.getImage(projectId, imageId);
Image fetchedImage = iaasApi.getImage(projectId, region, imageId);
System.out.println("\nFetched image:");
System.out.println("* Image name: " + fetchedImage.getName());
System.out.println("* Image id: " + fetchedImage.getId());
Expand Down Expand Up @@ -160,15 +164,17 @@ public static void main(String[] args) throws IOException {
* */

/* list all available machine types */
MachineTypeListResponse machineTypes = iaasApi.listMachineTypes(projectId, null);
MachineTypeListResponse machineTypes =
iaasApi.listMachineTypes(projectId, region, null);
System.out.println("\nAvailable machine types: ");
for (MachineType machineType : machineTypes.getItems()) {
System.out.println("* " + machineType.getName());
}

/* fetch details about a machine type */
MachineType fetchedMachineType =
iaasApi.getMachineType(projectId, machineTypes.getItems().get(0).getName());
iaasApi.getMachineType(
projectId, region, machineTypes.getItems().get(0).getName());
System.out.println("\nFetched machine type: ");
System.out.println("* Machine type name: " + fetchedMachineType.getName());
System.out.println("* Description: " + fetchedMachineType.getDescription());
Expand All @@ -187,6 +193,7 @@ public static void main(String[] args) throws IOException {
Server newServer =
iaasApi.createServer(
projectId,
region,
new CreateServerPayload()
.name("java-sdk-example-server-01")
.machineType("t2i.1")
Expand All @@ -196,37 +203,38 @@ public static void main(String[] args) throws IOException {
.keypairName(newKeypair.getName())
// add the server to the network we created above
.networking(
new CreateServerPayloadNetworking(
new CreateServerPayloadAllOfNetworking(
new CreateServerNetworking()
.networkId(
newNetwork.getNetworkId()))));
.networkId(newNetwork.getId()))));
assert newServer.getId() != null;

/* wait for the server creation to complete */
UUID serverId = newServer.getId();
assert serverId != null;
while (Objects.equals(
iaasApi.getServer(projectId, serverId, false).getStatus(), "CREATING")) {
iaasApi.getServer(projectId, region, serverId, false).getStatus(),
"CREATING")) {
System.out.println("Waiting for server creation to complete ...");
TimeUnit.SECONDS.sleep(5);
}

/* update the server we just created */
iaasApi.updateServer(
projectId,
region,
newServer.getId(),
new UpdateServerPayload()
.labels(Collections.singletonMap("foo", "bar-updated")));

/* list all servers */
ServerListResponse servers = iaasApi.listServers(projectId, false, null);
ServerListResponse servers = iaasApi.listServers(projectId, region, false, null);
System.out.println("\nAvailable servers: ");
for (Server server : servers.getItems()) {
System.out.println("* " + server.getId() + " | " + server.getName());
}

/* fetch the server we just created */
Server fetchedServer = iaasApi.getServer(projectId, serverId, false);
Server fetchedServer = iaasApi.getServer(projectId, region, serverId, false);
System.out.println("\nFetched server:");
System.out.println("* Name: " + fetchedServer.getName());
System.out.println("* Id: " + fetchedServer.getId());
Expand All @@ -239,25 +247,27 @@ public static void main(String[] args) throws IOException {
System.out.println("* Launched at: " + fetchedServer.getLaunchedAt());

/* stop the server we just created */
iaasApi.stopServer(projectId, serverId);
iaasApi.stopServer(projectId, region, serverId);
/* wait for the server to stop */
while (!Objects.equals(
iaasApi.getServer(projectId, serverId, false).getPowerStatus(), "STOPPED")) {
iaasApi.getServer(projectId, region, serverId, false).getPowerStatus(),
"STOPPED")) {
System.out.println("Waiting for server " + serverId + " to stop...");
TimeUnit.SECONDS.sleep(5);
}

/* boot the server we just created */
iaasApi.startServer(projectId, serverId);
iaasApi.startServer(projectId, region, serverId);
/* wait for the server to boot */
while (!Objects.equals(
iaasApi.getServer(projectId, serverId, false).getPowerStatus(), "RUNNING")) {
iaasApi.getServer(projectId, region, serverId, false).getPowerStatus(),
"RUNNING")) {
System.out.println("Waiting for server " + serverId + " to boot...");
TimeUnit.SECONDS.sleep(5);
}

/* reboot the server we just created */
iaasApi.rebootServer(projectId, serverId, null);
iaasApi.rebootServer(projectId, region, serverId, null);

/*
* ///////////////////////////////////////////////////////
Expand All @@ -266,13 +276,13 @@ public static void main(String[] args) throws IOException {
* */

/* delete the server we just created */
iaasApi.deleteServer(projectId, serverId);
iaasApi.deleteServer(projectId, region, serverId);
System.out.println("Deleted server: " + serverId);

/* wait for server deletion to complete */
while (true) {
try {
iaasApi.getServer(projectId, serverId, false);
iaasApi.getServer(projectId, region, serverId, false);
System.out.println("Waiting for server deletion to complete...");
TimeUnit.SECONDS.sleep(5);
} catch (ApiException e) {
Expand All @@ -287,8 +297,8 @@ public static void main(String[] args) throws IOException {
System.out.println("Deleted key pair: " + newKeypair.getName());

/* delete the network we just created */
iaasApi.deleteNetwork(projectId, newNetwork.getNetworkId());
System.out.println("Deleted network: " + newNetwork.getNetworkId());
iaasApi.deleteNetwork(projectId, region, newNetwork.getId());
System.out.println("Deleted network: " + newNetwork.getId());

} catch (ApiException | InterruptedException e) {
throw new RuntimeException(e);
Expand Down
22 changes: 22 additions & 0 deletions services/iaas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## v1.0.0
- **Breaking Change:** The region must be passed as a parameter to any region-specific request.
- **Feature:** Add new methods to manage routing tables: `addRoutingTableToArea`, `deleteRoutingTableFromArea`, `getRoutingTableOfArea`, `listRoutingTablesOfArea`, `updateRoutingTableOfArea`
- **Feature:** Add new methods to manage routes in routing tables: `addRoutesToRoutingTable`, `deleteRouteFromRoutingTable`, `getRouteOfRoutingTable`, `listRoutesOfRoutingTable`, `updateRouteOfRoutingTable`
- **Breaking Change:** Add new method to manage network area regions: `createNetworkAreaRegion`, `deleteNetworkAreaRegion`, `getNetworkAreaRegion`, `listNetworkAreaRegions`, `updateNetworkAreaRegion`
- **Feature:** Add new field `Encrypted` to `Backup` model, which indicates if a backup is encrypted
- **Feature:** Add new field `ImportProgress` to `Image` model, which indicates the import progress of an image
- **Breaking Change:** Remove field `addressFamily` in `CreateNetworkAreaPayload` model
- **Breaking Change:** `Network` model has changed:
- Rename `networkId` to `id`
- Rename `state` to `status`
- Move fields `gateway`, `nameservers`, `prefixes` and `publicIp` to new model `NetworkIPv4`, and can be accessed in the new field `ipv4`
- Move fields `gatewayv6`, `nameserversv6` and `prefixesv6` to new model `NetworkIPv6`, and can be accessed in the new field `ipv6`
- Add new field `routingTabledId`
- **Breaking Change:** `NetworkArea` model has changed:
- Rename `areaId` to `id`
- Remove field `ipv4`
- **Breaking Change:** Rename `networkRangeId` to `id` in `NetworkRange` model
- **Breaking Change:** `CreateServerPayload` model has changed:
- Model `CreateServerPayloadBootVolume` of `BootVolume` property changed to `ServerBootVolume`
- Property `Networking` in `CreateServerPayload` is required now

## v0.3.0
- **Feature:** Add `createdAt` and `updatedAt` attributes to `SecurityGroupRule`, `BaseSecurityGroupRule`, `CreateSecurityGroupRulePayload` model classes
- **Feature:** Add `description` attribute to `CreateNicPayload`, `NIC`, `UpdateNicPayload` model classes
Expand Down
2 changes: 1 addition & 1 deletion services/iaas/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# STACKIT Java SDK for IaaS-API

- API version: 1
- API version: 2

This API allows you to create and modify IaaS resources.

Expand Down
2 changes: 1 addition & 1 deletion services/iaas/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
1.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* IaaS-API
* This API allows you to create and modify IaaS resources.
*
* The version of the OpenAPI document: 1
* The version of the OpenAPI document: 2
* Contact: stackit-iaas@mail.schwarz
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* IaaS-API
* This API allows you to create and modify IaaS resources.
*
* The version of the OpenAPI document: 1
* The version of the OpenAPI document: 2
* Contact: stackit-iaas@mail.schwarz
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -52,22 +52,21 @@
/** ApiClient class. */
public class ApiClient {

protected String basePath = "https://iaas.api.eu01.stackit.cloud";
protected String basePath = "https://iaas.api.stackit.cloud";
protected List<ServerConfiguration> servers =
new ArrayList<ServerConfiguration>(
Arrays.asList(
new ServerConfiguration(
"https://iaas.api.{region}stackit.cloud",
"https://iaas.api.stackit.cloud",
"No description provided",
new HashMap<String, ServerVariable>() {
{
put(
"region",
new ServerVariable(
"No description provided",
"eu01.",
new HashSet<String>(
Arrays.asList("eu01."))));
"global",
new HashSet<String>()));
}
})));
protected Integer serverIndex = 0;
Expand Down Expand Up @@ -190,7 +189,7 @@ public String getBasePath() {
/**
* Set base path
*
* @param basePath Base path of the URL (e.g https://iaas.api.eu01.stackit.cloud
* @param basePath Base path of the URL (e.g https://iaas.api.stackit.cloud
* @return An instance of OkHttpClient
*/
public ApiClient setBasePath(String basePath) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* IaaS-API
* This API allows you to create and modify IaaS resources.
*
* The version of the OpenAPI document: 1
* The version of the OpenAPI document: 2
* Contact: stackit-iaas@mail.schwarz
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* IaaS-API
* This API allows you to create and modify IaaS resources.
*
* The version of the OpenAPI document: 1
* The version of the OpenAPI document: 2
* Contact: stackit-iaas@mail.schwarz
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Loading