Java client library to interact with various IBM Cloud Schematics.
Disclaimer: this SDK is being released initially as a pre-release version. Changes might occur which impact applications that use this SDK.
The IBM Cloud Schematics Java SDK allows developers to programmatically interact with the following IBM Cloud services:
Service Name | Artifact Coordinates |
---|---|
Schematics | com.ibm.cloud:schematics:1.3.1 --> |
- An IBM Cloud account.
- An IAM API key to allow the SDK to access your account. Create one here.
- Java 8 or above.
The current version of this SDK is: 1.3.1
Each service's artifact coordinates are listed in the table above.
The project artifacts are published on the public Maven Central artifact repository. This is the default public repository used by maven when searching for dependencies. To use this repository within a gradle build, please see this link.
To use a particular service, define a dependency that contains the artifact coordinates (group id, artifact id and version) for the service, like this:
<dependency>
<groupId>com.ibm.cloud</groupId>
<artifactId>schematics-service</artifactId>
<version>1.3.1</version>
</dependency>
'com.ibm.cloud:schematics-service:1.3.1'
The library requires Identity and Access Management (IAM) to authenticate requests. There are several ways to set the properties for authentication
For Schematics IAM authentication set the following environmental variables by replacing with your proper service credentials.
SCHEMATICS_URL = https://schematics.cloud.ibm.com
SCHEMATICS_APIKEY = <apikey>
To use an external configuration file, see the related documentation in the Java SDK Core document about authentication.
To learn more about how to use programmatic authentication, see the related documentation in the Java SDK Core document about authentication.
A quick example to get you up and running with Schematics Java SDK service
import com.ibm.cloud.schematics.v1.Schematics;
import com.ibm.cloud.schematics.v1.model.GetSchematicsVersionOptions;
import com.ibm.cloud.schematics.v1.model.VersionResponse;
import com.ibm.cloud.sdk.core.http.Response;
import com.ibm.cloud.sdk.core.security.IamAuthenticator;
Schematics service = null;
IamAuthenticator authenticator = new IamAuthenticator("<apiKey>");
service = new Schematics(Schematics.DEFAULT_SERVICE_NAME, authenticator);
service.setServiceUrl("https://schematics.cloud.ibm.com");
GetSchematicsVersionOptions getSchematicsVersionOptions = new GetSchematicsVersionOptions();
// Invoke operation
Response<VersionResponse> response = service.getSchematicsVersion(getSchematicsVersionOptions).execute();
VersionResponse versionResponseResult = response.getResult();
System.out.println(versionResponseResult);
For sample code on handling errors, please see Schematics API docs.
For general SDK usage information, please see this link
If you are having difficulties using this SDK or have a question about the IBM Cloud services, please ask a question at Stack Overflow.
If you encounter an issue with the project, you are welcome to submit a bug report. Before that, please search for similar issues. It's possible that someone has already reported the problem.
Find more open source projects on the IBM Github Page
See CONTRIBUTING.
The IBM Cloud Schematics Java SDK is released under the Apache 2.0 license. The license's full text can be found in LICENSE.