• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
Managing your private cloud, Part 2:Using theWebSphere CloudBurst REST API interface
Skill Level: IntroductoryDustin AmrheinStaff Software EngineerIBMXi Ning Wang(wangxn@cn.ibm.com) Software EngineerIBM04 Nov 2009Several interface options are available to help you to interact with the IBM® WebSphere® CloudBurst™ Appliance, which provides functionality for creating,deploying, and managing IBM WebSphere Application Server virtual systems in aprivate cloud. These interfaces include a Web 2.0 graphical user interface, a Jythoncommand line interface, and an HTTP REST API. This article discusses the HTTPREST API, which provides a language-neutral interface that is ideal for integratingWebSphere CloudBurst capabilities into existing applications or user interfaces.
Introduction
The IBM WebSphere CloudBurst Appliance provides you with the capability tomanage the full lifecycle of WebSphere Application Server virtual systems in aprivate cloud, including the ability to create, deploy, and manage such virtualsystems.Three user interfaces enable you to leverage the function of the appliance:The
Web 2.0 graphical user interface
(GUI) is generally the right fit forinfrequently performed actions or for introducing new users to thecapabilities of the appliance.
Using the WebSphere CloudBurst REST API interface © Copyright IBM Corporation 2009. All rights reserved.Page 1 of 18
 
The
command line interface
, described inPart 1, provides a Jythoninterface with which commonly performed tasks can be automated.The
REST API
is ideal for integrating the appliance into existingapplications and user interfaces. The use of the REST API does not implythe use of a certain technology or programming language on the client. Infact, since the API is used by issuing HTTP URL requests, the interfacecan be accessed from Java™, C++, PHP, JavaScript™, Groovy, and ahost of other environments.The WebSphere CloudBurst REST API equips you with a means with which youinteract with the appliance that is both language neutral and programming modelneutral. When using the REST API, you interact with the resources of the appliance(hypervisors, patterns, script packages, and so on) entirely by using well-definedHTTP URLs and associated HTTP verbs (GET, POST, PUT, DELETE). Using thissimple interface you can perform many of the appliance’s capabilities for managingWebSphere Application Server environments in a private cloud.
Preparing to use the REST API
Before you begin working with the WebSphere CloudBurst REST API, take amoment to understand a few basics about this interface.First, every WebSphere CloudBurst Appliance provides the WebSphere CloudBurstREST API out of the box; there is no feature you need to enable to use the API. TheAPI is accessible on the same host as the appliance, but all API requests must besent using the HTTPS protocol, and they must be sent to port 443. The appliancedoes use self-signed SSL certificates, so it is important that you configure your clientappropriately. Clients can either choose to accept or ignore this certificate.When using the REST API, you also need to be aware of certain HTTP headers thatare required in every request. Table 1 provides a listing of those headers and a briefexplanation of their use.
Table 1. Required HTTP request headers
Header name Description
Accept The appliance generally sends back JSON (JavaScript Object Notation) encoded data in allresponses. Clients should set application/json asthe Accept value for all requests.Accept-Language This parameter indicates the language or localeto be used when generating responses.Authorization The REST API supports basic authentication.The same user IDs and passwords configured forusers in the appliance should be used when
developerWorks® ibm.com/developerWorksUsing the WebSphere CloudBurst REST API interfacePage 2 of 18© Copyright IBM Corporation 2009. All rights reserved.
 
sending requests to the REST API. Thepermissions and access granted to users of theappliance are the same regardless of theinterface that is used.Content-Type All data sent via the REST API must be JSONencoded. As such, clients that send data inrequests should set application/json as theContent-Type value.X-CloudBurst-API-Version This specifies the version of the WebSphereCloudBurst REST API being used. As of the dateof publication, the only valid value is 1.0.
The remainder of this article presents examples that illustrate how the WebSphereCloudBurst REST API can be used, specifically to:Setup a private cloud: Define a hypervisor to the appliance, associate IPaddresses with the hypervisor, create a cloud group containing thehypervisor, and ensure the hypervisor is properly initialized and ready fordeployments.Retrieve a pattern: Retrieve all the patterns available for deployment anddeploy a selected pattern to a defined cloud group.Deploy patterns to the cloud: Query virtual systems to gather informationabout WebSphere Application Server virtual systems (cells) that havebeen deployed by a particular WebSphere CloudBurst Appliance.This article illustrates how to use the WebSphere CloudBurst REST API by sendingHTTP requests. This API is formed by the combination of a URL, HTTP method,HTTP request headers, and, in some cases, an HTTP request body. Thesecomponents are labeled as such in the listings below that show REST API requests.In addition, several listings are provided that show the HTTP responses you canexpect from such requests. In these HTTP responses, only the body of the returnedresponse is shown, in JSON format. HTTP response headers are omitted because,in many cases, they are not important to the content being displayed. When anHTTP response header is important, it will be noted in the text.This article does not dictate the use of any particular HTTP client to make theserequests. In fact, any client (programattic or otherwise) that is capable of sendingHTTP requests with the headers and body format specified in this article can beused to communicate with the WebSphere CloudBurst Appliance through the RESTAPI.For the purpose of illustrating the results of the HTTP requests that are shown here,screen captures of the graphical user interface are also presented on occasion.Also, these examples assume that the appliance is available using themycloudburst.com host name.
ibm.com/developerWorks developerWorks® Using the WebSphere CloudBurst REST API interface © Copyright IBM Corporation 2009. All rights reserved.Page 3 of 18
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...