September 29, 2011 | Written by: Dominique Vernier
Share this post:
Usually we access IBM SmartCloud Enterprise platform through the portal (ibm.com/cloud/enterprise) to order servers, storage, IP addresses, and to take other actions such as create an image out of an instance. This is easy to use and very user-friendly, however if you want to integrate your own solution with IBM SmartCloud Enterprise or automate processes, you can use the API provided by the IBM SmartCloud Enterprise platform.
The IBM SmartCloud Enterprise platform provides APIs, which can help you to integrate the platform with external systems. These systems can be, among others, service management request system, consumption monitoring systems.
Three types of APIs are available to manage the IBM SmartCloud Enterprise platform:
- RESTFul API
- Java API
- Command-line API
The Java API is a wrapper around the RESTFul API, meaning that the Java API provides beans and classes from which you call methods; each method will call the RESTFul API. The command-line API calls a Java API method, which triggers RESTFul API requests.
By definition RESTFul APIs are based on HTTP requests and methods. For example, a GET method will retrieve information from the platform, a POST method will create resource on the platform. The IBM SmartCloud Enterprise RESTFul APIs are implemented in an application server that is located on the IBM SmartCloud Enterprise platform and thus a base URL address is provided to specify that server. This base URL is: https://www.ibm.com/computecloud/enterprise/api/rest/20100331.
As an example, the following URL will list all instances you owned on the IBM SmartCloud Enterprise platform:
The RESTFul API can return either an XML or JSON object.
The documentation is available from the support page of the IBM SmartCloud Enterprise portal:
The Java API provides beans and classes. A special class, DeveloperCloud, provides a getClient() method, which returns an object that implements the DeveloperCloudClient interface. This object must be, at least, initialized with your credentials. After you have this object, you can call any methods of the interface such as createIntances(), deleteInstances(), addKey(). For example, the describeInstances() method will return a List of Instance object.
To use these APIs, download the IBM SmartCloud Enterprise Java API library from the IBM SmartCloud Enterprise portal. From the same location, you can also download the Javadoc:
The command-line API (CLI) consists of a number of batch files that provide the same functionality as the other APIs. Batch files are provided for Windows and Linux platforms. They also run on the Mac operating system.
After installation, you will be able to use command lines such as ic-create-instance.cmd or .sh depending on your platform.
You can download them from the support tab of IBM SmartCloud Enterprise portal:
After logging in to the IBM SmartCloud Enterprise platform, you may also download extra command lines and a Java library from the following address:
This library provides a number of new command lines, such as handy-ic-wait-instances, which waits for a list of instances to reach a given status, or handy-ic-create-instances, which creates a number of instances in one command line.
You can also reuse the provided Java library in your own Java code.
For more information about the IBM SmartCloud Enterprise and other IBM cloud solutions, visit http://www.ibm.com/cloud-computing.