The Java SDK v5 is deprecated and no longer maintained. Please upgrade to v6, which uses the latest stable API version.
The Java SDK v5 will reach End of Life by September 30, 2023. After this date, the v5 API will not be accessible. If you require any assistance, please contact our support team.
Overview
The IONOS Cloud SDK for Java provides you with access to the IONOS Cloud API. The client library supports both simple and complex requests. It is designed for developers who are building applications in Java . The SDK for Java wraps the IONOS Cloud API. All API operations are performed over SSL and authenticated using your IONOS Cloud portal credentials. The API can be accessed within an instance running in IONOS Cloud or directly over the Internet from any application that can send an HTTPS request and receive an HTTPS response.
Getting Started
Installation
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
// Import classes:importcom.ionoscloud.ApiClient;importcom.ionoscloud.ApiException;importcom.ionoscloud.Configuration;importcom.ionoscloud.auth.*;importcom.ionoscloud.model.*;importcom.ionoscloud.api.DataCenterApi;publicclassExample {publicstaticvoidmain(String[] args) {ApiClient defaultClient =Configuration.getDefaultApiClient();// Configure HTTP basic authorization: Basic AuthenticationHttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");basicAuthentication.setUsername("YOUR USERNAME");basicAuthentication.setPassword("YOUR PASSWORD");DataCenterApi apiInstance =newDataCenterApi(defaultClient);Boolean pretty =true; // Boolean | Controls whether response is pretty-printed (with indentation and new lines) Integer depth = 0; // Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
Integer xContractNumber =56; // Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executedInteger offset =0; // Integer | the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination)Integer limit =1000; // Integer | the maximum number of elements to return (use together with <code>offset</code> for pagination)try {Datacenters result =apiInstance.datacentersGet(pretty, depth, xContractNumber, offset, limit);System.out.println(result); } catch (ApiException e) {System.err.println("Exception when calling DataCenterApi#datacentersGet");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace(); } }}
Feature Reference
The IONOS Cloud SDK for JAVA aims to offer access to all resources in the IONOS Cloud API and also offers some additional features that make the integration easier:
Can I contribute to the Java SDK? Pur SDKs are automatically generated using OpenAPI Generator and don’t support manual changes. If you need changes please open an issue and we’ll try to take care of it.